From: Beilei Xing Date: Wed, 17 Aug 2016 01:58:06 +0000 (+0800) Subject: net/i40e: fix dropping packets with ethertype 0x88A8 X-Git-Tag: spdx-start~5835 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4d61120d5ce750ec5a3b3625cb45ad7c3a915d9e;p=dpdk.git net/i40e: fix dropping packets with ethertype 0x88A8 In FW default settings, Ethertype 0x88A8 is treated as S-TAG, and packets with S-TAG should be received in Port Virtualizer mode. However, Port Virtualizer mode is not initialized in DPDK, so X710 will drop packets with Ethertype 0x88A8. This patch fixes this issue by turning off S-TAG identification. Fixes: 4861cde46116 ("i40e: new poll mode driver") Signed-off-by: Beilei Xing Acked-by: Jingjing Wu --- diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 784635c116..3c4a5f10b6 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -915,6 +915,9 @@ config_floating_veb(struct rte_eth_dev *dev) } } +#define I40E_L2_TAGS_S_TAG_SHIFT 1 +#define I40E_L2_TAGS_S_TAG_MASK I40E_MASK(0x1, I40E_L2_TAGS_S_TAG_SHIFT) + static int eth_i40e_dev_init(struct rte_eth_dev *dev) { @@ -1103,6 +1106,13 @@ eth_i40e_dev_init(struct rte_eth_dev *dev) /* Disable double vlan by default */ i40e_vsi_config_double_vlan(vsi, FALSE); + /* Disable S-TAG identification by default */ + ret = I40E_READ_REG(hw, I40E_PRT_L2TAGSEN); + if (ret & I40E_L2_TAGS_S_TAG_MASK) { + ret &= ~I40E_L2_TAGS_S_TAG_MASK; + I40E_WRITE_REG(hw, I40E_PRT_L2TAGSEN, ret); + } + if (!vsi->max_macaddrs) len = ETHER_ADDR_LEN; else