net: stmmac: dwxgmac2: Also pass control frames while in promisc mode
authorJose Abreu <Jose.Abreu@synopsys.com>
Fri, 24 May 2019 08:20:18 +0000 (10:20 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 24 May 2019 20:45:56 +0000 (13:45 -0700)
In order for the selftests to run the Flow Control selftest we need to
also pass pause frames to the stack.

Pass this type of frames while in promiscuous mode.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Joao Pinto <jpinto@synopsys.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c

index f629ccc8932aec21b64483345eb16785cd39f5e1..b8296eb41011b56aab7c14b24fc5146ed77057b3 100644 (file)
@@ -40,6 +40,7 @@
 #define XGMAC_CORE_INIT_RX             0
 #define XGMAC_PACKET_FILTER            0x00000008
 #define XGMAC_FILTER_RA                        BIT(31)
+#define XGMAC_FILTER_PCF               BIT(7)
 #define XGMAC_FILTER_PM                        BIT(4)
 #define XGMAC_FILTER_HMC               BIT(2)
 #define XGMAC_FILTER_PR                        BIT(0)
index c27b3ca052eaa8bdabe9ac9cd8047813c1dc1a66..bfa7d6913fd49642450fb1afbe38fdd40cb2f47b 100644 (file)
@@ -310,7 +310,7 @@ static void dwxgmac2_set_filter(struct mac_device_info *hw,
        u32 value = XGMAC_FILTER_RA;
 
        if (dev->flags & IFF_PROMISC) {
-               value |= XGMAC_FILTER_PR;
+               value |= XGMAC_FILTER_PR | XGMAC_FILTER_PCF;
        } else if ((dev->flags & IFF_ALLMULTI) ||
                   (netdev_mc_count(dev) > HASH_TABLE_SIZE)) {
                value |= XGMAC_FILTER_PM;