[dpdk-dev] [PATCH v2 07/14] net/avf: enable ops for MAC VLAN offload

Ferruh Yigit ferruh.yigit at intel.com
Mon Dec 4 20:59:26 CET 2017


On 11/23/2017 10:33 PM, Jingjing Wu wrote:
>  - promiscuous_enable
>  - promiscuous_disable
>  - allmulticast_enable
>  - allmulticast_disable
>  - mac_addr_add
>  - mac_addr_remove
>  - mac_addr_set
>  - vlan_filter_set
>  - vlan_offload_set

Patch title is misleading.

> 
> Signed-off-by: Jingjing Wu <jingjing.wu at intel.com>

<....>

> +static int
> +avf_dev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
> +{
> +	struct avf_adapter *adapter =
> +		AVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
> +	struct avf_info *vf = AVF_DEV_PRIVATE_TO_VF(adapter);
> +	int err;
> +
> +	if (!(vf->vf_res->vf_offload_flags & VIRTCHNL_VF_OFFLOAD_VLAN))
> +		return -ENOTSUP;
> +
> +	err = avf_add_del_vlan(adapter, vlan_id, on);
> +	if (err)
> +		return -EIO;

Compiler complains about missing return.

> +}
> +
> +static int
> +avf_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask)
> +{
> +	struct avf_adapter *adapter =
> +		AVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
> +	struct avf_info *vf = AVF_DEV_PRIVATE_TO_VF(adapter);
> +	struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
> +	int err;
> +
> +	if (!(vf->vf_res->vf_offload_flags & VIRTCHNL_VF_OFFLOAD_VLAN))
> +		return -ENOTSUP;
> +
> +	/* Vlan stripping setting */
> +	if (mask & ETH_VLAN_STRIP_MASK) {
> +		/* Enable or disable VLAN stripping */
> +		if (dev_conf->rxmode.hw_vlan_strip)
> +			err = avf_enable_vlan_strip(adapter);
> +		else
> +			err = avf_disable_vlan_strip(adapter);
> +	}
> +
> +	if (err)
> +		return -EIO;

Same here, missing return.


More information about the dev mailing list