Skip to contentSkip to conversation

Fix socket options used by NVMe over MPTCP

PATCH Superseded Geliang Tang 2 participants 11 messages Jul 28

Subsystems (5)

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Geliang Tang

author reviewer
#0 lore raw

v3 cover Fix socket options used by NVMe over MPTCP

From: Geliang Tang <[email protected]>

NVMe over MPTCP relies on SO_LINGER, SO_PRIORITY, SO_REUSEADDR, TCP_SYNCNT, TCP_NODELAY, IP_TOS, and SO_BINDTODEVICE. This series contains fixes to make all of them work correctly, and adds tclass support for it.

v3:
- include tclass patches.
- I also included three NVMe patches here because they have dependencies.

v2:
- Drop "mptcp: don't reset dst when setting default 0 tos"
and "selftests: mptcp: sockopt: cover LINGER, REUSEADDR,
PRIORITY, NODELAY, SYNCNT": the 'if (val > 0)' guard
blocked the legitimate "reset to 0" path, and the test
only ran val_in=1, missing the SK_CAN_REUSE "any non-zero
-> 1" normalization.
- mptcp: bump setsockopt_seq for subflow-only socket options,
so secondary subflows created via MP_JOIN re-sync
sk_reuse / sk_reuseport / sk_bound_dev_if from msk.
- mptcp: copy the subflow's TOS to the msk on accept
(alongside the existing ssk->rcv_tos copy), so MP_JOIN'd
subflows inherit the reflected outgoing TOS.
- mptcp: propagate sk_reuseport to subflows via
sync_socket_options, so secondary subflows inherit
SO_REUSEPORT, not just SO_REUSEADDR.
- mptcp: tighten TCP_SYNCNT bounds check
('val < 1 || val > MAX_TCP_SYNCNT'), so out-of-bounds
values are rejected even when msk has no subflows yet
(where __mptcp_setsockopt_set_val would otherwise return 0
without invoking the set_val callback).
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/

v1:
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/

David 'equinox' Lamparter (1):
mptcp: sockopt: implement IPV6_TCLASS

Geliang Tang (8):
mptcp: inherit sk_reuse/sk_reuseport on subflow creation
mptcp: handle TCP_MAXSEG getsockopt in common case
mptcp: add TCP_SYNCNT setsockopt/getsockopt
ipv6: extract and export ip6_sock_set_tclass helper
nvme-fabrics: add IPv6 traffic class option
nvme-tcp: support IPv6 traffic class
nvmet-tcp: support IPv6 traffic class
mptcp: copy the subflow's tos/tclass to the msk on accept

 drivers/nvme/host/fabrics.c | 18 ++++++++++
 drivers/nvme/host/fabrics.h |  3 ++
 drivers/nvme/host/tcp.c     |  5 ++-
 drivers/nvme/target/tcp.c   | 14 ++++++--
 include/net/ipv6.h          |  3 ++
 net/ipv6/ipv6_sockglue.c    | 31 ++++++++++++-----
 net/mptcp/protocol.c        | 11 ++++++
 net/mptcp/sockopt.c         | 68 +++++++++++++++++++++++++++++++++++--
 8 files changed, 138 insertions(+), 15 deletions(-)
Signature · 1 line
2.53.0
author reviewer
#1 lore raw

PATCH v3 1/9 mptcp: inherit sk_reuse/sk_reuseport on subflow creation

From: Geliang Tang <[email protected]>

Propagate sk_reuse and sk_reuseport from the master socket to newly-created subflows. Without this, subflows created after the master toggles SO_REUSEADDR/SO_REUSEPORT would not inherit the setting.

Also bump setsockopt_seq in the SO_REUSEPORT/SO_REUSEADDR path so that subflows created later (e.g. via MP_JOIN) trigger sync_socket_options() instead of skipping it.

---
 net/mptcp/sockopt.c | 5 +++++
 1 file changed, 5 insertions(+)
