public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 net-next 0/3] ECN offload handling for AccECN series
@ 2026-01-28 14:44 chia-yu.chang
  0 siblings, 0 replies; 15+ messages in thread
From: chia-yu.chang @ 2026-01-28 14:44 UTC (permalink / raw)
  To: pabeni, edumazet, parav, linux-doc, corbet, horms, dsahern,
	kuniyu, bpf, netdev, dave.taht, jhs, kuba, stephen,
	xiyou.wangcong, jiri, davem, andrew+netdev, donald.hunter, ast,
	liuhangbin, shuah, linux-kselftest, ij, ncardwell,
	koen.de_schepper, g.white, ingemar.s.johansson, mirja.kuehlewind,
	cheshire, rs.ietf, Jason_Livingood, vidhi_goel
  Cc: Chia-Yu Chang

From: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>

Hello,

Please find the v1 ECN offload handling for AccECN patch series. It aims
to avoid potential CWR flag corruption due to RFC3168 ECN offload, because
this flag is part of ACE signal used for Accurate ECN protocol (RFC9768).

Best regards,
Chia-Yu

---
Chia-Yu Chang (3):
  net: update commnets for SKB_GSO_TCP_ECN and SKB_GSO_TCP_ACCECN
  net: hns3/mlx5e: avoid corrupting CWR flag when receiving GRO packet
  virtio_net: Accurate ECN flag in virtio_net_hdr

 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c |  2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_rx.c |  4 ++--
 drivers/net/virtio_net.c                        | 14 +++++++++++---
 drivers/vdpa/pds/debugfs.c                      |  6 ++++++
 include/linux/skbuff.h                          | 16 +++++++++++++++-
 include/linux/virtio_net.h                      | 16 ++++++++++------
 include/uapi/linux/virtio_net.h                 |  5 +++++
 7 files changed, 50 insertions(+), 13 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v1 net-next 0/3] ECN offload handling for AccECN series
@ 2026-01-31 22:55 chia-yu.chang
  2026-01-31 22:55 ` [PATCH v1 net-next 1/3] net: update commnets for SKB_GSO_TCP_ECN and SKB_GSO_TCP_ACCECN chia-yu.chang
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: chia-yu.chang @ 2026-01-31 22:55 UTC (permalink / raw)
  To: tariqt, linux-rdma, shaojijie, shenjian15, salil.mehta, mbloch,
	saeedm, leon, eperezma, brett.creeley, jasowang, virtualization,
	mst, xuanzhuo, pabeni, edumazet, parav, linux-doc, corbet, horms,
	dsahern, kuniyu, bpf, netdev, dave.taht, jhs, kuba, stephen,
	xiyou.wangcong, jiri, davem, andrew+netdev, donald.hunter, ast,
	liuhangbin, shuah, linux-kselftest, ij, ncardwell,
	koen.de_schepper, g.white, ingemar.s.johansson, mirja.kuehlewind,
	cheshire, rs.ietf, Jason_Livingood, vidhi_goel
  Cc: Chia-Yu Chang

From: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>

Hello,

Please find the v2 ECN offload handling for AccECN patch series. It aims
to avoid potential CWR flag corruption due to RFC3168 ECN offload, because
this flag is part of ACE signal used for Accurate ECN protocol (RFC9768).

Best regards,
Chia-Yu

---
v2:
- Replace VIRTIO_NET_HDR_GSO_ECN with VIRTIO_NET_HDR_GSO_ECN_FLAGS

---
Chia-Yu Chang (3):
  net: update commnets for SKB_GSO_TCP_ECN and SKB_GSO_TCP_ACCECN
  net: hns3/mlx5e: avoid corrupting CWR flag when receiving GRO packet
  virtio_net: Accurate ECN flag in virtio_net_hdr

 .../net/ethernet/hisilicon/hns3/hns3_enet.c    |  2 +-
 .../net/ethernet/mellanox/mlx5/core/en_rx.c    |  4 ++--
 drivers/net/virtio_net.c                       | 14 +++++++++++---
 drivers/vdpa/pds/debugfs.c                     |  6 ++++++
 include/linux/skbuff.h                         | 16 +++++++++++++++-
 include/linux/virtio_net.h                     | 18 +++++++++++-------
 include/uapi/linux/virtio_net.h                |  5 +++++
 7 files changed, 51 insertions(+), 14 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v1 net-next 1/3] net: update commnets for SKB_GSO_TCP_ECN and SKB_GSO_TCP_ACCECN
  2026-01-31 22:55 [PATCH v1 net-next 0/3] ECN offload handling for AccECN series chia-yu.chang
@ 2026-01-31 22:55 ` chia-yu.chang
  2026-02-01  9:01   ` Michael S. Tsirkin
  2026-01-31 22:55 ` [PATCH v1 net-next 2/3] net: hns3/mlx5e: avoid corrupting CWR flag when receiving GRO packet chia-yu.chang
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 15+ messages in thread
From: chia-yu.chang @ 2026-01-31 22:55 UTC (permalink / raw)
  To: tariqt, linux-rdma, shaojijie, shenjian15, salil.mehta, mbloch,
	saeedm, leon, eperezma, brett.creeley, jasowang, virtualization,
	mst, xuanzhuo, pabeni, edumazet, parav, linux-doc, corbet, horms,
	dsahern, kuniyu, bpf, netdev, dave.taht, jhs, kuba, stephen,
	xiyou.wangcong, jiri, davem, andrew+netdev, donald.hunter, ast,
	liuhangbin, shuah, linux-kselftest, ij, ncardwell,
	koen.de_schepper, g.white, ingemar.s.johansson, mirja.kuehlewind,
	cheshire, rs.ietf, Jason_Livingood, vidhi_goel
  Cc: Chia-Yu Chang

From: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>

No functional changes.

