[dpdk-dev] [PATCH v2 11/14] net/i40e: support AVF basic interface

Ferruh Yigit ferruh.yigit at intel.com
Mon Dec 4 21:04:04 CET 2017


On 11/23/2017 10:33 PM, Jingjing Wu wrote:
> Enable Virtchnl offload Caps negotiation and RSS_PF offload
> to support AVF basic interface.
> 
> Signed-off-by: Jingjing Wu <jingjing.wu at intel.com>
> ---
>  config/common_base             |   2 +-
>  drivers/net/i40e/i40e_ethdev.c |  64 +++++++++++++++----
>  drivers/net/i40e/i40e_ethdev.h |   4 ++
>  drivers/net/i40e/i40e_pf.c     | 137 +++++++++++++++++++++++++++++++++++++----
>  drivers/net/i40e/i40e_pf.h     |   6 ++

This is a i40e patch that enables AVF support, right?

I believe it would be better to separate the config change that enables the AVF
PMD by default from i40e changes patches.

<...>

> @@ -3694,14 +3695,21 @@ i40e_get_rss_lut(struct i40e_vsi *vsi, uint8_t *lut, uint16_t lut_size)
>  		uint32_t *lut_dw = (uint32_t *)lut;
>  		uint16_t i, lut_size_dw = lut_size / 4;
>  
> -		for (i = 0; i < lut_size_dw; i++)
> -			lut_dw[i] = I40E_READ_REG(hw, I40E_PFQF_HLUT(i));
> +		if (vsi->type == I40E_VSI_SRIOV) {
> +			for (i = 0; i <= lut_size_dw; i++)
> +				reg = I40E_VFQF_HLUT1(i, vsi->user_param);
> +				lut_dw[i] = i40e_read_rx_ctl(hw, reg);

this assignment is out of "for" loop.

> +		} else {
> +			for (i = 0; i < lut_size_dw; i++)
> +				lut_dw[i] = I40E_READ_REG(hw,
> +							  I40E_PFQF_HLUT(i));
> +		}
>  	}
>  
>  	return 0;
>  }
>  

<...>

> @@ -6754,8 +6784,20 @@ i40e_get_rss_key(struct i40e_vsi *vsi, uint8_t *key, uint8_t *key_len)
>  		uint32_t *key_dw = (uint32_t *)key;
>  		uint16_t i;
>  
> -		for (i = 0; i <= I40E_PFQF_HKEY_MAX_INDEX; i++)
> -			key_dw[i] = i40e_read_rx_ctl(hw, I40E_PFQF_HKEY(i));
> +		if (vsi->type == I40E_VSI_SRIOV) {
> +			for (i = 0; i <= I40E_VFQF_HKEY_MAX_INDEX; i++)
> +				reg = I40E_VFQF_HKEY1(i, vsi->user_param);
> +				key_dw[i] = i40e_read_rx_ctl(hw, reg);

This line is not part of the for loop, seems which is the intention, and all
credits goes to compiler to figuring this out.

> +				*key_len = (I40E_VFQF_HKEY_MAX_INDEX + 1) *
> +					   sizeof(uint32_t);
> +
> +		} else {
> +			for (i = 0; i <= I40E_PFQF_HKEY_MAX_INDEX; i++)
> +				reg = I40E_PFQF_HKEY(i);
> +				key_dw[i] = i40e_read_rx_ctl(hw, reg);

Same problem here, "for" scope is wrong.

<...>


More information about the dev mailing list