mbox series

[MPTCP,net-next,00/16] mptcp: RM_ADDR/ADD_ADDR enhancements

Message ID cover.1600853093.git.geliangtang@gmail.com
Headers show
Series mptcp: RM_ADDR/ADD_ADDR enhancements | expand

Message

Geliang Tang Sept. 24, 2020, 12:29 a.m. UTC
This series include two enhancements for the MPTCP path management,
namely RM_ADDR support and ADD_ADDR echo support, as specified by RFC
sections 3.4.1 and 3.4.2.

1 RM_ADDR support include 9 patches (1-3 and 8-13):

Patch 1 is the helper for patch 2, these two patches add the RM_ADDR
outgoing functions, which are derived from ADD_ADDR's corresponding
functions.

Patch 3 adds the RM_ADDR incoming logic, when RM_ADDR suboption is
received, close the subflow matching the rm_id, and update PM counter.

Patch 8 is the main remove routine. When the PM netlink removes an address,
we traverse all the existing msk sockets to find the relevant sockets. Then
trigger the RM_ADDR signal and remove the subflow which using this local
address, this subflow removing functions has been implemented in patch 9.

Finally, patches 10-13 are the self-tests for RM_ADDR.

2 ADD_ADDR echo support include 7 patches (4-7 and 14-16).

Patch 4 adds the ADD_ADDR echo logic, when the ADD_ADDR suboption has been
received, send out the same ADD_ADDR suboption with echo-flag, and no HMAC
included.

Patches 5 and 6 are the self-tests for ADD_ADDR echo. Patch 7 is a little
cleaning up.

Patch 14 and 15 are the helpers for patch 16. These three patches add
the ADD_ADDR retransmition when no ADD_ADDR echo is received.

Geliang Tang (16):
  mptcp: rename addr_signal and the related functions
  mptcp: add the outgoing RM_ADDR support
  mptcp: add the incoming RM_ADDR support
  mptcp: send out ADD_ADDR with echo flag
  mptcp: add ADD_ADDR related mibs
  selftests: mptcp: add ADD_ADDR mibs check function
  mptcp: add accept_subflow re-check
  mptcp: remove addr and subflow in PM netlink
  mptcp: implement mptcp_pm_remove_subflow
  mptcp: add RM_ADDR related mibs
  mptcp: add mptcp_destroy_common helper
  selftests: mptcp: add remove cfg in mptcp_connect
  selftests: mptcp: add remove addr and subflow test cases
  mptcp: add struct mptcp_pm_add_entry
  mptcp: add sk_stop_timer_sync helper
  mptcp: retransmit ADD_ADDR when timeout

 include/net/sock.h                            |   2 +
 net/core/sock.c                               |   7 +
 net/mptcp/mib.c                               |   4 +
 net/mptcp/mib.h                               |   4 +
 net/mptcp/options.c                           |  81 +++--
 net/mptcp/pm.c                                |  91 ++++--
 net/mptcp/pm_netlink.c                        | 276 +++++++++++++++++-
 net/mptcp/protocol.c                          |  30 +-
 net/mptcp/protocol.h                          |  39 ++-
 net/mptcp/subflow.c                           |   3 +-
 .../selftests/net/mptcp/mptcp_connect.c       |  18 +-
 .../testing/selftests/net/mptcp/mptcp_join.sh | 189 +++++++++++-
 12 files changed, 674 insertions(+), 70 deletions(-)

Comments

Mat Martineau Sept. 25, 2020, 12:17 a.m. UTC | #1
On Thu, 24 Sep 2020, Geliang Tang wrote:

> This patch renamed addr_signal and the related functions with the explicit
> word "add".
>
> Suggested-by: Matthieu Baerts <matthieu.baerts@tessares.net>
> Suggested-by: Paolo Abeni <pabeni@redhat.com>
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
> ---
> net/mptcp/options.c  | 14 +++++++-------
> net/mptcp/pm.c       | 12 ++++++------
> net/mptcp/protocol.h | 10 +++++-----
> 3 files changed, 18 insertions(+), 18 deletions(-)

Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>

--
Mat Martineau
Intel
Mat Martineau Sept. 25, 2020, 12:17 a.m. UTC | #2
On Thu, 24 Sep 2020, Geliang Tang wrote:

