All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: Kishen Maloor <kishen.maloor@intel.com>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v6 02/14] mptcp: handle local addrs announced by userspace PMs
Date: Fri, 1 Apr 2022 12:02:15 -0700 (PDT)	[thread overview]
Message-ID: <2588c590-a25d-28d-23e-fc8b75389bc9@linux.intel.com> (raw)
In-Reply-To: <20220329021437.1196552-3-kishen.maloor@intel.com>

On Mon, 28 Mar 2022, Kishen Maloor wrote:

> This change adds an internal function to store/retrieve local
> addrs announced by userspace PM implementations to/from its kernel
> context. The function addresses the requirements of three scenarios:
> 1) ADD_ADDR announcements (which require that a local id be
> provided), 2) retrieving the local id associated with an address,
> and also where one may need to be assigned, and 3) reissuance of
> ADD_ADDRs when there's a successful match of addr/id.
>
> The list of all stored local addr entries is held under the
> MPTCP sock structure. Memory for these entries is allocated from
> the sock option buffer, so the list of addrs is bounded by optmem_max.
> The list if not released via REMOVE_ADDR signals is ultimately
> freed when the sock is destructed.
>
> Signed-off-by: Kishen Maloor <kishen.maloor@intel.com>
> ---
> v6:
> -Move local_addr_list into struct mptcp_pm_data.
> -Replace mptcp_data_lock() with the pm spinlock.
> -Move mptcp_userspace_pm_append_new_local_addr() and
> mptcp_free_local_addr_list() into a new pm_userspace.c.
> -Make addresses_equal() helper non-static and rename to
> mptcp_addresses_equal().
> ---
> net/mptcp/Makefile       |  2 +-
> net/mptcp/pm.c           |  1 +
> net/mptcp/pm_netlink.c   | 34 +++++++++---------
> net/mptcp/pm_userspace.c | 74 ++++++++++++++++++++++++++++++++++++++++
> net/mptcp/protocol.c     |  1 +
> net/mptcp/protocol.h     |  7 ++++
> 6 files changed, 101 insertions(+), 18 deletions(-)
> create mode 100644 net/mptcp/pm_userspace.c
>
> diff --git a/net/mptcp/Makefile b/net/mptcp/Makefile
> index e54daceac58b..cb7f53f6ab22 100644
> --- a/net/mptcp/Makefile
> +++ b/net/mptcp/Makefile
> @@ -2,7 +2,7 @@
> obj-$(CONFIG_MPTCP) += mptcp.o
>
> mptcp-y := protocol.o subflow.o options.o token.o crypto.o ctrl.o pm.o diag.o \
> -	   mib.o pm_netlink.o sockopt.o
> +	   mib.o pm_netlink.o sockopt.o pm_userspace.o
>
> obj-$(CONFIG_SYN_COOKIES) += syncookies.o
> obj-$(CONFIG_INET_MPTCP_DIAG) += mptcp_diag.o
> diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
> index 5d6832c4d9f2..cdc2d79071f8 100644
> --- a/net/mptcp/pm.c
> +++ b/net/mptcp/pm.c
> @@ -469,6 +469,7 @@ void mptcp_pm_data_init(struct mptcp_sock *msk)
> {
> 	spin_lock_init(&msk->pm.lock);
> 	INIT_LIST_HEAD(&msk->pm.anno_list);
> +	INIT_LIST_HEAD(&msk->pm.userspace_pm_local_addr_list);
> 	mptcp_pm_data_reset(msk);
> }
>
> diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
> index 8d04c8d8a8df..836f6df9f744 100644
> --- a/net/mptcp/pm_netlink.c
> +++ b/net/mptcp/pm_netlink.c
> @@ -55,8 +55,8 @@ struct pm_nl_pernet {
> #define MPTCP_PM_ADDR_MAX	8
> #define ADD_ADDR_RETRANS_MAX	3
>
> -static bool addresses_equal(const struct mptcp_addr_info *a,
> -			    const struct mptcp_addr_info *b, bool use_port)
> +bool mptcp_addresses_equal(const struct mptcp_addr_info *a,
> +			   const struct mptcp_addr_info *b, bool use_port)

There's a minor conflict with the export branch here after the get_pernet 
helpers were added. I know you're planning a rebase but figured I'd 
capture it here on the ML.


--
Mat Martineau
Intel

  parent reply	other threads:[~2022-04-01 19:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29  2:14 [PATCH mptcp-next v6 00/14] mptcp: APIs and self-tests for userspace path management Kishen Maloor
2022-03-29  2:14 ` [PATCH mptcp-next v6 01/14] mptcp: allow ADD_ADDR reissuance by userspace PMs Kishen Maloor
2022-03-29  2:14 ` [PATCH mptcp-next v6 02/14] mptcp: handle local addrs announced " Kishen Maloor
2022-04-01 14:43   ` Paolo Abeni
2022-04-07  1:57     ` Kishen Maloor
2022-04-01 19:02   ` Mat Martineau [this message]
2022-03-29  2:14 ` [PATCH mptcp-next v6 03/14] mptcp: read attributes of addr entries managed " Kishen Maloor
2022-04-01 15:03   ` Paolo Abeni
2022-04-07  1:58     ` Kishen Maloor
2022-04-01 19:13   ` Mat Martineau
2022-03-29  2:14 ` [PATCH mptcp-next v6 04/14] mptcp: netlink: split mptcp_pm_parse_addr into two functions Kishen Maloor
2022-03-29  2:14 ` [PATCH mptcp-next v6 05/14] mptcp: netlink: Add MPTCP_PM_CMD_ANNOUNCE Kishen Maloor
2022-03-29  2:14 ` [PATCH mptcp-next v6 06/14] selftests: mptcp: support MPTCP_PM_CMD_ANNOUNCE Kishen Maloor
2022-03-29  2:14 ` [PATCH mptcp-next v6 07/14] mptcp: netlink: Add MPTCP_PM_CMD_REMOVE Kishen Maloor
2022-03-29  2:14 ` [PATCH mptcp-next v6 08/14] selftests: mptcp: support MPTCP_PM_CMD_REMOVE Kishen Maloor
2022-03-29  2:14 ` [PATCH mptcp-next v6 09/14] mptcp: netlink: allow userspace-driven subflow establishment Kishen Maloor
2022-03-29  2:14 ` [PATCH mptcp-next v6 10/14] selftests: mptcp: support MPTCP_PM_CMD_SUBFLOW_CREATE Kishen Maloor
2022-03-29  2:14 ` [PATCH mptcp-next v6 11/14] selftests: mptcp: support MPTCP_PM_CMD_SUBFLOW_DESTROY Kishen Maloor
2022-03-29  2:14 ` [PATCH mptcp-next v6 12/14] selftests: mptcp: capture netlink events Kishen Maloor
2022-03-29  2:14 ` [PATCH mptcp-next v6 13/14] selftests: mptcp: create listeners to receive MPJs Kishen Maloor
2022-03-29  2:14 ` [PATCH mptcp-next v6 14/14] selftests: mptcp: functional tests for the userspace PM type Kishen Maloor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2588c590-a25d-28d-23e-fc8b75389bc9@linux.intel.com \
    --to=mathew.j.martineau@linux.intel.com \
    --cc=kishen.maloor@intel.com \
    --cc=mptcp@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.