[dpdk-dev] net/i40e: VF with vlan ID set from host does not work

Min Tang tommytang at gmail.com
Fri Dec 14 22:28:47 CET 2018


Hi All:

When vlan ID was set on a VF from host by "ip link set <pf> vf <vf> vlan
<vlan id>", other VF with the same ID  could not ping it. Packet capturing
showed that it could receive packets but it failed to send packet. There
was no such issue with linux driver. I understand that it needs vlan
stripping/insertion to work: PF strips vlan tag when sending packet to VF
and insert vlan tag for packets received from VF. It looked like that vlan
insertion did not work although vlan stripping worked fine.

The problem was caused by vlan stripping enabling in i40evf_init_vlan. It
worked after I made the following change. To make port vlan work, we have
to enable vlan stripping, but I don't know why enabling vlan stripping
makes vlan insertion fail. The ixgbe driver does not have the issue.

Index: git/drivers/net/i40e/i40e_ethdev_vf.c
===================================================================
--- git.orig/drivers/net/i40e/i40e_ethdev_vf.c
+++ git/drivers/net/i40e/i40e_ethdev_vf.c

@@ -1633,9 +1632,6 @@ i40evf_init_vlan(struct rte_eth_dev *dev
        struct rte_eth_dev_data *data = dev->data;
        int ret;

-       /* Apply vlan offload setting */
-       i40evf_vlan_offload_set(dev, ETH_VLAN_STRIP_MASK);
-
        /* Apply pvid setting */
        ret = i40evf_vlan_pvid_set(dev, data->dev_conf.txmode.pvid,
                                data->dev_conf.txmode.hw_vlan_insert_pvid);


More information about the dev mailing list