net/mptcp/sockopt.c +5 -0
index fcf6feb2a9eb..37e65923f544 100644
@@ -326,6 +326,8 @@ static int mptcp_setsockopt_sol_socket(struct mptcp_sock *msk, int optname,
 				sk->sk_bound_dev_if = ssk->sk_bound_dev_if;
 			else if (optname == SO_BINDTOIFINDEX)
 				sk->sk_bound_dev_if = ssk->sk_bound_dev_if;
+
+			sockopt_seq_inc(msk);
 		}
 		release_sock(sk);
 		return ret;
@@ -1601,6 +1603,9 @@ static void sync_socket_options(struct mptcp_sock *msk, struct sock *ssk)
 	inet_assign_bit(FREEBIND, ssk, inet_test_bit(FREEBIND, sk));
 	inet_assign_bit(BIND_ADDRESS_NO_PORT, ssk, inet_test_bit(BIND_ADDRESS_NO_PORT, sk));
 	WRITE_ONCE(inet_sk(ssk)->local_port_range, READ_ONCE(inet_sk(sk)->local_port_range));
+
+	ssk->sk_reuse = sk->sk_reuse;
+	ssk->sk_reuseport = sk->sk_reuseport;
 }
 
 void mptcp_sockopt_sync_locked(struct mptcp_sock *msk, struct sock *ssk)
Signature · 1 line
2.53.0
author reviewer
#2 lore raw

PATCH v3 2/9 mptcp: handle TCP_MAXSEG getsockopt in common case

In reply to Geliang Tang

From: Geliang Tang <[email protected]>

Move TCP_MAXSEG from a tail-clause into the common case alongside other "first subflow only" options (TCP_FASTOPEN_*), making the dispatch logic more uniform.

No behavioural change.

---
 net/mptcp/sockopt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
net/mptcp/sockopt.c +1 -3
index 37e65923f544..34f6cd9c7967 100644
@@ -1425,6 +1425,7 @@ static int mptcp_getsockopt_sol_tcp(struct mptcp_sock *msk, int optname,
 	case TCP_FASTOPEN_CONNECT:
 	case TCP_FASTOPEN_KEY:
 	case TCP_FASTOPEN_NO_COOKIE:
+	case TCP_MAXSEG:
 		return mptcp_getsockopt_first_sf_only(msk, SOL_TCP, optname,
 						      optval, optlen);
 	case TCP_INQ:
@@ -1449,9 +1450,6 @@ static int mptcp_getsockopt_sol_tcp(struct mptcp_sock *msk, int optname,
 		return mptcp_put_int_option(msk, optval, optlen, msk->notsent_lowat);
 	case TCP_IS_MPTCP:
 		return mptcp_put_int_option(msk, optval, optlen, 1);
-	case TCP_MAXSEG:
-		return mptcp_getsockopt_first_sf_only(msk, SOL_TCP, optname,
-						      optval, optlen);
 	}
 	return -EOPNOTSUPP;
 }
Signature · 1 line
2.53.0
author reviewer
#3 lore raw

PATCH v3 3/9 mptcp: add TCP_SYNCNT setsockopt/getsockopt

In reply to Geliang Tang

From: Geliang Tang <[email protected]>

This patch adds TCP_SYNCNT support on the MPTCP socket.

The setsockopt() path stores the value in inet_csk(sk)->icsk_syn_retries on the msk and all subflow sockets. The getsockopt() path reads the same field back from the master socket.

A newly created subflow picks up the master socket's syn_retries through sync_socket_options(), so the setting takes effect for outgoing SYNs without further plumbing.

---
 net/mptcp/sockopt.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
net/mptcp/sockopt.c +15 -0
index 34f6cd9c7967..dbfae244a731 100644
@@ -898,6 +898,13 @@ static int mptcp_setsockopt_sol_tcp(struct mptcp_sock *msk, int optname,
 		ret = mptcp_setsockopt_all_sf(msk, SOL_TCP, optname, optval,
 					      optlen);
 		break;
+	case TCP_SYNCNT:
+		ret = __mptcp_setsockopt_set_val(msk, MAX_TCP_SYNCNT,
+						 &tcp_sock_set_syncnt,
+						 &val, val);
+		if (ret == 0)
+			tcp_sock_set_syncnt(sk, val);
+		break;
 	default:
 		ret = -ENOPROTOOPT;
 	}
