Skip to content

Commit eb13885

Browse files
pmachatadavem330
authored andcommitted
selftests: router_bridge: Add remastering tests
Add two tests to deslave a port from and reenslave to a bridge. This should retain the ability of the system to forward traffic, but on an offloading driver that is sensitive to ordering of operations, it might not. The first test does this configuration in a way that relies on vlan_default_pvid to assign the PVID. The second test disables that autoconfiguration and configures PVID by hand in a separate step. Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Danielle Ratson <danieller@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 10857e6 commit eb13885

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tools/testing/selftests/net/forwarding/router_bridge.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
# +---------------------------------------------------------------------------+
2121

2222
ALL_TESTS="
23+
ping_ipv4
24+
ping_ipv6
25+
config_remaster
2326
ping_ipv4
2427
ping_ipv6
2528
config_remove_pvid
@@ -28,6 +31,9 @@ ALL_TESTS="
2831
config_add_pvid
2932
ping_ipv4
3033
ping_ipv6
34+
config_late_pvid
35+
ping_ipv4
36+
ping_ipv6
3137
"
3238
NUM_NETIFS=4
3339
source lib.sh
@@ -86,6 +92,15 @@ router_destroy()
8692
ip link del dev br1
8793
}
8894

95+
config_remaster()
96+
{
97+
log_info "Remaster bridge slave"
98+
99+
ip link set dev $swp1 nomaster
100+
sleep 2
101+
ip link set dev $swp1 master br1
102+
}
103+
89104
config_remove_pvid()
90105
{
91106
log_info "Remove PVID from the bridge"
@@ -102,6 +117,17 @@ config_add_pvid()
102117
sleep 2
103118
}
104119

120+
config_late_pvid()
121+
{
122+
log_info "Add bridge PVID after enslaving port"
123+
124+
ip link set dev $swp1 nomaster
125+
ip link set dev br1 type bridge vlan_default_pvid 0
126+
sleep 2
127+
ip link set dev $swp1 master br1
128+
ip link set dev br1 type bridge vlan_default_pvid 1
129+
}
130+
105131
setup_prepare()
106132
{
107133
h1=${NETIFS[p1]}

0 commit comments

Comments
 (0)