]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
mptcp: protect the rx path with the msk socket spinlock
authorPaolo Abeni <pabeni@redhat.com>
Fri, 27 Nov 2020 10:10:24 +0000 (11:10 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 1 Dec 2020 01:55:23 +0000 (17:55 -0800)
commit879526030c8b5e8bd786a6408730893b9b2958ea
treee30eb84b720672ebf301180083e7599531febd12
parente93da92896bc0ddc26e88bbc09e7e39b84366a38
mptcp: protect the rx path with the msk socket spinlock

Such spinlock is currently used only to protect the 'owned'
flag inside the socket lock itself. With this patch, we extend
its scope to protect the whole msk receive path and
sk_forward_memory.

Given the above, we can always move data into the msk receive
queue (and OoO queue) from the subflow.

We leverage the previous commit, so that we need to acquire the
spinlock in the tx path only when moving fwd memory.

recvmsg() must now explicitly acquire the socket spinlock
when moving skbs out of sk_receive_queue. To reduce the number of
lock operations required we use a second rx queue and splice the
first into the latter in mptcp_lock_sock(). Additionally rmem
allocated memory is bulk-freed via release_cb()

Acked-by: Florian Westphal <fw@strlen.de>
Co-developed-by: Florian Westphal <fw@strlen.de>
Signed-off-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>
net/mptcp/protocol.c
net/mptcp/protocol.h