@@ -1450,6 +1457,10 @@ static int mptcp_getsockopt_sol_tcp(struct mptcp_sock *msk, int optname,
 		return mptcp_put_int_option(msk, optval, optlen, msk->notsent_lowat);
 	case TCP_IS_MPTCP:
 		return mptcp_put_int_option(msk, optval, optlen, 1);
+	case TCP_SYNCNT:
+		return mptcp_put_int_option(msk, optval, optlen,
+					    READ_ONCE(inet_csk(sk)->icsk_syn_retries) ? :
+					    READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_syn_retries));
 	}
 	return -EOPNOTSUPP;
 }
@@ -1552,6 +1563,7 @@ static void sync_socket_options(struct mptcp_sock *msk, struct sock *ssk)
 	static const unsigned int tx_rx_locks = SOCK_RCVBUF_LOCK | SOCK_SNDBUF_LOCK;
 	struct sock *sk = (struct sock *)msk;
 	bool keep_open;
+	int syncnt;
 
 	keep_open = sock_flag(sk, SOCK_KEEPOPEN);
 	if (ssk->sk_prot->keepalive)
@@ -1604,6 +1616,9 @@ static void sync_socket_options(struct mptcp_sock *msk, struct sock *ssk)
 
 	ssk->sk_reuse = sk->sk_reuse;
 	ssk->sk_reuseport = sk->sk_reuseport;
+	syncnt = READ_ONCE(inet_csk(sk)->icsk_syn_retries);
+	if (syncnt > 0 && tcp_sock_set_syncnt(ssk, syncnt))
+		pr_warn("Failed to sync TCP_SYNCNT=%u to subflow\n", syncnt);
 }
 
 void mptcp_sockopt_sync_locked(struct mptcp_sock *msk, struct sock *ssk)
Signature · 1 line
2.53.0
author reviewer
#4 lore raw

PATCH v3 4/9 ipv6: extract and export ip6_sock_set_tclass helper

In reply to Geliang Tang

From: Geliang Tang <[email protected]>

The IPV6_TCLASS case in do_ipv6_setsockopt() inlined the same ECN mask handling and inet6_sk(sk)->tclass write that callers need to do when propagating a tclass value onto a freshly created socket.

Pull this into a small helper exported via <net/ipv6.h>, so external modules (e.g. nvme-tcp, nvmet-tcp) can apply IPV6_TCLASS without duplicating the ECN handling.

---
 include/net/ipv6.h       |  2 ++
 net/ipv6/ipv6_sockglue.c | 31 +++++++++++++++++++++++--------
 2 files changed, 25 insertions(+), 8 deletions(-)
include/net/ipv6.h +2 -0
index 3de07e738538..d61ccb48b5a5 100644
@@ -1252,6 +1252,8 @@ static inline void ip6_sock_set_recverr(struct sock *sk)
 	inet6_set_bit(RECVERR6, sk);
 }
 
+void ip6_sock_set_tclass(struct sock *sk, int val);
+
 #define IPV6_PREFER_SRC_MASK (IPV6_PREFER_SRC_TMP | IPV6_PREFER_SRC_PUBLIC | \
 			      IPV6_PREFER_SRC_COA)
 
net/ipv6/ipv6_sockglue.c +23 -8
index b4c977434c2e..34a25583942f 100644
@@ -373,6 +373,28 @@ static int ipv6_set_opt_hdr(struct sock *sk, int optname, sockptr_t optval,
 	return err;
 }
 
