aboutsummaryrefslogtreecommitdiffstats
path: root/net/mptcp/protocol.h
diff options
context:
space:
mode:
authorPaolo Abeni <pabeni@redhat.com>2020-11-27 11:10:23 +0100
committerJakub Kicinski <kuba@kernel.org>2020-11-30 17:55:23 -0800
commite93da92896bc0ddc26e88bbc09e7e39b84366a38 (patch)
treee6620b22e75c17f5510dda10982e2a234ebe88bc /net/mptcp/protocol.h
parentmptcp: open code mptcp variant for lock_sock (diff)
downloadlinux-dev-e93da92896bc0ddc26e88bbc09e7e39b84366a38.tar.xz
linux-dev-e93da92896bc0ddc26e88bbc09e7e39b84366a38.zip
mptcp: implement wmem reservation
This leverages the previous commit to reserve the wmem required for the sendmsg() operation when the msk socket lock is first acquired. Some heuristics are used to get a reasonable [over] estimation of the whole memory required. If we can't forward alloc such amount fallback to a reasonable small chunk, otherwise enter the wait for memory path. When sendmsg() needs more memory it looks at wmem_reserved first and if that is exhausted, move more space from sk_forward_alloc. The reserved memory is not persistent and is released at the next socket unlock via the release_cb(). Overall this will simplify the next patch. Acked-by: Florian Westphal <fw@strlen.de> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/mptcp/protocol.h')
-rw-r--r--net/mptcp/protocol.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 6abac8238de3..4cf355076e35 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -218,6 +218,7 @@ struct mptcp_sock {
u64 ack_seq;
u64 rcv_wnd_sent;
u64 rcv_data_fin_seq;
+ int wmem_reserved;
struct sock *last_snd;
int snd_burst;
int old_wspace;