When port netdevs are leaving a bridged LAG device, then the bridge's
cleanup sequence isn't invoked and the switch driver needs to do the
necessary cleanup.
Adjust current LAG recipes to test the flow.
Note that I'm creating a new LAG device on the switch for the second
fastpath test, as currently switchdev drivers suffer from an ordering
problem, which first requires the LAG to be populated and only then
bridged. Hopefully, this will be resolved soon.
Signed-off-by: Ido Schimmel <idosch(a)mellanox.com>
---
recipes/switchdev/l2-006-bridge_team.py | 28 ++++++++++++++-
recipes/switchdev/l2-015-bridge_team_vlan1d.py | 48 ++++++++++++++++++++++++--
2 files changed, 72 insertions(+), 4 deletions(-)
diff --git a/recipes/switchdev/l2-006-bridge_team.py b/recipes/switchdev/l2-006-bridge_team.py
index fd648c9..48b9752 100644
--- a/recipes/switchdev/l2-006-bridge_team.py
+++ b/recipes/switchdev/l2-006-bridge_team.py
@@ -31,7 +31,8 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_lag2 = sw.create_team(slaves=[sw_if3, sw_if4],
config=team_config)
- sw.create_bridge(slaves=[sw_lag1, sw_lag2], options={"vlan_filtering": 1})
+ sw_br = sw.create_bridge(slaves=[sw_lag1, sw_lag2],
+ options={"vlan_filtering": 1})
sleep(15)
@@ -40,6 +41,31 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.netperf_tcp(m1_lag1, m2_lag1)
tl.netperf_udp(m1_lag1, m2_lag1)
+ sw_lag1.slave_del(sw_if1.get_id())
+ sw_lag1.slave_del(sw_if2.get_id())
+
+ m1_lag1.slave_del(m1_if1.get_id())
+
+ # Make sure slowpath is working.
+ sw_if1.reset(ip=["192.168.102.10/24", "2003::1/64"])
+ m1_if1.reset(ip=["192.168.102.11/24", "2003::2/64"])
+
+ sleep(15)
+
+ tl.ping_simple(sw_if1, m1_if1)
+
+ # Repopulate the LAGs and make sure fastpath is OK.
+ sw_lag3 = sw.create_team(slaves=[sw_if1, sw_if2],
+ config=team_config)
+ sw_br.slave_add(sw_lag3.get_id())
+ m1_lag1.slave_add(m1_if1.get_id())
+
+ sleep(15)
+
+ tl.ping_simple(m1_lag1, m2_lag1)
+ tl.netperf_tcp(m1_lag1, m2_lag1)
+ tl.netperf_udp(m1_lag1, m2_lag1)
+
do_task(ctl, [ctl.get_host("machine1"),
ctl.get_host("machine2"),
ctl.get_host("switch")],
diff --git a/recipes/switchdev/l2-015-bridge_team_vlan1d.py b/recipes/switchdev/l2-015-bridge_team_vlan1d.py
index 3bea6e2..723a04a 100644
--- a/recipes/switchdev/l2-015-bridge_team_vlan1d.py
+++ b/recipes/switchdev/l2-015-bridge_team_vlan1d.py
@@ -34,15 +34,17 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_lag1 = sw.create_team(slaves=[sw_if1, sw_if2], config=team_config)
sw_lag2 = sw.create_team(slaves=[sw_if3, sw_if4], config=team_config)
br_options = {"vlan_filtering": 1}
- sw.create_bridge(slaves=[sw_lag1, sw_lag2], options=br_options)
+ sw_br1 = sw.create_bridge(slaves=[sw_lag1, sw_lag2], options=br_options)
sw_lag1_10 = sw.create_vlan(sw_lag1, 10)
sw_lag2_10 = sw.create_vlan(sw_lag2, 10)
- sw.create_bridge(slaves=[sw_lag1_10, sw_lag2_10], options=br_options)
+ sw_br2 = sw.create_bridge(slaves=[sw_lag1_10, sw_lag2_10],
+ options=br_options)
sw_lag1_20 = sw.create_vlan(sw_lag1, 20)
sw_lag2_21 = sw.create_vlan(sw_lag2, 21)
- sw.create_bridge(slaves=[sw_lag1_20, sw_lag2_21], options=br_options)
+ sw_br3 = sw.create_bridge(slaves=[sw_lag1_20, sw_lag2_21],
+ options=br_options)
sleep(15)
@@ -60,6 +62,46 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.netperf_tcp(m1_lag1_20, m2_lag1_21)
tl.netperf_udp(m1_lag1_20, m2_lag1_21)
+ sw_lag1.slave_del(sw_if1.get_id())
+ sw_lag1.slave_del(sw_if2.get_id())
+
+ m1_lag1.slave_del(m1_if1.get_id())
+
+ # Make sure slowpath is working.
+ sw_if1.reset(ip=test_ip(4, 1))
+ m1_if1.reset(ip=test_ip(4, 2))
+
+ sleep(15)
+
+ tl.ping_simple(sw_if1, m1_if1)
+
+ # Repopulate the LAGs and make sure fastpath is OK.
+ sw_lag3 = sw.create_team(slaves=[sw_if1, sw_if2],
+ config=team_config)
+ sw_br1.slave_add(sw_lag3.get_id())
+
+ sw_lag3_10 = sw.create_vlan(sw_lag3, 10)
+ sw_br2.slave_add(sw_lag3_10.get_id())
+
+ sw_lag3_20 = sw.create_vlan(sw_lag3, 20)
+ sw_br3.slave_add(sw_lag3_20.get_id())
+
+ m1_lag1.slave_add(m1_if1.get_id())
+
+ sleep(15)
+
+ tl.ping_simple(m1_lag1, m2_lag1)
+ tl.netperf_tcp(m1_lag1, m2_lag1)
+ tl.netperf_udp(m1_lag1, m2_lag1)
+
+ tl.ping_simple(m1_lag1_10, m2_lag1_10)
+ tl.netperf_tcp(m1_lag1_10, m2_lag1_10)
+ tl.netperf_udp(m1_lag1_10, m2_lag1_10)
+
+ tl.ping_simple(m1_lag1_20, m2_lag1_21)
+ tl.netperf_tcp(m1_lag1_20, m2_lag1_21)
+ tl.netperf_udp(m1_lag1_20, m2_lag1_21)
+
do_task(ctl, [ctl.get_host("machine1"),
ctl.get_host("machine2"),
ctl.get_host("switch")],
--
2.4.10