NVMe over MPTCP
Subsystems (6)
Geliang Tang
reviewercover NVMe over MPTCP
From: Geliang Tang <[email protected]>
This series (previously named "MPTCP support to NVMe over TCP") had three RFC versions sent to Hannes in May 2025, with subsequent revisions based on his input. Following that, I initiated the process of upstreaming the dependent "mptcp: implement .read_sock" series, which was merged into the Linux kernel in February 2026.
After several rounds of iteration on the MPTCP mailing list, this set addresses all the reviewer comments (including Sashiko's) and fixes the identified issues.
This topic was presented as a discussion item at LSF/MM/BPF 2026. During the "NVMe over MPTCP" [1] discussion at the conference, it was concluded that MPTCP should be treated as a new transport type, rather than a TCP variant. A request will be submitted to the NVMe working group to officially allocate a transport value for MPTCP.
This series runs without any user space changes (libnvme, nvme-cli). Later, MPTCP KTLS support will be added, and a follow-up series will be sent to enable TLS for NVMe over MPTCP.
Based on NVMe Multipath and Block Multiqueue, each TCP queue is converted into one MPTCP queue. This is achieved by abstracting six socket helpers (set_nodelay, set_reuseaddr, no_linger, etc.) into per-transport structures. Inside each MPTCP queue, multiple subflows using different IP addresses aggregate multi-NIC bandwidth and provide fail-over resilience.
Patch 10 demonstrates that with a single NVMe multipath configuration and four network interfaces, MPTCP achieves four times the bandwidth of TCP. Patch 11 demonstrates that with four NVMe multipath paths, using the round-robin I/O policy and a lossy four-interface environment, MPTCP still achieves four times the bandwidth of TCP.
[1]
https://lore.kernel.org/linux-nvme/[email protected]/
Geliang Tang (11):
nvmet-tcp: define accept tcp_proto struct
nvmet-tcp: implement accept mptcp proto
nvmet-tcp: define listen socket ops
nvmet-tcp: register target mptcp transport
nvmet-tcp: implement mptcp listen socket ops
nvme-fabrics: compare transport in ip_options_match
nvme-tcp: define host tcp_proto struct
nvme-tcp: register host mptcp transport
nvme-tcp: implement host mptcp proto
selftests: mptcp: add nvme over mptcp test
selftests: mptcp: nvme: add iopolicy tests
drivers/nvme/host/fabrics.c | 1 + drivers/nvme/host/tcp.c | 101 ++++- drivers/nvme/target/configfs.c | 1 + drivers/nvme/target/tcp.c | 128 +++++- include/linux/nvme.h | 1 + include/net/mptcp.h | 31 ++ net/mptcp/sockopt.c | 149 +++++++ tools/testing/selftests/net/mptcp/Makefile | 1 + tools/testing/selftests/net/mptcp/config | 8 + .../testing/selftests/net/mptcp/mptcp_lib.sh | 12 + .../testing/selftests/net/mptcp/mptcp_nvme.sh | 397 ++++++++++++++++++ 11 files changed, 813 insertions(+), 17 deletions(-) create mode 100755 tools/testing/selftests/net/mptcp/mptcp_nvme.sh
Signature · 1 line
2.53.0
Geliang Tang
reviewerPATCH 1/11 nvmet-tcp: define accept tcp_proto struct
From: Geliang Tang <[email protected]>
To handle accepted sockets, this patch adds struct nvmet_tcp_proto to hold accept socket operations (no_linger, set_priority, set_tos, ops). A proto field is added to struct nvmet_tcp_queue, which points to the appropriate protocol structure. A TCP version is defined and assigned to queue->proto for TCP connections.
Also modify nvmet_tcp_set_queue_sock() and nvmet_tcp_done_recv_pdu() to use queue->proto for socket operations and fabrics callbacks.
--- drivers/nvme/target/tcp.c | 40 +++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-)
drivers/nvme/target/tcp.c +34 -6
@@ -145,6 +145,13 @@ enum nvmet_tcp_queue_state { NVMET_TCP_Q_FAILED, }; +struct nvmet_tcp_proto { +void (*no_linger)(struct sock *sk); +void (*set_priority)(struct sock *sk,u32 priority); +void (*set_tos)(struct sock *sk); +const struct nvmet_fabrics_ops *ops; +}; +struct nvmet_tcp_queue {struct socket *sock;struct nvmet_tcp_port *port;
@@ -196,6 +203,7 @@ struct nvmet_tcp_queue {void (*data_ready)(struct sock *);void (*state_change)(struct sock *);void (*write_space)(struct sock *); +const struct nvmet_tcp_proto *proto; };struct nvmet_tcp_port {
@@ -1081,7 +1089,8 @@ static int nvmet_tcp_done_recv_pdu(struct nvmet_tcp_queue *queue) req = &queue->cmd->req;memcpy (req->cmd, nvme_cmd,sizeof (*nvme_cmd)); -if (unlikely (!nvmet_req_init (req, &queue->nvme_sq, &nvmet_tcp_ops))) { +if (unlikely (!nvmet_req_init (req, &queue->nvme_sq, + queue->proto->ops))) { pr_err("failed cmd %p id %d opcode %d, data_len: %d, status: %04x\n", req->cmd, req->cmd->common.command_id, req->cmd->common.opcode,
@@ -1698,7 +1707,6 @@ static void nvmet_tcp_state_change(struct sock *sk)static int nvmet_tcp_set_queue_sock (struct nvmet_tcp_queue *queue) {struct socket *sock = queue->sock; -struct inet_sock *inet =inet_sk (sock->sk);int ret; ret = kernel_getsockname(sock,
@@ -1716,14 +1724,13 @@ static int nvmet_tcp_set_queue_sock(struct nvmet_tcp_queue *queue)* close. This is done to prevent stale data from being sent should * the network connection be restored before TCP times out. */ -sock_no_linger (sock->sk); + queue->proto->no_linger (sock->sk);if (so_priority >0 ) -sock_set_priority (sock->sk, so_priority); + queue->proto->set_priority (sock->sk, so_priority);/* Set socket type of service */ -if (inet->rcv_tos >0 ) -ip_sock_set_tos (sock->sk, inet->rcv_tos); + queue->proto->set_tos (sock->sk); ret =0 ;write_lock_bh (&sock->sk->sk_callback_lock);
@@ -1906,6 +1913,21 @@ static int nvmet_tcp_tls_handshake(struct nvmet_tcp_queue *queue)static void nvmet_tcp_tls_handshake_timeout (struct work_struct *w) {}#endif +static void tcp_sock_set_tos (struct sock *sk) +{ +struct inet_sock *inet =inet_sk (sk); + +if (inet->rcv_tos >0 ) +ip_sock_set_tos (sk, inet->rcv_tos); +} + +static const struct nvmet_tcp_proto nvmet_tcp_proto = { + .no_linger = sock_no_linger, + .set_priority = sock_set_priority, + .set_tos = tcp_sock_set_tos, + .ops = &nvmet_tcp_ops, +}; +static void nvmet_tcp_alloc_queue (struct nvmet_tcp_port *port,struct socket *newsock) {
@@ -1923,6 +1945,12 @@ static void nvmet_tcp_alloc_queue(struct nvmet_tcp_port *port,INIT_WORK (&queue->io_work, nvmet_tcp_io_work);kref_init (&queue->kref); queue->sock = newsock; +if (newsock->sk->sk_protocol ==IPPROTO_TCP ) { + queue->proto = &nvmet_tcp_proto; + }else { + ret = -EINVAL ; + goto out_free_queue; + } queue->port = port; queue->nr_cmds =0 ;spin_lock_init (&queue->state_lock);
Signature · 1 line
2.53.0
Geliang Tang
reviewerPATCH 2/11 nvmet-tcp: implement accept mptcp proto
In reply to Geliang TangFrom: Geliang Tang <[email protected]>
An MPTCP-specific version of struct nvmet_tcp_proto is implemented for accept sockets. It is assigned to queue->proto when the accepted socket protocol is IPPROTO_MPTCP.
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().
--- drivers/nvme/target/tcp.c | 16 ++++++++ include/net/mptcp.h | 12 ++++++ net/mptcp/sockopt.c | 79 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+)
drivers/nvme/target/tcp.c +16 -0
@@ -220,6 +220,9 @@ static DEFINE_MUTEX(nvmet_tcp_queue_mutex);static struct workqueue_struct *nvmet_tcp_wq;static const struct nvmet_fabrics_ops nvmet_tcp_ops; +#ifdef CONFIG_MPTCP +static const struct nvmet_fabrics_ops nvmet_mptcp_ops; +#endif static void nvmet_tcp_free_cmd (struct nvmet_tcp_cmd *c);static void nvmet_tcp_free_cmd_buffers (struct nvmet_tcp_cmd *cmd);
@@ -1928,6 +1931,15 @@ static const struct nvmet_tcp_proto nvmet_tcp_proto = { .ops = &nvmet_tcp_ops, }; +#ifdef CONFIG_MPTCP +static const struct nvmet_tcp_proto nvmet_mptcp_proto = { + .no_linger = mptcp_sock_no_linger, + .set_priority = mptcp_sock_set_priority, + .set_tos = mptcp_sock_set_tos, + .ops = &nvmet_mptcp_ops, +}; +#endif +static void nvmet_tcp_alloc_queue (struct nvmet_tcp_port *port,struct socket *newsock) {
@@ -1947,6 +1959,10 @@ static void nvmet_tcp_alloc_queue(struct nvmet_tcp_port *port, queue->sock = newsock;if (newsock->sk->sk_protocol ==IPPROTO_TCP ) { queue->proto = &nvmet_tcp_proto; +#ifdef CONFIG_MPTCP + }else if (newsock->sk->sk_protocol ==IPPROTO_MPTCP ) { + queue->proto = &nvmet_mptcp_proto; +#endif }else { ret = -EINVAL ; goto out_free_queue;
include/net/mptcp.h +12 -0
@@ -233,6 +233,12 @@ static inline __be32 mptcp_reset_option(const struct sk_buff *skb) }void mptcp_active_detect_blackhole (struct sock *sk,bool expired); + +void mptcp_sock_no_linger (struct sock *sk); + +void mptcp_sock_set_priority (struct sock *sk,u32 priority); + +void mptcp_sock_set_tos (struct sock *sk);#else static inline void mptcp_init (void )
@@ -319,6 +325,12 @@ static inline struct request_sock *mptcp_subflow_reqsk_alloc(const struct requesstatic inline __be32 mptcp_reset_option (const struct sk_buff *skb) {return htonl (0u ); }static inline void mptcp_active_detect_blackhole (struct sock *sk,bool expired) { } + +static inline void mptcp_sock_no_linger (struct sock *sk) { } + +static inline void mptcp_sock_set_priority (struct sock *sk,u32 priority) { } + +static inline void mptcp_sock_set_tos (struct sock *sk) { }#endif /* CONFIG_MPTCP */ #if IS_ENABLED (CONFIG_MPTCP_IPV6 )
net/mptcp/sockopt.c +79 -0
82 lines not on this page · raw message
Signature · 1 line
2.53.0
Jakub Kicinski
maintainerRe: [PATCH 02/11] nvmet-tcp: implement accept mptcp proto
Quoted 4 lines · 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 usingmptcp_for_each_subflow(). The values are then synchronized to other newly created subflows insync_socket_options().
These are not protocol specific options, why do we have to export MPTCP-specific functions for them?
Geliang Tang
reviewerRe: [PATCH 02/11] nvmet-tcp: implement accept mptcp proto
Hi Jakub,
Quoted 10 lines · Jakub Kicinski
Quoted 8 lines · 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 usingmptcp_for_each_subflow(). The values are then
synchronized to other newly created subflows insync_socket_options().
Quoted 2 lines
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)-
Quoted 1 line
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
Geliang Tang
reviewerRe: [PATCH 02/11] nvmet-tcp: implement accept mptcp proto
Hi,
Thank you all very much for your interest in "NVMe over MPTCP" and for adding review comments to this version of the series. This has been very helpful to me. There are indeed some issues with this version, but the good news is that I have recently found a direction for improving it.
Quoted 32 lines · Geliang Tang
Hi Jakub,
Quoted 11 lines · Jakub Kicinski
Quoted 9 lines · 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 usingmptcp_for_each_subflow(). The values are then
synchronized to other newly created subflows insync_socket_options().Quoted 2 lines
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)
intmptcp_sock_set_syncnt(struct sock *sk, int val)voidmptcp_sock_set_tos(struct sock *sk, int val)voidmptcp_sock_no_linger(struct sock *sk)
voidmptcp_sock_set_priority(struct sock *sk, u32 priority)voidmptcp_sock_set_reuseaddr(struct sock *sk)These correspond to the following six functions originally used for TCP:
Quoted 6 lines
tcp_sock_set_nodelay()
tcp_sock_set_syncnt()
ip_sock_set_tos()
sock_no_linger()
sock_set_priority()
sock_set_reuseaddr()
Here I missed one option, SO_BINDTODEVICE. Currently, NVMe TCP sets 7
sockopts: TCP_NODELAY, TCP_SYNCNT, IP_TOS, SO_LINGER, SO_PRIORITY, SO_REUSEADDR, and SO_BINDTODEVICE. The first 6 are called through the following 6 functions:
tcp_sock_set_nodelay()
tcp_sock_set_syncnt()
ip_sock_set_tos()
sock_no_linger()
sock_set_priority()
sock_set_reuseaddr()The last one is called through sock_setsockopt:
ret = sock_setsockopt(queue->sock, SOL_SOCKET, SO_BINDTODEVICE,
optval, strlen(iface));In NVMe TCP, the first three - TCP_NODELAY, TCP_SYNCNT, IP_TOS - are protocol-specific, while the last four - SO_LINGER, SO_PRIORITY, SO_REUSEADDR, SO_BINDTODEVICE - are protocol-independent.
When we add NVMe MPTCP support, all sockets created when using NVMe MPTCP are MPTCP sockets. Using the above functions to set sockopts on MPTCP sockets will not succeed. The implementations of these 7 sockopts for MPTCP are all protocol-specific. MPTCP needs to set the sockopts not only on the MPTCP socket itself but also synchronize them to all subflow sockets, so that the sockopts actually take effect.
Therefore, in this version, I defined MPTCP-specific sockopt functions for each option, and switched between TCP and MPTCP by defining the struct nvmet_tcp_proto and struct nvme_tcp_proto structures.
A better design is to initiate protocol-specific sockopt settings from the NVMe side by calling the sock_common_setsockopt() function. This can automatically select the appropriate protocol and call each protocol's .setsockopt implementation to set the sockopt, thus making it compatible with both TCP and MPTCP, without needing to export functions from the TCP or MPTCP side for NVMe to use.
For MPTCP, all 7 sockopt functions can be implemented by passing each sockopt to sock_common_setsockopt(), similar to:
static void nvmet_tcp_sock_no_linger(struct sock *sk)
{
struct linger ling = { .l_onoff = 1, .l_linger = 0 };
sock_common_setsockopt(sk->sk_socket, false, SOL_SOCKET, SO_LINGER,
KERNEL_SOCKPTR(&ling), sizeof(ling));
}However, for TCP, the three protocol-specific options - TCP_NODELAY, TCP_SYNCNT, IP_TOS - can be implemented by calling sock_common_setsockopt(), but the other four protocol-independent ones need to be called through sock_setsockopt(). To hide this difference, we can call the higher-level do_sock_setsockopt() function instead, like:
static void nvmet_tcp_sock_no_linger(struct sock *sk)
{
struct linger ling = { .l_onoff = 1, .l_linger = 0 };
do_sock_setsockopt(sk->sk_socket, false, SOL_SOCKET, SO_LINGER,
KERNEL_SOCKPTR(&ling), sizeof(ling));
}In this way, this wrapper becomes protocol-independent and works correctly for both TCP and MPTCP. Moreover, all 7 functions are uniformly converted into wrappers that call do_sock_setsockopt(), so every one of them becomes protocol-independent without needing to distinguish between TCP and MPTCP internally.
static void nvmet_tcp_sock_set_priority(struct sock *sk, u32 priority)
{
do_sock_setsockopt(sk->sk_socket, false, SOL_SOCKET, SO_PRIORITY,
KERNEL_SOCKPTR(&priority), sizeof(priority));
}static void nvmet_tcp_sock_set_reuseaddr(struct sock *sk)
{
int val = SK_CAN_REUSE;
do_sock_setsockopt(sk->sk_socket, false, SOL_SOCKET, SO_REUSEADDR,
KERNEL_SOCKPTR(&val), sizeof(val));
}static void nvmet_tcp_sock_set_nodelay(struct sock *sk)
{
int val = 1;
do_sock_setsockopt(sk->sk_socket, false, SOL_TCP, TCP_NODELAY,
KERNEL_SOCKPTR(&val), sizeof(val));
}static void nvmet_tcp_sock_set_tos(struct sock *sk, int tos)
{
do_sock_setsockopt(sk->sk_socket, false, SOL_IP, IP_TOS,
KERNEL_SOCKPTR(&tos), sizeof(tos));
}static int nvme_tcp_sock_set_bindtodevice(struct sock *sk, char *iface)
{
return do_sock_setsockopt(sk->sk_socket, false, SOL_SOCKET,
SO_BINDTODEVICE,
KERNEL_SOCKPTR(iface), strlen(iface));
}static int nvme_tcp_sock_set_syncnt(struct sock *sk, int val)
{
return do_sock_setsockopt(sk->sk_socket, false, SOL_TCP,
TCP_SYNCNT, KERNEL_SOCKPTR(&val),
sizeof(val));
}With this approach, there is no longer any need to define structures like struct nvmet_tcp_proto and struct nvme_tcp_proto, nor to export special set-sockopt functions from the MPTCP side. We only need to define these 7 wrappers for NVMe, and then replace the original function calls with the wrapper calls to enable MPTCP support. For example:
- sock_set_reuseaddr(port->sock->sk); - tcp_sock_set_nodelay(port->sock->sk); + nvmet_tcp_sock_set_reuseaddr(port->sock->sk); + nvmet_tcp_sock_set_nodelay(port->sock->sk);
if (so_priority > 0)
- sock_set_priority(port->sock->sk, so_priority);
+ nvmet_tcp_sock_set_priority(port->sock->sk, so_priority);
With these changes, implementing NVMe MPTCP support is simplified to just choosing which type of socket to create at socket creation time. In addition, I am also pushing the company I work for to join the NVMe membership, in preparation for submitting an MPTCP proposal to the NVMe technical working group in the future.
I'm thinking that this approach of unifying NVMe sockopts via do_sock_setsockopt() could actually serve as a general improvement, and it would be valid even independently of this MPTCP series. If no one objects, I will send these patches of do_sock_setsockopt() improvement to the NVMe mailing list for review in the near future.
Thanks,
-Geliang
Quoted 29 lines
The first two functions -
tcp_sock_set_nodelay()andtcp_sock_set_syncnt()- cannot be directly used with an MPTCP socket. In fact, passing an MPTCP socket totcp_sock_set_nodelay()even causes
a crash. Therefore I implemented these two MPTCP-specific functions. Actually, a better approach would be to add protocol-independentsock_set_nodelay()andsock_set_syncnt()innet/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)-Quoted 1 line
rcv_tos, so I implemented an MPTCP-specific function.The last three functions -
sock_no_linger(),sock_set_priority(), andsock_set_reuseaddr()- are not protocol-specific, but attributes set on
the MPTCP socket cannot be synchronized to its subflows becausemptcp_sockopt_sync_locked()checksmsk->setsockopt_seq. Thus I implemented these three MPTCP-specific functions, explicitly callingsockopt_seq_inc(msk)inside them to incrementmsk->setsockopt_seq, so thatmptcp_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
Re: [PATCH 02/11] nvmet-tcp: implement accept mptcp proto
In reply to Geliang TangQuoted 22 lines · Geliang Tang
From: Geliang Tang<[email protected]>
An MPTCP-specific version of struct
nvmet_tcp_protois implemented for accept sockets. It is assigned toqueue->protowhen the accepted socket protocol isIPPROTO_MPTCP.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 usingmptcp_for_each_subflow(). The values are then synchronized to other newly created subflows insync_socket_options().Cc Hannes Reinecke<[email protected]>Cc John Meneghini<[email protected]>Cc Randy Jennings<[email protected]>Cc Nilay Shroff<[email protected]>Co-developed-by zhenwei pi<[email protected]>Signed-off-by zhenwei pi<[email protected]>Co-developed-by Hui Zhu<[email protected]>Signed-off-by Hui Zhu<[email protected]>Co-developed-by Gang Yan<[email protected]>Signed-off-by Gang Yan<[email protected]>Signed-off-by Geliang Tang<[email protected]>
Quoted 5 lines
--- drivers/nvme/target/tcp.c | 16 ++++++++ include/net/mptcp.h | 12 ++++++ net/mptcp/sockopt.c | 79 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+)
I'd recommend splitting this into two patches: the first patch shall define and export mptcp_sock_xxx() APIs and then the another patch specific to nvmet which uses those exported methods.
Thanks,
--Nilay
Geliang Tang
reviewerPATCH 3/11 nvmet-tcp: define listen socket ops
In reply to Geliang TangFrom: Geliang Tang <[email protected]>
To support MPTCP on the target side, the listen socket needs to pass IPPROTO_MPTCP to sock_create() for MPTCP ports, and use MPTCP-specific setsockopt functions.
This patch adds struct nvmet_tcp_proto_ops to hold listen socket protocol operations (protocol, set_reuseaddr, set_nodelay, set_priority). A TCP version is defined and used for TCP ports.
v2:
- use trtype instead of tsas (Hannes).
v3:
- check mptcp protocol from disc_addr.trtype instead of passing a
parameter (Hannes).
v4:
- check CONFIG_MPTCP.
v5:
- define nvmet_tcp_proto struct.
- add a pointer to this structure in nvmet_tcp_port.
v6:
- split nvmet_tcp_proto struct into two structs, nvmet_tcp_proto andnvmet_tcp_proto_ops, one for the accept socket, the other for the liston socket.
- add a pointer to nvmet_tcp_proto struct in nvmet_tcp_queue.
--- drivers/nvme/target/tcp.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-)
drivers/nvme/target/tcp.c +26 -4
@@ -2087,8 +2087,23 @@ static void nvmet_tcp_listen_data_ready(struct sock *sk)read_unlock_bh (&sk->sk_callback_lock); } +struct nvmet_tcp_proto_ops { +int protocol; +void (*set_reuseaddr)(struct sock *sk); +void (*set_nodelay)(struct sock *sk); +void (*set_priority)(struct sock *sk,u32 priority); +}; + +static const struct nvmet_tcp_proto_ops nvmet_tcp_proto_ops = { + .protocol =IPPROTO_TCP , + .set_reuseaddr = sock_set_reuseaddr, + .set_nodelay = tcp_sock_set_nodelay, + .set_priority = sock_set_priority, +}; +static int nvmet_tcp_add_port (struct nvmet_port *nport) { +const struct nvmet_tcp_proto_ops *ops;struct nvmet_tcp_port *port;__kernel_sa_family_t af;int ret;
@@ -2111,6 +2126,13 @@ static int nvmet_tcp_add_port(struct nvmet_port *nport) goto err_port; } +if (nport->disc_addr.trtype ==NVMF_TRTYPE_TCP ) { + ops = &nvmet_tcp_proto_ops; + }else { + ret = -EINVAL ; + goto err_port; + } + ret =inet_pton_with_scope (&init_net, af, nport->disc_addr.traddr, nport->disc_addr.trsvcid, &port->addr);if (ret) {
@@ -2125,7 +2147,7 @@ static int nvmet_tcp_add_port(struct nvmet_port *nport) port->nport->inline_data_size =NVMET_TCP_DEF_INLINE_DATA_SIZE ; ret =sock_create (port->addr.ss_family,SOCK_STREAM , -IPPROTO_TCP , &port->sock); + ops->protocol, &port->sock);if (ret) {pr_err ("failed to create a socket\n" ); goto err_port;
@@ -2134,10 +2156,10 @@ static int nvmet_tcp_add_port(struct nvmet_port *nport) port->sock->sk->sk_user_data = port; port->data_ready = port->sock->sk->sk_data_ready; port->sock->sk->sk_data_ready = nvmet_tcp_listen_data_ready; -sock_set_reuseaddr (port->sock->sk); -tcp_sock_set_nodelay (port->sock->sk); + ops->set_reuseaddr (port->sock->sk); + ops->set_nodelay (port->sock->sk);if (so_priority >0 ) -sock_set_priority (port->sock->sk, so_priority); + ops->set_priority (port->sock->sk, so_priority); ret =kernel_bind (port->sock, (struct sockaddr_unsized *)&port->addr,sizeof (port->addr));
Signature · 1 line
2.53.0
Geliang Tang
reviewerPATCH 4/11 nvmet-tcp: register target mptcp transport
In reply to Geliang TangFrom: Geliang Tang <[email protected]>
This patch adds a new nvme target transport type NVMF_TRTYPE_MPTCP for MPTCP. And defines a new nvmet_fabrics_ops named nvmet_mptcp_ops, which is almost the same as nvmet_tcp_ops except .type. It is registered in nvmet_tcp_init() and unregistered in nvmet_tcp_exit().
A MODULE_ALIAS for "nvmet-transport-4" is also added.
Note: NVMF_TRTYPE_MPTCP is temporarily assigned 4, a value currently reserved in the NVMe over Fabrics specification. During "NVMe over MPTCP" discussion at the LSF/MM/BPF 2026 conference, it was concluded that MPTCP should be treated as a new transport type, rather than a TCP variant. A request will be submitted to the NVMe working group to officially allocate this value for MPTCP.
--- drivers/nvme/target/configfs.c | 1 + drivers/nvme/target/tcp.c | 29 +++++++++++++++++++++++++++++ include/linux/nvme.h | 1 + 3 files changed, 31 insertions(+)
drivers/nvme/target/configfs.c +1 -0
@@ -37,6 +37,7 @@ static struct nvmet_type_name_map nvmet_transport[] = { { NVMF_TRTYPE_RDMA, "rdma" }, { NVMF_TRTYPE_FC, "fc" }, { NVMF_TRTYPE_TCP, "tcp" }, + { NVMF_TRTYPE_MPTCP, "mptcp" }, { NVMF_TRTYPE_PCI, "pci" }, { NVMF_TRTYPE_LOOP, "loop" }, };
drivers/nvme/target/tcp.c +29 -0
@@ -2299,6 +2299,23 @@ static const struct nvmet_fabrics_ops nvmet_tcp_ops = { .host_traddr = nvmet_tcp_host_port_addr, }; +#ifdef CONFIG_MPTCP +static bool nvmet_mptcp_registered; + +static const struct nvmet_fabrics_ops nvmet_mptcp_ops = { + .owner =THIS_MODULE , + .type =NVMF_TRTYPE_MPTCP , + .msdbd =1 , + .add_port = nvmet_tcp_add_port, + .remove_port = nvmet_tcp_remove_port, + .queue_response = nvmet_tcp_queue_response, + .delete_ctrl = nvmet_tcp_delete_ctrl, + .install_queue = nvmet_tcp_install_queue, + .disc_traddr = nvmet_tcp_disc_port_addr, + .host_traddr = nvmet_tcp_host_port_addr, +}; +#endif +static int __init nvmet_tcp_init (void ) {int ret;
@@ -2312,6 +2329,11 @@ static int __init nvmet_tcp_init(void)if (ret) goto err; +#ifdef CONFIG_MPTCP +if (!nvmet_register_transport (&nvmet_mptcp_ops)) + nvmet_mptcp_registered = true; +#endif +return 0 ; err:destroy_workqueue (nvmet_tcp_wq);
@@ -2322,6 +2344,10 @@ static void __exit nvmet_tcp_exit(void) {struct nvmet_tcp_queue *queue; +#ifdef CONFIG_MPTCP +if (nvmet_mptcp_registered) +nvmet_unregister_transport (&nvmet_mptcp_ops); +#endif nvmet_unregister_transport (&nvmet_tcp_ops);flush_workqueue (nvmet_wq);
@@ -2341,3 +2367,6 @@ module_exit(nvmet_tcp_exit);MODULE_DESCRIPTION ("NVMe target TCP transport driver" );MODULE_LICENSE ("GPL v2" );MODULE_ALIAS ("nvmet-transport-3" );/* 3 == NVMF_TRTYPE_TCP */ +#ifdef CONFIG_MPTCP +MODULE_ALIAS ("nvmet-transport-4" );/* 4 == NVMF_TRTYPE_MPTCP */ +#endif
include/linux/nvme.h +1 -0
@@ -68,6 +68,7 @@ enum {NVMF_TRTYPE_RDMA =1 ,/* RDMA */ NVMF_TRTYPE_FC =2 ,/* Fibre Channel */ NVMF_TRTYPE_TCP =3 ,/* TCP/IP */ +NVMF_TRTYPE_MPTCP =4 ,/* Multipath TCP */ NVMF_TRTYPE_LOOP =254 ,/* Reserved for host usage */ NVMF_TRTYPE_MAX, };
Signature · 1 line
2.53.0
Geliang Tang
reviewerPATCH 5/11 nvmet-tcp: implement mptcp listen socket ops
In reply to Geliang TangFrom: Geliang Tang <[email protected]>
An MPTCP-specific version of struct nvmet_tcp_proto_ops is implemented for listen sockets. It is assigned to port->proto_ops when the transport type is MPTCP.
Dedicated MPTCP helpers are introduced for setting listen socket options. The set_nodelay and set_priority helpers set the values on all existing subflows using mptcp_for_each_subflow(). The set_reuseaddr helper only applies to the first subflow. The values are then synchronized to other newly created subflows in sync_socket_options().
--- drivers/nvme/target/tcp.c | 13 ++++++++++++ include/net/mptcp.h | 8 ++++++++ net/mptcp/sockopt.c | 42 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+)
drivers/nvme/target/tcp.c +13 -0
@@ -2101,6 +2101,15 @@ static const struct nvmet_tcp_proto_ops nvmet_tcp_proto_ops = { .set_priority = sock_set_priority, }; +#ifdef CONFIG_MPTCP +static const struct nvmet_tcp_proto_ops nvmet_mptcp_proto_ops = { + .protocol =IPPROTO_MPTCP , + .set_reuseaddr = mptcp_sock_set_reuseaddr, + .set_nodelay = mptcp_sock_set_nodelay, + .set_priority = mptcp_sock_set_priority, +}; +#endif +static int nvmet_tcp_add_port (struct nvmet_port *nport) {const struct nvmet_tcp_proto_ops *ops;
@@ -2128,6 +2137,10 @@ static int nvmet_tcp_add_port(struct nvmet_port *nport)if (nport->disc_addr.trtype ==NVMF_TRTYPE_TCP ) { ops = &nvmet_tcp_proto_ops; +#ifdef CONFIG_MPTCP + }else if (nport->disc_addr.trtype ==NVMF_TRTYPE_MPTCP ) { + ops = &nvmet_mptcp_proto_ops; +#endif }else { ret = -EINVAL ; goto err_port;
include/net/mptcp.h +8 -0
@@ -239,6 +239,10 @@ void mptcp_sock_no_linger(struct sock *sk);void mptcp_sock_set_priority (struct sock *sk,u32 priority);void mptcp_sock_set_tos (struct sock *sk); + +void mptcp_sock_set_reuseaddr (struct sock *sk); + +void mptcp_sock_set_nodelay (struct sock *sk);#else static inline void mptcp_init (void )
@@ -331,6 +335,10 @@ static inline void mptcp_sock_no_linger(struct sock *sk) { }static inline void mptcp_sock_set_priority (struct sock *sk,u32 priority) { }static inline void mptcp_sock_set_tos (struct sock *sk) { } + +static inline void mptcp_sock_set_reuseaddr (struct sock *sk) { } + +static inline void mptcp_sock_set_nodelay (struct sock *sk) { }#endif /* CONFIG_MPTCP */ #if IS_ENABLED (CONFIG_MPTCP_IPV6 )
net/mptcp/sockopt.c +42 -0
51 lines not on this page · raw message
Signature · 1 line
2.53.0
Re: [PATCH 05/11] nvmet-tcp: implement mptcp listen socket ops
Quoted 23 lines · Geliang Tang
From: Geliang Tang<[email protected]>
An MPTCP-specific version of struct
nvmet_tcp_proto_opsis implemented for listen sockets. It is assigned toport->proto_opswhen the transport type is MPTCP.Dedicated MPTCP helpers are introduced for setting listen socket options. The
set_nodelayandset_priorityhelpers set the values on all existing subflows usingmptcp_for_each_subflow(). Theset_reuseaddrhelper only applies to the first subflow. The values are then synchronized to other newly created subflows insync_socket_options().Cc Hannes Reinecke<[email protected]>Cc John Meneghini<[email protected]>Cc Randy Jennings<[email protected]>Cc Nilay Shroff<[email protected]>Co-developed-by zhenwei pi<[email protected]>Signed-off-by zhenwei pi<[email protected]>Co-developed-by Hui Zhu<[email protected]>Signed-off-by Hui Zhu<[email protected]>Co-developed-by Gang Yan<[email protected]>Signed-off-by Gang Yan<[email protected]>Signed-off-by Geliang Tang<[email protected]>
Quoted 5 lines
--- drivers/nvme/target/tcp.c | 13 ++++++++++++ include/net/mptcp.h | 8 ++++++++ net/mptcp/sockopt.c | 42 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+)
Again same comment as earlier, split this into two patches. One patch for net/ implementation where we define and export mptcp helpers and another patch specific to nvme/ implementation which consume those helpers.
Thanks,
--Nilay
Geliang Tang
reviewerPATCH 6/11 nvme-fabrics: compare transport in ip_options_match
In reply to Geliang TangFrom: Geliang Tang <[email protected]>
When checking for an existing controller, nvmf_ip_options_match() does not compare the transport type. This can cause a TCP connection request to incorrectly match an existing MPTCP controller, or an MPTCP connection request to match an existing TCP controller, resulting in a false -EALREADY error.
Fix this by adding strcmp(opts->transport, ctrl->opts->transport) to the matching condition.
--- drivers/nvme/host/fabrics.c | 1 + 1 file changed, 1 insertion(+)
drivers/nvme/host/fabrics.c +1 -0
@@ -1220,6 +1220,7 @@ bool nvmf_ip_options_match(struct nvme_ctrl *ctrl, struct nvmf_ctrl_options *opts) {if (!nvmf_ctlr_matches_baseopts (ctrl, opts) || +strcmp (opts->transport, ctrl->opts->transport) ||strcmp (opts->traddr, ctrl->opts->traddr) ||strcmp (opts->trsvcid, ctrl->opts->trsvcid))return false;
Signature · 1 line
2.53.0
Geliang Tang
reviewerPATCH 7/11 nvme-tcp: define host tcp_proto struct
In reply to Geliang TangFrom: Geliang Tang <[email protected]>
To add MPTCP support in "NVMe over TCP", the host side needs to pass IPPROTO_MPTCP to sock_create_kern() instead of IPPROTO_TCP to create an MPTCP socket.
Similar to the target-side nvmet_tcp_proto, this patch defines the host-side nvme_tcp_proto structure, which contains the protocol of the socket and a set of function pointers for socket operations. The only difference is that it defines .set_syncnt instead of .set_reuseaddr.
A TCP-specific version of this structure is defined, and a proto field is added to nvme_tcp_ctrl. When the transport string is "tcp", it is assigned to ctrl->proto.
All locations that previously called TCP setsockopt functions are updated to call the corresponding function pointers in the nvme_tcp_proto structure. The controller's proto pointer is set during initialization and remains valid throughout the controller's lifetime.
v2:
- use 'trtype' instead of '--mptcp' (Hannes)
v3:
- check mptcp protocol from opts->transport instead of passing a
parameter (Hannes).
v4:
- check CONFIG_MPTCP.
v5:
- define nvme_tcp_proto struct.
- add a pointer to this structure in nvme_tcp_ctrl.
--- drivers/nvme/host/tcp.c | 44 ++++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 7 deletions(-)
drivers/nvme/host/tcp.c +37 -7
@@ -182,6 +182,16 @@ struct nvme_tcp_queue {void (*write_space)(struct sock *); }; +struct nvme_tcp_proto { +int protocol; +int (*set_syncnt)(struct sock *sk,int val); +void (*set_nodelay)(struct sock *sk); +void (*no_linger)(struct sock *sk); +void (*set_priority)(struct sock *sk,u32 priority); +void (*set_tos)(struct sock *sk,int val); +const struct nvme_ctrl_ops *ops; +}; +struct nvme_tcp_ctrl {/* read only in the hot path */ struct nvme_tcp_queue *queues;
@@ -198,6 +208,8 @@ struct nvme_tcp_ctrl {struct delayed_work connect_work;struct nvme_tcp_request async_req;u32 io_queues[HCTX_MAX_TYPES ]; + +const struct nvme_tcp_proto *proto; };static LIST_HEAD (nvme_tcp_ctrl_list);
@@ -1799,7 +1811,7 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl, int qid, ret =sock_create_kern (current->nsproxy->net_ns, ctrl->addr.ss_family,SOCK_STREAM , -IPPROTO_TCP , &queue->sock); + ctrl->proto->protocol, &queue->sock);if (ret) {dev_err (nctrl->device,"failed to create socket: %d\n" , ret);
@@ -1816,24 +1828,24 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl, int qid,nvme_tcp_reclassify_socket (queue->sock);/* Single syn retry */ -tcp_sock_set_syncnt (queue->sock->sk,1 ); + ctrl->proto->set_syncnt (queue->sock->sk,1 );/* Set TCP no delay */ -tcp_sock_set_nodelay (queue->sock->sk); + ctrl->proto->set_nodelay (queue->sock->sk);/* * Cleanup whatever is sitting in the TCP transmit queue on socket * close. This is done to prevent stale data from being sent should * the network connection be restored before TCP times out. */ -sock_no_linger (queue->sock->sk); + ctrl->proto->no_linger (queue->sock->sk);if (so_priority >0 ) -sock_set_priority (queue->sock->sk, so_priority); + ctrl->proto->set_priority (queue->sock->sk, so_priority);/* Set socket type of service */ if (nctrl->opts->tos >=0 ) -ip_sock_set_tos (queue->sock->sk, nctrl->opts->tos); + ctrl->proto->set_tos (queue->sock->sk, nctrl->opts->tos);/* Set 10 seconds timeout for icresp recvmsg */ queue->sock->sk->sk_rcvtimeo =10 *HZ ;
@@ -2900,6 +2912,17 @@ nvme_tcp_existing_controller(struct nvmf_ctrl_options *opts)return found; } +static const struct nvme_tcp_proto nvme_tcp_proto = { + .protocol =IPPROTO_TCP , + .set_syncnt = tcp_sock_set_syncnt, + .set_nodelay = tcp_sock_set_nodelay, + .no_linger = sock_no_linger, + .set_priority = sock_set_priority, + .set_tos = ip_sock_set_tos, + .ops = &nvme_tcp_ctrl_ops, + +}; +static struct nvme_tcp_ctrl *nvme_tcp_alloc_ctrl (struct device *dev,struct nvmf_ctrl_options *opts) {
@@ -2964,13 +2987,20 @@ static struct nvme_tcp_ctrl *nvme_tcp_alloc_ctrl(struct device *dev, goto out_free_ctrl; } +if (!strcmp (ctrl->ctrl.opts->transport,"tcp" )) { + ctrl->proto = &nvme_tcp_proto; + }else { + ret = -EINVAL ; + goto out_free_ctrl; + } + ctrl->queues =kzalloc_objs (*ctrl->queues, ctrl->ctrl.queue_count);if (!ctrl->queues) { ret = -ENOMEM ; goto out_free_ctrl; } - ret =nvme_init_ctrl (&ctrl->ctrl, dev, &nvme_tcp_ctrl_ops,0 ); + ret =nvme_init_ctrl (&ctrl->ctrl, dev, ctrl->proto->ops,0 );if (ret) goto out_kfree_queues;
Signature · 1 line
2.53.0
Geliang Tang
reviewerPATCH 8/11 nvme-tcp: register host mptcp transport
In reply to Geliang TangFrom: Geliang Tang <[email protected]>
This patch defines a new nvmf_transport_ops named nvme_mptcp_transport, which is almost the same as nvme_tcp_transport except .name and .allowed_opts.
MPTCP currently does not support TLS. The four TLS-related options (NVMF_OPT_TLS, NVMF_OPT_KEYRING, NVMF_OPT_TLS_KEY, and NVMF_OPT_CONCAT) have been removed from allowed_opts. They will be added back once MPTCP TLS is supported.
It is registered in nvme_tcp_init_module() and unregistered in nvme_tcp_cleanup_module().
A MODULE_ALIAS("nvme-mptcp") declaration is added at the end of the file.
--- drivers/nvme/host/tcp.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
drivers/nvme/host/tcp.c +23 -0
@@ -3067,6 +3067,20 @@ static struct nvmf_transport_ops nvme_tcp_transport = { .create_ctrl = nvme_tcp_create_ctrl, }; +#ifdef CONFIG_MPTCP +static struct nvmf_transport_ops nvme_mptcp_transport = { + .name ="mptcp" , + .module =THIS_MODULE , + .required_opts =NVMF_OPT_TRADDR , + .allowed_opts =NVMF_OPT_TRSVCID |NVMF_OPT_RECONNECT_DELAY | +NVMF_OPT_HOST_TRADDR |NVMF_OPT_CTRL_LOSS_TMO | +NVMF_OPT_HDR_DIGEST |NVMF_OPT_DATA_DIGEST | +NVMF_OPT_NR_WRITE_QUEUES |NVMF_OPT_NR_POLL_QUEUES | +NVMF_OPT_TOS |NVMF_OPT_HOST_IFACE , + .create_ctrl = nvme_tcp_create_ctrl, +}; +#endif +static int __init nvme_tcp_init_module (void ) {unsigned int wq_flags =WQ_MEM_RECLAIM |WQ_HIGHPRI |WQ_SYSFS ;
@@ -3092,6 +3106,9 @@ static int __init nvme_tcp_init_module(void)atomic_set (&nvme_tcp_cpu_queues[cpu],0 );nvmf_register_transport (&nvme_tcp_transport); +#ifdef CONFIG_MPTCP +nvmf_register_transport (&nvme_mptcp_transport); +#endif return 0 ; }
@@ -3099,6 +3116,9 @@ static void __exit nvme_tcp_cleanup_module(void) {struct nvme_tcp_ctrl *ctrl; +#ifdef CONFIG_MPTCP +nvmf_unregister_transport (&nvme_mptcp_transport); +#endif nvmf_unregister_transport (&nvme_tcp_transport);mutex_lock (&nvme_tcp_ctrl_mutex);
@@ -3116,3 +3136,6 @@ module_exit(nvme_tcp_cleanup_module);MODULE_DESCRIPTION ("NVMe host TCP transport driver" );MODULE_LICENSE ("GPL v2" );MODULE_ALIAS ("nvme-tcp" ); +#ifdef CONFIG_MPTCP +MODULE_ALIAS ("nvme-mptcp" ); +#endif
Signature · 1 line
2.53.0
Geliang Tang
reviewerPATCH 9/11 nvme-tcp: implement host mptcp proto
In reply to Geliang TangFrom: Geliang Tang <[email protected]>
An MPTCP-specific version of struct nvme_tcp_proto is implemented, and it is assigned to ctrl->proto when the transport string is "mptcp".
The socket option setting logic is similar to the target side, except that mptcp_sock_set_syncnt is newly defined for the host side.
These helpers set the values on all existing subflows of an MPTCP connection, except for set_reuseaddr which only applies to the first subflow. The values are then synchronized to other newly created subflows in sync_socket_options().
A separate nvme_mptcp_ctrl_ops structure with .name = "mptcp" is defined and used for MPTCP controllers.
"mptcp" is planned to be introduced as a new NVMe transport type into the NVMe Base Specification in the future.
Currently, the Discovery Log does not yet recognize trtype=4 (MPTCP), and will show "trtype: unrecognized" for such entries:
=====Discovery Log Entry 0======
trtype: unrecognized
adrfam: ipv4
subtype: current discovery subsystem
treq: not specified, sq flow control disable supported
portid: 23106
trsvcid: 23601
subnqn: nqn.2014-08.org.nvmexpress.discovery traddr: 10.1.1.1 eflags: none
--- drivers/nvme/host/tcp.c | 34 ++++++++++++++++++++++++++++++++++ include/net/mptcp.h | 11 +++++++++++ net/mptcp/sockopt.c | 30 +++++++++++++++++++++++++++++- 3 files changed, 74 insertions(+), 1 deletion(-)
drivers/nvme/host/tcp.c +34 -0
@@ -2895,6 +2895,24 @@ static const struct nvme_ctrl_ops nvme_tcp_ctrl_ops = { .get_virt_boundary = nvmf_get_virt_boundary, }; +#ifdef CONFIG_MPTCP +static const struct nvme_ctrl_ops nvme_mptcp_ctrl_ops = { + .name ="mptcp" , + .module =THIS_MODULE , + .flags =NVME_F_FABRICS |NVME_F_BLOCKING , + .reg_read32 = nvmf_reg_read32, + .reg_read64 = nvmf_reg_read64, + .reg_write32 = nvmf_reg_write32, + .subsystem_reset = nvmf_subsystem_reset, + .free_ctrl = nvme_tcp_free_ctrl, + .submit_async_event = nvme_tcp_submit_async_event, + .delete_ctrl = nvme_tcp_delete_ctrl, + .get_address = nvme_tcp_get_address, + .stop_ctrl = nvme_tcp_stop_ctrl, + .get_virt_boundary = nvmf_get_virt_boundary, +}; +#endif +static bool nvme_tcp_existing_controller (struct nvmf_ctrl_options *opts) {
@@ -2923,6 +2941,18 @@ static const struct nvme_tcp_proto nvme_tcp_proto = { }; +#ifdef CONFIG_MPTCP +static const struct nvme_tcp_proto nvme_mptcp_proto = { + .protocol =IPPROTO_MPTCP , + .set_syncnt = mptcp_sock_set_syncnt, + .set_nodelay = mptcp_sock_set_nodelay, + .no_linger = mptcp_sock_no_linger, + .set_priority = mptcp_sock_set_priority, + .set_tos = __mptcp_sock_set_tos, + .ops = &nvme_mptcp_ctrl_ops, +}; +#endif +static struct nvme_tcp_ctrl *nvme_tcp_alloc_ctrl (struct device *dev,struct nvmf_ctrl_options *opts) {
@@ -2989,6 +3019,10 @@ static struct nvme_tcp_ctrl *nvme_tcp_alloc_ctrl(struct device *dev,if (!strcmp (ctrl->ctrl.opts->transport,"tcp" )) { ctrl->proto = &nvme_tcp_proto; +#ifdef CONFIG_MPTCP + }else if (!strcmp (ctrl->ctrl.opts->transport,"mptcp" )) { + ctrl->proto = &nvme_mptcp_proto; +#endif }else { ret = -EINVAL ; goto out_free_ctrl;
include/net/mptcp.h +11 -0
@@ -238,11 +238,15 @@ void mptcp_sock_no_linger(struct sock *sk);void mptcp_sock_set_priority (struct sock *sk,u32 priority); +void __mptcp_sock_set_tos (struct sock *sk,int val); +void mptcp_sock_set_tos (struct sock *sk);void mptcp_sock_set_reuseaddr (struct sock *sk);void mptcp_sock_set_nodelay (struct sock *sk); + +int mptcp_sock_set_syncnt (struct sock *sk,int val);#else static inline void mptcp_init (void )
@@ -334,11 +338,18 @@ static inline void mptcp_sock_no_linger(struct sock *sk) { }static inline void mptcp_sock_set_priority (struct sock *sk,u32 priority) { } +static inline void __mptcp_sock_set_tos (struct sock *sk,int val) { } +static inline void mptcp_sock_set_tos (struct sock *sk) { }static inline void mptcp_sock_set_reuseaddr (struct sock *sk) { }static inline void mptcp_sock_set_nodelay (struct sock *sk) { } + +static inline int mptcp_sock_set_syncnt (struct sock *sk,int val) +{ +return 0 ; +}#endif /* CONFIG_MPTCP */ #if IS_ENABLED (CONFIG_MPTCP_IPV6 )
net/mptcp/sockopt.c +29 -1
@@ -1598,6 +1598,8 @@ static void sync_socket_options(struct mptcp_sock *msk, struct sock *ssk)WRITE_ONCE (inet_sk (ssk)->local_port_range,READ_ONCE (inet_sk (sk)->local_port_range)); ssk->sk_reuse = sk->sk_reuse; +if (inet_csk (sk)->icsk_syn_retries >0 ) +tcp_sock_set_syncnt (ssk,inet_csk (sk)->icsk_syn_retries); }void mptcp_sockopt_sync_locked (struct mptcp_sock *msk,struct sock *ssk)
@@ -1709,7 +1711,7 @@ void mptcp_sock_set_priority(struct sock *sk, u32 priority) }EXPORT_SYMBOL (mptcp_sock_set_priority); -static void __mptcp_sock_set_tos (struct sock *sk,int val) +void __mptcp_sock_set_tos (struct sock *sk,int val) {struct mptcp_sock *msk =mptcp_sk (sk);struct mptcp_subflow_context *subflow;
@@ -1728,6 +1730,7 @@ static void __mptcp_sock_set_tos(struct sock *sk, int val) }release_sock (sk); } +EXPORT_SYMBOL (__mptcp_sock_set_tos);void mptcp_sock_set_tos (struct sock *sk) {
@@ -1783,3 +1786,28 @@ void mptcp_sock_set_nodelay(struct sock *sk)release_sock (sk); }EXPORT_SYMBOL (mptcp_sock_set_nodelay); + +int mptcp_sock_set_syncnt (struct sock *sk,int val) +{ +struct mptcp_sock *msk =mptcp_sk (sk); +struct mptcp_subflow_context *subflow; +struct sock *ssk; + +if (val <1 || val >MAX_TCP_SYNCNT ) +return -EINVAL ; + +lock_sock (sk); +sockopt_seq_inc (msk); +inet_csk (sk)->icsk_syn_retries = val; +mptcp_for_each_subflow (msk, subflow) { + ssk =mptcp_subflow_tcp_sock (subflow); +if (ssk) { +lock_sock_nested (ssk,SINGLE_DEPTH_NESTING ); +tcp_sock_set_syncnt (ssk, val); +release_sock (ssk); + } + } +release_sock (sk); +return 0 ; +} +EXPORT_SYMBOL (mptcp_sock_set_syncnt);
Signature · 1 line
2.53.0
Re: [PATCH 09/11] nvme-tcp: implement host mptcp proto
Quoted 44 lines · Geliang Tang
From: Geliang Tang<[email protected]>
An MPTCP-specific version of struct
nvme_tcp_protois implemented, and it is assigned toctrl->protowhen the transport string is "mptcp".The socket option setting logic is similar to the target side, except that
mptcp_sock_set_syncntis newly defined for the host side.These helpers set the values on all existing subflows of an MPTCP connection, except for
set_reuseaddrwhich only applies to the first subflow. The values are then synchronized to other newly created subflows insync_socket_options().A separate
nvme_mptcp_ctrl_opsstructure with .name = "mptcp" is defined and used for MPTCP controllers."mptcp" is planned to be introduced as a new NVMe transport type into the NVMe Base Specification in the future.
Currently, the Discovery Log does not yet recognize trtype=4 (MPTCP), and will show "trtype: unrecognized" for such entries:
=====Discovery Log Entry 0======
trtype: unrecognized
adrfam: ipv4
subtype: current discovery subsystem
treq: not specified, sq flow control disable supported
portid: 23106
trsvcid: 23601subnqn: nqn.2014-08.org.nvmexpress.discovery traddr: 10.1.1.1 eflags: noneCc Hannes Reinecke<[email protected]>Cc John Meneghini<[email protected]>Cc Randy Jennings<[email protected]>Cc Nilay Shroff<[email protected]>Co-developed-by zhenwei pi<[email protected]>Signed-off-by zhenwei pi<[email protected]>Co-developed-by Hui Zhu<[email protected]>Signed-off-by Hui Zhu<[email protected]>Co-developed-by Gang Yan<[email protected]>Signed-off-by Gang Yan<[email protected]>Signed-off-by Geliang Tang<[email protected]>
Quoted 5 lines
--- drivers/nvme/host/tcp.c | 34 ++++++++++++++++++++++++++++++++++ include/net/mptcp.h | 11 +++++++++++ net/mptcp/sockopt.c | 30 +++++++++++++++++++++++++++++- 3 files changed, 74 insertions(+), 1 deletion(-)
Agian the same comment as earlier to split this into two patches. BTW, it seems another approach would be to club all mptcp helpers in one patch (may be the first patch in the series) as prep and then use those helpers in the subsequent patches.
Thanks,
--Nilay
Geliang Tang
reviewerPATCH 10/11 selftests: mptcp: add nvme over mptcp test
In reply to Geliang TangFrom: Geliang Tang <[email protected]>
A test case for NVMe over MPTCP has been implemented. It verifies the proper functionality of nvme discover and connect commands to establish NVMe over MPTCP connections. The test then evaluates read/write performance using fio, and ensures proper cleanup with nvme disconnect.
This script accepts two positional parameters:
trtype - Transport type (mptcp|tcp). Default: mptcp
path - Number of multipath (1-4). Default: 1
This test simulates four NICs on both target and host sides, each limited to 125MB/s. It shows that 'NVMe over MPTCP' delivered bandwidth up to four times that of standard TCP with a single NVMe multipath configuration:
# ./mptcp_nvme.sh tcp READ: bw=112MiB/s (118MB/s), 112MiB/s-112MiB/s (118MB/s-118MB/s), io=1123MiB (1177MB), run=10018-10018msec WRITE: bw=112MiB/s (117MB/s), 112MiB/s-112MiB/s (117MB/s-117MB/s), io=1118MiB (1173MB), run=10018-10018msec
# ./mptcp_nvme.sh mptcp READ: bw=427MiB/s (448MB/s), 427MiB/s-427MiB/s (448MB/s-448MB/s), io=4286MiB (4494MB), run=10039-10039msec WRITE: bw=387MiB/s (406MB/s), 387MiB/s-387MiB/s (406MB/s-406MB/s), io=3885MiB (4073MB), run=10043-10043msec
It reflects that MPTCP has the same multi-interface bandwidth aggregation capability as NVMe multipath.
--- tools/testing/selftests/net/mptcp/Makefile | 1 + tools/testing/selftests/net/mptcp/config | 8 + .../testing/selftests/net/mptcp/mptcp_lib.sh | 12 + .../testing/selftests/net/mptcp/mptcp_nvme.sh | 329 ++++++++++++++++++ 4 files changed, 350 insertions(+) create mode 100755 tools/testing/selftests/net/mptcp/mptcp_nvme.sh
tools/testing/selftests/net/mptcp/Makefile +1 -0
@@ -13,6 +13,7 @@ TEST_PROGS := \ mptcp_connect_sendfile.sh \ mptcp_connect_splice.sh \ mptcp_join.sh \ + mptcp_nvme.sh \ mptcp_sockopt.sh \ pm_netlink.sh \ simult_flows.sh \
tools/testing/selftests/net/mptcp/config +8 -0
@@ -34,3 +34,11 @@ CONFIG_NFT_SOCKET=m CONFIG_NFT_TPROXY=m CONFIG_SYN_COOKIES=y CONFIG_VETH=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_CONFIGFS_FS=y +CONFIG_NVME_CORE=y +CONFIG_NVME_FABRICS=y +CONFIG_NVME_TCP=y +CONFIG_NVME_TARGET=y +CONFIG_NVME_TARGET_TCP=y +CONFIG_NVME_MULTIPATH=y
tools/testing/selftests/net/mptcp/mptcp_lib.sh +12 -0
@@ -530,6 +530,18 @@ mptcp_lib_check_tools() { exit ${KSFT_SKIP} fi ;; + "nvme") + if ! nvme --version &> /dev/null; then + mptcp_lib_pr_skip "nvme tool not found" + exit ${KSFT_SKIP} + fi + ;; + "fio") + if ! fio -h &> /dev/null; then + mptcp_lib_pr_skip "fio tool not found" + exit ${KSFT_SKIP} + fi + ;; *) mptcp_lib_pr_fail "Internal error: unsupported tool: ${tool}" exit ${KSFT_FAIL}
tools/testing/selftests/net/mptcp/mptcp_nvme.sh new file +329 -0
329 lines not on this page · raw message
Signature · 1 line
2.53.0
Geliang Tang
reviewerPATCH 11/11 selftests: mptcp: nvme: add iopolicy tests
In reply to Geliang TangFrom: Geliang Tang <[email protected]>
Add NVMe iopolicy testing to mptcp_nvme.sh, with the default set to "numa". It can be set to "round-robin" or "queue-depth".
Test results with 4 NVMe multipath paths and round-robin iopolicy show that TCP and MPTCP achieve similar bandwidth:
# ./mptcp_nvme.sh tcp 4 round-robin READ: bw=455MiB/s (478MB/s), 455MiB/s-455MiB/s (478MB/s-478MB/s), io=4665MiB (4891MB), run=10242-10242msec WRITE: bw=455MiB/s (477MB/s), 455MiB/s-455MiB/s (477MB/s-477MB/s), io=4633MiB (4858MB), run=10184-10184msec
# ./mptcp_nvme.sh mptcp 4 round-robin READ: bw=445MiB/s (466MB/s), 445MiB/s-445MiB/s (466MB/s-466MB/s), io=4575MiB (4797MB), run=10287-10287msec WRITE: bw=445MiB/s (467MB/s), 445MiB/s-445MiB/s (467MB/s-467MB/s), io=4572MiB (4794MB), run=10267-10267msec
A "loss" argument is added to simulate network packet loss. When loss=1, each veth interface is configured with "delay 5ms loss 0.5%" using tc qdisc. Under this scenario, TCP performance is reduced by multiples compared to MPTCP:
# ./mptcp_nvme.sh tcp 4 round-robin 1 READ: bw=144MiB/s (151MB/s), 144MiB/s-144MiB/s (151MB/s-151MB/s), io=1909MiB (2001MB), run=13231-13231msec WRITE: bw=100.0MiB/s (105MB/s), 100.0MiB/s-100.0MiB/s (105MB/s-105MB/s), io=1397MiB (1465MB), run=13980-13980msec
# ./mptcp_nvme.sh mptcp 4 round-robin 1 READ: bw=428MiB/s (449MB/s), 428MiB/s-428MiB/s (449MB/s-449MB/s), io=4524MiB (4743MB), run=10564-10564msec WRITE: bw=431MiB/s (452MB/s), 431MiB/s-431MiB/s (452MB/s-452MB/s), io=4513MiB (4732MB), run=10481-10481msec
These results demonstrate that MPTCP has better resilience against packet loss compared to TCP, as it can leverage multiple subflows to mitigate network degradation.
--- .../testing/selftests/net/mptcp/mptcp_nvme.sh | 70 ++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-)
tools/testing/selftests/net/mptcp/mptcp_nvme.sh +69 -1
@@ -6,6 +6,8 @@ ret=0 trtype="${1:-mptcp}" path="${2:-1}" +iopolicy=${3:-"numa"} # round-robin, queue-depth +loss=${4:-0} nqn="nqn.2014-08.org.nvmexpress.${trtype}dev.$$.${RANDOM}" ns=1 port=$((RANDOM % 10000 + 20000))
@@ -17,6 +19,7 @@ loop_dev="" export trtype path nqn ns port trsvcid export loop_dev temp_file +export iopolicy loss usage() {
@@ -24,10 +27,12 @@ usage() Usage: - $(basename "$0") [trtype] [path] + $(basename "$0") [trtype] [path] [iopolicy] [loss] trtype Transport type (tcp|mptcp) - default: mptcp path Number of multipath (1-4) - default: 1 + iopolicy I/O policy (numa|round-robin|queue-depth) - default: numa + loss Enable packet loss (0|1) - default: 0 EOF exit ${KSFT_FAIL}
@@ -44,6 +49,16 @@ validate_params() echo "Invalid path count ${path}. Must be between 1 and 4" usage fi + + if [[ ! "${iopolicy}" =~ ^(numa|round-robin|queue-depth)$ ]]; then + echo "Invalid iopolicy ${iopolicy}." + usage + fi + + if [[ ! "${loss}" =~ ^[01]$ ]]; then + echo "Invalid loss value ${loss}. Must be 0 or 1" + usage + fi } # This function is invoked indirectly
@@ -105,6 +120,7 @@ cleanup() unset -v trtype path nqn ns port trsvcid unset -v loop_dev temp_file + unset -v iopolicy loss } # $tc_args needs word splitting to pass multiple arguments to netem
@@ -113,6 +129,10 @@ init() { local tc_args="rate 1000mbit" + if [ "${loss}" -eq 1 ]; then + tc_args+=" delay 5ms loss 0.5%" + fi + mptcp_lib_ns_init ns1 ns2 # ns1 ns2
@@ -193,6 +213,48 @@ run_target() done } +# This function is invoked indirectly +#shellcheck disable=SC2317,SC2329 +set_io_policy() +{ + local nqn="$1" + local iopolicy="$2" + local subname + local policy + local current + + subname=$(nvme list-subsys 2>/dev/null | grep "${nqn}" | + grep -o 'nvme-subsys[0-9]*' | head -1) + if [ -z "$subname" ]; then + return 1 + fi + + policy="/sys/class/nvme-subsystem/${subname}/iopolicy" + if [ ! -e "$policy" ]; then + # NVMe multipath not supported, skip iopolicy setting + return 0 + fi + + if [ ! -w "$policy" ]; then + return 1 + fi + + if ! echo "${iopolicy}" > "$policy" 2>/dev/null; then + return 1 + fi + + current=$(cat "$policy" 2>/dev/null) + if [ -z "$current" ]; then + return 1 + fi + + if [[ "$current" != *"${iopolicy}"* ]]; then + return 1 + fi + + return 0 +} + # This function is invoked indirectly #shellcheck disable=SC2317,SC2329 run_host()
@@ -242,6 +304,11 @@ run_host() return 1 fi + if ! set_io_policy "${nqn}" "${iopolicy}"; then + echo "Failed to set I/O policy to ${iopolicy}" + return 1 + fi + sleep 1 echo "fio randread /dev/${devname}"
@@ -306,6 +373,7 @@ run_test() fi if ! ip netns exec "$ns2" bash <<- EOF + $(declare -f set_io_policy) $(declare -f run_host) run_host exit \$?
Signature · 1 line
2.53.0
Re: [PATCH 11/11] selftests: mptcp: nvme: add iopolicy tests
Quoted 37 lines · Geliang Tang
From: Geliang Tang<[email protected]>
Add NVMe iopolicy testing to
mptcp_nvme.sh, with the default set to "numa". It can be set to "round-robin" or "queue-depth".Test results with 4 NVMe multipath paths and round-robin iopolicy show that TCP and MPTCP achieve similar bandwidth:
# ./mptcp_nvme.sh tcp 4 round-robin READ: bw=455MiB/s (478MB/s), 455MiB/s-455MiB/s (478MB/s-478MB/s), io=4665MiB (4891MB), run=10242-10242msec WRITE: bw=455MiB/s (477MB/s), 455MiB/s-455MiB/s (477MB/s-477MB/s), io=4633MiB (4858MB), run=10184-10184msec# ./mptcp_nvme.sh mptcp 4 round-robin READ: bw=445MiB/s (466MB/s), 445MiB/s-445MiB/s (466MB/s-466MB/s), io=4575MiB (4797MB), run=10287-10287msec WRITE: bw=445MiB/s (467MB/s), 445MiB/s-445MiB/s (467MB/s-467MB/s), io=4572MiB (4794MB), run=10267-10267msecA "loss" argument is added to simulate network packet loss. When loss=1, each veth interface is configured with "delay 5ms loss 0.5%" using tc qdisc. Under this scenario, TCP performance is reduced by multiples compared to MPTCP:
# ./mptcp_nvme.sh tcp 4 round-robin 1 READ: bw=144MiB/s (151MB/s), 144MiB/s-144MiB/s (151MB/s-151MB/s), io=1909MiB (2001MB), run=13231-13231msec WRITE: bw=100.0MiB/s (105MB/s), 100.0MiB/s-100.0MiB/s (105MB/s-105MB/s), io=1397MiB (1465MB), run=13980-13980msec# ./mptcp_nvme.sh mptcp 4 round-robin 1 READ: bw=428MiB/s (449MB/s), 428MiB/s-428MiB/s (449MB/s-449MB/s), io=4524MiB (4743MB), run=10564-10564msec WRITE: bw=431MiB/s (452MB/s), 431MiB/s-431MiB/s (452MB/s-452MB/s), io=4513MiB (4732MB), run=10481-10481msec
Quoted 3 lines
These results demonstrate that MPTCP has better resilience against packet loss compared to TCP, as it can leverage multiple subflows to mitigate network degradation.
There are a few observations I'd like to raise:
1. It is difficult to reason about the throughput results when NVMe native multipath is enabled together with MPTCP. In this topology, four NVMe paths are created and the round-robin I/O policy is configured. As a result, each I/O first goes through the NVMe multipath scheduler, which selects a path, and is then further subjected to the MPTCP scheduler, which selects a TCP subflow. This means there are two independent schedulers influencing I/O placement, making it difficult to attribute the observed throughput improvements to either NVMe multipath or MPTCP.
For throughput comparisons, it may be more meaningful to disable NVMe native multipath (e.g., modprobe nvme_core multipath=n) when testing MPTCP. This would ensure that all I/O is sent through a single NVMe/TCP path while allowing MPTCP alone to distribute traffic across available subflows. Such a setup would provide a clearer comparison between TCP and MPTCP.
2. The current test uses only a 128 KiB I/O size. It would be useful to include additional I/O sizes as well, such as 4 KiB, 8 KiB, and 32 KiB, since MPTCP and NVMe multipath may behave differently under different workload characteristics.
3. The fio runtime is only 10 seconds, which is relatively short for performance evaluation. The results may be influenced by startup transients and may not accurately reflect steady-state behavior. It would be preferable to run the tests for a longer duration, for example 120 seconds, to obtain more stable measurements.
4. The tests are run on the same host by setting up veth interfaces and running host and target under different network namespaces. It'd be useful if you could run this tests between real host and target systems.
Thanks,
--Nilay
Re: [PATCH 11/11] selftests: mptcp: nvme: add iopolicy tests
Quoted 63 lines · Nilay Shroff
Quoted 37 lines · Geliang Tang
From: Geliang Tang<[email protected]>
Add NVMe iopolicy testing to
mptcp_nvme.sh, with the default set to "numa". It can be set to "round-robin" or "queue-depth".Test results with 4 NVMe multipath paths and round-robin iopolicy show that TCP and MPTCP achieve similar bandwidth:
# ./mptcp_nvme.sh tcp 4 round-robin READ: bw=455MiB/s (478MB/s), 455MiB/s-455MiB/s (478MB/s-478MB/s), io=4665MiB (4891MB), run=10242-10242msec WRITE: bw=455MiB/s (477MB/s), 455MiB/s-455MiB/s (477MB/s-477MB/s), io=4633MiB (4858MB), run=10184-10184msec# ./mptcp_nvme.sh mptcp 4 round-robin READ: bw=445MiB/s (466MB/s), 445MiB/s-445MiB/s (466MB/s-466MB/s), io=4575MiB (4797MB), run=10287-10287msec WRITE: bw=445MiB/s (467MB/s), 445MiB/s-445MiB/s (467MB/s-467MB/s), io=4572MiB (4794MB), run=10267-10267msecA "loss" argument is added to simulate network packet loss. When loss=1, each veth interface is configured with "delay 5ms loss 0.5%" using tc qdisc. Under this scenario, TCP performance is reduced by multiples compared to MPTCP:
# ./mptcp_nvme.sh tcp 4 round-robin 1 READ: bw=144MiB/s (151MB/s), 144MiB/s-144MiB/s (151MB/s-151MB/s), io=1909MiB (2001MB), run=13231-13231msec WRITE: bw=100.0MiB/s (105MB/s), 100.0MiB/s-100.0MiB/s (105MB/s-105MB/s), io=1397MiB (1465MB), run=13980-13980msec# ./mptcp_nvme.sh mptcp 4 round-robin 1 READ: bw=428MiB/s (449MB/s), 428MiB/s-428MiB/s (449MB/s-449MB/s), io=4524MiB (4743MB), run=10564-10564msec WRITE: bw=431MiB/s (452MB/s), 431MiB/s-431MiB/s (452MB/s-452MB/s), io=4513MiB (4732MB), run=10481-10481msecQuoted 3 lines
These results demonstrate that MPTCP has better resilience against packet loss compared to TCP, as it can leverage multiple subflows to mitigate network degradation.
There are a few observations I'd like to raise:
1. It is difficult to reason about the throughput results when NVMe native multipath is enabled together with MPTCP. In this topology, four NVMe paths are created and the round-robin I/O policy is configured. As a result, each I/O first goes through the NVMe multipath scheduler, which selects a path, and is then further subjected to the MPTCP scheduler, which selects a TCP subflow. This means there are two independent schedulers influencing I/O placement, making it difficult to attribute the observed throughput improvements to either NVMe multipath or MPTCP.
For throughput comparisons, it may be more meaningful to disable NVMe native multipath (e.g., modprobe
nvme_coremultipath=n) when testing MPTCP. This would ensure that all I/O is sent through a single NVMe/TCP path while allowing MPTCP alone to distribute traffic across available subflows. Such a setup would provide a clearer comparison between TCP and MPTCP.2. The current test uses only a 128 KiB I/O size. It would be useful to include additional I/O sizes as well, such as 4 KiB, 8 KiB, and 32 KiB, since MPTCP and NVMe multipath may behave differently under different workload characteristics.
Quoted 9 lines
3. The fio runtime is only 10 seconds, which is relatively short for performance evaluation. The results may be influenced by startup transients and may not accurately reflect steady-state behavior. It would be preferable to run the tests for a longer duration, for example 120 seconds, to obtain more stable measurements.
4. The tests are run on the same host by setting up veth interfaces and running host and target under different network namespaces. It'd be useful if you could run this tests between real host and target systems.
One more point forgot to add:
Current tests uses symmetric path characteristics (i.e. all paths experiences same loos or ratelimit). However it'd be useful to simulate a scenario where paths exhibit asymmetric behavior (for instance, one path experiences loss or increased latency compared to other). This would demonstrate the real world network failures and it'd be interesting to see how mptcp performs compared to native NVMe multiapth.
Thanks,
--Nilay
Hi Geliang,
Thank you for your modifications, that's great!
Our CI did some validations and here is its report:
- KVM Validation: normal (except selftest_mptcp_join): Success! ✅
- KVM Validation: normal (only selftest_mptcp_join): Success! ✅
- KVM Validation: debug (except selftest_mptcp_join): Success! ✅
- KVM Validation: debug (only selftest_mptcp_join): Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/26553078551
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/9301d8ce78ac
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=1101939
If there are some issues, you can reproduce them using the same environment as the one used by the CI thanks to a docker image, e.g.:
$ cd [kernel source code]
$ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
--pull always mptcp/mptcp-upstream-virtme-docker:latest \
auto-normalFor more details:
https://github.com/multipath-tcp/mptcp-upstream-virtme-docker
Please note that despite all the efforts that have been already done to have a stable tests suite when executed on a public CI like here, it is possible some reported issues are not due to your modifications. Still, do not hesitate to help us improve that ;-)
Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)
Christoph Hellwig
maintainerYou need to talk to the NVMe technical working group, not us.
Geliang Tang
reviewerHi Christoph,
Quoted 2 lines · Christoph Hellwig
You need to talk to the NVMe technical working group, not us.
Sure. Thanks. I'm already pushing forward with the NVMe membership and trying to reach the NVMe technical working group.
-Geliang