[dpdk-dev] Issue with rte_eth_dev_set_vlan_offload

Hemant Agrawal hemant.agrawal at nxp.com
Tue Mar 7 13:30:00 CET 2017


Hi,
               Currently the "rte_eth_dev_set_vlan_offload" support setting of three different capabilities on the port i.e. strip, filter and extend

The current implementation only returns error when this API is not implemented by the PMD.


1.      First issue is that the documentation says that "(-ENOSUP) if hardware-assisted VLAN filtering not configured." But the APIs is also about strip and extend.

2.      These are three different capabilities, NICs may support one but not other. So, this API should return the which of these capabilities are not supported by the hardware.

I see following options to fix it:

1.      This API should check the hw capabilities and return the error, if there is a mismatch.  In case of error,  it may return the hw supported mask as a possible return value.

2.      Split the APIs into three different APIs for each function.

Regards,
Hemant

/**
* Set VLAN offload configuration on an Ethernet device
* Enable/Disable Extended VLAN by an Ethernet device, This is a register setup
* available on some Intel NIC, not but all, please check the data sheet for
* availability.
* Enable/Disable VLAN Strip can be done on rx queue for certain NIC, but here
* the configuration is applied on the port level.
*
* @param port_id
*   The port identifier of the Ethernet device.
* @param offload_mask
*   The VLAN Offload bit mask can be mixed use with "OR"
*       ETH_VLAN_STRIP_OFFLOAD
*       ETH_VLAN_FILTER_OFFLOAD
*       ETH_VLAN_EXTEND_OFFLOAD
* @return
*   - (0) if successful.
*   - (-ENOSUP) if hardware-assisted VLAN filtering not configured.
*   - (-ENODEV) if *port_id* invalid.
*/
int rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask);


More information about the dev mailing list