Skip to content

Commit

Permalink
net/i40e: fix VLAN stripping in VF
Browse files Browse the repository at this point in the history
[ upstream commit 95ba3f7 ]

When VF adds VLAN, Linux PF driver enables VLAN stripping by default,
this might have issues if the app configured DEV_RX_OFFLOAD_VLAN_STRIP.

This behavior of the Linux driver causes confusion with the DPDK app
using i40e_pmd. So it is better to reconfigure the vlan_offload, which
checks for DEV_RX_OFFLOAD_VLAN_STRIP flag in the dev_conf and enables or
disables the vlan strip in the PF.

Application cannot use rte_eth_dev_set_vlan_offload() to set
the VLAN_STRIP, as this will only work for the first time when
original and current config mismatch, but for all subsequent call
it will be ignored.

Fixes: 4861cde ("i40e: new poll mode driver")

Signed-off-by: Souvik Dey <sodey@rbbn.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
  • Loading branch information
DeySouvik authored and cpaelzer committed Feb 2, 2021
1 parent cb93e1f commit 2e89d3c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion drivers/net/i40e/i40e_ethdev_vf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1056,8 +1056,18 @@ i40evf_add_vlan(struct rte_eth_dev *dev, uint16_t vlanid)
args.out_buffer = vf->aq_resp;
args.out_size = I40E_AQ_BUF_SZ;
err = i40evf_execute_vf_cmd(dev, &args);
if (err)
if (err) {
PMD_DRV_LOG(ERR, "fail to execute command OP_ADD_VLAN");
return err;
}
/**
* In linux kernel driver on receiving ADD_VLAN it enables
* VLAN_STRIP by default. So reconfigure the vlan_offload
* as it was done by the app earlier.
*/
err = i40evf_vlan_offload_set(dev, ETH_VLAN_STRIP_MASK);
if (err)
PMD_DRV_LOG(ERR, "fail to set vlan_strip");

return err;
}
Expand Down

0 comments on commit 2e89d3c

Please sign in to comment.