patch 'net/iavf: fix data path selection' has been queued to stable release 20.11.6

Xueming Li xuemingl at nvidia.com
Tue Jun 21 10:02:39 CEST 2022


Hi,

FYI, your patch has been queued to stable release 20.11.6

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

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From e0658c31961ef7e6760aa577d50e19bc5b0d4617 Mon Sep 17 00:00:00 2001
From: Yiding Zhou <yidingx.zhou at intel.com>
Date: Sun, 8 May 2022 03:52:39 +0800
Subject: [PATCH] net/iavf: fix data path selection
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 865df516f931827580f00e65f246f49838c722bb ]

If PF driver don't support a flex Rx descriptor that required by VF,
legacy descriptor format will be negotiated to configure the hardware
queue.

The patch fixes the issue that an Rx data path that handle flexible
descriptor  (e.g.:
iavf_recv_scattered_pkts_vec_avx512_flex_rxd) is selected while the
actual hardware queues are configured as legacy due to above scenario,
which will cause following coredump.

Fixes: 12b435bf8f2f ("net/iavf: support flex desc metadata extraction")

Signed-off-by: Yiding Zhou <yidingx.zhou at intel.com>
Acked-by: Qi Zhang <qi.z.zhang at intel.com>
---
 drivers/net/iavf/iavf_rxtx.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 7554ce3593..516a1684c2 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -2370,10 +2370,24 @@ iavf_set_rx_function(struct rte_eth_dev *dev)
 	struct iavf_adapter *adapter =
 		IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+	int i;
+	struct iavf_rx_queue *rxq;
+	bool use_flex = true;
+
+	for (i = 0; i < dev->data->nb_rx_queues; i++) {
+		rxq = dev->data->rx_queues[i];
+		if (rxq->rxdid <= IAVF_RXDID_LEGACY_1) {
+			PMD_DRV_LOG(NOTICE, "request RXDID[%d] in Queue[%d] is legacy, "
+				"set rx_pkt_burst as legacy for all queues", rxq->rxdid, i);
+			use_flex = false;
+		} else if (!(vf->supported_rxdid & BIT(rxq->rxdid))) {
+			PMD_DRV_LOG(NOTICE, "request RXDID[%d] in Queue[%d] is not supported, "
+				"set rx_pkt_burst as legacy for all queues", rxq->rxdid, i);
+			use_flex = false;
+		}
+	}
 
 #ifdef RTE_ARCH_X86
-	struct iavf_rx_queue *rxq;
-	int i;
 	bool use_avx2 = false;
 #ifdef CC_AVX512_SUPPORT
 	bool use_avx512 = false;
@@ -2455,7 +2469,7 @@ iavf_set_rx_function(struct rte_eth_dev *dev)
 	if (dev->data->scattered_rx) {
 		PMD_DRV_LOG(DEBUG, "Using a Scattered Rx callback (port=%d).",
 			    dev->data->port_id);
-		if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC)
+		if (use_flex)
 			dev->rx_pkt_burst = iavf_recv_scattered_pkts_flex_rxd;
 		else
 			dev->rx_pkt_burst = iavf_recv_scattered_pkts;
@@ -2466,7 +2480,7 @@ iavf_set_rx_function(struct rte_eth_dev *dev)
 	} else {
 		PMD_DRV_LOG(DEBUG, "Using Basic Rx callback (port=%d).",
 			    dev->data->port_id);
-		if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC)
+		if (use_flex)
 			dev->rx_pkt_burst = iavf_recv_pkts_flex_rxd;
 		else
 			dev->rx_pkt_burst = iavf_recv_pkts;
-- 
2.35.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-21 15:37:53.412738993 +0800
+++ 0093-net-iavf-fix-data-path-selection.patch	2022-06-21 15:37:49.191118462 +0800
@@ -1 +1 @@
-From 865df516f931827580f00e65f246f49838c722bb Mon Sep 17 00:00:00 2001
+From e0658c31961ef7e6760aa577d50e19bc5b0d4617 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 865df516f931827580f00e65f246f49838c722bb ]
@@ -17 +19,0 @@
-Cc: stable at dpdk.org
@@ -22,2 +24,2 @@
- drivers/net/iavf/iavf_rxtx.c | 27 ++++++++++++++++++---------
- 1 file changed, 18 insertions(+), 9 deletions(-)
+ drivers/net/iavf/iavf_rxtx.c | 22 ++++++++++++++++++----
+ 1 file changed, 18 insertions(+), 4 deletions(-)
@@ -26 +28 @@
-index 345f6aeebc..d3b1a58b27 100644
+index 7554ce3593..516a1684c2 100644
@@ -29 +31 @@
-@@ -2899,14 +2899,27 @@ iavf_set_rx_function(struct rte_eth_dev *dev)
+@@ -2370,10 +2370,24 @@ iavf_set_rx_function(struct rte_eth_dev *dev)
@@ -53 +54,0 @@
- 	int check_ret;
@@ -54,0 +56 @@
+ #ifdef CC_AVX512_SUPPORT
@@ -56,16 +58 @@
--	bool use_flex = false;
- 
- 	check_ret = iavf_rx_vec_dev_check(dev);
- 	if (check_ret >= 0 &&
-@@ -2923,10 +2936,6 @@ iavf_set_rx_function(struct rte_eth_dev *dev)
- 			use_avx512 = true;
- #endif
- 
--		if (vf->vf_res->vf_cap_flags &
--			VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC)
--			use_flex = true;
--
- 		for (i = 0; i < dev->data->nb_rx_queues; i++) {
- 			rxq = dev->data->rx_queues[i];
- 			(void)iavf_rxq_vec_setup(rxq);
-@@ -3030,7 +3039,7 @@ iavf_set_rx_function(struct rte_eth_dev *dev)
+@@ -2455,7 +2469,7 @@ iavf_set_rx_function(struct rte_eth_dev *dev)
@@ -80 +67 @@
-@@ -3041,7 +3050,7 @@ iavf_set_rx_function(struct rte_eth_dev *dev)
+@@ -2466,7 +2480,7 @@ iavf_set_rx_function(struct rte_eth_dev *dev)


More information about the stable mailing list