Netdev List
 help / color / mirror / Atom feed
From: Geliang Tang <geliang@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>, Matthieu Baerts <matttbe@kernel.org>
Cc: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	Chaitanya Kulkarni <kch@nvidia.com>,
	 Matthieu Baerts <matttbe@kernel.org>,
	Mat Martineau <martineau@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	 Shuah Khan <shuah@kernel.org>,
	Geliang Tang <tanggeliang@kylinos.cn>,
	linux-nvme@lists.infradead.org,  netdev@vger.kernel.org,
	mptcp@lists.linux.dev, linux-kselftest@vger.kernel.org,
	 Hannes Reinecke	 <hare@suse.de>,
	John Meneghini <jmeneghi@redhat.com>,
	Randy Jennings	 <randyj@purestorage.com>,
	Nilay Shroff <nilay@linux.ibm.com>,
	zhenwei pi	 <zhenwei.pi@linux.dev>, Hui Zhu <zhuhui@kylinos.cn>,
	Gang Yan <yangang@kylinos.cn>
Subject: Re: [PATCH 02/11] nvmet-tcp: implement accept mptcp proto
Date: Fri, 29 May 2026 22:20:51 +0800	[thread overview]
Message-ID: <4df03cad08088fba7fb49beaeb6513cef5b87c2b.camel@kernel.org> (raw)
In-Reply-To: <20260528082344.7e4cd1a1@kernel.org>

Hi Jakub,

On Thu, 2026-05-28 at 08:23 -0700, Jakub Kicinski wrote:
> On Thu, 28 May 2026 11:10:36 +0800 Geliang Tang wrote:
> > Dedicated MPTCP helpers are introduced for setting accept socket
> > options.
> > These helpers (no_linger, set_priority, set_tos) set the values on
> > all
> > existing subflows using mptcp_for_each_subflow(). The values are
> > then
> > synchronized to other newly created subflows in
> > sync_socket_options().
> 
> These are not protocol specific options, why do we have to export
> MPTCP-specific functions for them?

Thank you for reading the code. In addition to the three MPTCP-specific
functions implemented in this patch, I have implemented and exported
the following six MPTCP-specific functions throughout the series:

    void mptcp_sock_set_nodelay(struct sock *sk)
    int mptcp_sock_set_syncnt(struct sock *sk, int val)
    void mptcp_sock_set_tos(struct sock *sk, int val)
    void mptcp_sock_no_linger(struct sock *sk)
    void mptcp_sock_set_priority(struct sock *sk, u32 priority)
    void mptcp_sock_set_reuseaddr(struct sock *sk)

These correspond to the following six functions originally used for
TCP:

    tcp_sock_set_nodelay()
    tcp_sock_set_syncnt()
    ip_sock_set_tos()
    sock_no_linger()
    sock_set_priority()
    sock_set_reuseaddr()

The first two functions - tcp_sock_set_nodelay() and
tcp_sock_set_syncnt() - cannot be directly used with an MPTCP socket.
In fact, passing an MPTCP socket to tcp_sock_set_nodelay() even causes
a crash. Therefore I implemented these two MPTCP-specific functions.
Actually, a better approach would be to add protocol-independent
sock_set_nodelay() and sock_set_syncnt() in net/core/sock.c.

The third function, ip_sock_set_tos(), takes different arguments for
TCP vs. MPTCP. For MPTCP, it needs to pass inet_sk(msk->first)-
>rcv_tos, so I implemented an MPTCP-specific function.

The last three functions - sock_no_linger(), sock_set_priority(), and
sock_set_reuseaddr() - are not protocol-specific, but attributes set on
the MPTCP socket cannot be synchronized to its subflows because
mptcp_sockopt_sync_locked() checks msk->setsockopt_seq. Thus I
implemented these three MPTCP-specific functions, explicitly calling
sockopt_seq_inc(msk) inside them to increment msk->setsockopt_seq, so
that mptcp_sockopt_sync_locked() can properly synchronize the
attributes to all subflows. There should be a better solution for this,
and I will discuss it with @Matt.

Please give me some advice.

Thanks,
-Geliang

  reply	other threads:[~2026-05-29 14:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-28  3:10 [PATCH 00/11] NVMe over MPTCP Geliang Tang
2026-05-28  3:10 ` [PATCH 01/11] nvmet-tcp: define accept tcp_proto struct Geliang Tang
2026-05-28  3:10 ` [PATCH 02/11] nvmet-tcp: implement accept mptcp proto Geliang Tang
2026-05-28 15:23   ` Jakub Kicinski
2026-05-29 14:20     ` Geliang Tang [this message]
2026-05-28  3:10 ` [PATCH 03/11] nvmet-tcp: define listen socket ops Geliang Tang
2026-05-28  3:10 ` [PATCH 04/11] nvmet-tcp: register target mptcp transport Geliang Tang
2026-05-28  3:10 ` [PATCH 05/11] nvmet-tcp: implement mptcp listen socket ops Geliang Tang
2026-05-28  3:10 ` [PATCH 06/11] nvme-fabrics: compare transport in ip_options_match Geliang Tang
2026-05-28  3:10 ` [PATCH 07/11] nvme-tcp: define host tcp_proto struct Geliang Tang
2026-05-28  3:10 ` [PATCH 08/11] nvme-tcp: register host mptcp transport Geliang Tang
2026-05-28  3:10 ` [PATCH 09/11] nvme-tcp: implement host mptcp proto Geliang Tang
2026-05-28  3:10 ` [PATCH 10/11] selftests: mptcp: add nvme over mptcp test Geliang Tang
2026-05-28  3:10 ` [PATCH 11/11] selftests: mptcp: nvme: add iopolicy tests Geliang Tang
2026-05-28  8:42 ` [PATCH 00/11] NVMe over MPTCP Christoph Hellwig
2026-05-29 14:31   ` Geliang Tang

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=4df03cad08088fba7fb49beaeb6513cef5b87c2b.camel@kernel.org \
    --to=geliang@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=horms@kernel.org \
    --cc=jmeneghi@redhat.com \
    --cc=kbusch@kernel.org \
    --cc=kch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=martineau@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=nilay@linux.ibm.com \
    --cc=pabeni@redhat.com \
    --cc=randyj@purestorage.com \
    --cc=sagi@grimberg.me \
    --cc=shuah@kernel.org \
    --cc=tanggeliang@kylinos.cn \
    --cc=yangang@kylinos.cn \
    --cc=zhenwei.pi@linux.dev \
    --cc=zhuhui@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