patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 18.11] net/avf: fix RSS RETA settings invalid
@ 2020-10-14  8:37 Junyu Jiang
  2020-10-14 10:12 ` Kevin Traynor
  0 siblings, 1 reply; 2+ messages in thread
From: Junyu Jiang @ 2020-10-14  8:37 UTC (permalink / raw)
  To: stable; +Cc: Junyu Jiang

[ upstream commit 1feb8e3f4e5c69071e5c461132a8b1bad05609af ]

This patch moved the RSS initialization from dev start to
dev configure, to fix the issue that RSS redirection table
can not be kept after restarting port.

Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")

Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
---
 drivers/net/avf/avf_ethdev.c | 76 ++++++++++++++++++------------------
 1 file changed, 37 insertions(+), 39 deletions(-)

diff --git a/drivers/net/avf/avf_ethdev.c b/drivers/net/avf/avf_ethdev.c
index 13eec1b45..6033034b1 100644
--- a/drivers/net/avf/avf_ethdev.c
+++ b/drivers/net/avf/avf_ethdev.c
@@ -120,36 +120,6 @@ static const struct eth_dev_ops avf_eth_dev_ops = {
 	.rx_queue_intr_disable      = avf_dev_rx_queue_intr_disable,
 };
 
-static int
-avf_dev_configure(struct rte_eth_dev *dev)
-{
-	struct avf_adapter *ad =
-		AVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
-	struct avf_info *vf =  AVF_DEV_PRIVATE_TO_VF(ad);
-	struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
-
-	ad->rx_bulk_alloc_allowed = true;
-#ifdef RTE_LIBRTE_AVF_INC_VECTOR
-	/* Initialize to TRUE. If any of Rx queues doesn't meet the
-	 * vector Rx/Tx preconditions, it will be reset.
-	 */
-	ad->rx_vec_allowed = true;
-	ad->tx_vec_allowed = true;
-#else
-	ad->rx_vec_allowed = false;
-	ad->tx_vec_allowed = false;
-#endif
-
-	/* Vlan stripping setting */
-	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) {
-		if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP)
-			avf_enable_vlan_strip(ad);
-		else
-			avf_disable_vlan_strip(ad);
-	}
-	return 0;
-}
-
 static int
 avf_init_rss(struct avf_adapter *adapter)
 {
@@ -206,6 +176,43 @@ avf_init_rss(struct avf_adapter *adapter)
 	return 0;
 }
 
+static int
+avf_dev_configure(struct rte_eth_dev *dev)
+{
+	struct avf_adapter *ad =
+		AVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
+	struct avf_info *vf =  AVF_DEV_PRIVATE_TO_VF(ad);
+	struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
+
+	ad->rx_bulk_alloc_allowed = true;
+#ifdef RTE_LIBRTE_AVF_INC_VECTOR
+	/* Initialize to TRUE. If any of Rx queues doesn't meet the
+	 * vector Rx/Tx preconditions, it will be reset.
+	 */
+	ad->rx_vec_allowed = true;
+	ad->tx_vec_allowed = true;
+#else
+	ad->rx_vec_allowed = false;
+	ad->tx_vec_allowed = false;
+#endif
+
+	/* Vlan stripping setting */
+	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) {
+		if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP)
+			avf_enable_vlan_strip(ad);
+		else
+			avf_disable_vlan_strip(ad);
+	}
+
+	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RSS_PF) {
+		if (avf_init_rss(ad) != 0) {
+			PMD_DRV_LOG(ERR, "configure rss failed");
+			return -1;
+		}
+	}
+	return 0;
+}
+
 static int
 avf_init_rxq(struct rte_eth_dev *dev, struct avf_rx_queue *rxq)
 {
@@ -425,14 +432,6 @@ avf_dev_start(struct rte_eth_dev *dev)
 		PMD_DRV_LOG(ERR, "failed to do Queue init");
 		return -1;
 	}
-
-	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RSS_PF) {
-		if (avf_init_rss(adapter) != 0) {
-			PMD_DRV_LOG(ERR, "configure rss failed");
-			goto err_rss;
-		}
-	}
-
 	if (avf_configure_queues(adapter) != 0) {
 		PMD_DRV_LOG(ERR, "configure queues failed");
 		goto err_queue;
@@ -461,7 +460,6 @@ avf_dev_start(struct rte_eth_dev *dev)
 err_mac:
 	avf_add_del_all_mac_addr(adapter, FALSE);
 err_queue:
-err_rss:
 	return -1;
 }
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [PATCH 18.11] net/avf: fix RSS RETA settings invalid
  2020-10-14  8:37 [dpdk-stable] [PATCH 18.11] net/avf: fix RSS RETA settings invalid Junyu Jiang
@ 2020-10-14 10:12 ` Kevin Traynor
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Traynor @ 2020-10-14 10:12 UTC (permalink / raw)
  To: Junyu Jiang, stable

