]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitd02829f3ef322bed3eb4bd784a7482136c58a978
tree0ed1f77476b06fbca46c4df0554d64c4be294fe9
parentd465beb837c8794d73bd02d6c3428d40e5ed80dd
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: 205dbb457eeb ("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