[dpdk-dev] [PATCH v4] net/ice: fix RSS advanced rule invalid issue

He, Zhiwei zhiwei.he at intel.com
Thu Apr 2 04:53:09 CEST 2020


The [PATCH v4] net/ice: fix RSS advanced rule invalid issue patch test -by Zhiwei.he <Zhiwei.he at intel.com>

-----Original Message-----
From: dev <dev-bounces at dpdk.org> On Behalf Of Junyu Jiang
Sent: Wednesday, April 1, 2020 4:27 PM
To: dev at dpdk.org
Cc: Zhang, Qi Z <qi.z.zhang at intel.com>; Yang, Qiming <qiming.yang at intel.com>; Jiang, JunyuX <junyux.jiang at intel.com>; stable at dpdk.org
Subject: [dpdk-dev] [PATCH v4] net/ice: fix RSS advanced rule invalid issue

This patch moved the RSS initialization from dev start to dev configure to fix RSS advanced rule invalid after running port stop and port start.

Fixes: 5ad3db8d4bdd ("net/ice: enable advanced RSS")
Cc: stable at dpdk.org

Signed-off-by: Junyu Jiang <junyux.jiang at intel.com>
---
 drivers/net/ice/ice_ethdev.c | 48 ++++++++++++++++++------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 85ef83e92..4cfdbd838 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2446,24 +2446,6 @@ ice_dev_uninit(struct rte_eth_dev *dev)
 	return 0;
 }
 
-static int
-ice_dev_configure(struct rte_eth_dev *dev) -{
-	struct ice_adapter *ad =
-		ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
-
-	/* Initialize to TRUE. If any of Rx queues doesn't meet the
-	 * bulk allocation or vector Rx preconditions we will reset it.
-	 */
-	ad->rx_bulk_alloc_allowed = true;
-	ad->tx_simple_allowed = true;
-
-	if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
-		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
-
-	return 0;
-}
-
 static int ice_init_rss(struct ice_pf *pf)  {
 	struct ice_hw *hw = ICE_PF_TO_HW(pf);
@@ -2594,6 +2576,30 @@ static int ice_init_rss(struct ice_pf *pf)
 	return 0;
 }
 
+static int
+ice_dev_configure(struct rte_eth_dev *dev) {
+	struct ice_adapter *ad =
+		ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
+	struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
+	int ret;
+
+	/* Initialize to TRUE. If any of Rx queues doesn't meet the
+	 * bulk allocation or vector Rx preconditions we will reset it.
+	 */
+	ad->rx_bulk_alloc_allowed = true;
+	ad->tx_simple_allowed = true;
+
+	if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
+	ret = ice_init_rss(pf);
+	if (ret)
+		PMD_DRV_LOG(ERR, "Failed to enable rss for PF");
+
+	return ret;
+}
+
 static void
 __vsi_queues_bind_intr(struct ice_vsi *vsi, uint16_t msix_vect,
 		       int base_queue, int nb_queue)
@@ -2797,12 +2803,6 @@ ice_dev_start(struct rte_eth_dev *dev)
 		}
 	}
 
-	ret = ice_init_rss(pf);
-	if (ret) {
-		PMD_DRV_LOG(ERR, "Failed to enable rss for PF");
-		goto rx_err;
-	}
-
 	ice_set_rx_function(dev);
 	ice_set_tx_function(dev);
 
--
2.17.1



More information about the dev mailing list