Netdev List
 help / color / mirror / Atom feed
From: Geliang Tang <geliang@kernel.org>
To: Jakub Kicinski <kuba@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>,
	 David Ahern <dsahern@kernel.org>,
	Ido Schimmel <idosch@nvidia.com>,
	"David S. Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	 Hannes Reinecke	 <hare@suse.de>,
	Geliang Tang <tanggeliang@kylinos.cn>,
		linux-nvme@lists.infradead.org, netdev@vger.kernel.org,
	mptcp@lists.linux.dev
Subject: Re: [PATCH v2 1/3] ipv6: extract and export ip6_sock_set_tclass helpers
Date: Sun, 09 Aug 2026 08:31:12 +0800	[thread overview]
Message-ID: <33e7a2b83f7de3651a3ab77732c869d15408c00f.camel@kernel.org> (raw)
In-Reply-To: <20260808125953.1e8488e3@kernel.org>

Hi Jakub,

On Sat, 2026-08-08 at 12:59 -0700, Jakub Kicinski wrote:
> On Sat,  8 Aug 2026 14:54:59 +0800 Geliang Tang wrote:
> > IPV6_TCLASS handling in do_ipv6_setsockopt() inlines the same ECN
> > mask
> > logic and inet6_sk(sk)->tclass write that callers need when
> > propagating
> > a tclass value onto a newly created socket.
> > 
> > Pull this into small helpers
> > __ip6_sock_set_tclass()/ip6_sock_set_tclass()
> > exported via <net/ipv6.h>, so external modules can apply
> > IPV6_TCLASS
> > without duplicating the ECN handling.
> > 
> > __ip6_sock_set_tclass() will be used by MPTCP's sockopt
> > implementation
> > (similar to __ip_sock_set_tos),
> 
> not part of this series

Exactly. The export of __ip6_sock_set_tclass() is not part of this
series, it belongs to the MPTCP series that adds IPV6_TCLASS support. I
will move this export to that series instead.

> 
> > while ip6_sock_set_tclass() will be used
> > by nvme-tcp (similar to ip_sock_set_tos).
> 
> setsockopt already supports generic kernel callers, sth like:
> 
>    do_sock_setsockopt(sock, false, SOL_IPV6, IPV6_TCLASS,
>   		      KERNEL_SOCKPTR(&val), sizeof(val));
> 
> ? Please don't export helpers for every single sockopt.

That is exactly what I planned to do in a follow-up patch - please see
my reply to [1].

The goal is to make NVMe work with both TCP and MPTCP going forward. To
achieve that, all sockopt calls in NVMe need to be switched to use
do_sock_setsockopt() instead of calling individual sockopt helpers.
This approach abstracts away the protocol differences, so NVMe no
longer needs to care whether it is dealing with TCP or MPTCP.

Even when MPTCP is not involved, switching to do_sock_setsockopt()
provides a general improvement to the code. I will include this "switch
NVMe to do_sock_setsockopt" patch in v3 of this series.

Thanks,
-Geliang

[1]https://patchwork.kernel.org/project/linux-nvme/patch/a1fa5dd3ebb0cafe1bf7948bf2a96436e9452e19.1779934709.git.tanggeliang@kylinos.cn/




  reply	other threads:[~2026-08-09  0:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-08  6:54 [PATCH v2 0/3] nvme-tcp: add IPv6 traffic class support Geliang Tang
2026-08-08  6:54 ` [PATCH v2 1/3] ipv6: extract and export ip6_sock_set_tclass helpers Geliang Tang
2026-08-08 19:59   ` Jakub Kicinski
2026-08-09  0:31     ` Geliang Tang [this message]
2026-08-08  6:55 ` [PATCH v2 2/3] nvme-tcp: support IPv6 traffic class Geliang Tang
2026-08-08  6:55 ` [PATCH v2 3/3] nvmet-tcp: " 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=33e7a2b83f7de3651a3ab77732c869d15408c00f.camel@kernel.org \
    --to=geliang@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kbusch@kernel.org \
    --cc=kch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sagi@grimberg.me \
    --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