From: Michael Chan Date: Mon, 6 Jun 2016 06:37:15 +0000 (-0400) Subject: bnxt_en: Enable and disable RX CTAG and RX STAG VLAN acceleration together. X-Git-Tag: v4.1.12-92~126^2~15 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9e4ca12dafa9d4d4fa41bcccd8df2561bc67ee90;p=users%2Fjedix%2Flinux-maple.git bnxt_en: Enable and disable RX CTAG and RX STAG VLAN acceleration together. Orabug: 23221795 The hardware can only be set to strip or not strip both the VLAN CTAG and STAG. It cannot strip one and not strip the other. Add logic to bnxt_fix_features() to toggle both feature flags when the user is toggling one of them. Signed-off-by: Michael Chan Signed-off-by: David S. Miller (cherry picked from commit 5a9f6b238e59bc05afb4cdeaf3672990bf2a5309) Signed-off-by: Brian Maly --- diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index f89090393fdab..a053071405418 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -5486,6 +5486,20 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev, if (!bnxt_rfs_capable(bp)) features &= ~NETIF_F_NTUPLE; + + /* Both CTAG and STAG VLAN accelaration on the RX side have to be + * turned on or off together. + */ + if ((features & (NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX)) != + (NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX)) { + if (dev->features & NETIF_F_HW_VLAN_CTAG_RX) + features &= ~(NETIF_F_HW_VLAN_CTAG_RX | + NETIF_F_HW_VLAN_STAG_RX); + else + features |= NETIF_F_HW_VLAN_CTAG_RX | + NETIF_F_HW_VLAN_STAG_RX; + } + return features; }