From: Mat Martineau <hidden> Date: 2022-02-03 01:03:51
Patch 1 has some minor cleanup in mptcp_write_options().
Patch 2 moves a rarely-needed branch to optimize mptcp_write_options().
Patch 3 adds a comment explaining which combinations of MPTCP option
headers are expected.
Patch 4 adds a pr_debug() for the MPTCP_RST option.
Patches 5-7 allow setting MPTCP_PM_ADDR_FLAG_FULLMESH with the "set
flags" netlink command. This allows changing the behavior of existing
path manager endpoints. The flag was previously only set at endpoint
creation time. Associated selftests also updated.
Geliang Tang (5):
mptcp: move the declarations of ssk and subflow
mptcp: print out reset infos of MP_RST
mptcp: set fullmesh flag in pm_netlink
selftests: mptcp: set fullmesh flag in pm_nl_ctl
selftests: mptcp: add fullmesh setting tests
Matthieu Baerts (2):
mptcp: reduce branching when writing MP_FAIL option
mptcp: clarify when options can be used
net/mptcp/options.c | 64 +++++++++++++------
net/mptcp/pm_netlink.c | 37 ++++++++---
.../testing/selftests/net/mptcp/mptcp_join.sh | 49 ++++++++++++--
tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 8 ++-
4 files changed, 121 insertions(+), 37 deletions(-)
base-commit: 52dae93f3bad842c6d585700460a0dea4d70e096
--
2.35.1
From: Mat Martineau <hidden> Date: 2022-02-03 01:03:52
From: Geliang Tang <redacted>
Move the declarations of ssk and subflow in MP_FAIL and MP_PRIO to the
beginning of the function mptcp_write_options().
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
net/mptcp/options.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
From: Mat Martineau <hidden> Date: 2022-02-03 01:03:53
From: Geliang Tang <redacted>
This patch printed out the reset infos, reset_transient and reset_reason,
of MP_RST in mptcp_parse_option() to show that MP_RST is received.
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
net/mptcp/options.c | 2 ++
1 file changed, 2 insertions(+)
From: Mat Martineau <hidden> Date: 2022-02-03 01:03:55
From: Matthieu Baerts <redacted>
MP_FAIL should be use in very rare cases, either when the TCP RST flag
is set -- with or without an MP_RST -- or with a DSS, see
mptcp_established_options().
Here, we do the same in mptcp_write_options().
Co-developed-by: Geliang Tang <redacted>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Matthieu Baerts <redacted>
Signed-off-by: Mat Martineau <redacted>
---
net/mptcp/options.c | 30 +++++++++++++++++++-----------
1 file changed, 19 insertions(+), 11 deletions(-)
From: Mat Martineau <hidden> Date: 2022-02-03 01:03:56
From: Matthieu Baerts <redacted>
RFC8684 doesn't seem to clearly specify which MPTCP options can be used
together.
Some options are mutually exclusive -- e.g. MP_CAPABLE and MP_JOIN --,
some can be used together -- e.g. DSS + MP_PRIO --, some can but we
prefer not to -- e.g. DSS + ADD_ADDR -- and some have to be used
together at some points -- e.g. MP_FAIL and DSS.
We need to clarify this as a base before allowing other modifications.
For example, does it make sense to send a RM_ADDR with an MPC or MPJ?
This remains open for possible future discussions.
Signed-off-by: Matthieu Baerts <redacted>
Signed-off-by: Mat Martineau <redacted>
---
net/mptcp/options.c | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
@@ -1267,8 +1267,27 @@ void mptcp_write_options(__be32 *ptr, const struct tcp_sock *tp,conststructsock*ssk=(conststructsock*)tp;structmptcp_subflow_context*subflow;-/* DSS, MPC, MPJ, ADD_ADDR, FASTCLOSE and RST are mutually exclusive,-*seemptcp_established_options*()+/* Which options can be used together?+*+*X:mutuallyexclusive+*O:oftenusedtogether+*C:canbeusedtogetherinsomecases+*P:couldbeusedtogetherbutweprefernotto(optimisations)+*+*Opt:|MPC|MPJ|DSS|ADD|RM|PRIO|FAIL|FC|+*------|------|------|------|------|------|------|------|------|+*MPC|------|------|------|------|------|------|------|------|+*MPJ|X|------|------|------|------|------|------|------|+*DSS|X|X|------|------|------|------|------|------|+*ADD|X|X|P|------|------|------|------|------|+*RM|C|C|C|P|------|------|------|------|+*PRIO|X|C|C|C|C|------|------|------|+*FAIL|X|X|C|X|X|X|------|------|+*FC|X|X|X|X|X|X|X|------|+*RST|X|X|X|X|X|X|O|O|+*------|------|------|------|------|------|------|------|------|+*+*Thesameappliesinmptcp_established_options()function.*/if(likely(OPTION_MPTCP_DSS&opts->suboptions)){structmptcp_ext*mpext=&opts->ext_copy;
From: Mat Martineau <hidden> Date: 2022-02-03 01:03:57
From: Geliang Tang <redacted>
This patch added the fullmesh flag setting support in pm_netlink.
If the fullmesh flag of the address is changed, remove all the related
subflows, update the fullmesh flag and create subflows again.
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
net/mptcp/pm_netlink.c | 37 ++++++++++++++++++++++++++++---------
1 file changed, 28 insertions(+), 9 deletions(-)
@@ -1744,7 +1755,10 @@ static int mptcp_nl_addr_backup(struct net *net,lock_sock(sk);spin_lock_bh(&msk->pm.lock);-ret=mptcp_pm_nl_mp_prio_send_ack(msk,addr,bkup);+if(changed&MPTCP_PM_ADDR_FLAG_BACKUP)+ret=mptcp_pm_nl_mp_prio_send_ack(msk,addr,bkup);+if(changed&MPTCP_PM_ADDR_FLAG_FULLMESH)+mptcp_pm_nl_fullmesh(msk,addr);spin_unlock_bh(&msk->pm.lock);release_sock(sk);
From: Mat Martineau <hidden> Date: 2022-02-03 01:03:57
From: Geliang Tang <redacted>
This patch added the fullmesh flag setting and clearing support in
pm_nl_ctl:
# pm_nl_ctl set ip flags fullmesh
# pm_nl_ctl set ip flags nofullmesh
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
@@ -704,12 +704,14 @@ int set_flags(int fd, int pm_family, int argc, char *argv[])if(++arg>=argc)error(1,0," missing flags value");-/* do not support flag list yet */for(str=argv[arg];(tok=strtok(str,","));str=NULL){if(!strcmp(tok,"backup"))flags|=MPTCP_PM_ADDR_FLAG_BACKUP;-elseif(strcmp(tok,"nobackup"))+elseif(!strcmp(tok,"fullmesh"))+flags|=MPTCP_PM_ADDR_FLAG_FULLMESH;+elseif(strcmp(tok,"nobackup")&&+strcmp(tok,"nofullmesh"))error(1,errno,"unknown flag %s",argv[arg]);}
From: Mat Martineau <hidden> Date: 2022-02-03 01:03:58
From: Geliang Tang <redacted>
This patch added the fullmesh setting and clearing selftests in
mptcp_join.sh.
Now we can set both backup and fullmesh flags, so avoid using the
words 'backup' and 'bkup'.
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
.../testing/selftests/net/mptcp/mptcp_join.sh | 49 ++++++++++++++++---
1 file changed, 43 insertions(+), 6 deletions(-)
@@ -1888,6 +1887,44 @@ fullmesh_tests()run_tests$ns1$ns210.0.1.100fullmesh_2slowchk_join_nr"fullmesh test 1x2, limited"444chk_add_nr11++# set fullmesh flag+reset+ipnetnsexec$ns1./pm_nl_ctllimits44+ipnetnsexec$ns1./pm_nl_ctladd10.0.2.1flagssubflow+ipnetnsexec$ns2./pm_nl_ctllimits44+run_tests$ns1$ns210.0.1.1001slowfullmesh+chk_join_nr"set fullmesh flag test"222+chk_rm_nr01++# set nofullmesh flag+reset+ipnetnsexec$ns1./pm_nl_ctllimits44+ipnetnsexec$ns1./pm_nl_ctladd10.0.2.1flagssubflow,fullmesh+ipnetnsexec$ns2./pm_nl_ctllimits44+run_tests$ns1$ns210.0.1.100fullmesh_1slownofullmesh+chk_join_nr"set nofullmesh flag test"222+chk_rm_nr01++# set backup,fullmesh flags+reset+ipnetnsexec$ns1./pm_nl_ctllimits44+ipnetnsexec$ns1./pm_nl_ctladd10.0.2.1flagssubflow+ipnetnsexec$ns2./pm_nl_ctllimits44+run_tests$ns1$ns210.0.1.1001slowbackup,fullmesh+chk_join_nr"set backup,fullmesh flags test"222+chk_prio_nr01+chk_rm_nr01++# set nobackup,nofullmesh flags+reset+ipnetnsexec$ns1./pm_nl_ctllimits44+ipnetnsexec$ns2./pm_nl_ctllimits44+ipnetnsexec$ns2./pm_nl_ctladd10.0.2.2flagssubflow,backup,fullmesh+run_tests$ns1$ns210.0.1.1000slownobackup,nofullmesh+chk_join_nr"set nobackup,nofullmesh flags test"222+chk_prio_nr01+chk_rm_nr01} all_tests()
Hello:
This series was applied to netdev/net-next.git (master)
by David S. Miller [off-list ref]:
On Wed, 2 Feb 2022 17:03:36 -0800 you wrote:
Patch 1 has some minor cleanup in mptcp_write_options().
Patch 2 moves a rarely-needed branch to optimize mptcp_write_options().
Patch 3 adds a comment explaining which combinations of MPTCP option
headers are expected.
[...]