mptcp: pm: reduce entries iterations on connect
authorMatthieu Baerts (NGI0) <matttbe@kernel.org>
Mon, 2 Sep 2024 10:45:53 +0000 (12:45 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 3 Sep 2024 22:25:42 +0000 (15:25 -0700)
commitb83fbca1b4c9c45628aa55d582c14825b0e71c2b
treee935c075c51963e531cf75c0582d7a390ef28145
parent7bcf4d8022f93c0af15a11f962fa55892853f2c0
mptcp: pm: reduce entries iterations on connect

__mptcp_subflow_connect() is currently called from the path-managers,
which have all the required information to create subflows. No need to
call the PM again to re-iterate over the list of entries with RCU lock
to get more info.

Instead, it is possible to pass a mptcp_pm_addr_entry structure, instead
of a mptcp_addr_info one. The former contains the ifindex and the flags
that are required when creating the new subflow.

This is a partial revert of commit ee285257a9c1 ("mptcp: drop flags and
ifindex arguments").

While at it, the local ID can also be set if it is known and 0, to avoid
having to set it in the 'rebuild_header' hook, which will cause a new
iteration of the endpoint entries.

Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20240902-net-next-mptcp-mib-mpjtx-misc-v1-2-d3e0f3773b90@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/pm.c
net/mptcp/pm_netlink.c
net/mptcp/pm_userspace.c
net/mptcp/protocol.h
net/mptcp/subflow.c