]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
mptcp: allocate fwd memory separately on the rx and tx path
authorPaolo Abeni <pabeni@redhat.com>
Tue, 26 Oct 2021 23:29:15 +0000 (16:29 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 28 Oct 2021 01:20:29 +0000 (18:20 -0700)
commit6511882cdd82d6cf2178932fa9b78647d130b860
tree3b7ab4afc535d93f5d8d1a3f4cb1fa10b43c7b3e
parent292e6077b04091d138bae6010fb9fdc958170d64
mptcp: allocate fwd memory separately on the rx and tx path

All the mptcp receive path is protected by the msk socket
spinlock. As consequences, the tx path has to play a few tricks to
allocate the forward memory without acquiring the spinlock multiple
times, making the overall TX path quite complex.

This patch tries to clean-up a bit the tx path, using completely
separated fwd memory allocation, for the rx and the tx path.

The forward memory allocated in the rx path is now accounted in
msk->rmem_fwd_alloc and is (still) protected by the msk socket spinlock.

To cope with the above we provide a few MPTCP-specific variants for
the helpers to charge, uncharge, reclaim and free the forward memory
in the receive path.

msk->sk_forward_alloc now accounts only the forward memory for the tx
path, we can use the plain core sock helper to manipulate it and drop
quite a bit of complexity.

On memory pressure, both rx and tx fwd memories are reclaimed.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-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