Co-developed-by: Ilpo Järvinen <ij@kernel.org>
Signed-off-by: Ilpo Järvinen <ij@kernel.org>
Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
---
 include/linux/skbuff.h | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index e6bfe5d0c525..30a8dc4233ba 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -671,7 +671,13 @@ enum {
 	/* This indicates the skb is from an untrusted source. */
 	SKB_GSO_DODGY = 1 << 1,
 
-	/* This indicates the tcp segment has CWR set. */
+	/* For Tx, this indicates the first TCP segment has CWR set, and any
+	 * subsequent segment in the same skb has CWR cleared. However, because
+	 * the connection to which the segment belongs is not tracked to use
+	 * RFC3168 or AccECN (RFC9768), and using RFC3168 ECN offload may clear
+	 * ACE signal (CWR is one of it). Therefore, this cannot be used on Rx.
+	 * Instead, SKB_GSO_TCP_ACCECN shall be used to avoid CWR corruption.
+	 */
 	SKB_GSO_TCP_ECN = 1 << 2,
 
 	__SKB_GSO_TCP_FIXEDID = 1 << 3,
@@ -706,6 +712,14 @@ enum {
 
 	SKB_GSO_FRAGLIST = 1 << 18,
 
+	/* For TX, this indicates the TCP segment uses the CWR flag as part of
+	 * ACE signal, and the CWR flag is not modified in the skb. For RX, any
+	 * CWR flagged segment must use SKB_GSO_TCP_ACCECN to ensure CWR flag
+	 * is not cleared by any RFC3168 ECN offload, and thus keeping ACE
+	 * signal of AccECN segments. This is particularly used for Rx of
+	 * virtio_net driver in order to tell latter GSO Tx in a forwarding
+	 * scenario that it is NOT ok to clean CWR flag from the 2nd segment.
+	 */
 	SKB_GSO_TCP_ACCECN = 1 << 19,
 
 	/* These indirectly map onto the same netdev feature.
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v1 net-next 2/3] net: hns3/mlx5e: avoid corrupting CWR flag when receiving GRO packet
  2026-01-31 22:55 [PATCH v1 net-next 0/3] ECN offload handling for AccECN series chia-yu.chang
  2026-01-31 22:55 ` [PATCH v1 net-next 1/3] net: update commnets for SKB_GSO_TCP_ECN and SKB_GSO_TCP_ACCECN chia-yu.chang
@ 2026-01-31 22:55 ` chia-yu.chang
  2026-02-01  9:05   ` Michael S. Tsirkin
  2026-01-31 22:55 ` [PATCH v1 net-next 3/3] virtio_net: Accurate ECN flag in virtio_net_hdr chia-yu.chang
  2026-02-01  0:45 ` [PATCH v1 net-next 0/3] ECN offload handling for AccECN series Jakub Kicinski
  3 siblings, 1 reply; 15+ messages in thread
From: chia-yu.chang @ 2026-01-31 22:55 UTC (permalink / raw)
  To: tariqt, linux-rdma, shaojijie, shenjian15, salil.mehta, mbloch,
	saeedm, leon, eperezma, brett.creeley, jasowang, virtualization,
	mst, xuanzhuo, pabeni, edumazet, parav, linux-doc, corbet, horms,
	dsahern, kuniyu, bpf, netdev, dave.taht, jhs, kuba, stephen,
	xiyou.wangcong, jiri, davem, andrew+netdev, donald.hunter, ast,
	liuhangbin, shuah, linux-kselftest, ij, ncardwell,
	koen.de_schepper, g.white, ingemar.s.johansson, mirja.kuehlewind,
	cheshire, rs.ietf, Jason_Livingood, vidhi_goel
  Cc: Chia-Yu Chang

From: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>

In Accurate ECN, ACE counter (AE, ECE, CWR flags) changes only when new
CE packets arrive, while setting SKB_GSO_TCP_ECN in case of not knowing
the ECN variant can result in header change that corrupts the ACE field.
The new flag SKB_GSO_TCP_ACCECN is to prevent SKB_GSO_TCP_ECN or
NETIF_F_TSO_ECN offloading to be used because they would corrupt CWR
flag somewhere.

Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index a47464a22751..3a1cf4335477 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -3897,7 +3897,7 @@ static int hns3_gro_complete(struct sk_buff *skb, u32 l234info)
 
 	skb_shinfo(skb)->gso_segs = NAPI_GRO_CB(skb)->count;
 	if (th->cwr)
-		skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_ECN;
+		skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_ACCECN;
 
 	if (l234info & BIT(HNS3_RXD_GRO_FIXID_B))
 		skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_FIXEDID;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
index 1fc3720d2201..d174f83478a3 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
@@ -1311,7 +1311,7 @@ static void mlx5e_shampo_update_ipv4_tcp_hdr(struct mlx5e_rq *rq, struct iphdr *
 	skb->csum_offset = offsetof(struct tcphdr, check);
 
 	if (tcp->cwr)
-		skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_ECN;
+		skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_ACCECN;
 }
 
 static void mlx5e_shampo_update_ipv6_tcp_hdr(struct mlx5e_rq *rq, struct ipv6hdr *ipv6,
@@ -1332,7 +1332,7 @@ static void mlx5e_shampo_update_ipv6_tcp_hdr(struct mlx5e_rq *rq, struct ipv6hdr
 	skb->csum_offset = offsetof(struct tcphdr, check);
 
 	if (tcp->cwr)
-		skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_ECN;
+		skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_ACCECN;
 }
 
 static void mlx5e_shampo_update_hdr(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe, bool match)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v1 net-next 3/3] virtio_net: Accurate ECN flag in virtio_net_hdr
  2026-01-31 22:55 [PATCH v1 net-next 0/3] ECN offload handling for AccECN series chia-yu.chang
  2026-01-31 22:55 ` [PATCH v1 net-next 1/3] net: update commnets for SKB_GSO_TCP_ECN and SKB_GSO_TCP_ACCECN chia-yu.chang
  2026-01-31 22:55 ` [PATCH v1 net-next 2/3] net: hns3/mlx5e: avoid corrupting CWR flag when receiving GRO packet chia-yu.chang
@ 2026-01-31 22:55 ` chia-yu.chang
  2026-02-01  9:17   ` Michael S. Tsirkin
  2026-02-01  0:45 ` [PATCH v1 net-next 0/3] ECN offload handling for AccECN series Jakub Kicinski
  3 siblings, 1 reply; 15+ messages in thread
From: chia-yu.chang @ 2026-01-31 22:55 UTC (permalink / raw)
  To: tariqt, linux-rdma, shaojijie, shenjian15, salil.mehta, mbloch,
	saeedm, leon, eperezma, brett.creeley, jasowang, virtualization,
	mst, xuanzhuo, pabeni, edumazet, parav, linux-doc, corbet, horms,
	dsahern, kuniyu, bpf, netdev, dave.taht, jhs, kuba, stephen,
	xiyou.wangcong, jiri, davem, andrew+netdev, donald.hunter, ast,
	liuhangbin, shuah, linux-kselftest, ij, ncardwell,
	koen.de_schepper, g.white, ingemar.s.johansson, mirja.kuehlewind,
	cheshire, rs.ietf, Jason_Livingood, vidhi_goel
  Cc: Chia-Yu Chang

From: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>

Unlike RFC 3168 ECN, accurate ECN uses the CWR flag as part of the ACE
field to count new packets with CE mark; however, it will be corrupted
by the RFC 3168 ECN-aware TSO. Therefore, fallback shall be applied by
seting NETIF_F_GSO_ACCECN to ensure that the CWR flag should not be
changed within a super-skb.

To apply the aforementieond new AccECN GSO for virtio, new featue bits
for host and guest are added for feature negotiation between driver and
device. And the translation of Accurate ECN GSO flag between
virtio_net_hdr and skb header for NETIF_F_GSO_ACCECN is also added to
avoid CWR flag corruption due to RFC3168 ECN TSO.

Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>

---
v2:
- Replace VIRTIO_NET_HDR_GSO_ECN with VIRTIO_NET_HDR_GSO_ECN_FLAGS

---
 drivers/net/virtio_net.c        | 14 +++++++++++---
 drivers/vdpa/pds/debugfs.c      |  6 ++++++
 include/linux/virtio_net.h      | 18 +++++++++++-------
 include/uapi/linux/virtio_net.h |  5 +++++
 4 files changed, 33 insertions(+), 10 deletions(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index db88dcaefb20..103fb87c690e 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -75,6 +75,7 @@ static const unsigned long guest_offloads[] = {
 	VIRTIO_NET_F_GUEST_TSO4,
 	VIRTIO_NET_F_GUEST_TSO6,
 	VIRTIO_NET_F_GUEST_ECN,
+	VIRTIO_NET_F_GUEST_ACCECN,
 	VIRTIO_NET_F_GUEST_UFO,
 	VIRTIO_NET_F_GUEST_CSUM,
 	VIRTIO_NET_F_GUEST_USO4,
@@ -87,6 +88,7 @@ static const unsigned long guest_offloads[] = {
 #define GUEST_OFFLOAD_GRO_HW_MASK ((1ULL << VIRTIO_NET_F_GUEST_TSO4) | \
 			(1ULL << VIRTIO_NET_F_GUEST_TSO6) | \
 			(1ULL << VIRTIO_NET_F_GUEST_ECN)  | \
+			(1ULL << VIRTIO_NET_F_GUEST_ACCECN) | \
 			(1ULL << VIRTIO_NET_F_GUEST_UFO)  | \
 			(1ULL << VIRTIO_NET_F_GUEST_USO4) | \
 			(1ULL << VIRTIO_NET_F_GUEST_USO6) | \
@@ -5976,6 +5978,7 @@ static int virtnet_xdp_set(struct net_device *dev, struct bpf_prog *prog,
 	    && (virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO4) ||
 	        virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO6) ||
 	        virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ECN) ||
+		virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ACCECN) ||
 		virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_UFO) ||
 		virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_CSUM) ||
 		virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_USO4) ||
@@ -6635,6 +6638,7 @@ static bool virtnet_check_guest_gso(const struct virtnet_info *vi)
 	return virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO4) ||
 		virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO6) ||
 		virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ECN) ||
+		virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ACCECN) ||
 		virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_UFO) ||
 		(virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_USO4) &&
 		virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_USO6));
@@ -6749,6 +6753,8 @@ static int virtnet_probe(struct virtio_device *vdev)
 			dev->hw_features |= NETIF_F_TSO6;
 		if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_ECN))
 			dev->hw_features |= NETIF_F_TSO_ECN;
+		if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_ACCECN))
+			dev->hw_features |= NETIF_F_GSO_ACCECN;
 		if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_USO))
 			dev->hw_features |= NETIF_F_GSO_UDP_L4;
 
@@ -7169,9 +7175,11 @@ static struct virtio_device_id id_table[] = {
 	VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GUEST_CSUM, \
 	VIRTIO_NET_F_MAC, \
 	VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6, \
-	VIRTIO_NET_F_HOST_ECN, VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, \
-	VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_UFO, \
-	VIRTIO_NET_F_HOST_USO, VIRTIO_NET_F_GUEST_USO4, VIRTIO_NET_F_GUEST_USO6, \
+	VIRTIO_NET_F_HOST_ECN, VIRTIO_NET_F_HOST_ACCECN, \
+	VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, \
+	VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_ACCECN, \
+	VIRTIO_NET_F_GUEST_UFO, VIRTIO_NET_F_HOST_USO, \
+	VIRTIO_NET_F_GUEST_USO4, VIRTIO_NET_F_GUEST_USO6, \
 	VIRTIO_NET_F_MRG_RXBUF, VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ, \
 	VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, \
 	VIRTIO_NET_F_GUEST_ANNOUNCE, VIRTIO_NET_F_MQ, \
diff --git a/drivers/vdpa/pds/debugfs.c b/drivers/vdpa/pds/debugfs.c
index c328e694f6e7..90bd95db0245 100644
--- a/drivers/vdpa/pds/debugfs.c
+++ b/drivers/vdpa/pds/debugfs.c
@@ -78,6 +78,9 @@ static void print_feature_bits_all(struct seq_file *seq, u64 features)
 		case BIT_ULL(VIRTIO_NET_F_GUEST_ECN):
 			seq_puts(seq, " VIRTIO_NET_F_GUEST_ECN");
 			break;
+		case BIT_ULL(VIRTIO_NET_F_GUEST_ACCECN):
+			seq_puts(seq, " VIRTIO_NET_F_GUEST_ACCECN");
+			break;
 		case BIT_ULL(VIRTIO_NET_F_GUEST_UFO):
 			seq_puts(seq, " VIRTIO_NET_F_GUEST_UFO");
 			break;
@@ -90,6 +93,9 @@ static void print_feature_bits_all(struct seq_file *seq, u64 features)
 		case BIT_ULL(VIRTIO_NET_F_HOST_ECN):
 			seq_puts(seq, " VIRTIO_NET_F_HOST_ECN");
 			break;
+		case BIT_ULL(VIRTIO_NET_F_HOST_ACCECN):
+			seq_puts(seq, " VIRTIO_NET_F_HOST_ACCECN");
+			break;
 		case BIT_ULL(VIRTIO_NET_F_HOST_UFO):
 			seq_puts(seq, " VIRTIO_NET_F_HOST_UFO");
 			break;
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index 75dabb763c65..0cf86b026828 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -11,7 +11,7 @@
 
 static inline bool virtio_net_hdr_match_proto(__be16 protocol, __u8 gso_type)
 {
-	switch (gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
+	switch (gso_type & ~VIRTIO_NET_HDR_GSO_ECN_FLAGS) {
 	case VIRTIO_NET_HDR_GSO_TCPV4:
 		return protocol == cpu_to_be16(ETH_P_IP);
 	case VIRTIO_NET_HDR_GSO_TCPV6:
@@ -31,7 +31,7 @@ static inline int virtio_net_hdr_set_proto(struct sk_buff *skb,
 	if (skb->protocol)
 		return 0;
 
-	switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
+	switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN_FLAGS) {
 	case VIRTIO_NET_HDR_GSO_TCPV4:
 	case VIRTIO_NET_HDR_GSO_UDP:
 	case VIRTIO_NET_HDR_GSO_UDP_L4:
@@ -58,7 +58,7 @@ static inline int __virtio_net_hdr_to_skb(struct sk_buff *skb,
 	unsigned int ip_proto;
 
 	if (hdr_gso_type != VIRTIO_NET_HDR_GSO_NONE) {
-		switch (hdr_gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
+		switch (hdr_gso_type & ~VIRTIO_NET_HDR_GSO_ECN_FLAGS) {
 		case VIRTIO_NET_HDR_GSO_TCPV4:
 			gso_type = SKB_GSO_TCPV4;
 			ip_proto = IPPROTO_TCP;
@@ -84,7 +84,9 @@ static inline int __virtio_net_hdr_to_skb(struct sk_buff *skb,
 			return -EINVAL;
 		}
 
-		if (hdr_gso_type & VIRTIO_NET_HDR_GSO_ECN)
+		if (hdr_gso_type & VIRTIO_NET_HDR_GSO_ACCECN)
+			gso_type |= SKB_GSO_TCP_ACCECN;
+		else if (hdr_gso_type & VIRTIO_NET_HDR_GSO_ECN)
 			gso_type |= SKB_GSO_TCP_ECN;
 
 		if (hdr->gso_size == 0)
@@ -159,7 +161,7 @@ static inline int __virtio_net_hdr_to_skb(struct sk_buff *skb,
 		unsigned int nh_off = p_off;
 		struct skb_shared_info *shinfo = skb_shinfo(skb);
 
-		switch (gso_type & ~SKB_GSO_TCP_ECN) {
+		switch (gso_type & ~(SKB_GSO_TCP_ECN | SKB_GSO_TCP_ACCECN)) {
 		case SKB_GSO_UDP:
 			/* UFO may not include transport header in gso_size. */
 			nh_off -= thlen;
@@ -231,7 +233,9 @@ static inline int virtio_net_hdr_from_skb(const struct sk_buff *skb,
 			hdr->gso_type = VIRTIO_NET_HDR_GSO_UDP_L4;
 		else
 			return -EINVAL;
-		if (sinfo->gso_type & SKB_GSO_TCP_ECN)
+		if (sinfo->gso_type & SKB_GSO_TCP_ACCECN)
+			hdr->gso_type |= VIRTIO_NET_HDR_GSO_ACCECN;
+		else if (sinfo->gso_type & SKB_GSO_TCP_ECN)
 			hdr->gso_type |= VIRTIO_NET_HDR_GSO_ECN;
 	} else
 		hdr->gso_type = VIRTIO_NET_HDR_GSO_NONE;
@@ -282,7 +286,7 @@ virtio_net_hdr_tnl_to_skb(struct sk_buff *skb,
 		return -EINVAL;
 
 	/* The UDP tunnel must carry a GSO packet, but no UFO. */
-	gso_inner_type = hdr->gso_type & ~(VIRTIO_NET_HDR_GSO_ECN |
+	gso_inner_type = hdr->gso_type & ~(VIRTIO_NET_HDR_GSO_ECN_FLAGS |
 					   VIRTIO_NET_HDR_GSO_UDP_TUNNEL);
 	if (!gso_inner_type || gso_inner_type == VIRTIO_NET_HDR_GSO_UDP)
 		return -EINVAL;
diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h
index 1db45b01532b..af5bfe45aa1f 100644
--- a/include/uapi/linux/virtio_net.h
+++ b/include/uapi/linux/virtio_net.h
@@ -56,6 +56,8 @@
 #define VIRTIO_NET_F_MQ	22	/* Device supports Receive Flow
 					 * Steering */
 #define VIRTIO_NET_F_CTRL_MAC_ADDR 23	/* Set MAC address */
+#define VIRTIO_NET_F_HOST_ACCECN 25	/* Host can handle GSO of AccECN */
+#define VIRTIO_NET_F_GUEST_ACCECN 26	/* Guest can handle GSO of AccECN */
 #define VIRTIO_NET_F_DEVICE_STATS 50	/* Device can provide device-level statistics. */
 #define VIRTIO_NET_F_VQ_NOTF_COAL 52	/* Device supports virtqueue notification coalescing */
 #define VIRTIO_NET_F_NOTF_COAL	53	/* Device supports notifications coalescing */
@@ -165,6 +167,9 @@ struct virtio_net_hdr_v1 {
 #define VIRTIO_NET_HDR_GSO_UDP_TUNNEL (VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV4 | \
 				       VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV6)
 #define VIRTIO_NET_HDR_GSO_ECN		0x80	/* TCP has ECN set */
+#define VIRTIO_NET_HDR_GSO_ACCECN	0x10	/* TCP AccECN segmentation */
+#define VIRTIO_NET_HDR_GSO_ECN_FLAGS	(VIRTIO_NET_HDR_GSO_ECN | \
+					 VIRTIO_NET_HDR_GSO_ACCECN)
 	__u8 gso_type;
 	__virtio16 hdr_len;	/* Ethernet + IP + tcp/udp hdrs */
 	__virtio16 gso_size;	/* Bytes to append to hdr_len per frame */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v1 net-next 0/3] ECN offload handling for AccECN series
  2026-01-31 22:55 [PATCH v1 net-next 0/3] ECN offload handling for AccECN series chia-yu.chang
                   ` (2 preceding siblings ...)
  2026-01-31 22:55 ` [PATCH v1 net-next 3/3] virtio_net: Accurate ECN flag in virtio_net_hdr chia-yu.chang
@ 2026-02-01  0:45 ` Jakub Kicinski
  2026-02-02 14:10   ` Chia-Yu Chang (Nokia)
  3 siblings, 1 reply; 15+ messages in thread
From: Jakub Kicinski @ 2026-02-01  0:45 UTC (permalink / raw)
  To: chia-yu.chang
  Cc: tariqt, linux-rdma, shaojijie, shenjian15, salil.mehta, mbloch,
	saeedm, leon, eperezma, brett.creeley, jasowang, virtualization,
	mst, xuanzhuo, pabeni, edumazet, parav, linux-doc, corbet, horms,
	dsahern, kuniyu, bpf, netdev, dave.taht, jhs, stephen,
	xiyou.wangcong, jiri, davem, andrew+netdev, donald.hunter, ast,
	liuhangbin, shuah, linux-kselftest, ij, ncardwell,
	koen.de_schepper, g.white, ingemar.s.johansson, mirja.kuehlewind,
	cheshire, rs.ietf, Jason_Livingood, vidhi_goel

On Sat, 31 Jan 2026 23:55:07 +0100 chia-yu.chang@nokia-bell-labs.com
wrote:
> ---
> v2:
> - Replace VIRTIO_NET_HDR_GSO_ECN with VIRTIO_NET_HDR_GSO_ECN_FLAGS

For the future:

Quoting documentation:

  Limit patches outstanding on mailing list
  -----------------------------------------
  
  Avoid having more than 15 patches, across all series, outstanding for
  review on the mailing list for a single tree. In other words, a maximum of
  15 patches under review on net, and a maximum of 15 patches under review on
  net-next.
  
  This limit is intended to focus developer effort on testing patches before
  upstream review. Aiding the quality of upstream submissions, and easing the
  load on reviewers.
    
See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#limit-patches-outstanding-on-mailing-list

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v1 net-next 1/3] net: update commnets for SKB_GSO_TCP_ECN and SKB_GSO_TCP_ACCECN
  2026-01-31 22:55 ` [PATCH v1 net-next 1/3] net: update commnets for SKB_GSO_TCP_ECN and SKB_GSO_TCP_ACCECN chia-yu.chang
@ 2026-02-01  9:01   ` Michael S. Tsirkin
  0 siblings, 0 replies; 15+ messages in thread
From: Michael S. Tsirkin @ 2026-02-01  9:01 UTC (permalink / raw)
  To: chia-yu.chang
  Cc: tariqt, linux-rdma, shaojijie, shenjian15, salil.mehta, mbloch,
	saeedm, leon, eperezma, brett.creeley, jasowang, virtualization,
	xuanzhuo, pabeni, edumazet, parav, linux-doc, corbet, horms,
	dsahern, kuniyu, bpf, netdev, dave.taht, jhs, kuba, stephen,
	xiyou.wangcong, jiri, davem, andrew+netdev, donald.hunter, ast,
	liuhangbin, shuah, linux-kselftest, ij, ncardwell,
	koen.de_schepper, g.white, ingemar.s.johansson, mirja.kuehlewind,
	cheshire, rs.ietf, Jason_Livingood, vidhi_goel

On Sat, Jan 31, 2026 at 11:55:08PM +0100, chia-yu.chang@nokia-bell-labs.com wrote:
> From: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
> 
> No functional changes.
> 
> Co-developed-by: Ilpo Järvinen <ij@kernel.org>
> Signed-off-by: Ilpo Järvinen <ij@kernel.org>
> Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>

Subject: comments?

> ---
>  include/linux/skbuff.h | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index e6bfe5d0c525..30a8dc4233ba 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -671,7 +671,13 @@ enum {
>  	/* This indicates the skb is from an untrusted source. */
>  	SKB_GSO_DODGY = 1 << 1,
>  
> -	/* This indicates the tcp segment has CWR set. */
> +	/* For Tx, this indicates the first TCP segment has CWR set, and any
> +	 * subsequent segment in the same skb has CWR cleared. However, because
> +	 * the connection to which the segment belongs is not tracked to use
> +	 * RFC3168 or AccECN (RFC9768), and using RFC3168 ECN offload may clear
> +	 * ACE signal (CWR is one of it). Therefore, this cannot be used on Rx.
> +	 * Instead, SKB_GSO_TCP_ACCECN shall be used to avoid CWR corruption.
> +	 */
>  	SKB_GSO_TCP_ECN = 1 << 2,
>  
>  	__SKB_GSO_TCP_FIXEDID = 1 << 3,
> @@ -706,6 +712,14 @@ enum {
>  
>  	SKB_GSO_FRAGLIST = 1 << 18,
>  
> +	/* For TX, this indicates the TCP segment uses the CWR flag as part of
> +	 * ACE signal, and the CWR flag is not modified in the skb. For RX, any
> +	 * CWR flagged segment must use SKB_GSO_TCP_ACCECN to ensure CWR flag
> +	 * is not cleared by any RFC3168 ECN offload, and thus keeping ACE
> +	 * signal of AccECN segments. This is particularly used for Rx of
> +	 * virtio_net driver in order to tell latter GSO Tx in a forwarding
> +	 * scenario that it is NOT ok to clean CWR flag from the 2nd segment.
> +	 */
>  	SKB_GSO_TCP_ACCECN = 1 << 19,
>  
>  	/* These indirectly map onto the same netdev feature.
> -- 
> 2.34.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v1 net-next 2/3] net: hns3/mlx5e: avoid corrupting CWR flag when receiving GRO packet
  2026-01-31 22:55 ` [PATCH v1 net-next 2/3] net: hns3/mlx5e: avoid corrupting CWR flag when receiving GRO packet chia-yu.chang
@ 2026-02-01  9:05   ` Michael S. Tsirkin
  2026-02-02 16:44     ` Chia-Yu Chang (Nokia)
  0 siblings, 1 reply; 15+ messages in thread
From: Michael S. Tsirkin @ 2026-02-01  9:05 UTC (permalink / raw)
  To: chia-yu.chang
  Cc: tariqt, linux-rdma, shaojijie, shenjian15, salil.mehta, mbloch,
	saeedm, leon, eperezma, brett.creeley, jasowang, virtualization,
	xuanzhuo, pabeni, edumazet, parav, linux-doc, corbet, horms,
	dsahern, kuniyu, bpf, netdev, dave.taht, jhs, kuba, stephen,
	xiyou.wangcong, jiri, davem, andrew+netdev, donald.hunter, ast,
	liuhangbin, shuah, linux-kselftest, ij, ncardwell,
	koen.de_schepper, g.white, ingemar.s.johansson, mirja.kuehlewind,
	cheshire, rs.ietf, Jason_Livingood, vidhi_goel

On Sat, Jan 31, 2026 at 11:55:09PM +0100, chia-yu.chang@nokia-bell-labs.com wrote:
> From: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
> 
> In Accurate ECN, ACE counter (AE, ECE, CWR flags) changes only when new
> CE packets arrive, while setting SKB_GSO_TCP_ECN in case of not knowing
> the ECN variant can result in header change that corrupts the ACE field.
> The new flag SKB_GSO_TCP_ACCECN is to prevent SKB_GSO_TCP_ECN or
> NETIF_F_TSO_ECN offloading to be used because they would corrupt CWR
> flag somewhere.
> 
> Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>

Not my driver, but a better format is something along the lines of:

Currently .... this is wrong because ... as the result .... fix this by ...
so that ....

the coding style does say that you should use the imperative form.



> ---
>  drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 +-
>  drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> index a47464a22751..3a1cf4335477 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> @@ -3897,7 +3897,7 @@ static int hns3_gro_complete(struct sk_buff *skb, u32 l234info)
>  
>  	skb_shinfo(skb)->gso_segs = NAPI_GRO_CB(skb)->count;
>  	if (th->cwr)
> -		skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_ECN;
> +		skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_ACCECN;
>  
>  	if (l234info & BIT(HNS3_RXD_GRO_FIXID_B))
>  		skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_FIXEDID;
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
> index 1fc3720d2201..d174f83478a3 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
> @@ -1311,7 +1311,7 @@ static void mlx5e_shampo_update_ipv4_tcp_hdr(struct mlx5e_rq *rq, struct iphdr *
>  	skb->csum_offset = offsetof(struct tcphdr, check);
>  
>  	if (tcp->cwr)
> -		skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_ECN;
> +		skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_ACCECN;
>  }
>  
>  static void mlx5e_shampo_update_ipv6_tcp_hdr(struct mlx5e_rq *rq, struct ipv6hdr *ipv6,
> @@ -1332,7 +1332,7 @@ static void mlx5e_shampo_update_ipv6_tcp_hdr(struct mlx5e_rq *rq, struct ipv6hdr
>  	skb->csum_offset = offsetof(struct tcphdr, check);
>  
>  	if (tcp->cwr)
> -		skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_ECN;
> +		skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_ACCECN;
>  }
>  
>  static void mlx5e_shampo_update_hdr(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe, bool match)
> -- 
> 2.34.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v1 net-next 3/3] virtio_net: Accurate ECN flag in virtio_net_hdr
  2026-01-31 22:55 ` [PATCH v1 net-next 3/3] virtio_net: Accurate ECN flag in virtio_net_hdr chia-yu.chang
@ 2026-02-01  9:17   ` Michael S. Tsirkin
  2026-02-02 16:56     ` Chia-Yu Chang (Nokia)
  0 siblings, 1 reply; 15+ messages in thread
From: Michael S. Tsirkin @ 2026-02-01  9:17 UTC (permalink / raw)
  To: chia-yu.chang
  Cc: tariqt, linux-rdma, shaojijie, shenjian15, salil.mehta, mbloch,
	saeedm, leon, eperezma, brett.creeley, jasowang, virtualization,
	xuanzhuo, pabeni, edumazet, parav, linux-doc, corbet, horms,
	dsahern, kuniyu, bpf, netdev, dave.taht, jhs, kuba, stephen,
	xiyou.wangcong, jiri, davem, andrew+netdev, donald.hunter, ast,
	liuhangbin, shuah, linux-kselftest, ij, ncardwell,
	koen.de_schepper, g.white, ingemar.s.johansson, mirja.kuehlewind,
	cheshire, rs.ietf, Jason_Livingood, vidhi_goel

Thanks for the patch! Yet something to improve:

On Sat, Jan 31, 2026 at 11:55:10PM +0100, chia-yu.chang@nokia-bell-labs.com wrote:
> From: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
> 
> Unlike RFC 3168 ECN, accurate ECN uses the CWR flag as part of the ACE
> field to count new packets with CE mark; however, it will be corrupted
> by the RFC 3168 ECN-aware TSO. Therefore, fallback shall be applied by
> seting NETIF_F_GSO_ACCECN to ensure that the CWR flag should not be
> changed within a super-skb.
> 
> To apply the aforementieond new AccECN GSO for virtio, new featue bits
> for host and guest are added for feature negotiation between driver and
> device. And the translation of Accurate ECN GSO flag between
> virtio_net_hdr and skb header for NETIF_F_GSO_ACCECN is also added to
> avoid CWR flag corruption due to RFC3168 ECN TSO.
> 
> Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>


To the best of my understanding, this is a new feature - support
for VIRTIO_NET_F_HOST_ACCECN, VIRTIO_NET_F_GUEST_ACCECN?
The commit log makes it sound like it fixes some behaviour for
existing hardware, but that is not the case.





> ---
> v2:
> - Replace VIRTIO_NET_HDR_GSO_ECN with VIRTIO_NET_HDR_GSO_ECN_FLAGS

but where is v2? this is v1...

> ---
>  drivers/net/virtio_net.c        | 14 +++++++++++---
>  drivers/vdpa/pds/debugfs.c      |  6 ++++++
>  include/linux/virtio_net.h      | 18 +++++++++++-------
>  include/uapi/linux/virtio_net.h |  5 +++++
>  4 files changed, 33 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index db88dcaefb20..103fb87c690e 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -75,6 +75,7 @@ static const unsigned long guest_offloads[] = {
>  	VIRTIO_NET_F_GUEST_TSO4,
>  	VIRTIO_NET_F_GUEST_TSO6,
>  	VIRTIO_NET_F_GUEST_ECN,
> +	VIRTIO_NET_F_GUEST_ACCECN,
>  	VIRTIO_NET_F_GUEST_UFO,
>  	VIRTIO_NET_F_GUEST_CSUM,
>  	VIRTIO_NET_F_GUEST_USO4,
> @@ -87,6 +88,7 @@ static const unsigned long guest_offloads[] = {
>  #define GUEST_OFFLOAD_GRO_HW_MASK ((1ULL << VIRTIO_NET_F_GUEST_TSO4) | \
>  			(1ULL << VIRTIO_NET_F_GUEST_TSO6) | \
>  			(1ULL << VIRTIO_NET_F_GUEST_ECN)  | \
> +			(1ULL << VIRTIO_NET_F_GUEST_ACCECN) | \
>  			(1ULL << VIRTIO_NET_F_GUEST_UFO)  | \
>  			(1ULL << VIRTIO_NET_F_GUEST_USO4) | \
>  			(1ULL << VIRTIO_NET_F_GUEST_USO6) | \
> @@ -5976,6 +5978,7 @@ static int virtnet_xdp_set(struct net_device *dev, struct bpf_prog *prog,
>  	    && (virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO4) ||
>  	        virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO6) ||
>  	        virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ECN) ||
> +		virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ACCECN) ||
>  		virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_UFO) ||
>  		virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_CSUM) ||
>  		virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_USO4) ||
> @@ -6635,6 +6638,7 @@ static bool virtnet_check_guest_gso(const struct virtnet_info *vi)
>  	return virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO4) ||
>  		virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO6) ||
>  		virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ECN) ||
> +		virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ACCECN) ||
>  		virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_UFO) ||
>  		(virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_USO4) &&
>  		virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_USO6));
> @@ -6749,6 +6753,8 @@ static int virtnet_probe(struct virtio_device *vdev)
>  			dev->hw_features |= NETIF_F_TSO6;
>  		if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_ECN))
>  			dev->hw_features |= NETIF_F_TSO_ECN;
> +		if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_ACCECN))
> +			dev->hw_features |= NETIF_F_GSO_ACCECN;
>  		if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_USO))
>  			dev->hw_features |= NETIF_F_GSO_UDP_L4;
>  
> @@ -7169,9 +7175,11 @@ static struct virtio_device_id id_table[] = {
>  	VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GUEST_CSUM, \
>  	VIRTIO_NET_F_MAC, \
>  	VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6, \
> -	VIRTIO_NET_F_HOST_ECN, VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, \
> -	VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_UFO, \
> -	VIRTIO_NET_F_HOST_USO, VIRTIO_NET_F_GUEST_USO4, VIRTIO_NET_F_GUEST_USO6, \
> +	VIRTIO_NET_F_HOST_ECN, VIRTIO_NET_F_HOST_ACCECN, \
> +	VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, \
> +	VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_ACCECN, \
> +	VIRTIO_NET_F_GUEST_UFO, VIRTIO_NET_F_HOST_USO, \
> +	VIRTIO_NET_F_GUEST_USO4, VIRTIO_NET_F_GUEST_USO6, \
>  	VIRTIO_NET_F_MRG_RXBUF, VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ, \
>  	VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, \
>  	VIRTIO_NET_F_GUEST_ANNOUNCE, VIRTIO_NET_F_MQ, \
> diff --git a/drivers/vdpa/pds/debugfs.c b/drivers/vdpa/pds/debugfs.c
> index c328e694f6e7..90bd95db0245 100644
> --- a/drivers/vdpa/pds/debugfs.c
> +++ b/drivers/vdpa/pds/debugfs.c
> @@ -78,6 +78,9 @@ static void print_feature_bits_all(struct seq_file *seq, u64 features)
>  		case BIT_ULL(VIRTIO_NET_F_GUEST_ECN):
>  			seq_puts(seq, " VIRTIO_NET_F_GUEST_ECN");
>  			break;
> +		case BIT_ULL(VIRTIO_NET_F_GUEST_ACCECN):
> +			seq_puts(seq, " VIRTIO_NET_F_GUEST_ACCECN");
> +			break;
>  		case BIT_ULL(VIRTIO_NET_F_GUEST_UFO):
>  			seq_puts(seq, " VIRTIO_NET_F_GUEST_UFO");
>  			break;
> @@ -90,6 +93,9 @@ static void print_feature_bits_all(struct seq_file *seq, u64 features)
>  		case BIT_ULL(VIRTIO_NET_F_HOST_ECN):
>  			seq_puts(seq, " VIRTIO_NET_F_HOST_ECN");
>  			break;
> +		case BIT_ULL(VIRTIO_NET_F_HOST_ACCECN):
> +			seq_puts(seq, " VIRTIO_NET_F_HOST_ACCECN");
> +			break;
>  		case BIT_ULL(VIRTIO_NET_F_HOST_UFO):
>  			seq_puts(seq, " VIRTIO_NET_F_HOST_UFO");
>  			break;
> diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
> index 75dabb763c65..0cf86b026828 100644
> --- a/include/linux/virtio_net.h
> +++ b/include/linux/virtio_net.h
> @@ -11,7 +11,7 @@
>  
>  static inline bool virtio_net_hdr_match_proto(__be16 protocol, __u8 gso_type)
>  {
> -	switch (gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
> +	switch (gso_type & ~VIRTIO_NET_HDR_GSO_ECN_FLAGS) {
>  	case VIRTIO_NET_HDR_GSO_TCPV4:
>  		return protocol == cpu_to_be16(ETH_P_IP);
>  	case VIRTIO_NET_HDR_GSO_TCPV6:
> @@ -31,7 +31,7 @@ static inline int virtio_net_hdr_set_proto(struct sk_buff *skb,
>  	if (skb->protocol)
>  		return 0;
>  
> -	switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
> +	switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN_FLAGS) {
>  	case VIRTIO_NET_HDR_GSO_TCPV4:
>  	case VIRTIO_NET_HDR_GSO_UDP:
>  	case VIRTIO_NET_HDR_GSO_UDP_L4:
> @@ -58,7 +58,7 @@ static inline int __virtio_net_hdr_to_skb(struct sk_buff *skb,
>  	unsigned int ip_proto;
>  
>  	if (hdr_gso_type != VIRTIO_NET_HDR_GSO_NONE) {
> -		switch (hdr_gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
> +		switch (hdr_gso_type & ~VIRTIO_NET_HDR_GSO_ECN_FLAGS) {
>  		case VIRTIO_NET_HDR_GSO_TCPV4:
>  			gso_type = SKB_GSO_TCPV4;
>  			ip_proto = IPPROTO_TCP;
> @@ -84,7 +84,9 @@ static inline int __virtio_net_hdr_to_skb(struct sk_buff *skb,
>  			return -EINVAL;
>  		}
>  
> -		if (hdr_gso_type & VIRTIO_NET_HDR_GSO_ECN)
> +		if (hdr_gso_type & VIRTIO_NET_HDR_GSO_ACCECN)
> +			gso_type |= SKB_GSO_TCP_ACCECN;
> +		else if (hdr_gso_type & VIRTIO_NET_HDR_GSO_ECN)
>  			gso_type |= SKB_GSO_TCP_ECN;
>  
>  		if (hdr->gso_size == 0)
> @@ -159,7 +161,7 @@ static inline int __virtio_net_hdr_to_skb(struct sk_buff *skb,
>  		unsigned int nh_off = p_off;
>  		struct skb_shared_info *shinfo = skb_shinfo(skb);
>  
> -		switch (gso_type & ~SKB_GSO_TCP_ECN) {
> +		switch (gso_type & ~(SKB_GSO_TCP_ECN | SKB_GSO_TCP_ACCECN)) {
>  		case SKB_GSO_UDP:
>  			/* UFO may not include transport header in gso_size. */
>  			nh_off -= thlen;
> @@ -231,7 +233,9 @@ static inline int virtio_net_hdr_from_skb(const struct sk_buff *skb,
>  			hdr->gso_type = VIRTIO_NET_HDR_GSO_UDP_L4;
>  		else
>  			return -EINVAL;
> -		if (sinfo->gso_type & SKB_GSO_TCP_ECN)
> +		if (sinfo->gso_type & SKB_GSO_TCP_ACCECN)
> +			hdr->gso_type |= VIRTIO_NET_HDR_GSO_ACCECN;
> +		else if (sinfo->gso_type & SKB_GSO_TCP_ECN)
>  			hdr->gso_type |= VIRTIO_NET_HDR_GSO_ECN;
>  	} else
>  		hdr->gso_type = VIRTIO_NET_HDR_GSO_NONE;
> @@ -282,7 +286,7 @@ virtio_net_hdr_tnl_to_skb(struct sk_buff *skb,
>  		return -EINVAL;
>  
>  	/* The UDP tunnel must carry a GSO packet, but no UFO. */
> -	gso_inner_type = hdr->gso_type & ~(VIRTIO_NET_HDR_GSO_ECN |
> +	gso_inner_type = hdr->gso_type & ~(VIRTIO_NET_HDR_GSO_ECN_FLAGS |
>  					   VIRTIO_NET_HDR_GSO_UDP_TUNNEL);
>  	if (!gso_inner_type || gso_inner_type == VIRTIO_NET_HDR_GSO_UDP)
>  		return -EINVAL;
> diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h
> index 1db45b01532b..af5bfe45aa1f 100644
> --- a/include/uapi/linux/virtio_net.h
> +++ b/include/uapi/linux/virtio_net.h
> @@ -56,6 +56,8 @@
>  #define VIRTIO_NET_F_MQ	22	/* Device supports Receive Flow
>  					 * Steering */
>  #define VIRTIO_NET_F_CTRL_MAC_ADDR 23	/* Set MAC address */
> +#define VIRTIO_NET_F_HOST_ACCECN 25	/* Host can handle GSO of AccECN */
> +#define VIRTIO_NET_F_GUEST_ACCECN 26	/* Guest can handle GSO of AccECN */
>  #define VIRTIO_NET_F_DEVICE_STATS 50	/* Device can provide device-level statistics. */
>  #define VIRTIO_NET_F_VQ_NOTF_COAL 52	/* Device supports virtqueue notification coalescing */
>  #define VIRTIO_NET_F_NOTF_COAL	53	/* Device supports notifications coalescing */
> @@ -165,6 +167,9 @@ struct virtio_net_hdr_v1 {
>  #define VIRTIO_NET_HDR_GSO_UDP_TUNNEL (VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV4 | \
>  				       VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV6)
>  #define VIRTIO_NET_HDR_GSO_ECN		0x80	/* TCP has ECN set */
> +#define VIRTIO_NET_HDR_GSO_ACCECN	0x10	/* TCP AccECN segmentation */
> +#define VIRTIO_NET_HDR_GSO_ECN_FLAGS	(VIRTIO_NET_HDR_GSO_ECN | \
> +					 VIRTIO_NET_HDR_GSO_ACCECN)
>  	__u8 gso_type;
>  	__virtio16 hdr_len;	/* Ethernet + IP + tcp/udp hdrs */
>  	__virtio16 gso_size;	/* Bytes to append to hdr_len per frame */


UAPI changes need to be added to the virtio spec.
Pls get this approved by the virtio TC.
Thanks!


> -- 
> 2.34.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH v1 net-next 0/3] ECN offload handling for AccECN series
  2026-02-01  0:45 ` [PATCH v1 net-next 0/3] ECN offload handling for AccECN series Jakub Kicinski
@ 2026-02-02 14:10   ` Chia-Yu Chang (Nokia)
  0 siblings, 0 replies; 15+ messages in thread
From: Chia-Yu Chang (Nokia) @ 2026-02-02 14:10 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: tariqt@nvidia.com, linux-rdma@vger.kernel.org,
	shaojijie@huawei.com, shenjian15@huawei.com,
	salil.mehta@huawei.com, mbloch@nvidia.com, saeedm@nvidia.com,
	leon@kernel.org, eperezma@redhat.com, brett.creeley@amd.com,
	jasowang@redhat.com, virtualization@lists.linux.dev,
	mst@redhat.com, xuanzhuo@linux.alibaba.com, pabeni@redhat.com,
	edumazet@google.com, parav@nvidia.com, linux-doc@vger.kernel.org,
	corbet@lwn.net, horms@kernel.org, dsahern@kernel.org,
	kuniyu@google.com, bpf@vger.kernel.org, netdev@vger.kernel.org,
	dave.taht@gmail.com, jhs@mojatatu.com, stephen@networkplumber.org,
	xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net,
	andrew+netdev@lunn.ch, donald.hunter@gmail.com, ast@fiberby.net,
	liuhangbin@gmail.com, shuah@kernel.org,
	linux-kselftest@vger.kernel.org, ij@kernel.org,
	ncardwell@google.com, Koen De Schepper (Nokia),
	g.white@cablelabs.com, ingemar.s.johansson@ericsson.com,
	mirja.kuehlewind@ericsson.com, cheshire@apple.com, rs.ietf@gmx.at,
	Jason_Livingood@comcast.com, vidhi_goel@apple.com

> -----Original Message-----
> From: Jakub Kicinski <kuba@kernel.org>
> Sent: Sunday, February 1, 2026 1:45 AM
> To: Chia-Yu Chang (Nokia) <chia-yu.chang@nokia-bell-labs.com>
> Cc: tariqt@nvidia.com; linux-rdma@vger.kernel.org; shaojijie@huawei.com; shenjian15@huawei.com; salil.mehta@huawei.com; mbloch@nvidia.com; saeedm@nvidia.com; leon@kernel.org; eperezma@redhat.com; brett.creeley@amd.com; jasowang@redhat.com; virtualization@lists.linux.dev; mst@redhat.com; xuanzhuo@linux.alibaba.com; pabeni@redhat.com; edumazet@google.com; parav@nvidia.com; linux-doc@vger.kernel.org; corbet@lwn.net; horms@kernel.org; dsahern@kernel.org; kuniyu@google.com; bpf@vger.kernel.org; netdev@vger.kernel.org; dave.taht@gmail.com; jhs@mojatatu.com; stephen@networkplumber.org; xiyou.wangcong@gmail.com; jiri@resnulli.us; davem@davemloft.net; andrew+netdev@lunn.ch; donald.hunter@gmail.com; ast@fiberby.net; liuhangbin@gmail.com; shuah@kernel.org; linux-kselftest@vger.kernel.org; ij@kernel.org; ncardwell@google.com; Koen De Schepper (Nokia) <koen.de_schepper@nokia-bell-labs.com>; g.white@cablelabs.com; ingemar.s.johansson@ericsson.com; mirja.kuehlewind@ericsson.com; cheshire@apple.com; rs.ietf@gmx.at; Jason_Livingood@comcast.com; vidhi_goel@apple.com
> Subject: Re: [PATCH v1 net-next 0/3] ECN offload handling for AccECN series
>
>
> CAUTION: This is an external email. Please be very careful when clicking links or opening attachments. See the URL nok.it/ext for additional information.
>
>
>
> On Sat, 31 Jan 2026 23:55:07 +0100 chia-yu.chang@nokia-bell-labs.com
> wrote:
> > ---
> > v2:
> > - Replace VIRTIO_NET_HDR_GSO_ECN with VIRTIO_NET_HDR_GSO_ECN_FLAGS
>
> For the future:
>
> Quoting documentation:
>
>   Limit patches outstanding on mailing list
>   -----------------------------------------
>
>   Avoid having more than 15 patches, across all series, outstanding for
>   review on the mailing list for a single tree. In other words, a maximum of
>   15 patches under review on net, and a maximum of 15 patches under review on
>   net-next.
>
>   This limit is intended to focus developer effort on testing patches before
>   upstream review. Aiding the quality of upstream submissions, and easing the
>   load on reviewers.
>
> See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#limit-patches-outstanding-on-mailing-list

Hi Jakub,

Sorry for my miss, I was thinking to submit up to 15 patches per series, without considering the overall limit on net-next.
Will be careful next time. Thanks.

Chia-Yu

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH v1 net-next 2/3] net: hns3/mlx5e: avoid corrupting CWR flag when receiving GRO packet
  2026-02-01  9:05   ` Michael S. Tsirkin
@ 2026-02-02 16:44     ` Chia-Yu Chang (Nokia)
  0 siblings, 0 replies; 15+ messages in thread
From: Chia-Yu Chang (Nokia) @ 2026-02-02 16:44 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: tariqt@nvidia.com, linux-rdma@vger.kernel.org,
	shaojijie@huawei.com, shenjian15@huawei.com,
	salil.mehta@huawei.com, mbloch@nvidia.com, saeedm@nvidia.com,
	leon@kernel.org, eperezma@redhat.com, brett.creeley@amd.com,
	jasowang@redhat.com, virtualization@lists.linux.dev,
	xuanzhuo@linux.alibaba.com, pabeni@redhat.com,
	edumazet@google.com, parav@nvidia.com, linux-doc@vger.kernel.org,
	corbet@lwn.net, horms@kernel.org, dsahern@kernel.org,
	kuniyu@google.com, bpf@vger.kernel.org, netdev@vger.kernel.org,
	dave.taht@gmail.com, jhs@mojatatu.com, kuba@kernel.org,
	stephen@networkplumber.org, xiyou.wangcong@gmail.com,
	jiri@resnulli.us, davem@davemloft.net, andrew+netdev@lunn.ch,
	donald.hunter@gmail.com, ast@fiberby.net, liuhangbin@gmail.com,
	shuah@kernel.org, linux-kselftest@vger.kernel.org, ij@kernel.org,
	ncardwell@google.com, Koen De Schepper (Nokia),
	g.white@cablelabs.com, ingemar.s.johansson@ericsson.com,
	mirja.kuehlewind@ericsson.com, cheshire@apple.com, rs.ietf@gmx.at,
	Jason_Livingood@comcast.com, vidhi_goel@apple.com

> -----Original Message-----
> From: Michael S. Tsirkin <mst@redhat.com> 
> Sent: Sunday, February 1, 2026 10:05 AM
> To: Chia-Yu Chang (Nokia) <chia-yu.chang@nokia-bell-labs.com>
> Cc: tariqt@nvidia.com; linux-rdma@vger.kernel.org; shaojijie@huawei.com; shenjian15@huawei.com; salil.mehta@huawei.com; mbloch@nvidia.com; saeedm@nvidia.com; leon@kernel.org; eperezma@redhat.com; brett.creeley@amd.com; jasowang@redhat.com; virtualization@lists.linux.dev; xuanzhuo@linux.alibaba.com; pabeni@redhat.com; edumazet@google.com; parav@nvidia.com; linux-doc@vger.kernel.org; corbet@lwn.net; horms@kernel.org; dsahern@kernel.org; kuniyu@google.com; bpf@vger.kernel.org; netdev@vger.kernel.org; dave.taht@gmail.com; jhs@mojatatu.com; kuba@kernel.org; stephen@networkplumber.org; xiyou.wangcong@gmail.com; jiri@resnulli.us; davem@davemloft.net; andrew+netdev@lunn.ch; donald.hunter@gmail.com; ast@fiberby.net; liuhangbin@gmail.com; shuah@kernel.org; linux-kselftest@vger.kernel.org; ij@kernel.org; ncardwell@google.com; Koen De Schepper (Nokia) <koen.de_schepper@nokia-bell-labs.com>; g.white@cablelabs.com; ingemar.s.johansson@ericsson.com; mirja.kuehlewind@ericsson.com; cheshire@apple.com; rs.ietf@gmx.at; Jason_Livingood@comcast.com; vidhi_goel@apple.com
> Subject: Re: [PATCH v1 net-next 2/3] net: hns3/mlx5e: avoid corrupting CWR flag when receiving GRO packet
> 
> 
> CAUTION: This is an external email. Please be very careful when clicking links or opening attachments. See the URL nok.it/ext for additional information.
> 
> 
> 
> On Sat, Jan 31, 2026 at 11:55:09PM +0100, chia-yu.chang@nokia-bell-labs.com wrote:
> > From: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
> >
> > In Accurate ECN, ACE counter (AE, ECE, CWR flags) changes only when 
> > new CE packets arrive, while setting SKB_GSO_TCP_ECN in case of not 
> > knowing the ECN variant can result in header change that corrupts the ACE field.
> > The new flag SKB_GSO_TCP_ACCECN is to prevent SKB_GSO_TCP_ECN or 
> > NETIF_F_TSO_ECN offloading to be used because they would corrupt CWR 
> > flag somewhere.
> >
> > Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
> 
> Not my driver, but a better format is something along the lines of:
> 
> Currently .... this is wrong because ... as the result .... fix this by ...
> so that ....
> 
> the coding style does say that you should use the imperative form.
> 
Hi Michael,

I will update the commit messages for all these 3 patches.
And sorry for the typo, this shall be v2, and the next version will be v3 - will clarify it.
Thanks.

Chia-Yu

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH v1 net-next 3/3] virtio_net: Accurate ECN flag in virtio_net_hdr
  2026-02-01  9:17   ` Michael S. Tsirkin
@ 2026-02-02 16:56     ` Chia-Yu Chang (Nokia)
  2026-02-02 17:19       ` Michael S. Tsirkin
  0 siblings, 1 reply; 15+ messages in thread
From: Chia-Yu Chang (Nokia) @ 2026-02-02 16:56 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: tariqt@nvidia.com, linux-rdma@vger.kernel.org,
	shaojijie@huawei.com, shenjian15@huawei.com,
	salil.mehta@huawei.com, mbloch@nvidia.com, saeedm@nvidia.com,
	leon@kernel.org, eperezma@redhat.com, brett.creeley@amd.com,
	jasowang@redhat.com, virtualization@lists.linux.dev,
	xuanzhuo@linux.alibaba.com, pabeni@redhat.com,
	edumazet@google.com, parav@nvidia.com, linux-doc@vger.kernel.org,
	corbet@lwn.net, horms@kernel.org, dsahern@kernel.org,
	kuniyu@google.com, bpf@vger.kernel.org, netdev@vger.kernel.org,
	dave.taht@gmail.com, jhs@mojatatu.com, kuba@kernel.org,
	stephen@networkplumber.org, xiyou.wangcong@gmail.com,
	jiri@resnulli.us, davem@davemloft.net, andrew+netdev@lunn.ch,
	donald.hunter@gmail.com, ast@fiberby.net, liuhangbin@gmail.com,
	shuah@kernel.org, linux-kselftest@vger.kernel.org, ij@kernel.org,
	ncardwell@google.com, Koen De Schepper (Nokia),
	g.white@cablelabs.com, ingemar.s.johansson@ericsson.com,
	mirja.kuehlewind@ericsson.com, cheshire@apple.com, rs.ietf@gmx.at,
	Jason_Livingood@comcast.com, vidhi_goel@apple.com

> -----Original Message-----
> From: Michael S. Tsirkin <mst@redhat.com> 
> Sent: Sunday, February 1, 2026 10:18 AM
> To: Chia-Yu Chang (Nokia) <chia-yu.chang@nokia-bell-labs.com>
> Cc: tariqt@nvidia.com; linux-rdma@vger.kernel.org; shaojijie@huawei.com; shenjian15@huawei.com; salil.mehta@huawei.com; mbloch@nvidia.com; saeedm@nvidia.com; leon@kernel.org; eperezma@redhat.com; brett.creeley@amd.com; jasowang@redhat.com; virtualization@lists.linux.dev; xuanzhuo@linux.alibaba.com; pabeni@redhat.com; edumazet@google.com; parav@nvidia.com; linux-doc@vger.kernel.org; corbet@lwn.net; horms@kernel.org; dsahern@kernel.org; kuniyu@google.com; bpf@vger.kernel.org; netdev@vger.kernel.org; dave.taht@gmail.com; jhs@mojatatu.com; kuba@kernel.org; stephen@networkplumber.org; xiyou.wangcong@gmail.com; jiri@resnulli.us; davem@davemloft.net; andrew+netdev@lunn.ch; donald.hunter@gmail.com; ast@fiberby.net; liuhangbin@gmail.com; shuah@kernel.org; linux-kselftest@vger.kernel.org; ij@kernel.org; ncardwell@google.com; Koen De Schepper (Nokia) <koen.de_schepper@nokia-bell-labs.com>; g.white@cablelabs.com; ingemar.s.johansson@ericsson.com; mirja.kuehlewind@ericsson.com; cheshire@apple.com; rs.ietf@gmx.at; Jason_Livingood@comcast.com; vidhi_goel@apple.com
> Subject: Re: [PATCH v1 net-next 3/3] virtio_net: Accurate ECN flag in virtio_net_hdr
> 
> 
> CAUTION: This is an external email. Please be very careful when clicking links or opening attachments. See the URL nok.it/ext for additional information.
> 
> 
> 
> Thanks for the patch! Yet something to improve:
> 
> On Sat, Jan 31, 2026 at 11:55:10PM +0100, chia-yu.chang@nokia-bell-labs.com wrote:
> > From: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
> >
> > Unlike RFC 3168 ECN, accurate ECN uses the CWR flag as part of the ACE 
> > field to count new packets with CE mark; however, it will be corrupted 
> > by the RFC 3168 ECN-aware TSO. Therefore, fallback shall be applied by 
> > seting NETIF_F_GSO_ACCECN to ensure that the CWR flag should not be 
> > changed within a super-skb.
> >
> > To apply the aforementieond new AccECN GSO for virtio, new featue bits 
> > for host and guest are added for feature negotiation between driver 
> > and device. And the translation of Accurate ECN GSO flag between 
> > virtio_net_hdr and skb header for NETIF_F_GSO_ACCECN is also added to 
> > avoid CWR flag corruption due to RFC3168 ECN TSO.
> >
> > Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
> 
> 
> To the best of my understanding, this is a new feature - support for VIRTIO_NET_F_HOST_ACCECN, VIRTIO_NET_F_GUEST_ACCECN?
> The commit log makes it sound like it fixes some behaviour for existing hardware, but that is not the case.
> 

Thansk for the feedback, I will update commit message in v3.
> 
> > ---
> > v2:
> > - Replace VIRTIO_NET_HDR_GSO_ECN with VIRTIO_NET_HDR_GSO_ECN_FLAGS
> 
> but where is v2? this is v1...

I shall update this version as v2, will do at the next version.

[...]
> > diff --git a/include/uapi/linux/virtio_net.h 
> > b/include/uapi/linux/virtio_net.h index 1db45b01532b..af5bfe45aa1f 
> > 100644
> > --- a/include/uapi/linux/virtio_net.h
> > +++ b/include/uapi/linux/virtio_net.h
> > @@ -56,6 +56,8 @@
> >  #define VIRTIO_NET_F_MQ      22      /* Device supports Receive Flow
> >                                        * Steering */
> >  #define VIRTIO_NET_F_CTRL_MAC_ADDR 23        /* Set MAC address */
> > +#define VIRTIO_NET_F_HOST_ACCECN 25  /* Host can handle GSO of AccECN 
> > +*/ #define VIRTIO_NET_F_GUEST_ACCECN 26 /* Guest can handle GSO of 
> > +AccECN */
> >  #define VIRTIO_NET_F_DEVICE_STATS 50 /* Device can provide 
> > device-level statistics. */  #define VIRTIO_NET_F_VQ_NOTF_COAL 52 /* Device supports virtqueue notification coalescing */
> >  #define VIRTIO_NET_F_NOTF_COAL       53      /* Device supports notifications coalescing */
> > @@ -165,6 +167,9 @@ struct virtio_net_hdr_v1 {  #define 
> > VIRTIO_NET_HDR_GSO_UDP_TUNNEL (VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV4 | \
> >                                      VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV6)
> >  #define VIRTIO_NET_HDR_GSO_ECN               0x80    /* TCP has ECN set */
> > +#define VIRTIO_NET_HDR_GSO_ACCECN    0x10    /* TCP AccECN segmentation */
> > +#define VIRTIO_NET_HDR_GSO_ECN_FLAGS (VIRTIO_NET_HDR_GSO_ECN | \
> > +                                      VIRTIO_NET_HDR_GSO_ACCECN)
> >       __u8 gso_type;
> >       __virtio16 hdr_len;     /* Ethernet + IP + tcp/udp hdrs */
> >       __virtio16 gso_size;    /* Bytes to append to hdr_len per frame */
> 
> 
> UAPI changes need to be added to the virtio spec.
> Pls get this approved by the virtio TC.
> Thanks!

There were some discussions last October in virtio-comment@lists.linux.dev mailing list.

At that moment, it is suggested to make Linux kernel accept new comments for SKB_GSO_TCP_ECN and SKB_GSO_TCP_ACCECN first.

So, could virtio-spec colleague give your feedback? (Parav?).

Otherwise, the CWR handling of virtio will be wrong after all Accurate ECN commits are merged in Linux.

Chia-Yu

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v1 net-next 3/3] virtio_net: Accurate ECN flag in virtio_net_hdr
  2026-02-02 16:56     ` Chia-Yu Chang (Nokia)
@ 2026-02-02 17:19       ` Michael S. Tsirkin
  2026-02-02 21:09         ` Chia-Yu Chang (Nokia)
  0 siblings, 1 reply; 15+ messages in thread
From: Michael S. Tsirkin @ 2026-02-02 17:19 UTC (permalink / raw)
  To: Chia-Yu Chang (Nokia)
  Cc: tariqt@nvidia.com, linux-rdma@vger.kernel.org,
	shaojijie@huawei.com, shenjian15@huawei.com,
	salil.mehta@huawei.com, mbloch@nvidia.com, saeedm@nvidia.com,
	leon@kernel.org, eperezma@redhat.com, brett.creeley@amd.com,
	jasowang@redhat.com, virtualization@lists.linux.dev,
	xuanzhuo@linux.alibaba.com, pabeni@redhat.com,
	edumazet@google.com, parav@nvidia.com, linux-doc@vger.kernel.org,
	corbet@lwn.net, horms@kernel.org, dsahern@kernel.org,
	kuniyu@google.com, bpf@vger.kernel.org, netdev@vger.kernel.org,
	dave.taht@gmail.com, jhs@mojatatu.com, kuba@kernel.org,
	stephen@networkplumber.org, xiyou.wangcong@gmail.com,
	jiri@resnulli.us, davem@davemloft.net, andrew+netdev@lunn.ch,
	donald.hunter@gmail.com, ast@fiberby.net, liuhangbin@gmail.com,
	shuah@kernel.org, linux-kselftest@vger.kernel.org, ij@kernel.org,
	ncardwell@google.com, Koen De Schepper (Nokia),
	g.white@cablelabs.com, ingemar.s.johansson@ericsson.com,
	mirja.kuehlewind@ericsson.com, cheshire@apple.com, rs.ietf@gmx.at,
	Jason_Livingood@comcast.com, vidhi_goel@apple.com

On Mon, Feb 02, 2026 at 04:56:38PM +0000, Chia-Yu Chang (Nokia) wrote:
> > -----Original Message-----
> > From: Michael S. Tsirkin <mst@redhat.com> 
> > Sent: Sunday, February 1, 2026 10:18 AM
> > To: Chia-Yu Chang (Nokia) <chia-yu.chang@nokia-bell-labs.com>
> > Cc: tariqt@nvidia.com; linux-rdma@vger.kernel.org; shaojijie@huawei.com; shenjian15@huawei.com; salil.mehta@huawei.com; mbloch@nvidia.com; saeedm@nvidia.com; leon@kernel.org; eperezma@redhat.com; brett.creeley@amd.com; jasowang@redhat.com; virtualization@lists.linux.dev; xuanzhuo@linux.alibaba.com; pabeni@redhat.com; edumazet@google.com; parav@nvidia.com; linux-doc@vger.kernel.org; corbet@lwn.net; horms@kernel.org; dsahern@kernel.org; kuniyu@google.com; bpf@vger.kernel.org; netdev@vger.kernel.org; dave.taht@gmail.com; jhs@mojatatu.com; kuba@kernel.org; stephen@networkplumber.org; xiyou.wangcong@gmail.com; jiri@resnulli.us; davem@davemloft.net; andrew+netdev@lunn.ch; donald.hunter@gmail.com; ast@fiberby.net; liuhangbin@gmail.com; shuah@kernel.org; linux-kselftest@vger.kernel.org; ij@kernel.org; ncardwell@google.com; Koen De Schepper (Nokia) <koen.de_schepper@nokia-bell-labs.com>; g.white@cablelabs.com; ingemar.s.johansson@ericsson.com; mirja.kuehlewind@ericsson.com; cheshire@apple.com; rs.ietf@gmx.at; Jason_Livingood@comcast.com; vidhi_goel@apple.com
> > Subject: Re: [PATCH v1 net-next 3/3] virtio_net: Accurate ECN flag in virtio_net_hdr
> > 
> > 
> > CAUTION: This is an external email. Please be very careful when clicking links or opening attachments. See the URL nok.it/ext for additional information.
> > 
> > 
> > 
> > Thanks for the patch! Yet something to improve:
> > 
> > On Sat, Jan 31, 2026 at 11:55:10PM +0100, chia-yu.chang@nokia-bell-labs.com wrote:
> > > From: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
> > >
> > > Unlike RFC 3168 ECN, accurate ECN uses the CWR flag as part of the ACE 
> > > field to count new packets with CE mark; however, it will be corrupted 
> > > by the RFC 3168 ECN-aware TSO. Therefore, fallback shall be applied by 
> > > seting NETIF_F_GSO_ACCECN to ensure that the CWR flag should not be 
> > > changed within a super-skb.
> > >
> > > To apply the aforementieond new AccECN GSO for virtio, new featue bits 
> > > for host and guest are added for feature negotiation between driver 
> > > and device. And the translation of Accurate ECN GSO flag between 
> > > virtio_net_hdr and skb header for NETIF_F_GSO_ACCECN is also added to 
> > > avoid CWR flag corruption due to RFC3168 ECN TSO.
> > >
> > > Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
> > 
> > 
> > To the best of my understanding, this is a new feature - support for VIRTIO_NET_F_HOST_ACCECN, VIRTIO_NET_F_GUEST_ACCECN?
> > The commit log makes it sound like it fixes some behaviour for existing hardware, but that is not the case.
> > 
> 
> Thansk for the feedback, I will update commit message in v3.
> > 
> > > ---
> > > v2:
> > > - Replace VIRTIO_NET_HDR_GSO_ECN with VIRTIO_NET_HDR_GSO_ECN_FLAGS
> > 
> > but where is v2? this is v1...
> 
> I shall update this version as v2, will do at the next version.
> 
> [...]
> > > diff --git a/include/uapi/linux/virtio_net.h 
> > > b/include/uapi/linux/virtio_net.h index 1db45b01532b..af5bfe45aa1f 
> > > 100644
> > > --- a/include/uapi/linux/virtio_net.h
> > > +++ b/include/uapi/linux/virtio_net.h
> > > @@ -56,6 +56,8 @@
> > >  #define VIRTIO_NET_F_MQ      22      /* Device supports Receive Flow
> > >                                        * Steering */
> > >  #define VIRTIO_NET_F_CTRL_MAC_ADDR 23        /* Set MAC address */
> > > +#define VIRTIO_NET_F_HOST_ACCECN 25  /* Host can handle GSO of AccECN 
> > > +*/ #define VIRTIO_NET_F_GUEST_ACCECN 26 /* Guest can handle GSO of 
> > > +AccECN */
> > >  #define VIRTIO_NET_F_DEVICE_STATS 50 /* Device can provide 
> > > device-level statistics. */  #define VIRTIO_NET_F_VQ_NOTF_COAL 52 /* Device supports virtqueue notification coalescing */
> > >  #define VIRTIO_NET_F_NOTF_COAL       53      /* Device supports notifications coalescing */
> > > @@ -165,6 +167,9 @@ struct virtio_net_hdr_v1 {  #define 
> > > VIRTIO_NET_HDR_GSO_UDP_TUNNEL (VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV4 | \
> > >                                      VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV6)
> > >  #define VIRTIO_NET_HDR_GSO_ECN               0x80    /* TCP has ECN set */
> > > +#define VIRTIO_NET_HDR_GSO_ACCECN    0x10    /* TCP AccECN segmentation */
> > > +#define VIRTIO_NET_HDR_GSO_ECN_FLAGS (VIRTIO_NET_HDR_GSO_ECN | \
> > > +                                      VIRTIO_NET_HDR_GSO_ACCECN)
> > >       __u8 gso_type;
> > >       __virtio16 hdr_len;     /* Ethernet + IP + tcp/udp hdrs */
> > >       __virtio16 gso_size;    /* Bytes to append to hdr_len per frame */
> > 
> > 
> > UAPI changes need to be added to the virtio spec.
> > Pls get this approved by the virtio TC.
> > Thanks!
> 
> There were some discussions last October in virtio-comment@lists.linux.dev mailing list.


That's it I could not find it. Could you include the archive link pls? 


> At that moment, it is suggested to make Linux kernel accept new comments for SKB_GSO_TCP_ECN and SKB_GSO_TCP_ACCECN first.
> So, could virtio-spec colleague give your feedback? (Parav?).
> 
> Otherwise, the CWR handling of virtio will be wrong after all Accurate ECN commits are merged in Linux.
> 
> Chia-Yu

if there's a general agreement we don't need to block linux on tc
approval.

-- 
MST


^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH v1 net-next 3/3] virtio_net: Accurate ECN flag in virtio_net_hdr
  2026-02-02 17:19       ` Michael S. Tsirkin
@ 2026-02-02 21:09         ` Chia-Yu Chang (Nokia)
  2026-02-02 23:45           ` Michael S. Tsirkin
  0 siblings, 1 reply; 15+ messages in thread
From: Chia-Yu Chang (Nokia) @ 2026-02-02 21:09 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: tariqt@nvidia.com, linux-rdma@vger.kernel.org,
	shaojijie@huawei.com, shenjian15@huawei.com,
	salil.mehta@huawei.com, mbloch@nvidia.com, saeedm@nvidia.com,
	leon@kernel.org, eperezma@redhat.com, brett.creeley@amd.com,
	jasowang@redhat.com, virtualization@lists.linux.dev,
	xuanzhuo@linux.alibaba.com, pabeni@redhat.com,
	edumazet@google.com, parav@nvidia.com, linux-doc@vger.kernel.org,
	corbet@lwn.net, horms@kernel.org, dsahern@kernel.org,
	kuniyu@google.com, bpf@vger.kernel.org, netdev@vger.kernel.org,
	dave.taht@gmail.com, jhs@mojatatu.com, kuba@kernel.org,
	stephen@networkplumber.org, xiyou.wangcong@gmail.com,
	jiri@resnulli.us, davem@davemloft.net, andrew+netdev@lunn.ch,
	donald.hunter@gmail.com, ast@fiberby.net, liuhangbin@gmail.com,
	shuah@kernel.org, linux-kselftest@vger.kernel.org, ij@kernel.org,
	ncardwell@google.com, Koen De Schepper (Nokia),
	g.white@cablelabs.com, ingemar.s.johansson@ericsson.com,
	mirja.kuehlewind@ericsson.com, cheshire@apple.com, rs.ietf@gmx.at,
	Jason_Livingood@comcast.com, vidhi_goel@apple.com

> -----Original Message-----
> From: Michael S. Tsirkin <mst@redhat.com> 
> Sent: Monday, February 2, 2026 6:20 PM
> To: Chia-Yu Chang (Nokia) <chia-yu.chang@nokia-bell-labs.com>
> Cc: tariqt@nvidia.com; linux-rdma@vger.kernel.org; shaojijie@huawei.com; shenjian15@huawei.com; salil.mehta@huawei.com; mbloch@nvidia.com; saeedm@nvidia.com; leon@kernel.org; eperezma@redhat.com; brett.creeley@amd.com; jasowang@redhat.com; virtualization@lists.linux.dev; xuanzhuo@linux.alibaba.com; pabeni@redhat.com; edumazet@google.com; parav@nvidia.com; linux-doc@vger.kernel.org; corbet@lwn.net; horms@kernel.org; dsahern@kernel.org; kuniyu@google.com; bpf@vger.kernel.org; netdev@vger.kernel.org; dave.taht@gmail.com; jhs@mojatatu.com; kuba@kernel.org; stephen@networkplumber.org; xiyou.wangcong@gmail.com; jiri@resnulli.us; davem@davemloft.net; andrew+netdev@lunn.ch; donald.hunter@gmail.com; ast@fiberby.net; liuhangbin@gmail.com; shuah@kernel.org; linux-kselftest@vger.kernel.org; ij@kernel.org; ncardwell@google.com; Koen De Schepper (Nokia) <koen.de_schepper@nokia-bell-labs.com>; g.white@cablelabs.com; ingemar.s.johansson@ericsson.com; mirja.kuehlewind@ericsson.com; cheshire@apple.com; rs.ietf@gmx.at; Jason_Livingood@comcast.com; vidhi_goel@apple.com
> Subject: Re: [PATCH v1 net-next 3/3] virtio_net: Accurate ECN flag in virtio_net_hdr
> 
> 
> CAUTION: This is an external email. Please be very careful when clicking links or opening attachments. See the URL nok.it/ext for additional information.
> 
> 
> 
> On Mon, Feb 02, 2026 at 04:56:38PM +0000, Chia-Yu Chang (Nokia) wrote:
> > > -----Original Message-----
> > > From: Michael S. Tsirkin <mst@redhat.com>
> > > Sent: Sunday, February 1, 2026 10:18 AM
> > > To: Chia-Yu Chang (Nokia) <chia-yu.chang@nokia-bell-labs.com>
> > > Cc: tariqt@nvidia.com; linux-rdma@vger.kernel.org; 
> > > shaojijie@huawei.com; shenjian15@huawei.com; salil.mehta@huawei.com; 
> > > mbloch@nvidia.com; saeedm@nvidia.com; leon@kernel.org; 
> > > eperezma@redhat.com; brett.creeley@amd.com; jasowang@redhat.com; 
> > > virtualization@lists.linux.dev; xuanzhuo@linux.alibaba.com; 
> > > pabeni@redhat.com; edumazet@google.com; parav@nvidia.com; 
> > > linux-doc@vger.kernel.org; corbet@lwn.net; horms@kernel.org; 
> > > dsahern@kernel.org; kuniyu@google.com; bpf@vger.kernel.org; 
> > > netdev@vger.kernel.org; dave.taht@gmail.com; jhs@mojatatu.com; 
> > > kuba@kernel.org; stephen@networkplumber.org; 
> > > xiyou.wangcong@gmail.com; jiri@resnulli.us; davem@davemloft.net; 
> > > andrew+netdev@lunn.ch; donald.hunter@gmail.com; ast@fiberby.net; 
> > > liuhangbin@gmail.com; shuah@kernel.org; 
> > > linux-kselftest@vger.kernel.org; ij@kernel.org; 
> > > ncardwell@google.com; Koen De Schepper (Nokia) 
> > > <koen.de_schepper@nokia-bell-labs.com>; g.white@cablelabs.com; 
> > > ingemar.s.johansson@ericsson.com; mirja.kuehlewind@ericsson.com; 
> > > cheshire@apple.com; rs.ietf@gmx.at; Jason_Livingood@comcast.com; 
> > > vidhi_goel@apple.com
> > > Subject: Re: [PATCH v1 net-next 3/3] virtio_net: Accurate ECN flag 
> > > in virtio_net_hdr
> > >
> > >
> > > CAUTION: This is an external email. Please be very careful when clicking links or opening attachments. See the URL nok.it/ext for additional information.
> > >
> > >
> > >
> > > Thanks for the patch! Yet something to improve:
> > >
> > > On Sat, Jan 31, 2026 at 11:55:10PM +0100, chia-yu.chang@nokia-bell-labs.com wrote:
> > > > From: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
> > > >
> > > > Unlike RFC 3168 ECN, accurate ECN uses the CWR flag as part of the 
> > > > ACE field to count new packets with CE mark; however, it will be 
> > > > corrupted by the RFC 3168 ECN-aware TSO. Therefore, fallback shall 
> > > > be applied by seting NETIF_F_GSO_ACCECN to ensure that the CWR 
> > > > flag should not be changed within a super-skb.
> > > >
> > > > To apply the aforementieond new AccECN GSO for virtio, new featue 
> > > > bits for host and guest are added for feature negotiation between 
> > > > driver and device. And the translation of Accurate ECN GSO flag 
> > > > between virtio_net_hdr and skb header for NETIF_F_GSO_ACCECN is 
> > > > also added to avoid CWR flag corruption due to RFC3168 ECN TSO.
> > > >
> > > > Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
> > >
> > >
> > > To the best of my understanding, this is a new feature - support for VIRTIO_NET_F_HOST_ACCECN, VIRTIO_NET_F_GUEST_ACCECN?
> > > The commit log makes it sound like it fixes some behaviour for existing hardware, but that is not the case.
> > >
> >
> > Thansk for the feedback, I will update commit message in v3.
> > >
> > > > ---
> > > > v2:
> > > > - Replace VIRTIO_NET_HDR_GSO_ECN with VIRTIO_NET_HDR_GSO_ECN_FLAGS
> > >
> > > but where is v2? this is v1...
> >
> > I shall update this version as v2, will do at the next version.
> >
> > [...]
> > > > diff --git a/include/uapi/linux/virtio_net.h 
> > > > b/include/uapi/linux/virtio_net.h index 1db45b01532b..af5bfe45aa1f
> > > > 100644
> > > > --- a/include/uapi/linux/virtio_net.h
> > > > +++ b/include/uapi/linux/virtio_net.h
> > > > @@ -56,6 +56,8 @@
> > > >  #define VIRTIO_NET_F_MQ      22      /* Device supports Receive Flow
> > > >                                        * Steering */
> > > >  #define VIRTIO_NET_F_CTRL_MAC_ADDR 23        /* Set MAC address */
> > > > +#define VIRTIO_NET_F_HOST_ACCECN 25  /* Host can handle GSO of 
> > > > +AccECN */ #define VIRTIO_NET_F_GUEST_ACCECN 26 /* Guest can 
> > > > +handle GSO of AccECN */
> > > >  #define VIRTIO_NET_F_DEVICE_STATS 50 /* Device can provide 
> > > > device-level statistics. */  #define VIRTIO_NET_F_VQ_NOTF_COAL 52 /* Device supports virtqueue notification coalescing */
> > > >  #define VIRTIO_NET_F_NOTF_COAL       53      /* Device supports notifications coalescing */
> > > > @@ -165,6 +167,9 @@ struct virtio_net_hdr_v1 {  #define 
> > > > VIRTIO_NET_HDR_GSO_UDP_TUNNEL (VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV4 | \
> > > >                                      VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV6)
> > > >  #define VIRTIO_NET_HDR_GSO_ECN               0x80    /* TCP has ECN set */
> > > > +#define VIRTIO_NET_HDR_GSO_ACCECN    0x10    /* TCP AccECN segmentation */
> > > > +#define VIRTIO_NET_HDR_GSO_ECN_FLAGS (VIRTIO_NET_HDR_GSO_ECN | \
> > > > +                                      VIRTIO_NET_HDR_GSO_ACCECN)
> > > >       __u8 gso_type;
> > > >       __virtio16 hdr_len;     /* Ethernet + IP + tcp/udp hdrs */
> > > >       __virtio16 gso_size;    /* Bytes to append to hdr_len per frame */
> > >
> > >
> > > UAPI changes need to be added to the virtio spec.
> > > Pls get this approved by the virtio TC.
> > > Thanks!
> >
> > There were some discussions last October in virtio-comment@lists.linux.dev mailing list.
> 
> 
> That's it I could not find it. Could you include the archive link pls?

The email thread I found is https://yhbt.net/lore/all/20250814120118.81787-1-chia-yu.chang@nokia-bell-labs.com/T/#m62dd5e559a68e8d3e5872e85d37c924f65fc7033

There were discussions about updating the documents of SKB_GSO_TCP_ECN and SKB_GSO_TCP_ACCECN, and you can find it in the first patch of this series.

> 
> 
> > At that moment, it is suggested to make Linux kernel accept new comments for SKB_GSO_TCP_ECN and SKB_GSO_TCP_ACCECN first.
> > So, could virtio-spec colleague give your feedback? (Parav?).
> >
> > Otherwise, the CWR handling of virtio will be wrong after all Accurate ECN commits are merged in Linux.
> >
> > Chia-Yu
> 
> if there's a general agreement we don't need to block linux on tc approval.
> 
> --
> MST

Shall I also submit patches to virtio-spec? Please suggest ways forwards.

Thanks!

Chia-Yu

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v1 net-next 3/3] virtio_net: Accurate ECN flag in virtio_net_hdr
  2026-02-02 21:09         ` Chia-Yu Chang (Nokia)
