diff options
author | Jose Abreu <Jose.Abreu@synopsys.com> | 2019-08-07 10:03:13 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-08 22:20:19 -0700 |
commit | 1fbdad00055c59adb853935606468cf218c28dad (patch) | |
tree | 5ef4c0893a2d9369df670c481a2eea6d188723a4 /drivers/net/ethernet/stmicro | |
parent | 76067459c686c4fc6352613e5a6a54e4ffef2861 (diff) | |
download | linux-1fbdad00055c59adb853935606468cf218c28dad.tar.gz linux-1fbdad00055c59adb853935606468cf218c28dad.tar.bz2 linux-1fbdad00055c59adb853935606468cf218c28dad.zip |
net: stmmac: selftests: Add RSS test
Add a test for RSS in the stmmac selftests.
Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c index a97b1ea76438..83b775a8cedc 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c @@ -700,6 +700,21 @@ cleanup: return ret; } +static int stmmac_test_rss(struct stmmac_priv *priv) +{ + struct stmmac_packet_attrs attr = { }; + + if (!priv->dma_cap.rssen || !priv->rss.enable) + return -EOPNOTSUPP; + + attr.dst = priv->dev->dev_addr; + attr.exp_hash = true; + attr.sport = 0x321; + attr.dport = 0x123; + + return __stmmac_test_loopback(priv, &attr); +} + #define STMMAC_LOOPBACK_NONE 0 #define STMMAC_LOOPBACK_MAC 1 #define STMMAC_LOOPBACK_PHY 2 @@ -745,6 +760,10 @@ static const struct stmmac_test { .name = "Flow Control ", .lb = STMMAC_LOOPBACK_PHY, .fn = stmmac_test_flowctrl, + }, { + .name = "RSS ", + .lb = STMMAC_LOOPBACK_PHY, + .fn = stmmac_test_rss, }, }; |