From: Geliang Tang <geliang@kernel.org>
To: 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>,
Hannes Reinecke <hare@suse.de>
Cc: Geliang Tang <tanggeliang@kylinos.cn>, linux-nvme@lists.infradead.org
Subject: [PATCH 0/3] nvme-tcp: add IPv6 traffic class support
Date: Mon, 27 Jul 2026 11:19:00 +0800 [thread overview]
Message-ID: <cover.1785122120.git.tanggeliang@kylinos.cn> (raw)
From: Geliang Tang <tanggeliang@kylinos.cn>
This series adds IPv6 traffic class (tclass) support to the NVMe/TCP
fabrics stack, mirroring the existing IPv4 TOS configuration.
The current code path only handles IPv4: nvme-fabrics exposes a 'tos'
option, the host (nvme-tcp) applies IP_TOS to each queue socket, and
the target (nvmet-tcp) reflects the value received on the wire. This
leaves no way to control or observe the IPv6 traffic class for NVMe/TCP
connections, which is a real gap for deployments running over IPv6 or
MPTCP subflows that need a non-default tclass.
The series is split into three patches following the natural
fabrics/host/target layering:
1. nvme-fabrics: add IPv6 traffic class option
Parse the new 'tclass' option in nvmf_parse_options(), validate
that it is in the 0-255 range, and store it in
struct nvmf_ctrl_options. Use -1 to mean "transport default",
matching the existing tos handling.
2. nvme-tcp: support IPv6 traffic class
Advertise NVMF_OPT_TCLASS in the nvme_tcp transport and, when a
tclass was provided, set IPV6_TCLASS on each queue socket. The
existing IP_TOS path is left untouched so IPv4 behaviour is
unchanged.
3. nvmet-tcp: support IPv6 traffic class
On the target side, differentiate the socket family: for AF_INET
keep the existing TOS handling, and for AF_INET6 read the traffic
class from the incoming socket and apply it via IPV6_TCLASS.
Follow-up changes outside of this series expose the same option
through libnvme and the nvme-cli, so the new tclass can be selected
from the user-facing command line; those patches will be sent in a
separate series.
This was tested with the selftests mptcp_nvme.sh [1], extended in
"nvme: add tclass support" to pass "--tclass" on the host side and
validate that the value is reflected on the wire by the target.
[1]
https://patchwork.kernel.org/project/linux-nvme/cover/cover.1779934709.git.tanggeliang@kylinos.cn/
Geliang Tang (3):
nvme-fabrics: add IPv6 traffic class option
nvme-tcp: support IPv6 traffic class
nvmet-tcp: support IPv6 traffic class
drivers/nvme/host/fabrics.c | 18 ++++++++++++++++++
drivers/nvme/host/fabrics.h | 3 +++
drivers/nvme/host/tcp.c | 8 +++++++-
drivers/nvme/target/tcp.c | 15 +++++++++++++--
4 files changed, 41 insertions(+), 3 deletions(-)
--
2.53.0
next reply other threads:[~2026-07-27 3:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 3:19 Geliang Tang [this message]
2026-07-27 3:19 ` [PATCH 1/3] nvme-fabrics: add IPv6 traffic class option Geliang Tang
2026-07-27 3:19 ` [PATCH 2/3] nvme-tcp: support IPv6 traffic class Geliang Tang
2026-07-27 3:19 ` [PATCH 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=cover.1785122120.git.tanggeliang@kylinos.cn \
--to=geliang@kernel.org \
--cc=axboe@kernel.dk \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=kch@nvidia.com \
--cc=linux-nvme@lists.infradead.org \
--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