@ 2026-02-02 23:45           ` Michael S. Tsirkin
  0 siblings, 0 replies; 15+ messages in thread
From: Michael S. Tsirkin @ 2026-02-02 23:45 UTC (permalink / raw)
  To: Chia-Yu Chang (Nokia)
  Cc: tariqt@nvidia.com, linux-rdma@vger.kernel.org,
	shaojijie@huawei.com, shenjian15@huawei.com,
	salil.mehta@huawei.com, mbloch@nvidia.com, saeedm@nvidia.com,
	leon@kernel.org, eperezma@redhat.com, brett.creeley@amd.com,
	jasowang@redhat.com, virtualization@lists.linux.dev,
	xuanzhuo@linux.alibaba.com, pabeni@redhat.com,
	edumazet@google.com, parav@nvidia.com, linux-doc@vger.kernel.org,
	corbet@lwn.net, horms@kernel.org, dsahern@kernel.org,
	kuniyu@google.com, bpf@vger.kernel.org, netdev@vger.kernel.org,
	dave.taht@gmail.com, jhs@mojatatu.com, kuba@kernel.org,
	stephen@networkplumber.org, xiyou.wangcong@gmail.com,
	jiri@resnulli.us, davem@davemloft.net, andrew+netdev@lunn.ch,
	donald.hunter@gmail.com, ast@fiberby.net, liuhangbin@gmail.com,
	shuah@kernel.org, linux-kselftest@vger.kernel.org, ij@kernel.org,
	ncardwell@google.com, Koen De Schepper (Nokia),
	g.white@cablelabs.com, ingemar.s.johansson@ericsson.com,
	mirja.kuehlewind@ericsson.com, cheshire@apple.com, rs.ietf@gmx.at,
	Jason_Livingood@comcast.com, vidhi_goel@apple.com

On Mon, Feb 02, 2026 at 09:09:28PM +0000, Chia-Yu Chang (Nokia) wrote:
> > -----Original Message-----
> > From: Michael S. Tsirkin <mst@redhat.com> 
> > Sent: Monday, February 2, 2026 6:20 PM
> > To: Chia-Yu Chang (Nokia) <chia-yu.chang@nokia-bell-labs.com>
> > Cc: tariqt@nvidia.com; linux-rdma@vger.kernel.org; shaojijie@huawei.com; shenjian15@huawei.com; salil.mehta@huawei.com; mbloch@nvidia.com; saeedm@nvidia.com; leon@kernel.org; eperezma@redhat.com; brett.creeley@amd.com; jasowang@redhat.com; virtualization@lists.linux.dev; xuanzhuo@linux.alibaba.com; pabeni@redhat.com; edumazet@google.com; parav@nvidia.com; linux-doc@vger.kernel.org; corbet@lwn.net; horms@kernel.org; dsahern@kernel.org; kuniyu@google.com; bpf@vger.kernel.org; netdev@vger.kernel.org; dave.taht@gmail.com; jhs@mojatatu.com; kuba@kernel.org; stephen@networkplumber.org; xiyou.wangcong@gmail.com; jiri@resnulli.us; davem@davemloft.net; andrew+netdev@lunn.ch; donald.hunter@gmail.com; ast@fiberby.net; liuhangbin@gmail.com; shuah@kernel.org; linux-kselftest@vger.kernel.org; ij@kernel.org; ncardwell@google.com; Koen De Schepper (Nokia) <koen.de_schepper@nokia-bell-labs.com>; g.white@cablelabs.com; ingemar.s.johansson@ericsson.com; mirja.kuehlewind@ericsson.com; cheshire@apple.com; rs.ietf@gmx.at; Jason_Livingood@comcast.com; vidhi_goel@apple.com
> > Subject: Re: [PATCH v1 net-next 3/3] virtio_net: Accurate ECN flag in virtio_net_hdr
> > 
> > 
> > CAUTION: This is an external email. Please be very careful when clicking links or opening attachments. See the URL nok.it/ext for additional information.
> > 
> > 
> > 
> > On Mon, Feb 02, 2026 at 04:56:38PM +0000, Chia-Yu Chang (Nokia) wrote:
> > > > -----Original Message-----
> > > > From: Michael S. Tsirkin <mst@redhat.com>
> > > > Sent: Sunday, February 1, 2026 10:18 AM
> > > > To: Chia-Yu Chang (Nokia) <chia-yu.chang@nokia-bell-labs.com>
> > > > Cc: tariqt@nvidia.com; linux-rdma@vger.kernel.org; 
> > > > shaojijie@huawei.com; shenjian15@huawei.com; salil.mehta@huawei.com; 
> > > > mbloch@nvidia.com; saeedm@nvidia.com; leon@kernel.org; 
> > > > eperezma@redhat.com; brett.creeley@amd.com; jasowang@redhat.com; 
> > > > virtualization@lists.linux.dev; xuanzhuo@linux.alibaba.com; 
> > > > pabeni@redhat.com; edumazet@google.com; parav@nvidia.com; 
> > > > linux-doc@vger.kernel.org; corbet@lwn.net; horms@kernel.org; 
> > > > dsahern@kernel.org; kuniyu@google.com; bpf@vger.kernel.org; 
> > > > netdev@vger.kernel.org; dave.taht@gmail.com; jhs@mojatatu.com; 
> > > > kuba@kernel.org; stephen@networkplumber.org; 
> > > > xiyou.wangcong@gmail.com; jiri@resnulli.us; davem@davemloft.net; 
> > > > andrew+netdev@lunn.ch; donald.hunter@gmail.com; ast@fiberby.net; 
> > > > liuhangbin@gmail.com; shuah@kernel.org; 
> > > > linux-kselftest@vger.kernel.org; ij@kernel.org; 
> > > > ncardwell@google.com; Koen De Schepper (Nokia) 
> > > > <koen.de_schepper@nokia-bell-labs.com>; g.white@cablelabs.com; 
> > > > ingemar.s.johansson@ericsson.com; mirja.kuehlewind@ericsson.com; 
> > > > cheshire@apple.com; rs.ietf@gmx.at; Jason_Livingood@comcast.com; 
> > > > vidhi_goel@apple.com
> > > > Subject: Re: [PATCH v1 net-next 3/3] virtio_net: Accurate ECN flag 
> > > > in virtio_net_hdr
> > > >
> > > >
> > > > CAUTION: This is an external email. Please be very careful when clicking links or opening attachments. See the URL nok.it/ext for additional information.
> > > >
> > > >
> > > >
> > > > Thanks for the patch! Yet something to improve:
> > > >
> > > > On Sat, Jan 31, 2026 at 11:55:10PM +0100, chia-yu.chang@nokia-bell-labs.com wrote:
> > > > > From: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
> > > > >
> > > > > Unlike RFC 3168 ECN, accurate ECN uses the CWR flag as part of the 
> > > > > ACE field to count new packets with CE mark; however, it will be 
> > > > > corrupted by the RFC 3168 ECN-aware TSO. Therefore, fallback shall 
> > > > > be applied by seting NETIF_F_GSO_ACCECN to ensure that the CWR 
> > > > > flag should not be changed within a super-skb.
> > > > >
> > > > > To apply the aforementieond new AccECN GSO for virtio, new featue 
> > > > > bits for host and guest are added for feature negotiation between 
> > > > > driver and device. And the translation of Accurate ECN GSO flag 
> > > > > between virtio_net_hdr and skb header for NETIF_F_GSO_ACCECN is 
> > > > > also added to avoid CWR flag corruption due to RFC3168 ECN TSO.
> > > > >
> > > > > Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
> > > >
> > > >
> > > > To the best of my understanding, this is a new feature - support for VIRTIO_NET_F_HOST_ACCECN, VIRTIO_NET_F_GUEST_ACCECN?
> > > > The commit log makes it sound like it fixes some behaviour for existing hardware, but that is not the case.
> > > >
> > >
> > > Thansk for the feedback, I will update commit message in v3.
> > > >
> > > > > ---
> > > > > v2:
> > > > > - Replace VIRTIO_NET_HDR_GSO_ECN with VIRTIO_NET_HDR_GSO_ECN_FLAGS
> > > >
> > > > but where is v2? this is v1...
> > >
> > > I shall update this version as v2, will do at the next version.
> > >
> > > [...]
> > > > > diff --git a/include/uapi/linux/virtio_net.h 
> > > > > b/include/uapi/linux/virtio_net.h index 1db45b01532b..af5bfe45aa1f
> > > > > 100644
> > > > > --- a/include/uapi/linux/virtio_net.h
> > > > > +++ b/include/uapi/linux/virtio_net.h
> > > > > @@ -56,6 +56,8 @@
> > > > >  #define VIRTIO_NET_F_MQ      22      /* Device supports Receive Flow
> > > > >                                        * Steering */
> > > > >  #define VIRTIO_NET_F_CTRL_MAC_ADDR 23        /* Set MAC address */
> > > > > +#define VIRTIO_NET_F_HOST_ACCECN 25  /* Host can handle GSO of 
> > > > > +AccECN */ #define VIRTIO_NET_F_GUEST_ACCECN 26 /* Guest can 
> > > > > +handle GSO of AccECN */
> > > > >  #define VIRTIO_NET_F_DEVICE_STATS 50 /* Device can provide 
> > > > > device-level statistics. */  #define VIRTIO_NET_F_VQ_NOTF_COAL 52 /* Device supports virtqueue notification coalescing */
> > > > >  #define VIRTIO_NET_F_NOTF_COAL       53      /* Device supports notifications coalescing */
> > > > > @@ -165,6 +167,9 @@ struct virtio_net_hdr_v1 {  #define 
> > > > > VIRTIO_NET_HDR_GSO_UDP_TUNNEL (VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV4 | \
> > > > >                                      VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV6)
> > > > >  #define VIRTIO_NET_HDR_GSO_ECN               0x80    /* TCP has ECN set */
> > > > > +#define VIRTIO_NET_HDR_GSO_ACCECN    0x10    /* TCP AccECN segmentation */
> > > > > +#define VIRTIO_NET_HDR_GSO_ECN_FLAGS (VIRTIO_NET_HDR_GSO_ECN | \
> > > > > +                                      VIRTIO_NET_HDR_GSO_ACCECN)
> > > > >       __u8 gso_type;
> > > > >       __virtio16 hdr_len;     /* Ethernet + IP + tcp/udp hdrs */
> > > > >       __virtio16 gso_size;    /* Bytes to append to hdr_len per frame */
> > > >
> > > >
> > > > UAPI changes need to be added to the virtio spec.
> > > > Pls get this approved by the virtio TC.
> > > > Thanks!
> > >
> > > There were some discussions last October in virtio-comment@lists.linux.dev mailing list.
> > 
> > 
> > That's it I could not find it. Could you include the archive link pls?
> 
> The email thread I found is https://yhbt.net/lore/all/20250814120118.81787-1-chia-yu.chang@nokia-bell-labs.com/T/#m62dd5e559a68e8d3e5872e85d37c924f65fc7033

or

https://lore.kernel.org/all/20250814120118.81787-1-chia-yu.chang@nokia-bell-labs.com/


> There were discussions about updating the documents of SKB_GSO_TCP_ECN and SKB_GSO_TCP_ACCECN, and you can find it in the first patch of this series.

document this in commit log and cover letter pls.

> > 
> > 
> > > At that moment, it is suggested to make Linux kernel accept new comments for SKB_GSO_TCP_ECN and SKB_GSO_TCP_ACCECN first.
> > > So, could virtio-spec colleague give your feedback? (Parav?).
> > >
> > > Otherwise, the CWR handling of virtio will be wrong after all Accurate ECN commits are merged in Linux.
> > >
> > > Chia-Yu
> > 
> > if there's a general agreement we don't need to block linux on tc approval.
> > 
> > --
> > MST
> 
> Shall I also submit patches to virtio-spec? Please suggest ways forwards.
> 
> Thanks!
> 
> Chia-Yu


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-02-02 23:45 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-31 22:55 [PATCH v1 net-next 0/3] ECN offload handling for AccECN series chia-yu.chang
2026-01-31 22:55 ` [PATCH v1 net-next 1/3] net: update commnets for SKB_GSO_TCP_ECN and SKB_GSO_TCP_ACCECN chia-yu.chang
2026-02-01  9:01   ` Michael S. Tsirkin
2026-01-31 22:55 ` [PATCH v1 net-next 2/3] net: hns3/mlx5e: avoid corrupting CWR flag when receiving GRO packet chia-yu.chang
2026-02-01  9:05   ` Michael S. Tsirkin
2026-02-02 16:44     ` Chia-Yu Chang (Nokia)
2026-01-31 22:55 ` [PATCH v1 net-next 3/3] virtio_net: Accurate ECN flag in virtio_net_hdr chia-yu.chang
2026-02-01  9:17   ` Michael S. Tsirkin
2026-02-02 16:56     ` Chia-Yu Chang (Nokia)
2026-02-02 17:19       ` Michael S. Tsirkin
2026-02-02 21:09         ` Chia-Yu Chang (Nokia)
2026-02-02 23:45           ` Michael S. Tsirkin
2026-02-01  0:45 ` [PATCH v1 net-next 0/3] ECN offload handling for AccECN series Jakub Kicinski
2026-02-02 14:10   ` Chia-Yu Chang (Nokia)
  -- strict thread matches above, loose matches on Subject: below --
2026-01-28 14:44 chia-yu.chang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox