From: Souvik Dey Date: Tue, 15 Dec 2020 13:28:15 +0000 (-0500) Subject: net/i40e: fix VLAN stripping in VF X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=95ba3f72110c10dd51517d6544be64854c5a1208;p=dpdk.git net/i40e: fix VLAN stripping in VF 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: 4861cde46116 ("i40e: new poll mode driver") Cc: stable@dpdk.org Signed-off-by: Souvik Dey Acked-by: Jeff Guo --- diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index c26b036b85..2faee1d7e1 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -1078,8 +1078,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; }