net: stmmac: selftests: Flow Control test can also run with ASYM Pause
authorJose Abreu <Jose.Abreu@synopsys.com>
Mon, 23 Sep 2019 07:49:08 +0000 (09:49 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 25 Sep 2019 11:58:25 +0000 (13:58 +0200)
The Flow Control selftest is also available with ASYM Pause. Lets add
this check to the test and fix eventual false positive failures.

Fixes: 091810dbded9 ("net: stmmac: Introduce selftests support")
Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c

index 9c8d210..5f66f61 100644 (file)
@@ -670,7 +670,7 @@ static int stmmac_test_flowctrl(struct stmmac_priv *priv)
        unsigned int pkt_count;
        int i, ret = 0;
 
-       if (!phydev || !phydev->pause)
+       if (!phydev || (!phydev->pause && !phydev->asym_pause))
                return -EOPNOTSUPP;
 
        tpriv = kzalloc(sizeof(*tpriv), GFP_KERNEL);