net: stmmac: dwmac4/5: Also pass control frames while in promisc mode
authorJose Abreu <Jose.Abreu@synopsys.com>
Fri, 24 May 2019 08:20:17 +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/dwmac4.h
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c

index 3dddd7902b0f63b7ab5dc3364cfb738d75b38f06..c3cbca804bcd0d3d9e83a3fb64d6ec46d2abe8fd 100644 (file)
@@ -64,6 +64,7 @@
 #define GMAC_PACKET_FILTER_PR          BIT(0)
 #define GMAC_PACKET_FILTER_HMC         BIT(2)
 #define GMAC_PACKET_FILTER_PM          BIT(4)
+#define GMAC_PACKET_FILTER_PCF         BIT(7)
 
 #define GMAC_MAX_PERFECT_ADDRESSES     128
 
index 45c294f39ea60ab88b6788634dbeb48aabd7a886..31679480564a0b3885db9ac4a74d5ae44bbc51ab 100644 (file)
@@ -406,7 +406,7 @@ static void dwmac4_set_filter(struct mac_device_info *hw,
        unsigned int value = 0;
 
        if (dev->flags & IFF_PROMISC) {
-               value = GMAC_PACKET_FILTER_PR;
+               value = GMAC_PACKET_FILTER_PR | GMAC_PACKET_FILTER_PCF;
        } else if ((dev->flags & IFF_ALLMULTI) ||
                        (netdev_mc_count(dev) > HASH_TABLE_SIZE)) {
                /* Pass all multi */