[v5] net/ice: fix RSS advanced rule invalid issue

Message ID 20200407014817.25163-1-junyux.jiang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: xiaolong ye
Headers
Series [v5] net/ice: fix RSS advanced rule invalid issue |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/travis-robot success Travis build: passed
ci/Intel-compilation success Compilation OK

Commit Message

Junyu Jiang April 7, 2020, 1:48 a.m. UTC
  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@dpdk.org

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

Comments

He, Zhiwei April 7, 2020, 2:18 a.m. UTC | #1
The patch V5 has test-by Zhiwei<Zhiwei.he@intel.com>

-----Original Message-----
From: dev <dev-bounces@dpdk.org> On Behalf Of Junyu Jiang
Sent: Tuesday, April 7, 2020 9:48 AM
To: dev@dpdk.org
Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Yang, Qiming <qiming.yang@intel.com>; Jiang, JunyuX <junyux.jiang@intel.com>; stable@dpdk.org
Subject: [dpdk-dev] [PATCH v5] 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@dpdk.org

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

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 85ef83e92..90a91c9c1 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,32 @@ 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;
+	}
+
+	return 0;
+}
+
 static void
 __vsi_queues_bind_intr(struct ice_vsi *vsi, uint16_t msix_vect,
 		       int base_queue, int nb_queue)
@@ -2797,12 +2805,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
  
Qiming Yang April 7, 2020, 5:13 a.m. UTC | #2
Acked-by: Qiming Yang <qiming.yang@intel.com>

> -----Original Message-----
> From: Jiang, JunyuX <junyux.jiang@intel.com>
> Sent: 2020年4月7日 9:48
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>; Jiang, JunyuX <junyux.jiang@intel.com>;
> stable@dpdk.org
> Subject: [PATCH v5] 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@dpdk.org
> 
> Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
> ---
>  drivers/net/ice/ice_ethdev.c | 50 +++++++++++++++++++-----------------
>  1 file changed, 26 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index
> 85ef83e92..90a91c9c1 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,32 @@ 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;
> +	}
> +
> +	return 0;
> +}
> +
>  static void
>  __vsi_queues_bind_intr(struct ice_vsi *vsi, uint16_t msix_vect,
>  		       int base_queue, int nb_queue)
> @@ -2797,12 +2805,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
  
Xiaolong Ye April 8, 2020, 6:43 a.m. UTC | #3
On 04/07, Junyu Jiang wrote:
>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@dpdk.org
>
>Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
>---
> drivers/net/ice/ice_ethdev.c | 50 +++++++++++++++++++-----------------
> 1 file changed, 26 insertions(+), 24 deletions(-)
>
>diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
>index 85ef83e92..90a91c9c1 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,32 @@ 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;
>+	}
>+
>+	return 0;
>+}
>+
> static void
> __vsi_queues_bind_intr(struct ice_vsi *vsi, uint16_t msix_vect,
> 		       int base_queue, int nb_queue)
>@@ -2797,12 +2805,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
>

Applied to dpdk-next-net-intel, Thanks.
  

Patch

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 85ef83e92..90a91c9c1 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,32 @@  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;
+	}
+
+	return 0;
+}
+
 static void
 __vsi_queues_bind_intr(struct ice_vsi *vsi, uint16_t msix_vect,
 		       int base_queue, int nb_queue)
@@ -2797,12 +2805,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);