[dpdk-stable] [PATCH 18.11] net/avf: fix RSS RETA settings invalid

Kevin Traynor ktraynor at redhat.com
Wed Oct 14 12:12:07 CEST 2020


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 at intel.com>
> Acked-by: Qiming Yang <qiming.yang at 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;
>  }
>  
> 



More information about the stable mailing list