selftests: forwarding: fix learning_test when h1 supports IFF_UNICAST_FLT

[ Upstream commit 1a635d3e1c ]

The first host interface has by default no interest in receiving packets
MAC DA de:ad:be:ef:13:37, so it might drop them before they hit the tc
filter and this might confuse the selftest.

Enable promiscuous mode such that the filter properly counts received
packets.

Fixes: d4deb01467 ("selftests: forwarding: Add a test for FDB learning")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Tested-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Vladimir Oltean 2022-07-03 10:36:25 +03:00 коммит произвёл Greg Kroah-Hartman
Родитель 8e5fcfecd9
Коммит 1b74fe2e8f
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -1149,6 +1149,7 @@ learning_test()
# FDB entry was installed.
bridge link set dev $br_port1 flood off
ip link set $host1_if promisc on
tc qdisc add dev $host1_if ingress
tc filter add dev $host1_if ingress protocol ip pref 1 handle 101 \
flower dst_mac $mac action drop
@ -1198,6 +1199,7 @@ learning_test()
tc filter del dev $host1_if ingress protocol ip pref 1 handle 101 flower
tc qdisc del dev $host1_if ingress
ip link set $host1_if promisc off
bridge link set dev $br_port1 flood on