+static void __ip6_sock_set_tclass(struct sock *sk, int val)
+{
+	u8 old_tclass = inet6_sk(sk)->tclass;
+
+	if (sk->sk_type == SOCK_STREAM) {
+		val &= ~INET_ECN_MASK;
+		val |= old_tclass & INET_ECN_MASK;
+	}
+	if (old_tclass != val) {
+		WRITE_ONCE(inet6_sk(sk)->tclass, val);
+		sk_dst_reset(sk);
+	}
+}
+
+void ip6_sock_set_tclass(struct sock *sk, int val)
+{
+	sockopt_lock_sock(sk);
+	__ip6_sock_set_tclass(sk, val);
+	sockopt_release_sock(sk);
+}
+EXPORT_SYMBOL(ip6_sock_set_tclass);
+
 int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
 		       sockptr_t optval, unsigned int optlen)
 {
@@ -713,14 +735,7 @@ int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
 		/* RFC 3542, 6.5: default traffic class of 0x0 */
 		if (val == -1)
 			val = 0;
-		if (sk->sk_type == SOCK_STREAM) {
-			val &= ~INET_ECN_MASK;
-			val |= np->tclass & INET_ECN_MASK;
-		}
-		if (np->tclass != val) {
-			np->tclass = val;
-			sk_dst_reset(sk);
-		}
+		__ip6_sock_set_tclass(sk, val);
 		retv = 0;
 		break;
 
Signature · 1 line
2.53.0
author reviewer
#5 lore raw

PATCH v3 5/9 nvme-fabrics: add IPv6 traffic class option

In reply to Geliang Tang

From: Geliang Tang <[email protected]>

The NVMe/TCP transport needs to configure the IPv6 traffic class on its queue sockets, but the fabrics option parser currently has no corresponding option.

Add the tclass option to the fabrics parser and store the validated value in struct nvmf_ctrl_options. Negative values are rejected, while values greater than 255 are clamped to 255, matching the valid range of the IPv6 traffic class field.

Keep -1 as the default value to let the transport use its default traffic class.

---
 drivers/nvme/host/fabrics.c | 18 ++++++++++++++++++
 drivers/nvme/host/fabrics.h |  3 +++
 2 files changed, 21 insertions(+)
drivers/nvme/host/fabrics.c +18 -0
index ac3d4f400601..643c03dc7bcb 100644
@@ -695,6 +695,7 @@ static const match_table_t opt_tokens = {
 	{ NVMF_OPT_NR_WRITE_QUEUES,	"nr_write_queues=%d"	},
 	{ NVMF_OPT_NR_POLL_QUEUES,	"nr_poll_queues=%d"	},
 	{ NVMF_OPT_TOS,			"tos=%d"		},
+	{ NVMF_OPT_TCLASS,		"tclass=%d"		},
 #ifdef CONFIG_NVME_TCP_TLS
 	{ NVMF_OPT_KEYRING,		"keyring=%d"		},
 	{ NVMF_OPT_TLS_KEY,		"tls_key=%d"		},
@@ -734,6 +735,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
 	opts->hdr_digest = false;
 	opts->data_digest = false;
 	opts->tos = -1; /* < 0 == use transport default */
+	opts->tclass = -1; /* < 0 == use transport default */
 	opts->tls = false;
 	opts->tls_key = NULL;
 	opts->keyring = NULL;
@@ -991,6 +993,22 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
 			}
 			opts->tos = token;
 			break;
+		case NVMF_OPT_TCLASS:
+			if (match_int(args, &token)) {
+				ret = -EINVAL;
+				goto out;
+			}
+			if (token < 0) {
+				pr_err("Invalid traffic class %d\n", token);
+				ret = -EINVAL;
+				goto out;
+			}
+			if (token > 255) {
+				pr_warn("Clamping traffic class to 255\n");
+				token = 255;
+			}
+			opts->tclass = token;
+			break;
 		case NVMF_OPT_KEYRING:
 			if (match_int(args, &key_id) || key_id <= 0) {
 				ret = -EINVAL;
drivers/nvme/host/fabrics.h +3 -0
index caf5503d0833..3dfd40bd8960 100644
@@ -67,6 +67,7 @@ enum {
 	NVMF_OPT_KEYRING	= 1 << 26,
 	NVMF_OPT_TLS_KEY	= 1 << 27,
 	NVMF_OPT_CONCAT		= 1 << 28,
+	NVMF_OPT_TCLASS		= 1 << 29,
 };
 
 /**
@@ -109,6 +110,7 @@ enum {
  * @nr_write_queues: number of queues for write I/O
  * @nr_poll_queues: number of queues for polling I/O
  * @tos: type of service
+ * @tclass: IPv6 traffic class
  * @fast_io_fail_tmo: Fast I/O fail timeout in seconds
  */
 struct nvmf_ctrl_options {
@@ -139,6 +141,7 @@ struct nvmf_ctrl_options {
 	unsigned int		nr_write_queues;
 	unsigned int		nr_poll_queues;
 	int			tos;
+	int			tclass;
 	int			fast_io_fail_tmo;
 };
 
Signature · 1 line
2.53.0
author reviewer
#6 lore raw

PATCH v3 6/9 nvme-tcp: support IPv6 traffic class

In reply to Geliang Tang

From: Geliang Tang <[email protected]>

The fabrics layer now supports parsing the tclass option, but the NVMe/TCP transport does not currently advertise or apply it.

Allow NVMe/TCP to use NVMF_OPT_TCLASS and set IPV6_TCLASS on each queue socket when a traffic class is specified. Keep the existing IPv4 TOS handling unchanged.

---
 drivers/nvme/host/tcp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/nvme/host/tcp.c +4 -1
index ba5c7b3e2a7c..a9bb1568d929 100644
@@ -1837,6 +1837,8 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl, int qid,
 	/* Set socket type of service */
 	if (nctrl->opts->tos >= 0)
 		ip_sock_set_tos(queue->sock->sk, nctrl->opts->tos);
+	if (nctrl->opts->tclass >= 0)
+		ip6_sock_set_tclass(queue->sock->sk, nctrl->opts->tclass);
 
 	/* Set 10 seconds timeout for icresp recvmsg */
 	queue->sock->sk->sk_rcvtimeo = 10 * HZ;
@@ -3041,7 +3043,8 @@ static struct nvmf_transport_ops nvme_tcp_transport = {
 			  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 | NVMF_OPT_TLS |
+			  NVMF_OPT_TOS | NVMF_OPT_TCLASS |
+			  NVMF_OPT_HOST_IFACE | NVMF_OPT_TLS |
 			  NVMF_OPT_KEYRING | NVMF_OPT_TLS_KEY | NVMF_OPT_CONCAT,
 	.create_ctrl	= nvme_tcp_create_ctrl,
 };
Signature · 1 line
2.53.0
author reviewer
#7 lore raw

PATCH v3 7/9 nvmet-tcp: support IPv6 traffic class

In reply to Geliang Tang

From: Geliang Tang <[email protected]>

nvmet-tcp currently applies the received IPv4 TOS value when setting up a queue socket, but does not handle the IPv6 traffic class.

Extend the queue socket setup to handle AF_INET6 sockets. Obtain the traffic class from the IPv6 socket and apply it through IPV6_TCLASS. Keep the existing IPv4 TOS handling unchanged.

---
 drivers/nvme/target/tcp.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
drivers/nvme/target/tcp.c +11 -3
index 75a276d73be3..95cd57196973 100644
@@ -1699,7 +1699,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,
@@ -1723,8 +1722,17 @@ static int nvmet_tcp_set_queue_sock(struct nvmet_tcp_queue *queue)
 		sock_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);
+	if (sock->sk->sk_family == AF_INET) {
+		struct inet_sock *inet = inet_sk(sock->sk);
+
+		if (inet->rcv_tos > 0)
+			ip_sock_set_tos(sock->sk, inet->rcv_tos);
+	} else if (sock->sk->sk_family == AF_INET6) {
+		struct ipv6_pinfo *np = inet6_sk(sock->sk);
+
+		if (np->tclass > 0)
+			ip6_sock_set_tclass(sock->sk, np->tclass);
+	}
 
 	ret = 0;
 	write_lock_bh(&sock->sk->sk_callback_lock);
Signature · 1 line
2.53.0
author reviewer
#8 lore raw

PATCH v3 8/9 mptcp: sockopt: implement IPV6_TCLASS

In reply to Geliang Tang

From: David 'equinox' Lamparter <[email protected]>

The IPV6_TCLASS setsockopt just needs to be forwarded to the individual TCP sockets, like IP_TOS is already handled for IPv4.

Coincidentally, ssh uses this sockopt and prints an error in the middle of your ongoing SSH session when it doesn't work (very annoying when doing SCP/SFTP on a multiplexed session.)

For setsockopt, the value is first applied to the MPTCP socket itself via ipv6_setsockopt(), then propagated to all existing subflows using __ip6_sock_set_tclass(). The setsockopt_seq is bumped to ensure that subflows created later will pick up the setting through sync_socket_options().

For getsockopt, the value is read directly from the MPTCP socket.

Also add sync_socket_options() support for IPV6_TCLASS, so that new subflows created after the option is set inherit the correct tclass value.

---
 include/net/ipv6.h       |  1 +
 net/ipv6/ipv6_sockglue.c |  2 +-
 net/mptcp/sockopt.c      | 44 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 46 insertions(+), 1 deletion(-)
include/net/ipv6.h +1 -0
index d61ccb48b5a5..03b87a818c51 100644
@@ -1253,6 +1253,7 @@ static inline void ip6_sock_set_recverr(struct sock *sk)
 }
 
 void ip6_sock_set_tclass(struct sock *sk, int val);
+void __ip6_sock_set_tclass(struct sock *sk, int val);
 
 #define IPV6_PREFER_SRC_MASK (IPV6_PREFER_SRC_TMP | IPV6_PREFER_SRC_PUBLIC | \
 			      IPV6_PREFER_SRC_COA)
