提交 dd046132 编写于 作者: I Ido Schimmel 提交者: Zheng Zengkai

selftests: mirror_gre_bridge_1q: Avoid changing PVID while interface is operational

stable inclusion
from stable-v5.10.115
commit 9ac9f07f0fbb651086a7a8679de564f2db910cce
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5IZ9C

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9ac9f07f0fbb651086a7a8679de564f2db910cce

--------------------------------

commit 3122257c upstream.

In emulated environments, the bridge ports enslaved to br1 get a carrier
before changing br1's PVID. This means that by the time the PVID is
changed, br1 is already operational and configured with an IPv6
link-local address.

When the test is run with netdevs registered by mlxsw, changing the PVID
is vetoed, as changing the VID associated with an existing L3 interface
is forbidden. This restriction is similar to the 8021q driver's
restriction of changing the VID of an existing interface.

Fix this by taking br1 down and bringing it back up when it is fully
configured.

With this fix, the test reliably passes on top of both the SW and HW
data paths (emulated or not).

Fixes: 239e754a ("selftests: forwarding: Test mirror-to-gretap w/ UL 802.1q")
Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
Reviewed-by: NPetr Machata <petrm@nvidia.com>
Link: https://lore.kernel.org/r/20220502084507.364774-1-idosch@nvidia.comSigned-off-by: NPaolo Abeni <pabeni@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 4186fc98
...@@ -61,9 +61,12 @@ setup_prepare() ...@@ -61,9 +61,12 @@ setup_prepare()
vrf_prepare vrf_prepare
mirror_gre_topo_create mirror_gre_topo_create
# Avoid changing br1's PVID while it is operational as a L3 interface.
ip link set dev br1 down
ip link set dev $swp3 master br1 ip link set dev $swp3 master br1
bridge vlan add dev br1 vid 555 pvid untagged self bridge vlan add dev br1 vid 555 pvid untagged self
ip link set dev br1 up
ip address add dev br1 192.0.2.129/28 ip address add dev br1 192.0.2.129/28
ip address add dev br1 2001:db8:2::1/64 ip address add dev br1 2001:db8:2::1/64
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册