mptcp: get rid of msk->subflow
authorPaolo Abeni <pabeni@redhat.com>
Fri, 11 Aug 2023 15:57:26 +0000 (17:57 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Aug 2023 06:06:14 +0000 (07:06 +0100)
commit39880bd808ad2ddfb9b7fee129568c3b814f0609
treee339a4f8ccbea0530ebe7ae3a9b7bee5f8ca87c3
parent3f326a821b99812edb6d3c24bcb78377cae6e432
mptcp: get rid of msk->subflow

Such field is now unused just as a flag to control the first subflow
deletion at close() time. Introduce a new bit flag for that and finally
drop the mentioned field.

As an intended side effect, now the first subflow sock is not freed
before close() even for passive sockets. The msk has no open/active
subflows if the first one is closed and the subflow list is singular,
update accordingly the state check in mptcp_stream_accept().

Among other benefits, the subflow removal, reduces the amount of memory
used on the client side for each mptcp connection, allows passive sockets
to go through successful accept()/disconnect()/connect() and makes return
error code consistent for failing both passive and active sockets.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/290
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/protocol.c
net/mptcp/protocol.h