From: Matthieu Baerts <matttbe@kernel.org>
To: Mat Martineau <martineau@kernel.org>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next RFC] mptcp: socket option to check for fallback
Date: Thu, 9 May 2024 18:25:44 +0200 [thread overview]
Message-ID: <019d3bfe-90c7-472f-96fc-79e76461c10d@kernel.org> (raw)
In-Reply-To: <764b2d9f-8600-a3fd-9312-64b43e78162f@kernel.org>
Hi Mat,
On 07/05/2024 03:09, Mat Martineau wrote:
> On Mon, 6 May 2024, Matthieu Baerts (NGI0) wrote:
>
>> A way for an application to know if the connection fell back to TCP is
>> to use getsockopt(MPTCP_INFO) and look for errors. The issue with this
>> technique is that the same errors -- EOPNOTSUPP (IPv4) and ENOPROTOOPT
>> (IPv6) -- are returned if there was a fallback, or if the kernel doesn't
>> support this socket option. The userspace then has to look at the kernel
>> version to know what to expect.
>>
>> It is not clean, and it doesn't take into account older kernels where
>> the socket option has been backported. A cleaner way would be to expose
>> this info to the TCP socket level. In case of MPTCP socket where no
>> fallback happened, the socket options for the TCP level will be handled
>> in MPTCP code, in mptcp_getsockopt_sol_tcp(). If not, that will be in
>> TCP code, in do_tcp_getsockopt(). So one simply has to return 1, while
>> the other can return 0.
>>
>> If the socket option is not supported, an error will be reported:
>> EOPNOTSUPP (95 - Operation not supported) for MPTCP sockets, ENOPROTOOPT
>> (92 - Protocol not available) for TCP sockets.
>>
>
> Hi Matthieu -
>
> I like this approach as it's much simpler to check than MPTCP_INFO, and
> gives a clear answer to both "Is this kernel new enough to tell me the
> fallback status?" and "If it is new enough, is it currently a TCP or
> MPTCP socket?".
Thank you for your feedback!
As discussed yesterday, I just applied this patch in our tree, and I
will send it alone to netdev for review.
New patches for t/upstream:
- d035042ea2b4: mptcp: socket option to check for fallback
- Results: 5bc872cb274e..6d5ca2a78a70 (export)
Tests are now in progress:
- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/689430a018a9111229371ebb6167604e8dd6a7ae/checks
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
prev parent reply other threads:[~2024-05-09 16:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-06 13:15 [PATCH mptcp-next RFC] mptcp: socket option to check for fallback Matthieu Baerts (NGI0)
2024-05-06 14:05 ` MPTCP CI
2024-05-07 1:09 ` Mat Martineau
2024-05-09 16:25 ` Matthieu Baerts [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=019d3bfe-90c7-472f-96fc-79e76461c10d@kernel.org \
--to=matttbe@kernel.org \
--cc=martineau@kernel.org \
--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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).