[dpdk-dev] [PATCH] net/i40e: fix FPK VF overwrite PF RSS LUT

Zhang, Qi Z qi.z.zhang at intel.com
Mon Jan 14 13:48:03 CET 2019



> -----Original Message-----
> From: Wu, Yanglong
> Sent: Monday, January 14, 2019 4:24 PM
> To: dev at dpdk.org
> Cc: Hall, Ryan E <ryan.e.hall at intel.com>; Zhang, Qi Z <qi.z.zhang at intel.com>;
> Wu, Yanglong <yanglong.wu at intel.com>; stable at dpdk.org
> Subject: [PATCH] net/i40e: fix FPK VF overwrite PF RSS LUT

I think this is not a just for FPK, but for all i40e family right?
> 
> i40e_aq_set_rss_lut should set rigister according to the vsi->type. if not, VF
> may overwrite the rigister of PF
> 
> Fixes: d0a349409bd7 ("i40e: support AQ based RSS config")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Wu Yanglong <yanglong.wu at intel.com>

It should be "Yanglong Wu"

> ---
>  drivers/net/i40e/i40e_ethdev.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index a6b97e164..d4d99edcd 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -4183,8 +4183,13 @@ i40e_get_rss_lut(struct i40e_vsi *vsi, uint8_t *lut,
> uint16_t lut_size)
>  		return -EINVAL;
> 
>  	if (pf->flags & I40E_FLAG_RSS_AQ_CAPABLE) {
> -		ret = i40e_aq_get_rss_lut(hw, vsi->vsi_id, TRUE,
> -					  lut, lut_size);
> +		if (vsi->type == I40E_VSI_SRIOV) {
> +			ret = i40e_aq_get_rss_lut(hw, vsi->vsi_id, FALSE,
> +						  lut, lut_size);
> +		} else {
> +			ret = i40e_aq_get_rss_lut(hw, vsi->vsi_id, TRUE,
> +						  lut, lut_size);
> +		}

You can simplify above code to below single line

ret = i40e_aq_get_rss_lut(hw, vsi->vsi_id, vsi->type != I40E_VSI_SRIOV, lut, lut_size);

>  		if (ret) {
>  			PMD_DRV_LOG(ERR, "Failed to get RSS lookup table");
>  			return ret;
> --
> 2.11.0



More information about the dev mailing list