MPTCP Linux Development
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Geliang Tang <geliangtang@gmail.com>
Cc: mptcp@lists.linux.dev, Geliang Tang <geliangtang@xiaomi.com>
Subject: Re: [MPTCP][PATCH v3 mptcp-next 2/5] mptcp: local addresses fullmesh
Date: Mon, 26 Jul 2021 11:32:19 +0200	[thread overview]
Message-ID: <b263100b44ade87c4c8de95e549d1e761f7bd1e1.camel@redhat.com> (raw)
In-Reply-To: <CA+WQbwtmVWv+JkVd=RifG=o6=V0VMjaaGvJj2sMZQb6UDA0nYA@mail.gmail.com>

On Mon, 2021-07-26 at 16:32 +0800, Geliang Tang wrote:
> Paolo Abeni <pabeni@redhat.com> 于2021年7月26日周一 下午4:24写道:
> > On Mon, 2021-07-26 at 12:12 +0800, Geliang Tang wrote:
> > > From: Geliang Tang <geliangtang@xiaomi.com>
> > > 
> > > In mptcp_pm_nl_add_addr_received(), fill a temporary allocate array of
> > > all local address corresponding to the fullmesh endpoint. If such array
> > > is empty, keep the current behavior.
> > > 
> > > Elsewhere loop on such array and create a subflow for each local address
> > > towards the given remote address
> > > 
> > > Suggested-by: Paolo Abeni <pabeni@redhat.com>
> > > Signed-off-by: Geliang Tang <geliangtang@xiaomi.com>
> > > ---
> > >  net/mptcp/pm_netlink.c | 35 ++++++++++++++++++++++++++++++++---
> > >  1 file changed, 32 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
> > > index f57db5b9a50f..a03e8fd3a584 100644
> > > --- a/net/mptcp/pm_netlink.c
> > > +++ b/net/mptcp/pm_netlink.c
> > > @@ -526,12 +526,17 @@ static void mptcp_pm_nl_subflow_established(struct mptcp_sock *msk)
> > > 
> > >  static void mptcp_pm_nl_add_addr_received(struct mptcp_sock *msk)
> > >  {
> > > +     struct mptcp_pm_addr_entry entries[MPTCP_PM_ADDR_MAX];
> > >       struct sock *sk = (struct sock *)msk;
> > > +     struct mptcp_pm_addr_entry *entry;
> > >       unsigned int add_addr_accept_max;
> > > +     struct mptcp_pm_addr_entry local;
> > >       struct mptcp_addr_info remote;
> > > -     struct mptcp_addr_info local;
> > > +     struct pm_nl_pernet *pernet;
> > >       unsigned int subflows_max;
> > > +     int i, n = 0;
> > > 
> > > +     pernet = net_generic(sock_net(sk), pm_nl_pernet_id);
> > >       add_addr_accept_max = mptcp_pm_get_add_addr_accept_max(msk);
> > >       subflows_max = mptcp_pm_get_subflows_max(msk);
> > > 
> > > @@ -555,10 +560,34 @@ static void mptcp_pm_nl_add_addr_received(struct mptcp_sock *msk)
> > >       if (!remote.port)
> > >               remote.port = sk->sk_dport;
> > >       memset(&local, 0, sizeof(local));
> > > -     local.family = remote.family;
> > > +     local.addr.family = remote.family;
> > > 
> > > +     entries[n++] = local;
> > 
> > If I read correctly, I think this entry should be added only if the
> > full-mesh selection below find no other entries. Otherwise, e.g. in the
> > simple scenario with 2 locals address, 3 subflows will be created.
> 
> local is the id 0 address, this address should always be used, and it's
> not on the local_addr_list. 

Uhm... if the user-space configures correctly the mptcp endpoints,
every relevant address should be in local_addr_list.

e.g.

The client has 2 IPs:

192.168.255.2/24 dev eth0
192.168.254.2/24 dev eth1

The user-space should create 2 endpoints with full-mesh flags, one for
each of the above IPs, at addresses creation time.

When the mptcp socket is established, it's first subflow will use as
local address one of such IPs/endpoints.

If mptcp_pm_nl_add_addr_received() adds to the 'entries' array an
'IPADDRANY' address, and than the 2 addresses above, the client will
end-up creating 3 subflows towards the newly signaled address, instead
of the expected 2.

WDYT?

Paolo


      reply	other threads:[~2021-07-26  9:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-26  4:12 [MPTCP][PATCH v3 mptcp-next 0/5] fullmesh path manager support Geliang Tang
2021-07-26  4:12 ` [MPTCP][PATCH v3 mptcp-next 1/5] mptcp: remote addresses fullmesh Geliang Tang
2021-07-26  4:12   ` [MPTCP][PATCH v3 mptcp-next 2/5] mptcp: local " Geliang Tang
2021-07-26  4:12     ` [MPTCP][PATCH v3 mptcp-next 3/5] selftests: mptcp: set and print the fullmesh flag Geliang Tang
2021-07-26  4:12       ` [MPTCP][PATCH v3 mptcp-next 4/5] selftests: mptcp: add fullmesh testcases Geliang Tang
2021-07-26  4:12         ` [MPTCP][PATCH v3 mptcp-next 5/5] selftests: mptcp: delete uncontinuous removing ids Geliang Tang
2021-07-26  8:25       ` [MPTCP][PATCH v3 mptcp-next 3/5] selftests: mptcp: set and print the fullmesh flag Paolo Abeni
2021-07-26  9:21         ` Paolo Abeni
2021-07-26  8:24     ` [MPTCP][PATCH v3 mptcp-next 2/5] mptcp: local addresses fullmesh Paolo Abeni
2021-07-26  8:32       ` Geliang Tang
2021-07-26  9:32         ` Paolo Abeni [this message]

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=b263100b44ade87c4c8de95e549d1e761f7bd1e1.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=geliangtang@gmail.com \
    --cc=geliangtang@xiaomi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox