[dpdk-stable] patch 'net/igc: fix Rx packet size' has been queued to stable release 20.11.2

Xueming Li xuemingl at nvidia.com
Mon May 10 18:02:53 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/12/21. 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/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/8d6377e17251bff5e4e6d623ad7c751340b809bb

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 8d6377e17251bff5e4e6d623ad7c751340b809bb Mon Sep 17 00:00:00 2001
From: Alvin Zhang <alvinx.zhang at intel.com>
Date: Tue, 20 Apr 2021 10:05:20 +0800
Subject: [PATCH] net/igc: fix Rx packet size
Cc: Luca Boccassi <bluca at debian.org>

[ upstream commit be1fb9fe3cc8d2a70b76ba243eb19a4255cd8cd2 ]

When DEV_RX_OFFLOAD_KEEP_CRC is enabled, the PMD will minus 4 bytes
of CRC from the size of a packet, but the NIC will strip the CRC
because the CRC strip bit in DVMOLR register is not cleared. This
will cause the size of a packet to be 4 bytes less.

This patch updates the CRC strip bit according to whether
DEV_RX_OFFLOAD_KEEP_CRC is enabled.

Fixes: a5aeb2b9e225 ("net/igc: support Rx and Tx")

Signed-off-by: Alvin Zhang <alvinx.zhang at intel.com>
Acked-by: Haiyue Wang <haiyue.wang at intel.com>
---
 drivers/net/igc/igc_txrx.c | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/drivers/net/igc/igc_txrx.c b/drivers/net/igc/igc_txrx.c
index 4654ec41f0..c0b56e4c9b 100644
--- a/drivers/net/igc/igc_txrx.c
+++ b/drivers/net/igc/igc_txrx.c
@@ -1290,20 +1290,24 @@ igc_rx_init(struct rte_eth_dev *dev)
 	 * This needs to be done after enable.
 	 */
 	for (i = 0; i < dev->data->nb_rx_queues; i++) {
+		uint32_t dvmolr;
+
 		rxq = dev->data->rx_queues[i];
 		IGC_WRITE_REG(hw, IGC_RDH(rxq->reg_idx), 0);
-		IGC_WRITE_REG(hw, IGC_RDT(rxq->reg_idx),
-				rxq->nb_rx_desc - 1);
+		IGC_WRITE_REG(hw, IGC_RDT(rxq->reg_idx), rxq->nb_rx_desc - 1);
 
-		/* strip queue vlan offload */
-		if (rxq->offloads & DEV_RX_OFFLOAD_VLAN_STRIP) {
-			uint32_t dvmolr;
-			dvmolr = IGC_READ_REG(hw, IGC_DVMOLR(rxq->queue_id));
+		dvmolr = IGC_READ_REG(hw, IGC_DVMOLR(rxq->reg_idx));
+		if (rxq->offloads & DEV_RX_OFFLOAD_VLAN_STRIP)
+			dvmolr |= IGC_DVMOLR_STRVLAN;
+		else
+			dvmolr &= ~IGC_DVMOLR_STRVLAN;
 
-			/* If vlan been stripped off, the CRC is meaningless. */
-			dvmolr |= IGC_DVMOLR_STRVLAN | IGC_DVMOLR_STRCRC;
-			IGC_WRITE_REG(hw, IGC_DVMOLR(rxq->reg_idx), dvmolr);
-		}
+		if (offloads & DEV_RX_OFFLOAD_KEEP_CRC)
+			dvmolr &= ~IGC_DVMOLR_STRCRC;
+		else
+			dvmolr |= IGC_DVMOLR_STRCRC;
+
+		IGC_WRITE_REG(hw, IGC_DVMOLR(rxq->reg_idx), dvmolr);
 	}
 
 	return 0;
@@ -2266,12 +2270,10 @@ eth_igc_vlan_strip_queue_set(struct rte_eth_dev *dev,
 
 	reg_val = IGC_READ_REG(hw, IGC_DVMOLR(rx_queue_id));
 	if (on) {
-		/* If vlan been stripped off, the CRC is meaningless. */
-		reg_val |= IGC_DVMOLR_STRVLAN | IGC_DVMOLR_STRCRC;
+		reg_val |= IGC_DVMOLR_STRVLAN;
 		rxq->offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
 	} else {
-		reg_val &= ~(IGC_DVMOLR_STRVLAN | IGC_DVMOLR_HIDVLAN |
-				IGC_DVMOLR_STRCRC);
+		reg_val &= ~(IGC_DVMOLR_STRVLAN | IGC_DVMOLR_HIDVLAN);
 		rxq->offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP;
 	}
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-05-10 23:59:32.357936500 +0800
+++ 0225-net-igc-fix-Rx-packet-size.patch	2021-05-10 23:59:26.710000000 +0800
@@ -1 +1 @@
-From be1fb9fe3cc8d2a70b76ba243eb19a4255cd8cd2 Mon Sep 17 00:00:00 2001
+From 8d6377e17251bff5e4e6d623ad7c751340b809bb Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit be1fb9fe3cc8d2a70b76ba243eb19a4255cd8cd2 ]
@@ -15 +17,0 @@
-Cc: stable at dpdk.org
@@ -24 +26 @@
-index 8eaed728cc..b5489eedd2 100644
+index 4654ec41f0..c0b56e4c9b 100644
@@ -27 +29 @@
-@@ -1291,20 +1291,24 @@ igc_rx_init(struct rte_eth_dev *dev)
+@@ -1290,20 +1290,24 @@ igc_rx_init(struct rte_eth_dev *dev)
@@ -62 +64 @@
-@@ -2267,12 +2271,10 @@ eth_igc_vlan_strip_queue_set(struct rte_eth_dev *dev,
+@@ -2266,12 +2270,10 @@ eth_igc_vlan_strip_queue_set(struct rte_eth_dev *dev,


More information about the stable mailing list