From: Mat Martineau <hidden> Date: 2021-03-26 18:24:05
This patch series contains cleanup and fixes we have been testing in the
MPTCP tree. MPTCP uses TCP option headers to advertise additional
address information after an initial connection is established. The main
fixes here deal with making those advertisements more reliable and
improving the way subflows are created after an advertisement is
received.
Patches 1, 2, 4, 10, and 12 are for various cleanup or refactoring.
Patch 3 skips an extra connection attempt if there's already a subflow
connection for the newly received advertisement.
Patches 5, 6, and 7 make sure that the next address is advertised when
there are multiple addresses to share, the advertisement has been
retried, and the peer has not echoed the advertisement. Self tests are
updated.
Patches 8 and 9 fix a problem similar to 5/6/7, but covers a case where
the failure was due to a subflow connection not completing.
Patches 11 and 13 send a bare ack to revoke an advertisement rather than
waiting for other activity to trigger a packet send. This mirrors the
way acks are sent for new advertisements. Self test is included.
Geliang Tang (12):
mptcp: drop argument port from mptcp_pm_announce_addr
mptcp: skip connecting the connected address
mptcp: drop unused subflow in mptcp_pm_subflow_established
mptcp: move to next addr when timeout
selftests: mptcp: add cfg_do_w for cfg_remove
selftests: mptcp: timeout testcases for multi addresses
mptcp: export lookup_anno_list_by_saddr
mptcp: move to next addr when subflow creation fail
mptcp: drop useless addr_signal clear
mptcp: send ack for rm_addr
mptcp: rename mptcp_pm_nl_add_addr_send_ack
selftests: mptcp: signal addresses testcases
Paolo Abeni (1):
mptcp: clean-up the rtx path
net/mptcp/options.c | 3 +-
net/mptcp/pm.c | 25 ++++--
net/mptcp/pm_netlink.c | 69 +++++++++------
net/mptcp/protocol.c | 42 +++-------
net/mptcp/protocol.h | 12 ++-
.../selftests/net/mptcp/mptcp_connect.c | 10 ++-
.../testing/selftests/net/mptcp/mptcp_join.sh | 84 ++++++++++++++++++-
7 files changed, 173 insertions(+), 72 deletions(-)
base-commit: 6c996e19949b34d7edebed4f6b0511145c036404
--
2.31.0
From: Mat Martineau <hidden> Date: 2021-03-26 18:28:28
From: Geliang Tang <redacted>
Drop the redundant argument 'port' from mptcp_pm_announce_addr, use the
port field of another argument 'addr' instead.
Fixes: 0f5c9e3f079f ("mptcp: add port parameter for mptcp_pm_announce_addr")
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
net/mptcp/pm.c | 6 +++---
net/mptcp/pm_netlink.c | 9 +++------
net/mptcp/protocol.h | 2 +-
3 files changed, 7 insertions(+), 10 deletions(-)
From: Mat Martineau <hidden> Date: 2021-03-26 18:28:28
From: Paolo Abeni <pabeni@redhat.com>
After the previous patch we can easily avoid invoking
the workqueue to perform the retransmission, if the
msk socket lock is held at rtx timer expiration.
This also simplifies the relevant code.
Co-developed-by: Matthieu Baerts <redacted>
Signed-off-by: Matthieu Baerts <redacted>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <redacted>
---
net/mptcp/protocol.c | 42 +++++++++++-------------------------------
net/mptcp/protocol.h | 1 +
2 files changed, 12 insertions(+), 31 deletions(-)
@@ -2047,28 +2047,21 @@ static int mptcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,returncopied;}-staticvoidmptcp_retransmit_handler(structsock*sk)-{-structmptcp_sock*msk=mptcp_sk(sk);--set_bit(MPTCP_WORK_RTX,&msk->flags);-mptcp_schedule_work(sk);-}-staticvoidmptcp_retransmit_timer(structtimer_list*t){structinet_connection_sock*icsk=from_timer(icsk,t,icsk_retransmit_timer);structsock*sk=&icsk->icsk_inet.sk;+structmptcp_sock*msk=mptcp_sk(sk);bh_lock_sock(sk);if(!sock_owned_by_user(sk)){-mptcp_retransmit_handler(sk);+/* we need a process context to retransmit */+if(!test_and_set_bit(MPTCP_WORK_RTX,&msk->flags))+mptcp_schedule_work(sk);}else{/* delegate our work to tcp_release_cb() */-if(!test_and_set_bit(TCP_WRITE_TIMER_DEFERRED,-&sk->sk_tsq_flags))-sock_hold(sk);+set_bit(MPTCP_RETRANSMIT,&msk->flags);}bh_unlock_sock(sk);sock_put(sk);
From: Mat Martineau <hidden> Date: 2021-03-26 18:28:29
From: Geliang Tang <redacted>
This patch added the timeout testcases for multi addresses, valid and
invalid.
These testcases need to transmit 8 ADD_ADDRs, so add a new speed level
'least' to set 10 to mptcp_connect to slow down the transmitting process.
The original speed level 'slow' still uses 50.
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
.../testing/selftests/net/mptcp/mptcp_join.sh | 26 +++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
From: Mat Martineau <hidden> Date: 2021-03-26 18:28:29
From: Geliang Tang <redacted>
This patch called mptcp_pm_subflow_established to move to the next address
when an ADD_ADDR has been retransmitted the maximum number of times.
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
net/mptcp/pm_netlink.c | 3 +++
1 file changed, 3 insertions(+)
From: Mat Martineau <hidden> Date: 2021-03-26 18:28:29
From: Geliang Tang <redacted>
In some testcases, we need to slow down the transmitting process. This
patch added a new argument named cfg_do_w for cfg_remove to allow the
caller to pass an argument to cfg_remove.
In do_rnd_write, use this cfg_do_w to control the transmitting speed.
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
tools/testing/selftests/net/mptcp/mptcp_connect.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
From: Mat Martineau <hidden> Date: 2021-03-26 18:28:29
From: Geliang Tang <redacted>
This patch added a new helper named lookup_subflow_by_daddr to find
whether the destination address is in the msk's conn_list.
In mptcp_pm_nl_add_addr_received, use lookup_subflow_by_daddr to check
whether the announced address is already connected. If it is, skip
connecting this address and send out the echo.
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
net/mptcp/pm_netlink.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
From: Mat Martineau <hidden> Date: 2021-03-26 18:28:29
From: Geliang Tang <redacted>
When an invalid address was announced, the subflow couldn't be created
for this address. Therefore mptcp_pm_nl_subflow_established couldn't be
invoked. Then the next addresses in the local address list didn't have a
chance to be announced.
This patch invokes the new function mptcp_pm_add_addr_echoed when the
address is echoed. In it, use mptcp_lookup_anno_list_by_saddr to check
whether this address is in the anno_list. If it is, PM schedules the
status MPTCP_PM_SUBFLOW_ESTABLISHED to invoke
mptcp_pm_create_subflow_or_signal_addr to deal with the next address in
the local address list.
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
net/mptcp/options.c | 1 +
net/mptcp/pm.c | 15 +++++++++++++++
net/mptcp/protocol.h | 2 ++
3 files changed, 18 insertions(+)
From: Mat Martineau <hidden> Date: 2021-03-26 18:28:29
From: Geliang Tang <redacted>
This patch adds testcases for signalling multi valid and invalid
addresses for both signal_address_tests and remove_tests.
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
.../testing/selftests/net/mptcp/mptcp_join.sh | 58 +++++++++++++++++++
1 file changed, 58 insertions(+)
From: Mat Martineau <hidden> Date: 2021-03-26 18:28:29
From: Geliang Tang <redacted>
msk->pm.addr_signal is cleared in mptcp_pm_add_addr_signal, no need to
clear it in mptcp_pm_nl_add_addr_send_ack again. Drop it.
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
net/mptcp/pm_netlink.c | 8 --------
1 file changed, 8 deletions(-)
From: Mat Martineau <hidden> Date: 2021-03-26 18:28:30
From: Geliang Tang <redacted>
Since mptcp_pm_nl_add_addr_send_ack is now used for both ADD_ADDR and
RM_ADDR cases, rename it to mptcp_pm_nl_addr_send_ack.
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
net/mptcp/pm.c | 2 +-
net/mptcp/pm_netlink.c | 8 ++++----
net/mptcp/protocol.h | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
On Fri, 26 Mar 2021 11:23:07 -0700 you wrote:
This patch series contains cleanup and fixes we have been testing in the
MPTCP tree. MPTCP uses TCP option headers to advertise additional
address information after an initial connection is established. The main
fixes here deal with making those advertisements more reliable and
improving the way subflows are created after an advertisement is
received.
[...]