Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/mlx4_en: Disable vlan HW acceleration when in VF vlan protocol 802.1ad mode

In Ethernet VF, disable vlan HW acceleration on VF
while it is set to VF vlan protocol 802.1ad mode.

Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Moshe Shemesh and committed by
David S. Miller
0815fe3a 7c3d21c8

+13
+13
drivers/net/ethernet/mellanox/mlx4/en_netdev.c
··· 3224 3224 } 3225 3225 3226 3226 if (mlx4_is_slave(mdev->dev)) { 3227 + bool vlan_offload_disabled; 3227 3228 int phv; 3228 3229 3229 3230 err = get_phv_bit(mdev->dev, port, &phv); 3230 3231 if (!err && phv) { 3231 3232 dev->hw_features |= NETIF_F_HW_VLAN_STAG_TX; 3232 3233 priv->pflags |= MLX4_EN_PRIV_FLAGS_PHV; 3234 + } 3235 + err = mlx4_get_is_vlan_offload_disabled(mdev->dev, port, 3236 + &vlan_offload_disabled); 3237 + if (!err && vlan_offload_disabled) { 3238 + dev->hw_features &= ~(NETIF_F_HW_VLAN_CTAG_TX | 3239 + NETIF_F_HW_VLAN_CTAG_RX | 3240 + NETIF_F_HW_VLAN_STAG_TX | 3241 + NETIF_F_HW_VLAN_STAG_RX); 3242 + dev->features &= ~(NETIF_F_HW_VLAN_CTAG_TX | 3243 + NETIF_F_HW_VLAN_CTAG_RX | 3244 + NETIF_F_HW_VLAN_STAG_TX | 3245 + NETIF_F_HW_VLAN_STAG_RX); 3233 3246 } 3234 3247 } else { 3235 3248 if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_PHV_EN &&