net: stmmac: selftests: Prevent false positives in filter tests
authorJose Abreu <Jose.Abreu@synopsys.com>
Wed, 6 Nov 2019 15:02:57 +0000 (16:02 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 Nov 2019 05:22:55 +0000 (21:22 -0800)
commiteeb9d745169847ecde4aa311eb618beb984629b0
tree0ed1f77476b06fbca46c4df0554d64c4be294fe9
parent3d00e45d498fd5347cea653ef494c56731b651e0
net: stmmac: selftests: Prevent false positives in filter tests

In L2 tests that filter packets by destination MAC address we need to
prevent false positives that can occur if we add an address that
collides with the existing ones.

To fix this, lets manually check if the new address to be added is
already present in the NIC and use a different one if so. For Hash
filtering this also envolves converting the address to the hash.

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