patch 'net/netvsc: force Tx VLAN offload on 801.2Q packet' has been queued to stable release 21.11.9

Kevin Traynor ktraynor at redhat.com
Wed Nov 27 18:18:31 CET 2024


Hi,

FYI, your patch has been queued to stable release 21.11.9

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/02/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/1958baf3103cb81b8f3f814b23f3e82d009d8b7b

Thanks.

Kevin

---
>From 1958baf3103cb81b8f3f814b23f3e82d009d8b7b Mon Sep 17 00:00:00 2001
From: Long Li <longli at microsoft.com>
Date: Fri, 18 Oct 2024 11:13:50 -0700
Subject: [PATCH] net/netvsc: force Tx VLAN offload on 801.2Q packet

[ upstream commit 06c968f9ba8afeaf03b60871a453652a5828ff3f ]

The VSP assumes the packet doesn't have VLAN tags. When VLAN tag is
present in a TX packet, always strip it and use PPI to send VLAN info
through VSP packet.

Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")

Signed-off-by: Long Li <longli at microsoft.com>
Reviewed-by: Stephen Hemminger <stephen at networkplumber.org>
---
 drivers/net/netvsc/hn_rxtx.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c
index 69588bc264..13dede941d 100644
--- a/drivers/net/netvsc/hn_rxtx.c
+++ b/drivers/net/netvsc/hn_rxtx.c
@@ -1572,7 +1572,7 @@ hn_xmit_pkts(void *ptxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 	for (nb_tx = 0; nb_tx < nb_pkts; nb_tx++) {
 		struct rte_mbuf *m = tx_pkts[nb_tx];
-		uint32_t pkt_size = m->pkt_len + HN_RNDIS_PKT_LEN;
 		struct rndis_packet_msg *pkt;
 		struct hn_txdesc *txd;
+		uint32_t pkt_size;
 
 		txd = hn_txd_get(txq);
@@ -1580,4 +1580,22 @@ hn_xmit_pkts(void *ptxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 			break;
 
+		if (!(m->ol_flags & RTE_MBUF_F_TX_VLAN)) {
+			struct rte_ether_hdr *eh =
+				rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
+			struct rte_vlan_hdr *vh;
+
+			/* Force TX vlan offloading for 801.2Q packet */
+			if (eh->ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN)) {
+				vh = (struct rte_vlan_hdr *)(eh + 1);
+				m->ol_flags |= RTE_MBUF_F_TX_VLAN;
+				m->vlan_tci = rte_be_to_cpu_16(vh->vlan_tci);
+
+				/* Copy ether header over */
+				memmove(rte_pktmbuf_adj(m, sizeof(struct rte_vlan_hdr)),
+					eh, 2 * RTE_ETHER_ADDR_LEN);
+			}
+		}
+		pkt_size = m->pkt_len + HN_RNDIS_PKT_LEN;
+
 		/* For small packets aggregate them in chimney buffer */
 		if (m->pkt_len <= hv->tx_copybreak &&
-- 
2.47.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-11-27 17:17:40.911626432 +0000
+++ 0084-net-netvsc-force-Tx-VLAN-offload-on-801.2Q-packet.patch	2024-11-27 17:17:38.285269684 +0000
@@ -1 +1 @@
-From 06c968f9ba8afeaf03b60871a453652a5828ff3f Mon Sep 17 00:00:00 2001
+From 1958baf3103cb81b8f3f814b23f3e82d009d8b7b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 06c968f9ba8afeaf03b60871a453652a5828ff3f ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index 52aedb001f..9d3948e03d 100644
+index 69588bc264..13dede941d 100644
@@ -23 +24 @@
-@@ -1558,7 +1558,7 @@ hn_xmit_pkts(void *ptxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+@@ -1572,7 +1572,7 @@ hn_xmit_pkts(void *ptxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
@@ -32 +33 @@
-@@ -1566,4 +1566,22 @@ hn_xmit_pkts(void *ptxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+@@ -1580,4 +1580,22 @@ hn_xmit_pkts(void *ptxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)



More information about the stable mailing list