From: Geliang Tang <geliang.tang@linux.dev>
To: Mat Martineau <martineau@kernel.org>,
Matthieu Baerts <matttbe@kernel.org>
Cc: mptcp@lists.linux.dev, Geliang Tang <tanggeliang@kylinos.cn>,
Geliang Tang <geliang@kernel.org>
Subject: Re: [PATCH mptcp-next v10 10/23] mptcp: check userspace pm subflow flag
Date: Tue, 06 Feb 2024 10:57:01 +0800 [thread overview]
Message-ID: <8bbb6d165777dd32ec9cb3c9b679a7bf543b17f8.camel@linux.dev> (raw)
In-Reply-To: <38c3cf2e-ba53-b30f-cf2c-e39d793851f2@kernel.org>
Hi Mat & Matt,
On Tue, 2024-01-30 at 18:28 -0800, Mat Martineau wrote:
> On Thu, 18 Jan 2024, Geliang Tang wrote:
>
> > From: Geliang Tang <tanggeliang@kylinos.cn>
> >
> > Just like MPTCP_PM_ADDR_FLAG_SIGNAL flag is checked in userspace PM
> > announce mptcp_pm_nl_announce_doit(), MPTCP_PM_ADDR_FLAG_SUBFLOW
> > flag
> > should be checked in mptcp_pm_nl_subflow_create_doit() too.
> >
> > If MPTCP_PM_ADDR_FLAG_SUBFLOW flag is not set, there's no flags
> > field
> > in the output of dump_addr. This looks a bit strange:
> >
> > id 10 flags 10.0.3.2
> >
> > This patch uses mptcp_pm_parse_entry() instead of
> > mptcp_pm_parse_addr()
> > to get the flags of the entry. Add MPTCP_PM_ADDR_FLAG_SUBFLOW flag
> > check
> > in mptcp_pm_nl_subflow_create_doit().
> >
>
> Hi Geliang -
>
> Have you tested this change with mptcpd?
What do you think to test 'mptcpd' in our CI too? If you agree, I'll
try to do this, and add a new ticket about it in Github.
>
> Is the addr flag (SUBFLOW or SIGNAL) relevant for userspace PM
> addresses?
> It doesn't seem like a useful distinction: the userspace PM is always
> creating a new subflow in this context, since address signaling is
> handled
> by mptcp_pm_nl_announce_doit().
>
> Two options I see:
> * update the userspace tools to cleanly handle missing flags for
> userspace connections
> or
> * have mptcp_pm_nl_subflow_create_doit() always set
> MPTCP_PM_ADDR_FLAG_SUBFLOW for the local addr even if it's missing
> from
> the netlink attribute (and maybe don't allow
> MPTCP_PM_ADDR_FLAG_SIGNAL?)
Thanks for your suggestions. Option 2 has been updated in v11.
-Geliang
>
> - Mat
>
>
> > Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> > ---
> > net/mptcp/pm_userspace.c | 10 ++++++++--
> > 1 file changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
> > index f1582f40f70e..ca0d6e1dfade 100644
> > --- a/net/mptcp/pm_userspace.c
> > +++ b/net/mptcp/pm_userspace.c
> > @@ -361,11 +361,18 @@ int mptcp_pm_nl_subflow_create_doit(struct
> > sk_buff *skb, struct genl_info *info)
> > goto create_err;
> > }
> >
> > - err = mptcp_pm_parse_addr(laddr, info, &addr_l);
> > + err = mptcp_pm_parse_entry(laddr, info, true, &local);
> > if (err < 0) {
> > NL_SET_ERR_MSG_ATTR(info->extack, laddr, "error
> > parsing local addr");
> > goto create_err;
> > }
> > + addr_l = local.addr;
> > +
> > + if (!(local.flags & MPTCP_PM_ADDR_FLAG_SUBFLOW)) {
> > + GENL_SET_ERR_MSG(info, "invalid addr flags");
> > + err = -EINVAL;
> > + goto create_err;
> > + }
> >
> > err = mptcp_pm_parse_addr(raddr, info, &addr_r);
> > if (err < 0) {
> > @@ -379,7 +386,6 @@ int mptcp_pm_nl_subflow_create_doit(struct
> > sk_buff *skb, struct genl_info *info)
> > goto create_err;
> > }
> >
> > - local.addr = addr_l;
> > err = mptcp_userspace_pm_append_new_local_addr(msk,
> > &local,
> >
> > !mptcp_pm_has_addr_attr_id(laddr, info));
> > if (err < 0) {
> > --
> > 2.40.1
> >
> >
> >
next prev parent reply other threads:[~2024-02-06 2:57 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-18 6:11 [PATCH mptcp-next v10 00/23] dump for userspace pm Geliang Tang
2024-01-18 6:11 ` [PATCH mptcp-next v10 01/23] mptcp: add pm_has_addr_attr_id helper Geliang Tang
2024-01-31 2:15 ` Mat Martineau
2024-01-18 6:11 ` [PATCH mptcp-next v10 02/23] mptcp: add needs_id for userspace appending addr Geliang Tang
2024-01-31 2:20 ` Mat Martineau
2024-01-18 6:11 ` [PATCH mptcp-next v10 03/23] mptcp: add needs_id for netlink " Geliang Tang
2024-01-18 6:11 ` [PATCH mptcp-next v10 04/23] mptcp: map v4 address to v6 when destroying subflow Geliang Tang
2024-01-31 2:21 ` Mat Martineau
2024-01-18 6:11 ` [PATCH mptcp-next v10 05/23] selftests: mptcp: rm subflow with v4/v4mapped addr Geliang Tang
2024-01-18 6:11 ` [PATCH mptcp-next v10 06/23] mptcp: export mptcp_genl_family & mptcp_nl_fill_addr Geliang Tang
2024-01-18 6:11 ` [PATCH mptcp-next v10 07/23] mptcp: implement mptcp_userspace_pm_dump_addr Geliang Tang
2024-01-18 6:11 ` [PATCH mptcp-next v10 08/23] mptcp: add token for get-addr in yaml Geliang Tang
2024-01-18 6:11 ` [PATCH mptcp-next v10 09/23] mptcp: dump addrs in userspace pm list Geliang Tang
2024-01-18 6:11 ` [PATCH mptcp-next v10 10/23] mptcp: check userspace pm subflow flag Geliang Tang
2024-01-31 2:28 ` Mat Martineau
2024-02-06 2:57 ` Geliang Tang [this message]
2024-02-08 9:27 ` Matthieu Baerts
2024-01-18 6:11 ` [PATCH mptcp-next v10 11/23] selftests: mptcp: add " Geliang Tang
2024-01-18 6:11 ` [PATCH mptcp-next v10 12/23] selftests: mptcp: add token for dump_addr Geliang Tang
2024-01-18 6:11 ` [PATCH mptcp-next v10 13/23] selftests: mptcp: add check_output helper Geliang Tang
2024-01-18 6:11 ` [PATCH mptcp-next v10 14/23] selftests: mptcp: dump after creating id 0 subflow Geliang Tang
2024-01-18 6:11 ` [PATCH mptcp-next v10 15/23] selftests: mptcp: dump userspace addrs list Geliang Tang
2024-01-18 6:11 ` [PATCH mptcp-next v10 16/23] mptcp: add userspace_pm_lookup_addr_by_id helper Geliang Tang
2024-01-18 6:11 ` [PATCH mptcp-next v10 17/23] mptcp: implement mptcp_userspace_pm_get_addr Geliang Tang
2024-01-18 6:11 ` [PATCH mptcp-next v10 18/23] mptcp: get addr in userspace pm list Geliang Tang
2024-01-18 6:11 ` [PATCH mptcp-next v10 19/23] selftests: mptcp: add token for get_addr Geliang Tang
2024-01-18 6:12 ` [PATCH mptcp-next v10 20/23] selftests: mptcp: userspace pm get addr tests Geliang Tang
2024-01-18 6:12 ` [PATCH mptcp-next v10 21/23] mptcp: update set_flags interfaces Geliang Tang
2024-01-18 6:12 ` [PATCH mptcp-next v10 22/23] mptcp: set error messages for set_flags Geliang Tang
2024-01-18 6:12 ` [PATCH mptcp-next v10 23/23] selftests: mptcp: flush userspace addrs list Geliang Tang
2024-01-18 7:24 ` selftests: mptcp: flush userspace addrs list: Tests Results MPTCP CI
2024-01-18 8:03 ` MPTCP CI
2024-01-31 1:32 ` [PATCH mptcp-next v10 00/23] dump for userspace pm Mat Martineau
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=8bbb6d165777dd32ec9cb3c9b679a7bf543b17f8.camel@linux.dev \
--to=geliang.tang@linux.dev \
--cc=geliang@kernel.org \
--cc=martineau@kernel.org \
--cc=matttbe@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=tanggeliang@kylinos.cn \
/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