MPTCP Linux Development
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Matthieu Baerts <matthieu.baerts@tessares.net>
Cc: Florian Westphal <fw@strlen.de>, Paolo Abeni <pabeni@redhat.com>,
	mptcp@lists.linux.dev
Subject: Re: [PATCH v3 mptcp-next 2/6] mptcp: introduce MPTCP_FULL_INFO getsockopt
Date: Wed, 24 May 2023 12:04:07 +0200	[thread overview]
Message-ID: <20230524100407.GE17561@breakpoint.cc> (raw)
In-Reply-To: <fe2191fe-6842-7662-d300-0aa88cdb9827@tessares.net>

Matthieu Baerts <matthieu.baerts@tessares.net> wrote:
> On 23/05/2023 20:25, Florian Westphal wrote:
> > 	__u32		size_subflow_full_info;         /* size of this structure in userspace */
> 
> Why do we need this field? Can we not use the option length (int __user
> *optlen) provided by the userspace?

Right, yes, we can (and should) use __user *optlen instead
of this explicit member.

> >         __u32           size_sfinfo_kernel;		/* must be 0, set by kernel */
> >         __u32           size_sfinfo_user;
> >         __u32           size_tcpinfo_kernel;            /* must be 0, set by kernel */
> >         __u32           size_tcpinfo_user;
> 
> Do we need to have the kernel and user size in different fields?
> Is it not enough have:
> 
>   num_subflows;          /* will be set by the kernel */
>   num_subflows_copied;   /* max for the user, kernel put what it did */
>   size_sfinfo;           /* user set it, kernel put what it used: min */
>   size_tcpinfo;          /* same */

Yes, that would work too: kernel updates value to what its using.

I have no preference.  I used extra fields to better document
that this is filled in by the kernel.

I'll let Paolo make the call.

> If we add mptcp_info structure as mentioned by Paolo, we are getting
> very close the the getsockopt(MPTCP_INFO) from the fork kernel, see the
> section "Get detailed information of your subflows":
> 
> https://multipath-tcp.org/pmwiki.php/Users/ConfigureMPTCP
> 
> And the kernel header:
> 
> https://github.com/multipath-tcp/mptcp/blob/mptcp_trunk/include/uapi/linux/tcp.h#L321-L366

Right, this is similar.

> If we want to be even more future prove, why not having something more
> flexible where the userspace puts flags of what it wants and then there
> is a kind of TLV structure? Maybe it would be too complex to read/write?
> 
> 
>   struct mptcp_tlv_info {
>       __u32 type;
>       __u32 length;
>       __aligned_u64 value;
>   };
> 
>   struct mptcp_full_info {
>       __u32 flags;
>       __u32 num_subflows;
>       __u32 num_subflows_copied;
>       struct mptcp_tlv_info[];   /* number has to be linked to flags */
>   };

Hmm, I think it would be better to reuse an existing scheme
and e.g. return a netlink attribute blob in such a case,
this would also allow sharing with the diag interface/functions.

  parent reply	other threads:[~2023-05-24 10:04 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-23 17:37 [PATCH v3 mptcp-next 0/6] mptcp: add some more diag info Paolo Abeni
2023-05-23 17:37 ` [PATCH v3 mptcp-next 1/6] mptcp: add subflow unique id Paolo Abeni
2023-05-23 17:37 ` [PATCH v3 mptcp-next 2/6] mptcp: introduce MPTCP_FULL_INFO getsockopt Paolo Abeni
2023-05-23 18:25   ` Florian Westphal
2023-05-24  6:34     ` Paolo Abeni
2023-05-24  6:36       ` Paolo Abeni
2023-05-24  7:36         ` Matthieu Baerts
2023-05-24  8:11           ` Paolo Abeni
2023-05-24  8:16             ` Matthieu Baerts
2023-05-24  9:56       ` Florian Westphal
2023-05-24 12:04         ` Matthieu Baerts
2023-05-24 12:22           ` Florian Westphal
2023-05-24 12:37             ` Matthieu Baerts
2023-05-24  8:13     ` Matthieu Baerts
2023-05-24  8:53       ` Paolo Abeni
2023-05-24  9:12         ` Matthieu Baerts
2023-05-24 10:04       ` Florian Westphal [this message]
2023-05-24 12:08         ` Matthieu Baerts
2023-05-23 17:37 ` [PATCH v3 mptcp-next 3/6] mptcp: move snd_una update earlier for fallback socket Paolo Abeni
2023-05-23 17:37 ` [PATCH v3 mptcp-next 4/6] mptcp: track some aggregate data counters Paolo Abeni
2023-05-23 18:49   ` Florian Westphal
2023-05-24  8:15     ` Paolo Abeni
2023-05-24 10:05       ` Florian Westphal
2023-05-23 17:37 ` [PATCH v3 mptcp-next 5/6] selftests: mptcp: explicitly tests aggregate counters Paolo Abeni
2023-05-23 17:37 ` [PATCH v3 mptcp-next 6/6] selftests: mptcp: add MPTCP_FULL_INFO testcase Paolo Abeni

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=20230524100407.GE17561@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=matthieu.baerts@tessares.net \
    --cc=mptcp@lists.linux.dev \
    --cc=pabeni@redhat.com \
    /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