net/ipv6/ipv6_sockglue.c +1 -1
index 34a25583942f..c59f25fbb336 100644
@@ -373,7 +373,7 @@ static int ipv6_set_opt_hdr(struct sock *sk, int optname, sockptr_t optval,
 	return err;
 }
 
-static void __ip6_sock_set_tclass(struct sock *sk, int val)
+void __ip6_sock_set_tclass(struct sock *sk, int val)
 {
 	u8 old_tclass = inet6_sk(sk)->tclass;
 
net/mptcp/sockopt.c +44 -0

68 lines not on this page · raw message

Signature · 1 line
2.53.0
author reviewer
#9 lore raw

PATCH v3 9/9 mptcp: copy the subflow's tos/tclass to the msk on accept

In reply to Geliang Tang

From: Geliang Tang <[email protected]>

When a new MPTCP socket is accepted, copy the tos (and rcv_tos for IPv4) or tclass (and rcv_flowinfo for IPv6) from the first subflow to the newly-created msk.

This mirrors what plain TCP does in tcp_v4_syn_recv_sock() and tcp_v6_syn_recv_sock(), where these values are copied from the incoming skb to the accepted socket.

Without this, MP_JOIN subflows created later would inherit tos/tclass=0 from the msk and lose the peer's reflected value, causing inconsistent traffic class behavior.

---
 net/mptcp/protocol.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
net/mptcp/protocol.c +11 -0
index 954e20bb27de..749abfc28987 100644
@@ -3699,6 +3699,17 @@ struct sock *mptcp_sk_clone_init(const struct sock *sk,
 #endif
 		mptcp_copy_ip_options(nsk, sk);
 
+	if (ssk->sk_family == AF_INET) {
+		inet_sk(nsk)->rcv_tos = inet_sk(ssk)->rcv_tos;
+		__ip_sock_set_tos(nsk, inet_sk(ssk)->tos);
+	}
+#if IS_ENABLED(CONFIG_MPTCP_IPV6)
+	else if (ssk->sk_family == AF_INET6) {
+		inet6_sk(nsk)->rcv_flowinfo = inet6_sk(ssk)->rcv_flowinfo;
+		__ip6_sock_set_tclass(nsk, inet6_sk(ssk)->tclass);
+	}
+#endif
+
 	msk = mptcp_sk(nsk);
 	WRITE_ONCE(msk->local_key, subflow_req->local_key);
 	WRITE_ONCE(msk->token, subflow_req->token);
Signature · 1 line
2.53.0
#10 lore raw
In reply to Geliang Tang

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/30356797327

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/87186bb3a0ab
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=1135876

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-normal

For 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)