[dpdk-dev] [PATCH v2 10/32] net/i40e: implement ops for VF stats get/reset

Ferruh Yigit ferruh.yigit at intel.com
Wed Dec 7 14:59:54 CET 2016


On 12/7/2016 3:31 AM, Wenzhuo Lu wrote:
> This patch implement vf_stats_get and vf_stats_reset ops for i40e.
> 
> Signed-off-by: Qi Zhang <qi.z.zhang at intel.com>
> ---
<...>

> +static int
> +i40e_vf_stats_get(struct rte_eth_dev *dev,
> +		  uint16_t vf,
> +		  struct rte_eth_stats *stats)
> +{
> +	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
> +	struct i40e_vsi *vsi;
> +
> +	int ret = 0;
> +
> +	if (pf->vf_num <= vf) {
> +		PMD_DRV_LOG(ERR, "Invalid VF id %d\n", vf);
> +		return -EINVAL;
> +	}

Do we need following check as it has been done in prev patches:

+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (vf_id >= dev_info.max_vfs)
+		return -EINVAL;



More information about the dev mailing list