On 14/10/2020 09:37, Junyu Jiang wrote:
> [ upstream commit 1feb8e3f4e5c69071e5c461132a8b1bad05609af ]
> 
> This patch moved the RSS initialization from dev start to
> dev configure, to fix the issue that RSS redirection table
> can not be kept after restarting port.
> 
> Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
> 
> Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
> Acked-by: Qiming Yang <qiming.yang@intel.com>
> ---

Applied and removed from list of unresolved patches. Thanks.

>  drivers/net/avf/avf_ethdev.c | 76 ++++++++++++++++++------------------
>  1 file changed, 37 insertions(+), 39 deletions(-)
> 
> diff --git a/drivers/net/avf/avf_ethdev.c b/drivers/net/avf/avf_ethdev.c
> index 13eec1b45..6033034b1 100644
> --- a/drivers/net/avf/avf_ethdev.c
> +++ b/drivers/net/avf/avf_ethdev.c
> @@ -120,36 +120,6 @@ static const struct eth_dev_ops avf_eth_dev_ops = {
>  	.rx_queue_intr_disable      = avf_dev_rx_queue_intr_disable,
>  };
>  
> -static int
> -avf_dev_configure(struct rte_eth_dev *dev)
> -{
> -	struct avf_adapter *ad =
> -		AVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
> -	struct avf_info *vf =  AVF_DEV_PRIVATE_TO_VF(ad);
> -	struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
> -
> -	ad->rx_bulk_alloc_allowed = true;
> -#ifdef RTE_LIBRTE_AVF_INC_VECTOR
> -	/* Initialize to TRUE. If any of Rx queues doesn't meet the
> -	 * vector Rx/Tx preconditions, it will be reset.
> -	 */
> -	ad->rx_vec_allowed = true;
> -	ad->tx_vec_allowed = true;
> -#else
> -	ad->rx_vec_allowed = false;
> -	ad->tx_vec_allowed = false;
> -#endif
> -
> -	/* Vlan stripping setting */
> -	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) {
> -		if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP)
> -			avf_enable_vlan_strip(ad);
> -		else
> -			avf_disable_vlan_strip(ad);
> -	}
> -	return 0;
> -}
> -
>  static int
>  avf_init_rss(struct avf_adapter *adapter)
>  {
> @@ -206,6 +176,43 @@ avf_init_rss(struct avf_adapter *adapter)
>  	return 0;
>  }
>  
> +static int
> +avf_dev_configure(struct rte_eth_dev *dev)
> +{
> +	struct avf_adapter *ad =
> +		AVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
> +	struct avf_info *vf =  AVF_DEV_PRIVATE_TO_VF(ad);
> +	struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
> +
> +	ad->rx_bulk_alloc_allowed = true;
> +#ifdef RTE_LIBRTE_AVF_INC_VECTOR
> +	/* Initialize to TRUE. If any of Rx queues doesn't meet the
> +	 * vector Rx/Tx preconditions, it will be reset.
> +	 */
> +	ad->rx_vec_allowed = true;
> +	ad->tx_vec_allowed = true;
> +#else
> +	ad->rx_vec_allowed = false;
> +	ad->tx_vec_allowed = false;
> +#endif
> +
> +	/* Vlan stripping setting */
> +	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) {
> +		if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP)
> +			avf_enable_vlan_strip(ad);
> +		else
> +			avf_disable_vlan_strip(ad);
> +	}
> +
> +	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RSS_PF) {
> +		if (avf_init_rss(ad) != 0) {
> +			PMD_DRV_LOG(ERR, "configure rss failed");
> +			return -1;
> +		}
> +	}
> +	return 0;
> +}
> +
>  static int
>  avf_init_rxq(struct rte_eth_dev *dev, struct avf_rx_queue *rxq)
>  {
> @@ -425,14 +432,6 @@ avf_dev_start(struct rte_eth_dev *dev)
>  		PMD_DRV_LOG(ERR, "failed to do Queue init");
>  		return -1;
>  	}
> -
> -	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RSS_PF) {
> -		if (avf_init_rss(adapter) != 0) {
> -			PMD_DRV_LOG(ERR, "configure rss failed");
> -			goto err_rss;
> -		}
> -	}
> -
>  	if (avf_configure_queues(adapter) != 0) {
>  		PMD_DRV_LOG(ERR, "configure queues failed");
>  		goto err_queue;
> @@ -461,7 +460,6 @@ avf_dev_start(struct rte_eth_dev *dev)
>  err_mac:
>  	avf_add_del_all_mac_addr(adapter, FALSE);
>  err_queue:
> -err_rss:
>  	return -1;
>  }
>  
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-14 10:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-14  8:37 [dpdk-stable] [PATCH 18.11] net/avf: fix RSS RETA settings invalid Junyu Jiang
2020-10-14 10:12 ` Kevin Traynor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).