> This patch added a new signal named rm_addr_signal in PM. On outgoing path,

> we called mptcp_pm_should_rm_signal to check if rm_addr_signal has been

> set. If it has been, we sent out the RM_ADDR option.

>

> Suggested-by: Matthieu Baerts <matthieu.baerts@tessares.net>

> Suggested-by: Paolo Abeni <pabeni@redhat.com>

> Signed-off-by: Geliang Tang <geliangtang@gmail.com>

> ---

> net/mptcp/options.c  | 29 +++++++++++++++++++++++++++++

> net/mptcp/pm.c       | 25 +++++++++++++++++++++++++

> net/mptcp/protocol.h |  9 +++++++++

> 3 files changed, 63 insertions(+)


Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>


--
Mat Martineau
Intel
Mat Martineau Sept. 25, 2020, 12:20 a.m. UTC | #3
On Thu, 24 Sep 2020, Geliang Tang wrote:

> This patch implements the remove announced addr and subflow logic in PM

> netlink.

>

> When the PM netlink removes an address, we traverse all the existing msk

> sockets to find the relevant sockets.

>

> We add a new list named anno_list in mptcp_pm_data, to record all the

> announced addrs. In the traversing, we check if it has been recorded.

> If it has been, we trigger the RM_ADDR signal.

>

> We also check if this address is in conn_list. If it is, we remove the

> subflow which using this local address.

>

> Since we call mptcp_pm_free_anno_list in mptcp_destroy, we need to move

> __mptcp_init_sock before the mptcp_is_enabled check in mptcp_init_sock.

>

> Suggested-by: Matthieu Baerts <matthieu.baerts@tessares.net>

> Suggested-by: Paolo Abeni <pabeni@redhat.com>

> Suggested-by: Mat Martineau <mathew.j.martineau@linux.intel.com>

> Acked-by: Paolo Abeni <pabeni@redhat.com>

> Signed-off-by: Geliang Tang <geliangtang@gmail.com>

> ---

> net/mptcp/pm.c         |   7 ++-

> net/mptcp/pm_netlink.c | 122 +++++++++++++++++++++++++++++++++++++++--

> net/mptcp/protocol.c   |   9 +--

> net/mptcp/protocol.h   |   2 +

> net/mptcp/subflow.c    |   1 +

> 5 files changed, 130 insertions(+), 11 deletions(-)


Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>


--
Mat Martineau
Intel
Mat Martineau Sept. 25, 2020, 12:23 a.m. UTC | #4
On Thu, 24 Sep 2020, Geliang Tang wrote:

> This patch added a new helper named mptcp_destroy_common containing the
> shared code between mptcp_destroy() and mptcp_sock_destruct().
>
> Suggested-by: Paolo Abeni <pabeni@redhat.com>
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
> ---
> net/mptcp/protocol.c | 11 ++++++++---
> net/mptcp/protocol.h |  1 +
> net/mptcp/subflow.c  |  4 +---
> 3 files changed, 10 insertions(+), 6 deletions(-)

Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>

--
Mat Martineau
Intel
Mat Martineau Sept. 25, 2020, 12:25 a.m. UTC | #5
On Thu, 24 Sep 2020, Geliang Tang wrote:

> Add a new struct mptcp_pm_add_entry to describe add_addr's entry.

>

> Acked-by: Paolo Abeni <pabeni@redhat.com>

> Signed-off-by: Geliang Tang <geliangtang@gmail.com>

> ---

> net/mptcp/pm_netlink.c | 19 ++++++++++++-------

> 1 file changed, 12 insertions(+), 7 deletions(-)


Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>


--
Mat Martineau
Intel
Mat Martineau Sept. 25, 2020, 12:26 a.m. UTC | #6
On Thu, 24 Sep 2020, Geliang Tang wrote:

> This patch added a new helper sk_stop_timer_sync, it deactivates a timer
> like sk_stop_timer, but waits for the handler to finish.
>
> Acked-by: Paolo Abeni <pabeni@redhat.com>
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
> ---
> include/net/sock.h | 2 ++
> net/core/sock.c    | 7 +++++++
> 2 files changed, 9 insertions(+)

Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>

