[dpdk-dev] [PATCH v2 17/32] net/i40e: set VF broadcast mode from PF
Ferruh Yigit
ferruh.yigit at intel.com
Wed Dec 7 15:32:40 CET 2016
On 12/7/2016 3:32 AM, Wenzhuo Lu wrote:
> Support enabling/disabling VF broadcast mode from PF.
> User can call the API on PF to enable/disable a specific
> VF's broadcast mode.
>
> Signed-off-by: Bernard Iremonger <bernard.iremonger at intel.com>
<...>
> +int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id, uint8_t on)
> +{
> + struct rte_eth_dev *dev;
> + struct rte_eth_dev_info dev_info;
> + struct i40e_pf *pf;
> + struct i40e_pf_vf *vf;
> + struct i40e_hw *hw;
> + int ret;
> +
> + RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
> +
> + dev = &rte_eth_devices[port];
> + rte_eth_dev_info_get(port, &dev_info);
> +
> + if (vf_id >= dev_info.max_vfs)
> + return -EINVAL;
> +
> + if (on > 1)
> + return -EINVAL;
> +
> + pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
> + hw = I40E_PF_TO_HW(pf);
> +
> + if (vf_id > pf->vf_num)
if (vf_id > pf->vf_num - 1 || !pf->vfs)
> + return -EINVAL;
> +
<...>
More information about the dev
mailing list