--
Mat Martineau
Intel
Mat Martineau Sept. 25, 2020, 12:26 a.m. UTC | #7
On Thu, 24 Sep 2020, Geliang Tang wrote:

> This patch implemented the retransmition of ADD_ADDR when no ADD_ADDR echo

> is received. It added a timer with the announced address. When timeout

> occurs, ADD_ADDR will be retransmitted.

>

> Suggested-by: Mat Martineau <mathew.j.martineau@linux.intel.com>

> Suggested-by: Paolo Abeni <pabeni@redhat.com>

> Acked-by: Paolo Abeni <pabeni@redhat.com>

> Signed-off-by: Geliang Tang <geliangtang@gmail.com>

> ---

> net/mptcp/options.c    |   1 +

> net/mptcp/pm_netlink.c | 109 ++++++++++++++++++++++++++++++++++-------

> net/mptcp/protocol.h   |   3 ++

> 3 files changed, 96 insertions(+), 17 deletions(-)


Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>


--
Mat Martineau
Intel
Mat Martineau Sept. 25, 2020, 12:33 a.m. UTC | #8
On Thu, 24 Sep 2020, Geliang Tang wrote:

> This patch implemented the local subflow removing function,

> mptcp_pm_remove_subflow, it simply called mptcp_pm_nl_rm_subflow_received

> under the PM spin lock.

>

> We use mptcp_pm_remove_subflow to remove a local subflow, so change it's

> argument from remote_id to local_id.

>

> We check subflow->local_id in mptcp_pm_nl_rm_subflow_received to remove

> a subflow.

>

> Suggested-by: Matthieu Baerts <matthieu.baerts@tessares.net>

> Suggested-by: Paolo Abeni <pabeni@redhat.com>

> Suggested-by: Mat Martineau <mathew.j.martineau@linux.intel.com>

> Signed-off-by: Geliang Tang <geliangtang@gmail.com>

> ---

> net/mptcp/pm.c         |  9 +++++++--

> net/mptcp/pm_netlink.c | 33 +++++++++++++++++++++++++++++++++

> net/mptcp/protocol.h   |  3 ++-

> 3 files changed, 42 insertions(+), 3 deletions(-)


Resending this reviewed-by tag so patchwork picks it up (previous mail was 
not delivered to the mailing list, but I'm assuming it did go to other 
recipients).

Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>


--
Mat Martineau
Intel
David Miller Sept. 25, 2020, 2:58 a.m. UTC | #9
From: Geliang Tang <geliangtang@gmail.com>

Date: Thu, 24 Sep 2020 08:29:46 +0800

> This series include two enhancements for the MPTCP path management,

> namely RM_ADDR support and ADD_ADDR echo support, as specified by RFC

> sections 3.4.1 and 3.4.2.

> 

> 1 RM_ADDR support include 9 patches (1-3 and 8-13):

> 

> Patch 1 is the helper for patch 2, these two patches add the RM_ADDR

> outgoing functions, which are derived from ADD_ADDR's corresponding

> functions.

> 

> Patch 3 adds the RM_ADDR incoming logic, when RM_ADDR suboption is

> received, close the subflow matching the rm_id, and update PM counter.

> 

> Patch 8 is the main remove routine. When the PM netlink removes an address,

> we traverse all the existing msk sockets to find the relevant sockets. Then

> trigger the RM_ADDR signal and remove the subflow which using this local

> address, this subflow removing functions has been implemented in patch 9.

> 

> Finally, patches 10-13 are the self-tests for RM_ADDR.

> 

> 2 ADD_ADDR echo support include 7 patches (4-7 and 14-16).

> 

> Patch 4 adds the ADD_ADDR echo logic, when the ADD_ADDR suboption has been

> received, send out the same ADD_ADDR suboption with echo-flag, and no HMAC

> included.

> 

> Patches 5 and 6 are the self-tests for ADD_ADDR echo. Patch 7 is a little

> cleaning up.

> 

> Patch 14 and 15 are the helpers for patch 16. These three patches add

> the ADD_ADDR retransmition when no ADD_ADDR echo is received.


Series applied, thank you.