As part of cleanup we're doing, we've discovered we have several lnst patches in our internal development tree that were not sent upstream yet.
Some of the content here relate to recent changes in user APIs - - #1, #2 from Arkadi relate to user indicationes of whether an FDB entry was externally learned - #9 from Ido relate to nexthop flags change - #10 from Yotam handle mirroring changes - support clsact qdisc instead of ingress qdisc [in mlxsw].
The rest of the patches in this series are from Ido, and mostly revolve around adding/improving IPv6 support.
Arkadi Sharshevsky (2): BridgeTool: Update FDB parsing for new externally learned attribute recipes: switchdev: Change FDB check routine and bridge tests
Ido Schimmel (7): recipes: switchdev: Fix incorrect ping6 parameter recipes: switchdev: Enable multicast querier on bridge InterfaceManager: Don't flush IPv6 link-local addresses recipes: switchdev: Redue ECMP to two links recipes: switchdev: Execute recipe only for IPv4 recipes: switchdev: Add IPv6 support to existing L3 recipes HostAPI: Parse nexthop flags in route dump
Yotam Gigi (1): recipes: switchdev: span: Move to use the clsact qdisc
lnst/Slave/BridgeTool.py | 4 +- lnst/Slave/InterfaceManager.py | 2 +- lnst/Slave/NetTestSlave.py | 4 +- recipes/switchdev/TestLib.py | 25 +++-- recipes/switchdev/ecmp_common.py | 10 ++ recipes/switchdev/l2-000-minimal.py | 3 +- recipes/switchdev/l2-001-bridge.py | 3 +- recipes/switchdev/l2-002-bridge_fdb.py | 101 ++++++--------------- recipes/switchdev/l2-003-bridge_stp.py | 25 ++--- recipes/switchdev/l2-004-bridge_bond.py | 3 +- recipes/switchdev/l2-005-bridge_bond_failover.py | 3 +- recipes/switchdev/l2-006-bridge_team.py | 3 +- recipes/switchdev/l2-007-bridge_team_failover.py | 3 +- recipes/switchdev/l2-008-bridge_vlan1q_sanity.py | 2 +- recipes/switchdev/l2-009-bridge_vlan1q.py | 2 +- recipes/switchdev/l2-010-bridge_vlan1d_sanity.py | 8 +- recipes/switchdev/l2-011-bridge_vlan1d.py | 8 +- .../switchdev/l2-012-bridge_bond_vlan1d_sanity.py | 8 +- recipes/switchdev/l2-013-bridge_bond_vlan1d.py | 8 +- .../switchdev/l2-014-bridge_team_vlan1d_sanity.py | 8 +- recipes/switchdev/l2-015-bridge_team_vlan1d.py | 8 +- recipes/switchdev/l2-017-bridge_fdb_vlan1d.py | 100 ++++++-------------- recipes/switchdev/l2-018-bridge_fdb_team.py | 100 ++++++-------------- recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py | 100 ++++++-------------- recipes/switchdev/l2-021-span.py | 15 ++- recipes/switchdev/l3-000-minimal.py | 6 ++ recipes/switchdev/l3-001-router-port.py | 6 ++ recipes/switchdev/l3-002-vlan-interface.py | 6 ++ recipes/switchdev/l3-003-bond-interface.py | 6 ++ recipes/switchdev/l3-004-team-interface.py | 6 ++ recipes/switchdev/l3-005-ecmp-basic.py | 23 +---- recipes/switchdev/l3-005-ecmp-basic.xml | 4 - recipes/switchdev/l3-006-ecmp-linkdown.py | 13 +-- recipes/switchdev/l3-006-ecmp-linkdown.xml | 7 +- recipes/switchdev/l3-007-ecmp-maxsize.py | 29 ++---- recipes/switchdev/l3-007-ecmp-maxsize.xml | 4 - recipes/switchdev/l3-008-routes_stress.py | 2 +- recipes/switchdev/l3-009-1q_bridge_rif.py | 7 ++ recipes/switchdev/l3-010-1d_bridge_rif.py | 7 ++ recipes/switchdev/tc-001-action-vlan-modify.py | 3 +- recipes/switchdev/tc-002-flower-vlan.py | 3 +- 41 files changed, 280 insertions(+), 408 deletions(-)
From: Arkadi Sharshevsky arkadis@mellanox.com
Add FDB parsing to include externally learned attribute.
Signed-off-by: Arkadi Sharshevsky arkadis@mellanox.com Signed-off-by: Yuval Mintz yuvalm@mellanox.com --- lnst/Slave/BridgeTool.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lnst/Slave/BridgeTool.py b/lnst/Slave/BridgeTool.py index d93b1b9..08a4919 100644 --- a/lnst/Slave/BridgeTool.py +++ b/lnst/Slave/BridgeTool.py @@ -83,8 +83,10 @@ class BridgeTool: self = True if re.match(r'.*\s+self', line) else False master = True if re.match(r'.*\s+master', line) else False offload = True if re.match(r'.*\s+offload', line) else False + extern_learn = True if re.match(r'.*\s+extern_learn', line) else False br_fdb_info = {"hwaddr": hwaddr, "vlan_id": vlan_id, - "self": self, "master": master, "offload": offload} + "self": self, "master": master, "offload": offload, + "extern_learn": extern_learn} br_fdb_info_list.append(br_fdb_info) return br_fdb_info_list
From: Arkadi Sharshevsky arkadis@mellanox.com
Adopt the FDB check routine and bridge tests to the following changes 1. Removal of the support for SELF. 2. Adding of the extern_learned FDB attribute. 3. Remove tests realted to learining_sync.
Signed-off-by: Arkadi Sharshevsky arkadis@mellanox.com Signed-off-by: Yuval Mintz yuvalm@mellanox.com --- recipes/switchdev/TestLib.py | 23 +++-- recipes/switchdev/l2-002-bridge_fdb.py | 98 +++++++--------------- recipes/switchdev/l2-003-bridge_stp.py | 22 ++--- recipes/switchdev/l2-017-bridge_fdb_vlan1d.py | 98 +++++++--------------- recipes/switchdev/l2-018-bridge_fdb_team.py | 98 +++++++--------------- recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py | 98 +++++++--------------- 6 files changed, 136 insertions(+), 301 deletions(-)
diff --git a/recipes/switchdev/TestLib.py b/recipes/switchdev/TestLib.py index 02e8bd9..e5f3512 100644 --- a/recipes/switchdev/TestLib.py +++ b/recipes/switchdev/TestLib.py @@ -333,20 +333,29 @@ class TestLib: custom_mod = self._ctl.get_module("Custom", options=options) m1.run(custom_mod, desc=desc)
- def check_fdb(self, iface, hwaddr, vlan_id, rec_type, find=True): + def check_fdb(self, iface, hwaddr, vlan_id, offload, extern_learn, find=True): fdb_table = iface.get_br_fdbs()
- rec = "offload" if rec_type == "software" else "self" found = False + err_arg = None for fdb in fdb_table: - if (fdb["hwaddr"] == str(hwaddr) and fdb["vlan_id"] == vlan_id and - fdb[rec]): - found = True + if not (fdb["hwaddr"] == str(hwaddr) and fdb["vlan_id"] == vlan_id): + continue + if (offload and not fdb["offload"]): + err_arg = "offload" + continue + if (extern_learn and not fdb["extern_learn"]): + err_arg = "extern_learn" + continue + found = True
if found and not find: - err_msg = "found %s record when shouldn't" % rec_type + if err_arg is None: + err_msg = "didn't find record when should've" + else: + err_msg = "found %s record when shouldn't" % err_arg elif find and not found: - err_msg = "didn't find %s record when should've" % rec_type + err_msg = "didn't find %s record when should've" % err_arg else: err_msg = ""
diff --git a/recipes/switchdev/l2-002-bridge_fdb.py b/recipes/switchdev/l2-002-bridge_fdb.py index ba34749..63f9852 100644 --- a/recipes/switchdev/l2-002-bridge_fdb.py +++ b/recipes/switchdev/l2-002-bridge_fdb.py @@ -32,103 +32,61 @@ def do_task(ctl, hosts, ifaces, aliases):
tl = TestLib(ctl, aliases) tl.ping_simple(m1_if1, m2_if1) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software") - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware") - sw_if1.set_br_learning(on=False, self=True) + tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, True, True) + sw_if1.set_br_learning(on=False, master=True)
sleep(30)
- tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware", False) + tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, True, True, False)
# Make sure FDB is not populated when learning is disabled. - sw_if1.set_br_learning(on=False, self=True) + sw_if1.set_br_learning(on=False, master=True) tl.ping_simple(m1_if1, m2_if1) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware", False) + tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, True, True, False)
# Disable flooding and make sure ping fails. - sw_if1.set_br_flooding(on=False, self=True) + sw_if1.set_br_flooding(on=False, master=True) tl.ping_simple(m1_if1, m2_if1, fail_expected=True)
- # Set a static FDB entry and make sure ping works again. - sw_if1.add_br_fdb(str(m1_if1.get_hwaddr()), self=True, vlan_tci=1) + # Set a static FDB entry and make sure ping works again. Also check + # its offloaded + sw_if1.add_br_fdb(str(m1_if1.get_hwaddr()), master=True, vlan_tci=1) tl.ping_simple(m1_if1, m2_if1) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware") + tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, True, False)
# Remove static FDB entry. Ping should fail. - sw_if1.del_br_fdb(str(m1_if1.get_hwaddr()), self=True, vlan_tci=1) + sw_if1.del_br_fdb(str(m1_if1.get_hwaddr()), master=True, vlan_tci=1) tl.ping_simple(m1_if1, m2_if1, fail_expected=True) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware", False) + tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, True, False, False)
- # Enable learning_sync and make sure both FDBs are populated. - sw_if1.set_br_learning(on=True, self=True) - sw_if1.set_br_flooding(on=True, self=True) - sw_if1.set_br_learning_sync(on=True, self=True) + # Enable learning and flooding and make sure ping works again. + sw_if1.set_br_learning(on=True, master=True) + sw_if1.set_br_flooding(on=True, master=True) tl.ping_simple(m1_if1, m2_if1) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software") - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware") - sw_if1.set_br_learning(on=False, self=True) + tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, True, True) + sw_if1.set_br_learning(on=False, master=True)
sleep(20)
- tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware", False) + tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, True, True, False)
- # Disable learning_sync and make sure only hardware FDB is populated. - sw_if1.set_br_learning(on=True, self=True) - sw_if1.set_br_learning_sync(on=False, self=True) + # Insert a static FDB entry. Ping should work. + sw_if1.add_br_fdb(str(m1_if1.get_hwaddr()), master=True, vlan_tci=1) tl.ping_simple(m1_if1, m2_if1) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware") - - # Remove port from bridge and add it back. Disable flooding and learning - # and make sure ping doesn't work. Note that port must be removed from - # bridge when the FDB entry exists only in the hardware table. Otherwise, - # bridge code will flush it himself, instead of driver. - sw_br.slave_del(sw_if1.get_id()) - sw_br.slave_add(sw_if1.get_id()) # Enables learning sync by default. - sw_if1.set_br_learning(on=False, self=True) - sw_if1.set_br_flooding(on=False, self=True) - tl.ping_simple(m1_if1, m2_if1, fail_expected=True) - - # Enable learning and make sure ping works again. - sw_if1.set_br_learning(on=True, self=True) - tl.ping_simple(m1_if1, m2_if1) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software") - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware") - sw_if1.set_br_learning(on=False, self=True) - - sleep(20) - - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware", False) - - # Insert a static FDB entry and disable learning sync. Ping should work. - sw_if1.add_br_fdb(str(m1_if1.get_hwaddr()), self=True, vlan_tci=1) - sw_if1.set_br_learning_sync(on=False, self=True) - tl.ping_simple(m1_if1, m2_if1) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware") + tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, True, False)
sleep(20)
# Make sure static entry is not aged out. - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware") - - # Remove port from bridge and add it back. Disable flooding and learning - # and make sure ping doesn't work. Note that port must be removed from - # bridge when the FDB entry exists only in the hardware table. Otherwise, - # bridge code will flush it himself, instead of driver. Unlike the - # previous case, here we check if the driver correctly removes the static - # entry. + tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, True, False) + + # Remove port from bridge and add it back. The static entry added + # before should be flushed. Disable flooding and learning and make + # sure ping doesn't work. sw_br.slave_del(sw_if1.get_id()) sw_br.slave_add(sw_if1.get_id()) - sw_if1.set_br_learning(on=False, self=True) - sw_if1.set_br_flooding(on=False, self=True) + sw_if1.set_br_learning(on=False, master=True) + sw_if1.set_br_flooding(on=False, master=True) tl.ping_simple(m1_if1, m2_if1, fail_expected=True)
do_task(ctl, [ctl.get_host("machine1"), diff --git a/recipes/switchdev/l2-003-bridge_stp.py b/recipes/switchdev/l2-003-bridge_stp.py index 44e87e7..347b2d7 100644 --- a/recipes/switchdev/l2-003-bridge_stp.py +++ b/recipes/switchdev/l2-003-bridge_stp.py @@ -36,43 +36,37 @@ def do_task(ctl, hosts, ifaces, aliases): # populated. sw_if1.set_br_state(0) tl.ping_simple(m1_if1, m2_if1, fail_expected=True) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware", False) + tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, True, True, False)
# Set STP state to LISTENING and make sure ping fails and FDB is not # populated. sw_if1.set_br_state(1) tl.ping_simple(m1_if1, m2_if1, fail_expected=True) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware", False) + tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, True, True, False)
# Set STP state to LEARNING and make sure ping fails, but FDB *is* # populated. sw_if1.set_br_state(2) tl.ping_simple(m1_if1, m2_if1, fail_expected=True) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software") - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware") + tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, True, True)
sleep(30)
- tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware", False) + tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, True, True, False)
# Set STP state to FORWARDING and make sure ping works and FDB is # populated. sw_if1.set_br_state(3) tl.ping_simple(m1_if1, m2_if1) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software") - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware") + tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, True, True)
sleep(30)
- tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False) - tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware", False) + tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, True, True, False)
# Make sure that even with a static FDB record we don't get traffic # when state is DISABLED, LEARNING or LISTENING. - sw_if2.add_br_fdb(str(m2_if1.get_hwaddr()), self=True, vlan_tci=1) + sw_if2.add_br_fdb(str(m2_if1.get_hwaddr()), master=True, vlan_tci=1) sw_if1.set_br_state(0) tl.ping_simple(m1_if1, m2_if1, fail_expected=True) sw_if1.set_br_state(1) @@ -81,7 +75,7 @@ def do_task(ctl, hosts, ifaces, aliases): tl.ping_simple(m1_if1, m2_if1, fail_expected=True)
# Cleanup - sw_if2.del_br_fdb(str(m2_if1.get_hwaddr()), self=True, vlan_tci=1) + sw_if2.del_br_fdb(str(m2_if1.get_hwaddr()), master=True, vlan_tci=1)
do_task(ctl, [ctl.get_host("machine1"), ctl.get_host("machine2"), diff --git a/recipes/switchdev/l2-017-bridge_fdb_vlan1d.py b/recipes/switchdev/l2-017-bridge_fdb_vlan1d.py index 1de39ec..493dddd 100644 --- a/recipes/switchdev/l2-017-bridge_fdb_vlan1d.py +++ b/recipes/switchdev/l2-017-bridge_fdb_vlan1d.py @@ -34,103 +34,61 @@ def do_task(ctl, hosts, ifaces, aliases):
tl = TestLib(ctl, aliases) tl.ping_simple(m1_if1_10, m2_if1_20) - tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software") - tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware") - sw_if1_10.set_br_learning(on=False, self=True) + tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, True, True) + sw_if1_10.set_br_learning(on=False, master=True)
sleep(30)
- tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software", False) - tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware", False) + tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, True, True, False)
# Make sure FDB is not populated when learning is disabled. - sw_if1_10.set_br_learning(on=False, self=True) + sw_if1_10.set_br_learning(on=False, master=True) tl.ping_simple(m1_if1_10, m2_if1_20) - tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software", False) - tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware", False) + tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, True, True, False)
# Disable flooding and make sure ping fails. - sw_if1_10.set_br_flooding(on=False, self=True) + sw_if1_10.set_br_flooding(on=False, master=True) tl.ping_simple(m1_if1_10, m2_if1_20, fail_expected=True)
- # Set a static FDB entry and make sure ping works again. - sw_if1_10.add_br_fdb(str(m1_if1_10.get_hwaddr()), self=True) + # Set a static FDB entry and make sure ping works again. Also check + # its offloaded + sw_if1_10.add_br_fdb(str(m1_if1_10.get_hwaddr()), master=True) tl.ping_simple(m1_if1_10, m2_if1_20) - tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software", False) - tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware") + tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, True, False)
# Remove static FDB entry. Ping should fail. - sw_if1_10.del_br_fdb(str(m1_if1_10.get_hwaddr()), self=True) + sw_if1_10.del_br_fdb(str(m1_if1_10.get_hwaddr()), master=True) tl.ping_simple(m1_if1_10, m2_if1_20, fail_expected=True) - tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software", False) - tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware", False) + tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, True, False, False)
- # Enable learning_sync and make sure both FDBs are populated. - sw_if1_10.set_br_learning(on=True, self=True) - sw_if1_10.set_br_flooding(on=True, self=True) - sw_if1_10.set_br_learning_sync(on=True, self=True) + # Enable learning and flooding and make sure ping works again. + sw_if1_10.set_br_learning(on=True, master=True) + sw_if1_10.set_br_flooding(on=True, master=True) tl.ping_simple(m1_if1_10, m2_if1_20) - tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software") - tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware") - sw_if1_10.set_br_learning(on=False, self=True) + tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, True, True) + sw_if1_10.set_br_learning(on=False, master=True)
sleep(20)
- tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software", False) - tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware", False) + tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, True, True, False)
- # Disable learning_sync and make sure only hardware FDB is populated. - sw_if1_10.set_br_learning(on=True, self=True) - sw_if1_10.set_br_learning_sync(on=False, self=True) + # Insert a static FDB entry. Ping should work. + sw_if1_10.add_br_fdb(str(m1_if1_10.get_hwaddr()), master=True) tl.ping_simple(m1_if1_10, m2_if1_20) - tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software", False) - tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware") - - # Remove port from bridge and add it back. Disable flooding and learning - # and make sure ping doesn't work. Note that port must be removed from - # bridge when the FDB entry exists only in the hardware table. Otherwise, - # bridge code will flush it himself, instead of driver. - sw_br.slave_del(sw_if1_10.get_id()) - sw_br.slave_add(sw_if1_10.get_id()) # Enables learning sync by default. - sw_if1_10.set_br_learning(on=False, self=True) - sw_if1_10.set_br_flooding(on=False, self=True) - tl.ping_simple(m1_if1_10, m2_if1_20, fail_expected=True) - - # Enable learning and make sure ping works again. - sw_if1_10.set_br_learning(on=True, self=True) - tl.ping_simple(m1_if1_10, m2_if1_20) - tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software") - tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware") - sw_if1_10.set_br_learning(on=False, self=True) - - sleep(20) - - tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software", False) - tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware", False) - - # Insert a static FDB entry and disable learning sync. Ping should work. - sw_if1_10.add_br_fdb(str(m1_if1_10.get_hwaddr()), self=True) - sw_if1_10.set_br_learning_sync(on=False, self=True) - tl.ping_simple(m1_if1_10, m2_if1_20) - tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software", False) - tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware") + tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, True, False)
sleep(20)
# Make sure static entry is not aged out. - tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software", False) - tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware") - - # Remove port from bridge and add it back. Disable flooding and learning - # and make sure ping doesn't work. Note that port must be removed from - # bridge when the FDB entry exists only in the hardware table. Otherwise, - # bridge code will flush it himself, instead of driver. Unlike the - # previous case, here we check if the driver correctly removes the static - # entry. + tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, True, False) + + # Remove port from bridge and add it back. The static entry added + # before should be flushed. Disable flooding and learning and make + # sure ping doesn't work. sw_br.slave_del(sw_if1_10.get_id()) sw_br.slave_add(sw_if1_10.get_id()) - sw_if1_10.set_br_learning(on=False, self=True) - sw_if1_10.set_br_flooding(on=False, self=True) + sw_if1_10.set_br_learning(on=False, master=True) + sw_if1_10.set_br_flooding(on=False, master=True) tl.ping_simple(m1_if1_10, m2_if1_20, fail_expected=True)
do_task(ctl, [ctl.get_host("machine1"), diff --git a/recipes/switchdev/l2-018-bridge_fdb_team.py b/recipes/switchdev/l2-018-bridge_fdb_team.py index 38f910a..5fae8ff 100644 --- a/recipes/switchdev/l2-018-bridge_fdb_team.py +++ b/recipes/switchdev/l2-018-bridge_fdb_team.py @@ -36,103 +36,61 @@ def do_task(ctl, hosts, ifaces, aliases):
tl = TestLib(ctl, aliases) tl.ping_simple(m1_lag1, m2_lag1) - tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software") - tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware") - sw_lag1.set_br_learning(on=False, self=True) + tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, True, True) + sw_lag1.set_br_learning(on=False, master=True)
sleep(30)
- tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False) - tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware", False) + tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, True, True, False)
# Make sure FDB is not populated when learning is disabled. - sw_lag1.set_br_learning(on=False, self=True) + sw_lag1.set_br_learning(on=False, master=True) tl.ping_simple(m1_lag1, m2_lag1) - tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False) - tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware", False) + tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, True, True, False)
# Disable flooding and make sure ping fails. - sw_lag1.set_br_flooding(on=False, self=True) + sw_lag1.set_br_flooding(on=False, master=True) tl.ping_simple(m1_lag1, m2_lag1, fail_expected=True)
- # Set a static FDB entry and make sure ping works again. - sw_lag1.add_br_fdb(str(m1_lag1.get_hwaddr()), self=True, vlan_tci=1) + # Set a static FDB entry and make sure ping works again. Also check + # its offloaded + sw_lag1.add_br_fdb(str(m1_lag1.get_hwaddr()), master=True, vlan_tci=1) tl.ping_simple(m1_lag1, m2_lag1) - tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False) - tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware") + tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, True, False)
# Remove static FDB entry. Ping should fail. - sw_lag1.del_br_fdb(str(m1_lag1.get_hwaddr()), self=True, vlan_tci=1) + sw_lag1.del_br_fdb(str(m1_lag1.get_hwaddr()), master=True, vlan_tci=1) tl.ping_simple(m1_lag1, m2_lag1, fail_expected=True) - tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False) - tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware", False) + tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, True, False, False)
- # Enable learning_sync and make sure both FDBs are populated. - sw_lag1.set_br_learning(on=True, self=True) - sw_lag1.set_br_flooding(on=True, self=True) - sw_lag1.set_br_learning_sync(on=True, self=True) + # Enable learning and flooading and make sure ping works again. + sw_lag1.set_br_learning(on=True, master=True) + sw_lag1.set_br_flooding(on=True, master=True) tl.ping_simple(m1_lag1, m2_lag1) - tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software") - tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware") - sw_lag1.set_br_learning(on=False, self=True) + tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, True, True) + sw_lag1.set_br_learning(on=False, master=True)
sleep(30)
- tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False) - tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware", False) + tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, True, True, False)
- # Disable learning_sync and make sure only hardware FDB is populated. - sw_lag1.set_br_learning(on=True, self=True) - sw_lag1.set_br_learning_sync(on=False, self=True) + # Insert a static FDB entry. Ping should work. + sw_lag1.add_br_fdb(str(m1_lag1.get_hwaddr()), master=True, vlan_tci=1) tl.ping_simple(m1_lag1, m2_lag1) - tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False) - tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware") - - # Remove port from bridge and add it back. Disable flooding and learning - # and make sure ping doesn't work. Note that port must be removed from - # bridge when the FDB entry exists only in the hardware table. Otherwise, - # bridge code will flush it himself, instead of driver. - sw_br.slave_del(sw_lag1.get_id()) - sw_br.slave_add(sw_lag1.get_id()) # Enables learning sync by default. - sw_lag1.set_br_learning(on=False, self=True) - sw_lag1.set_br_flooding(on=False, self=True) - tl.ping_simple(m1_lag1, m2_lag1, fail_expected=True) - - # Enable learning and make sure ping works again. - sw_lag1.set_br_learning(on=True, self=True) - tl.ping_simple(m1_lag1, m2_lag1) - tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software") - tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware") - sw_lag1.set_br_learning(on=False, self=True) - - sleep(30) - - tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False) - tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware", False) - - # Insert a static FDB entry and disable learning sync. Ping should work. - sw_lag1.add_br_fdb(str(m1_lag1.get_hwaddr()), self=True, vlan_tci=1) - sw_lag1.set_br_learning_sync(on=False, self=True) - tl.ping_simple(m1_lag1, m2_lag1) - tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False) - tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware") + tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, True, False)
sleep(30)
# Make sure static entry is not aged out. - tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False) - tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware") - - # Remove port from bridge and add it back. Disable flooding and learning - # and make sure ping doesn't work. Note that port must be removed from - # bridge when the FDB entry exists only in the hardware table. Otherwise, - # bridge code will flush it himself, instead of driver. Unlike the - # previous case, here we check if the driver correctly removes the static - # entry. + tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, True, False) + + # Remove port from bridge and add it back. The static entry added + # before should be flushed. Disable flooding and learning and make + # sure ping doesn't work. sw_br.slave_del(sw_lag1.get_id()) sw_br.slave_add(sw_lag1.get_id()) - sw_lag1.set_br_learning(on=False, self=True) - sw_lag1.set_br_flooding(on=False, self=True) + sw_lag1.set_br_learning(on=False, master=True) + sw_lag1.set_br_flooding(on=False, master=True) tl.ping_simple(m1_lag1, m2_lag1, fail_expected=True)
do_task(ctl, [ctl.get_host("machine1"), diff --git a/recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py b/recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py index 03b5bfe..ec786b2 100644 --- a/recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py +++ b/recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py @@ -43,103 +43,61 @@ def do_task(ctl, hosts, ifaces, aliases):
tl = TestLib(ctl, aliases) tl.ping_simple(m1_lag1_10, m2_lag1_20) - tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software") - tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware") - sw_lag1_10.set_br_learning(on=False, self=True) + tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, True, True) + sw_lag1_10.set_br_learning(on=False, master=True)
sleep(30)
- tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software", False) - tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware", False) + tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, True, True, False)
# Make sure FDB is not populated when learning is disabled. - sw_lag1_10.set_br_learning(on=False, self=True) + sw_lag1_10.set_br_learning(on=False, master=True) tl.ping_simple(m1_lag1_10, m2_lag1_20) - tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software", False) - tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware", False) + tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, True, True, False)
# Disable flooding and make sure ping fails. - sw_lag1_10.set_br_flooding(on=False, self=True) + sw_lag1_10.set_br_flooding(on=False, master=True) tl.ping_simple(m1_lag1_10, m2_lag1_20, fail_expected=True)
- # Set a static FDB entry and make sure ping works again. - sw_lag1_10.add_br_fdb(str(m1_lag1_10.get_hwaddr()), self=True) + # Set a static FDB entry and make sure ping works again. Also check + # its offloaded + sw_lag1_10.add_br_fdb(str(m1_lag1_10.get_hwaddr()), master=True) tl.ping_simple(m1_lag1_10, m2_lag1_20) - tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software", False) - tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware") + tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, True, False)
# Remove static FDB entry. Ping should fail. - sw_lag1_10.del_br_fdb(str(m1_lag1_10.get_hwaddr()), self=True) + sw_lag1_10.del_br_fdb(str(m1_lag1_10.get_hwaddr()), master=True) tl.ping_simple(m1_lag1_10, m2_lag1_20, fail_expected=True) - tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software", False) - tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware", False) + tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, True, False, False)
- # Enable learning_sync and make sure both FDBs are populated. - sw_lag1_10.set_br_learning(on=True, self=True) - sw_lag1_10.set_br_flooding(on=True, self=True) - sw_lag1_10.set_br_learning_sync(on=True, self=True) + # Enable learning and flooding and make sure ping works again. + sw_lag1_10.set_br_learning(on=True, master=True) + sw_lag1_10.set_br_flooding(on=True, master=True) tl.ping_simple(m1_lag1_10, m2_lag1_20) - tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software") - tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware") - sw_lag1_10.set_br_learning(on=False, self=True) + tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, True, True) + sw_lag1_10.set_br_learning(on=False, master=True)
sleep(30)
- tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software", False) - tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware", False) + tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, True, True, False)
- # Disable learning_sync and make sure only hardware FDB is populated. - sw_lag1_10.set_br_learning(on=True, self=True) - sw_lag1_10.set_br_learning_sync(on=False, self=True) + # Insert a static FDB entry. Ping should work. + sw_lag1_10.add_br_fdb(str(m1_lag1_10.get_hwaddr()), master=True) tl.ping_simple(m1_lag1_10, m2_lag1_20) - tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software", False) - tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware") - - # Remove port from bridge and add it back. Disable flooding and learning - # and make sure ping doesn't work. Note that port must be removed from - # bridge when the FDB entry exists only in the hardware table. Otherwise, - # bridge code will flush it himself, instead of driver. - sw_br.slave_del(sw_lag1_10.get_id()) - sw_br.slave_add(sw_lag1_10.get_id()) # Enables learning sync by default. - sw_lag1_10.set_br_learning(on=False, self=True) - sw_lag1_10.set_br_flooding(on=False, self=True) - tl.ping_simple(m1_lag1_10, m2_lag1_20, fail_expected=True) - - # Enable learning and make sure ping works again. - sw_lag1_10.set_br_learning(on=True, self=True) - tl.ping_simple(m1_lag1_10, m2_lag1_20) - tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software") - tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware") - sw_lag1_10.set_br_learning(on=False, self=True) - - sleep(30) - - tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software", False) - tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware", False) - - # Insert a static FDB entry and disable learning sync. Ping should work. - sw_lag1_10.add_br_fdb(str(m1_lag1_10.get_hwaddr()), self=True) - sw_lag1_10.set_br_learning_sync(on=False, self=True) - tl.ping_simple(m1_lag1_10, m2_lag1_20) - tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software", False) - tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware") + tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, True, False)
sleep(30)
# Make sure static entry is not aged out. - tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software", False) - tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware") - - # Remove port from bridge and add it back. Disable flooding and learning - # and make sure ping doesn't work. Note that port must be removed from - # bridge when the FDB entry exists only in the hardware table. Otherwise, - # bridge code will flush it himself, instead of driver. Unlike the - # previous case, here we check if the driver correctly removes the static - # entry. + tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, True, False) + + # Remove port from bridge and add it back. The static entry added + # before should be flushed. Disable flooding and learning and make + # sure ping doesn't work. sw_br.slave_del(sw_lag1_10.get_id()) sw_br.slave_add(sw_lag1_10.get_id()) - sw_lag1_10.set_br_learning(on=False, self=True) - sw_lag1_10.set_br_flooding(on=False, self=True) + sw_lag1_10.set_br_learning(on=False, master=True) + sw_lag1_10.set_br_flooding(on=False, master=True) tl.ping_simple(m1_lag1_10, m2_lag1_20, fail_expected=True)
do_task(ctl, [ctl.get_host("machine1"),
From: Ido Schimmel idosch@mellanox.com
'iface' should be set to the interface's name and not its IP address.
Fixes: bfa1f380f017 ("recipes: Add recipeset for testing switchdev based switches") Signed-off-by: Ido Schimmel idosch@mellanox.com Signed-off-by: Yuval Mintz yuvalm@mellanox.com --- recipes/switchdev/TestLib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/recipes/switchdev/TestLib.py b/recipes/switchdev/TestLib.py index e5f3512..b6bec38 100644 --- a/recipes/switchdev/TestLib.py +++ b/recipes/switchdev/TestLib.py @@ -107,7 +107,7 @@ class TestLib: "addr": if2.get_ip(1), "count": count, "interval": interval, - "iface" : if1.get_ip(1), + "iface" : if1.get_devname(), "limit_rate": limit_rate})
if self._ipv in [ 'ipv6', 'both' ]:
From: Ido Schimmel idosch@mellanox.com
By default the Linux bridge is multicast enabled and since we want to start testing IPv6 traffic, we should also enable multicast querier on the bridge.
Otherwise, MDB records of the Solicited-Node multicast addresses won't be refreshed and thus aged-out, resulting in packet loss.
Signed-off-by: Ido Schimmel idosch@mellanox.com Signed-off-by: Yuval Mintz yuvalm@mellanox.com --- recipes/switchdev/l2-000-minimal.py | 3 ++- recipes/switchdev/l2-001-bridge.py | 3 ++- recipes/switchdev/l2-002-bridge_fdb.py | 3 ++- recipes/switchdev/l2-003-bridge_stp.py | 3 ++- recipes/switchdev/l2-004-bridge_bond.py | 3 ++- recipes/switchdev/l2-005-bridge_bond_failover.py | 3 ++- recipes/switchdev/l2-006-bridge_team.py | 3 ++- recipes/switchdev/l2-007-bridge_team_failover.py | 3 ++- recipes/switchdev/l2-008-bridge_vlan1q_sanity.py | 2 +- recipes/switchdev/l2-009-bridge_vlan1q.py | 2 +- recipes/switchdev/l2-010-bridge_vlan1d_sanity.py | 8 +++++--- recipes/switchdev/l2-011-bridge_vlan1d.py | 8 +++++--- recipes/switchdev/l2-012-bridge_bond_vlan1d_sanity.py | 8 +++++--- recipes/switchdev/l2-013-bridge_bond_vlan1d.py | 8 +++++--- recipes/switchdev/l2-014-bridge_team_vlan1d_sanity.py | 8 +++++--- recipes/switchdev/l2-015-bridge_team_vlan1d.py | 8 +++++--- recipes/switchdev/l2-017-bridge_fdb_vlan1d.py | 2 +- recipes/switchdev/l2-018-bridge_fdb_team.py | 2 +- recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py | 2 +- recipes/switchdev/l2-021-span.py | 3 ++- recipes/switchdev/tc-001-action-vlan-modify.py | 3 ++- recipes/switchdev/tc-002-flower-vlan.py | 3 ++- 22 files changed, 57 insertions(+), 34 deletions(-)
diff --git a/recipes/switchdev/l2-000-minimal.py b/recipes/switchdev/l2-000-minimal.py index 2b4dda7..9aab19a 100644 --- a/recipes/switchdev/l2-000-minimal.py +++ b/recipes/switchdev/l2-000-minimal.py @@ -19,7 +19,8 @@ def do_task(ctl, hosts, ifaces, aliases): m1_if1.reset(ip=["192.168.101.10/24", "2002::1/64"]) m2_if1.reset(ip=["192.168.101.11/24", "2002::2/64"])
- sw.create_bridge(slaves=[sw_if1, sw_if2], options={"vlan_filtering": 1}) + sw.create_bridge(slaves=[sw_if1, sw_if2], options={"vlan_filtering": 1, + "multicast_querier": 1})
sleep(30)
diff --git a/recipes/switchdev/l2-001-bridge.py b/recipes/switchdev/l2-001-bridge.py index 0b530b1..532be78 100644 --- a/recipes/switchdev/l2-001-bridge.py +++ b/recipes/switchdev/l2-001-bridge.py @@ -19,7 +19,8 @@ def do_task(ctl, hosts, ifaces, aliases): m1_if1.reset(ip=["192.168.101.10/24", "2002::1/64"]) m2_if1.reset(ip=["192.168.101.11/24", "2002::2/64"])
- sw.create_bridge(slaves=[sw_if1, sw_if2], options={"vlan_filtering": 1}) + sw.create_bridge(slaves=[sw_if1, sw_if2], options={"vlan_filtering": 1, + "multicast_querier": 1})
sleep(30)
diff --git a/recipes/switchdev/l2-002-bridge_fdb.py b/recipes/switchdev/l2-002-bridge_fdb.py index 63f9852..5f412b6 100644 --- a/recipes/switchdev/l2-002-bridge_fdb.py +++ b/recipes/switchdev/l2-002-bridge_fdb.py @@ -25,7 +25,8 @@ def do_task(ctl, hosts, ifaces, aliases): m2_if1.reset(ip=test_ip(1,2))
# Ageing time is 10 seconds. - br_options = {"vlan_filtering": 1, "ageing_time": 1000} + br_options = {"vlan_filtering": 1, "ageing_time": 1000, + "multicast_querier": 1} sw_br = sw.create_bridge(slaves = [sw_if1, sw_if2], options=br_options)
sleep(30) diff --git a/recipes/switchdev/l2-003-bridge_stp.py b/recipes/switchdev/l2-003-bridge_stp.py index 347b2d7..5f0fbd2 100644 --- a/recipes/switchdev/l2-003-bridge_stp.py +++ b/recipes/switchdev/l2-003-bridge_stp.py @@ -22,7 +22,8 @@ def do_task(ctl, hosts, ifaces, aliases): m1_if1, m2_if1, sw_if1, sw_if2 = ifaces
# We can't set STP state if kernel's STP is running. - br_options = {"stp_state": 0, "vlan_filtering": 1, "ageing_time": 1000} + br_options = {"stp_state": 0, "vlan_filtering": 1, "ageing_time": 1000, + "multicast_querier": 1} sw.create_bridge(slaves=[sw_if1, sw_if2], options=br_options)
m1_if1.reset(ip=test_ip(1, 1)) diff --git a/recipes/switchdev/l2-004-bridge_bond.py b/recipes/switchdev/l2-004-bridge_bond.py index 9599760..590218b 100644 --- a/recipes/switchdev/l2-004-bridge_bond.py +++ b/recipes/switchdev/l2-004-bridge_bond.py @@ -25,7 +25,8 @@ def do_task(ctl, hosts, ifaces, aliases): sw_lag1 = sw.create_bond(slaves=[sw_if1, sw_if2], options=bond_options) sw_lag2 = sw.create_bond(slaves=[sw_if3, sw_if4], options=bond_options)
- sw.create_bridge(slaves=[sw_lag1, sw_lag2], options={"vlan_filtering": 1}) + sw.create_bridge(slaves=[sw_lag1, sw_lag2], options={"vlan_filtering": 1, + "multicast_querier": 1})
sleep(30)
diff --git a/recipes/switchdev/l2-005-bridge_bond_failover.py b/recipes/switchdev/l2-005-bridge_bond_failover.py index f3e0b76..f048890 100644 --- a/recipes/switchdev/l2-005-bridge_bond_failover.py +++ b/recipes/switchdev/l2-005-bridge_bond_failover.py @@ -25,7 +25,8 @@ def do_task(ctl, hosts, ifaces, aliases): sw_lag1 = sw.create_bond(slaves=[sw_if1, sw_if2], options=bond_options) sw_lag2 = sw.create_bond(slaves=[sw_if3, sw_if4], options=bond_options)
- sw.create_bridge(slaves=[sw_lag1, sw_lag2], options={"vlan_filtering": 1}) + sw.create_bridge(slaves=[sw_lag1, sw_lag2], options={"vlan_filtering": 1, + "multicast_querier": 1})
sleep(30)
diff --git a/recipes/switchdev/l2-006-bridge_team.py b/recipes/switchdev/l2-006-bridge_team.py index a649e6f..6d82b80 100644 --- a/recipes/switchdev/l2-006-bridge_team.py +++ b/recipes/switchdev/l2-006-bridge_team.py @@ -32,7 +32,8 @@ def do_task(ctl, hosts, ifaces, aliases): config=team_config)
sw_br = sw.create_bridge(slaves=[sw_lag1, sw_lag2], - options={"vlan_filtering": 1}) + options={"vlan_filtering": 1, + "multicast_querier": 1})
sleep(30)
diff --git a/recipes/switchdev/l2-007-bridge_team_failover.py b/recipes/switchdev/l2-007-bridge_team_failover.py index c89db02..3eb24ed 100644 --- a/recipes/switchdev/l2-007-bridge_team_failover.py +++ b/recipes/switchdev/l2-007-bridge_team_failover.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.create_bridge(slaves=[sw_lag1, sw_lag2], options={"vlan_filtering": 1, + "multicast_querier": 1})
sleep(30)
diff --git a/recipes/switchdev/l2-008-bridge_vlan1q_sanity.py b/recipes/switchdev/l2-008-bridge_vlan1q_sanity.py index 0133df4..4afb94c 100644 --- a/recipes/switchdev/l2-008-bridge_vlan1q_sanity.py +++ b/recipes/switchdev/l2-008-bridge_vlan1q_sanity.py @@ -44,7 +44,7 @@ def do_task(ctl, hosts, ifaces, aliases): m2_if1_20 = m2.create_vlan(m2_if1, 20, ip=test_ip(3, 2)) m2_if1_30 = m2.create_vlan(m2_if1, 30, ip=test_ip(4, 2))
- br_options = {"vlan_filtering": 1} + br_options = {"vlan_filtering": 1, "multicast_snooping": 0} sw_br = sw.create_bridge(slaves=[sw_if1, sw_if2], options=br_options)
sw_if1.add_br_vlan(10) diff --git a/recipes/switchdev/l2-009-bridge_vlan1q.py b/recipes/switchdev/l2-009-bridge_vlan1q.py index 5b8dea6..5fe3ccf 100644 --- a/recipes/switchdev/l2-009-bridge_vlan1q.py +++ b/recipes/switchdev/l2-009-bridge_vlan1q.py @@ -29,7 +29,7 @@ def do_task(ctl, hosts, ifaces, aliases): m2_if1_10 = m2.create_vlan(m2_if1, 10, ip=test_ip(2, 2)) m2_if1_20 = m2.create_vlan(m2_if1, 20, ip=test_ip(3, 2))
- br_options = {"vlan_filtering": 1} + br_options = {"vlan_filtering": 1, "multicast_snooping": 0} sw.create_bridge(slaves=[sw_if1, sw_if2], options=br_options)
sw_if1.add_br_vlan(10) diff --git a/recipes/switchdev/l2-010-bridge_vlan1d_sanity.py b/recipes/switchdev/l2-010-bridge_vlan1d_sanity.py index acc696b..549d030 100644 --- a/recipes/switchdev/l2-010-bridge_vlan1d_sanity.py +++ b/recipes/switchdev/l2-010-bridge_vlan1d_sanity.py @@ -31,16 +31,18 @@ def do_task(ctl, hosts, ifaces, aliases): m2_if1_21 = m2.create_vlan(m2_if1, 21, ip=test_ip(3, 2)) m2_if1_30 = m2.create_vlan(m2_if1, 30, ip=test_ip(4, 2))
- br_options = {"vlan_filtering": 1} + br_options = {"vlan_filtering": 1, "multicast_querier": 1} sw.create_bridge(slaves=[sw_if1, sw_if2], options=br_options)
sw_if1_10 = sw.create_vlan(sw_if1, 10) sw_if2_10 = sw.create_vlan(sw_if2, 10) - sw_br = sw.create_bridge(slaves=[sw_if1_10, sw_if2_10]) + sw_br = sw.create_bridge(slaves=[sw_if1_10, sw_if2_10], + options={"multicast_querier": 1})
sw_if1_20 = sw.create_vlan(sw_if1, 20) sw_if2_21 = sw.create_vlan(sw_if2, 21) - sw.create_bridge(slaves=[sw_if1_20, sw_if2_21]) + sw.create_bridge(slaves=[sw_if1_20, sw_if2_21], + options={"multicast_querier": 1})
sleep(30)
diff --git a/recipes/switchdev/l2-011-bridge_vlan1d.py b/recipes/switchdev/l2-011-bridge_vlan1d.py index f5e4cd1..2024398 100644 --- a/recipes/switchdev/l2-011-bridge_vlan1d.py +++ b/recipes/switchdev/l2-011-bridge_vlan1d.py @@ -29,16 +29,18 @@ def do_task(ctl, hosts, ifaces, aliases): m2_if1_10 = m2.create_vlan(m2_if1, 10, ip=test_ip(2, 2)) m2_if1_21 = m2.create_vlan(m2_if1, 21, ip=test_ip(3, 2))
- br_options = {"vlan_filtering": 1} + br_options = {"vlan_filtering": 1, "multicast_querier": 1} sw.create_bridge(slaves=[sw_if1, sw_if2], options=br_options)
sw_if1_10 = sw.create_vlan(sw_if1, 10) sw_if2_10 = sw.create_vlan(sw_if2, 10) - sw.create_bridge(slaves=[sw_if1_10, sw_if2_10]) + sw.create_bridge(slaves=[sw_if1_10, sw_if2_10], + options={"multicast_querier": 1})
sw_if1_20 = sw.create_vlan(sw_if1, 20) sw_if2_21 = sw.create_vlan(sw_if2, 21) - sw.create_bridge(slaves=[sw_if1_20, sw_if2_21]) + sw.create_bridge(slaves=[sw_if1_20, sw_if2_21], + options={"multicast_querier": 1})
sleep(30)
diff --git a/recipes/switchdev/l2-012-bridge_bond_vlan1d_sanity.py b/recipes/switchdev/l2-012-bridge_bond_vlan1d_sanity.py index a8d86ba..86718fe 100644 --- a/recipes/switchdev/l2-012-bridge_bond_vlan1d_sanity.py +++ b/recipes/switchdev/l2-012-bridge_bond_vlan1d_sanity.py @@ -35,16 +35,18 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_lag1 = sw.create_bond(slaves=[sw_if1, sw_if2], options=bond_options) sw_lag2 = sw.create_bond(slaves=[sw_if3, sw_if4], options=bond_options) - br_options = {"vlan_filtering": 1} + br_options = {"vlan_filtering": 1, "multicast_querier": 1} 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]) + sw.create_bridge(slaves=[sw_lag1_10, sw_lag2_10], + options={"multicast_querier": 1})
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]) + sw.create_bridge(slaves=[sw_lag1_20, sw_lag2_21], + options={"multicast_querier": 1})
sleep(30)
diff --git a/recipes/switchdev/l2-013-bridge_bond_vlan1d.py b/recipes/switchdev/l2-013-bridge_bond_vlan1d.py index 4e2b36a..b4cf000 100644 --- a/recipes/switchdev/l2-013-bridge_bond_vlan1d.py +++ b/recipes/switchdev/l2-013-bridge_bond_vlan1d.py @@ -33,16 +33,18 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_lag1 = sw.create_bond(slaves=[sw_if1, sw_if2], options=bond_options) sw_lag2 = sw.create_bond(slaves=[sw_if3, sw_if4], options=bond_options) - br_options = {"vlan_filtering": 1} + br_options = {"vlan_filtering": 1, "multicast_querier": 1} 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]) + sw.create_bridge(slaves=[sw_lag1_10, sw_lag2_10], + options={"multicast_querier": 1})
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]) + sw.create_bridge(slaves=[sw_lag1_20, sw_lag2_21], + options={"multicast_querier": 1})
sleep(30)
diff --git a/recipes/switchdev/l2-014-bridge_team_vlan1d_sanity.py b/recipes/switchdev/l2-014-bridge_team_vlan1d_sanity.py index ba92d54..40c4f93 100644 --- a/recipes/switchdev/l2-014-bridge_team_vlan1d_sanity.py +++ b/recipes/switchdev/l2-014-bridge_team_vlan1d_sanity.py @@ -35,16 +35,18 @@ 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} + br_options = {"vlan_filtering": 1, "multicast_querier": 1} 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]) + sw.create_bridge(slaves=[sw_lag1_10, sw_lag2_10], + options={"multicast_querier": 1})
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]) + sw.create_bridge(slaves=[sw_lag1_20, sw_lag2_21], + options={"multicast_querier": 1})
sleep(30)
diff --git a/recipes/switchdev/l2-015-bridge_team_vlan1d.py b/recipes/switchdev/l2-015-bridge_team_vlan1d.py index 473c712..ba44f00 100644 --- a/recipes/switchdev/l2-015-bridge_team_vlan1d.py +++ b/recipes/switchdev/l2-015-bridge_team_vlan1d.py @@ -33,16 +33,18 @@ 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} + br_options = {"vlan_filtering": 1, "multicast_querier": 1} 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_br2 = sw.create_bridge(slaves=[sw_lag1_10, sw_lag2_10]) + sw_br2 = sw.create_bridge(slaves=[sw_lag1_10, sw_lag2_10], + options={"multicast_querier": 1})
sw_lag1_20 = sw.create_vlan(sw_lag1, 20) sw_lag2_21 = sw.create_vlan(sw_lag2, 21) - sw_br3 = sw.create_bridge(slaves=[sw_lag1_20, sw_lag2_21]) + sw_br3 = sw.create_bridge(slaves=[sw_lag1_20, sw_lag2_21], + options={"multicast_querier": 1})
sleep(30)
diff --git a/recipes/switchdev/l2-017-bridge_fdb_vlan1d.py b/recipes/switchdev/l2-017-bridge_fdb_vlan1d.py index 493dddd..4ab4749 100644 --- a/recipes/switchdev/l2-017-bridge_fdb_vlan1d.py +++ b/recipes/switchdev/l2-017-bridge_fdb_vlan1d.py @@ -27,7 +27,7 @@ def do_task(ctl, hosts, ifaces, aliases): sw_if2_20 = sw.create_vlan(sw_if2, 20)
# Ageing time is 10 seconds. - br_options = {"vlan_filtering": 0, "ageing_time": 1000} + br_options = {"vlan_filtering": 0, "ageing_time": 1000, "multicast_querier": 1} sw_br = sw.create_bridge(slaves = [sw_if1_10, sw_if2_20], options=br_options)
sleep(30) diff --git a/recipes/switchdev/l2-018-bridge_fdb_team.py b/recipes/switchdev/l2-018-bridge_fdb_team.py index 5fae8ff..c37b346 100644 --- a/recipes/switchdev/l2-018-bridge_fdb_team.py +++ b/recipes/switchdev/l2-018-bridge_fdb_team.py @@ -29,7 +29,7 @@ def do_task(ctl, hosts, ifaces, aliases): sw_lag2 = sw.create_team(slaves=[sw_if3, sw_if4], config=team_config)
# Ageing time is 10 seconds. - br_options = {"vlan_filtering": 1, "ageing_time": 1000} + br_options = {"vlan_filtering": 1, "ageing_time": 1000, "multicast_querier": 1} sw_br = sw.create_bridge(slaves = [sw_lag1, sw_lag2], options=br_options)
sleep(30) diff --git a/recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py b/recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py index ec786b2..08adc83 100644 --- a/recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py +++ b/recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py @@ -36,7 +36,7 @@ def do_task(ctl, hosts, ifaces, aliases): sw_lag2_20 = sw.create_vlan(sw_lag2, 20)
# Ageing time is 10 seconds. - br_options = {"vlan_filtering": 0, "ageing_time": 1000} + br_options = {"vlan_filtering": 0, "ageing_time": 1000, "multicast_querier": 1} sw_br = sw.create_bridge(slaves = [sw_lag1_10, sw_lag2_20], options=br_options)
sleep(30) diff --git a/recipes/switchdev/l2-021-span.py b/recipes/switchdev/l2-021-span.py index 92dea37..336b3c8 100644 --- a/recipes/switchdev/l2-021-span.py +++ b/recipes/switchdev/l2-021-span.py @@ -97,7 +97,8 @@ def do_task(ctl, hosts, ifaces, aliases): m2_if1.reset(ip=["192.168.101.11/24", "2002::2/64"]) sw_if3.set_link_up() m2_if2.set_link_up() - sw.create_bridge(slaves=[sw_if1, sw_if2], options={"vlan_filtering": 1}) + sw.create_bridge(slaves=[sw_if1, sw_if2], options={"vlan_filtering": 1, + "multicast_querier": 1}) mirred_port = MirredPort(sw_if2)
sleep(30) diff --git a/recipes/switchdev/tc-001-action-vlan-modify.py b/recipes/switchdev/tc-001-action-vlan-modify.py index a9c0d16..5e5ffb3 100644 --- a/recipes/switchdev/tc-001-action-vlan-modify.py +++ b/recipes/switchdev/tc-001-action-vlan-modify.py @@ -19,7 +19,8 @@ def do_task(ctl, hosts, ifaces, aliases): m1_if1_85 = m1.create_vlan(m1_if1, 85, ip=["192.168.101.10/24", "2002::1/64"]) m2_if1_65 = m2.create_vlan(m2_if1, 65, ip=["192.168.101.11/24", "2002::2/64"])
- sw_br1 = sw.create_bridge(slaves=[sw_if1, sw_if2], options={"vlan_filtering": 1}) + sw_br1 = sw.create_bridge(slaves=[sw_if1, sw_if2], options={"vlan_filtering": 1, + "multicast_snooping": 0}) sw_if1.add_br_vlan(85) sw_if2.add_br_vlan(65)
diff --git a/recipes/switchdev/tc-002-flower-vlan.py b/recipes/switchdev/tc-002-flower-vlan.py index 2eb419d..fd504c5 100644 --- a/recipes/switchdev/tc-002-flower-vlan.py +++ b/recipes/switchdev/tc-002-flower-vlan.py @@ -28,7 +28,8 @@ def do_task(ctl, hosts, ifaces, aliases): m2_if1_95 = m2.create_vlan(m2_if1, 95, ip=["192.168.95.11/24", "2002:95::2/64"])
- sw_br1 = sw.create_bridge(slaves=[sw_if1, sw_if2], options={"vlan_filtering": 1}) + sw_br1 = sw.create_bridge(slaves=[sw_if1, sw_if2], options={"vlan_filtering": 1, + "multicast_snooping": 0}) sw_if1.add_br_vlan(85) sw_if2.add_br_vlan(85) sw_if1.add_br_vlan(95)
From: Ido Schimmel idosch@mellanox.com
The set_addresses() function is used in different recipes to remove IP addresses from interfaces, so that the generated routes will be deleted.
However, there's no good reason to flush IPv6 link-local addresses, as it breaks neighbour discovery on the interface.
Signed-off-by: Ido Schimmel idosch@mellanox.com Signed-off-by: Yuval Mintz yuvalm@mellanox.com --- lnst/Slave/InterfaceManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lnst/Slave/InterfaceManager.py b/lnst/Slave/InterfaceManager.py index e28682f..8f12e39 100644 --- a/lnst/Slave/InterfaceManager.py +++ b/lnst/Slave/InterfaceManager.py @@ -736,7 +736,7 @@ class Device(object):
def set_addresses(self, ips): self._conf.set_addresses(ips) - exec_cmd("ip addr flush %s" % self._name) + exec_cmd("ip addr flush %s scope global" % self._name) for address in ips: exec_cmd("ip addr add %s dev %s" % (address, self._name))
From: Ido Schimmel idosch@mellanox.com
The purpose of the recipes is to test ECMP, so we can do with just two links instead of four.
This allows us to run the recipes on more setups without changing their functionality.
Signed-off-by: Ido Schimmel idosch@mellanox.com Signed-off-by: Yuval Mintz yuvalm@mellanox.com --- recipes/switchdev/l3-005-ecmp-basic.py | 13 ++++--------- recipes/switchdev/l3-005-ecmp-basic.xml | 4 ---- recipes/switchdev/l3-006-ecmp-linkdown.py | 13 ++++--------- recipes/switchdev/l3-006-ecmp-linkdown.xml | 4 ---- recipes/switchdev/l3-007-ecmp-maxsize.py | 13 ++++--------- recipes/switchdev/l3-007-ecmp-maxsize.xml | 4 ---- 6 files changed, 12 insertions(+), 39 deletions(-)
diff --git a/recipes/switchdev/l3-005-ecmp-basic.py b/recipes/switchdev/l3-005-ecmp-basic.py index 05f8634..2ccce1a 100644 --- a/recipes/switchdev/l3-005-ecmp-basic.py +++ b/recipes/switchdev/l3-005-ecmp-basic.py @@ -24,16 +24,15 @@ def ipv4(test_ip):
def do_task(ctl, hosts, ifaces, aliases): m1, sw, m2 = hosts - m1_if1, sw_if1, sw_if2, sw_if3, sw_if4, sw_if5, m2_if1, m2_if2, m2_if3, \ - m2_if4, m2_if5, m3_if1 = ifaces + m1_if1, sw_if1, sw_if2, sw_if3, m2_if1, m2_if2, m2_if3, m3_if1 = ifaces
- ecmp_sw_ifaces = [sw_if2, sw_if3, sw_if4, sw_if5] - ecmp_m_ifaces = [m2_if1, m2_if2, m2_if3, m2_if4] + ecmp_sw_ifaces = [sw_if2, sw_if3] + ecmp_m_ifaces = [m2_if1, m2_if2]
m2.config("/proc/sys/net/ipv4/ip_forward", "1")
ecmp_common.create_topology(m1_if1, sw_if1, ecmp_sw_ifaces, ecmp_m_ifaces, - m2_if5, m3_if1) + m2_if3, m3_if1) sleep(30)
tl = TestLib(ctl, aliases) @@ -48,12 +47,8 @@ do_task(ctl, [ctl.get_host("machine1"), ctl.get_host("switch").get_interface("if1"), ctl.get_host("switch").get_interface("if2"), ctl.get_host("switch").get_interface("if3"), - ctl.get_host("switch").get_interface("if4"), - ctl.get_host("switch").get_interface("if5"), ctl.get_host("machine2").get_interface("if1"), ctl.get_host("machine2").get_interface("if2"), - ctl.get_host("machine2").get_interface("if3"), - ctl.get_host("machine2").get_interface("if4"), ctl.get_host("machine2").get_interface("veth0"), ctl.get_host("machine2").get_interface("veth1")], ctl.get_aliases()) diff --git a/recipes/switchdev/l3-005-ecmp-basic.xml b/recipes/switchdev/l3-005-ecmp-basic.xml index c5bf094..7d063b8 100644 --- a/recipes/switchdev/l3-005-ecmp-basic.xml +++ b/recipes/switchdev/l3-005-ecmp-basic.xml @@ -11,16 +11,12 @@ <eth id="if1" label="X" /> <eth id="if2" label="A" /> <eth id="if3" label="B" /> - <eth id="if4" label="C" /> - <eth id="if5" label="D" /> </interfaces> </host> <host id="machine2"> <interfaces> <eth id="if1" label="A" /> <eth id="if2" label="B" /> - <eth id="if3" label="C" /> - <eth id="if4" label="D" /> <veth_pair> <veth id="veth0"/> <veth id="veth1" netns="nsif"> diff --git a/recipes/switchdev/l3-006-ecmp-linkdown.py b/recipes/switchdev/l3-006-ecmp-linkdown.py index 7677399..fb07701 100644 --- a/recipes/switchdev/l3-006-ecmp-linkdown.py +++ b/recipes/switchdev/l3-006-ecmp-linkdown.py @@ -25,16 +25,15 @@ def ipv4(test_ip):
def do_task(ctl, hosts, ifaces, aliases): m1, sw, m2 = hosts - m1_if1, sw_if1, sw_if2, sw_if3, sw_if4, sw_if5, m2_if1, m2_if2, m2_if3, \ - m2_if4, m2_if5, m3_if1 = ifaces + m1_if1, sw_if1, sw_if2, sw_if3, m2_if1, m2_if2, m2_if3, m3_if1 = ifaces
- ecmp_sw_ifaces = [sw_if2, sw_if3, sw_if4, sw_if5] - ecmp_m_ifaces = [m2_if1, m2_if2, m2_if3, m2_if4] + ecmp_sw_ifaces = [sw_if2, sw_if3] + ecmp_m_ifaces = [m2_if1, m2_if2]
m2.config("/proc/sys/net/ipv4/ip_forward", "1")
ecmp_common.create_topology(m1_if1, sw_if1, ecmp_sw_ifaces, ecmp_m_ifaces, - m2_if5, m3_if1) + m2_if3, m3_if1) sleep(30)
tl = TestLib(ctl, aliases) @@ -90,12 +89,8 @@ do_task(ctl, [ctl.get_host("machine1"), ctl.get_host("switch").get_interface("if1"), ctl.get_host("switch").get_interface("if2"), ctl.get_host("switch").get_interface("if3"), - ctl.get_host("switch").get_interface("if4"), - ctl.get_host("switch").get_interface("if5"), ctl.get_host("machine2").get_interface("if1"), ctl.get_host("machine2").get_interface("if2"), - ctl.get_host("machine2").get_interface("if3"), - ctl.get_host("machine2").get_interface("if4"), ctl.get_host("machine2").get_interface("veth0"), ctl.get_host("machine2").get_interface("veth1")], ctl.get_aliases()) diff --git a/recipes/switchdev/l3-006-ecmp-linkdown.xml b/recipes/switchdev/l3-006-ecmp-linkdown.xml index 27a5184..33e93f6 100644 --- a/recipes/switchdev/l3-006-ecmp-linkdown.xml +++ b/recipes/switchdev/l3-006-ecmp-linkdown.xml @@ -11,16 +11,12 @@ <eth id="if1" label="X" /> <eth id="if2" label="A" /> <eth id="if3" label="B" /> - <eth id="if4" label="C" /> - <eth id="if5" label="D" /> </interfaces> </host> <host id="machine2"> <interfaces> <eth id="if1" label="A" /> <eth id="if2" label="B" /> - <eth id="if3" label="C" /> - <eth id="if4" label="D" /> <veth_pair> <veth id="veth0"/> <veth id="veth1" netns="nsif"> diff --git a/recipes/switchdev/l3-007-ecmp-maxsize.py b/recipes/switchdev/l3-007-ecmp-maxsize.py index 64d750a..5936c5e 100644 --- a/recipes/switchdev/l3-007-ecmp-maxsize.py +++ b/recipes/switchdev/l3-007-ecmp-maxsize.py @@ -27,16 +27,15 @@ def ipv4(test_ip):
def do_task(ctl, hosts, ifaces, aliases): m1, sw, m2 = hosts - m1_if1, sw_if1, sw_if2, sw_if3, sw_if4, sw_if5, m2_if1, m2_if2, m2_if3, \ - m2_if4, m2_if5, m3_if1 = ifaces + m1_if1, sw_if1, sw_if2, sw_if3, m2_if1, m2_if2, m2_if3, m3_if1 = ifaces
- ecmp_sw_ifaces = [sw_if2, sw_if3, sw_if4, sw_if5] - ecmp_m_ifaces = [m2_if1, m2_if2, m2_if3, m2_if4] + ecmp_sw_ifaces = [sw_if2, sw_if3] + ecmp_m_ifaces = [m2_if1, m2_if2]
m2.config("/proc/sys/net/ipv4/ip_forward", "1")
ecmp_common.create_topology(m1_if1, sw_if1, ecmp_sw_ifaces, ecmp_m_ifaces, - m2_if5, m3_if1, num_nexthops = MAX_NEXTHOPS) + m2_if3, m3_if1, num_nexthops = MAX_NEXTHOPS) sleep(30)
tl = TestLib(ctl, aliases) @@ -60,12 +59,8 @@ do_task(ctl, [ctl.get_host("machine1"), ctl.get_host("switch").get_interface("if1"), ctl.get_host("switch").get_interface("if2"), ctl.get_host("switch").get_interface("if3"), - ctl.get_host("switch").get_interface("if4"), - ctl.get_host("switch").get_interface("if5"), ctl.get_host("machine2").get_interface("if1"), ctl.get_host("machine2").get_interface("if2"), - ctl.get_host("machine2").get_interface("if3"), - ctl.get_host("machine2").get_interface("if4"), ctl.get_host("machine2").get_interface("veth0"), ctl.get_host("machine2").get_interface("veth1")], ctl.get_aliases()) diff --git a/recipes/switchdev/l3-007-ecmp-maxsize.xml b/recipes/switchdev/l3-007-ecmp-maxsize.xml index a6b1bad..8d4391b 100644 --- a/recipes/switchdev/l3-007-ecmp-maxsize.xml +++ b/recipes/switchdev/l3-007-ecmp-maxsize.xml @@ -11,16 +11,12 @@ <eth id="if1" label="X" /> <eth id="if2" label="A" /> <eth id="if3" label="B" /> - <eth id="if4" label="C" /> - <eth id="if5" label="D" /> </interfaces> </host> <host id="machine2"> <interfaces> <eth id="if1" label="A" /> <eth id="if2" label="B" /> - <eth id="if3" label="C" /> - <eth id="if4" label="D" /> <veth_pair> <veth id="veth0"/> <veth id="veth1" netns="nsif">
From: Ido Schimmel idosch@mellanox.com
The 'ignore_routes_with_linkdown' is currently only supported for IPv4, so don't test IPv6.
Signed-off-by: Ido Schimmel idosch@mellanox.com Signed-off-by: Yuval Mintz yuvalm@mellanox.com --- recipes/switchdev/l3-006-ecmp-linkdown.xml | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/recipes/switchdev/l3-006-ecmp-linkdown.xml b/recipes/switchdev/l3-006-ecmp-linkdown.xml index 33e93f6..62fb842 100644 --- a/recipes/switchdev/l3-006-ecmp-linkdown.xml +++ b/recipes/switchdev/l3-006-ecmp-linkdown.xml @@ -1,5 +1,8 @@ <lnstrecipe xmlns:xi="http://www.w3.org/2003/XInclude"> <xi:include href="default_aliases.xml" /> + <define> + <alias name="ipv" value="ipv4" /> + </define> <network> <host id="machine1"> <interfaces>
From: Ido Schimmel idosch@mellanox.com
Signed-off-by: Ido Schimmel idosch@mellanox.com Signed-off-by: Yuval Mintz yuvalm@mellanox.com --- recipes/switchdev/ecmp_common.py | 10 ++++++++++ recipes/switchdev/l3-000-minimal.py | 6 ++++++ recipes/switchdev/l3-001-router-port.py | 6 ++++++ recipes/switchdev/l3-002-vlan-interface.py | 6 ++++++ recipes/switchdev/l3-003-bond-interface.py | 6 ++++++ recipes/switchdev/l3-004-team-interface.py | 6 ++++++ recipes/switchdev/l3-005-ecmp-basic.py | 10 +--------- recipes/switchdev/l3-007-ecmp-maxsize.py | 10 +--------- recipes/switchdev/l3-009-1q_bridge_rif.py | 7 +++++++ recipes/switchdev/l3-010-1d_bridge_rif.py | 7 +++++++ 10 files changed, 56 insertions(+), 18 deletions(-)
diff --git a/recipes/switchdev/ecmp_common.py b/recipes/switchdev/ecmp_common.py index 8d7bccb..f05ec86 100644 --- a/recipes/switchdev/ecmp_common.py +++ b/recipes/switchdev/ecmp_common.py @@ -14,6 +14,9 @@ def test_ip(major, minor, prefix=[24,64]): def ipv4(test_ip): return test_ip[0]
+def ipv6(test_ip): + return test_ip[1] + def test_traffic(tl, from_if, to_if, ecmp_in_if, ecmp_ifaces, expected = 1., errmsg = "ecmp traffic"): reciever_thresh = 0.9 * PKTGEN_ROUNDS * PKTGEN_COUNT * expected @@ -105,3 +108,10 @@ def create_topology(from_if, ecmp_in_if, ecmp_tx_ifaces, ecmp_rx_ifaces, ecmp_out_if.add_nhs_route(ipv4(test_ip(1,0)), [str(i.get_ip(0)) for i in ecmp_tx_ifaces]) to_if.add_nhs_route(ipv4(test_ip(1,0)), [str(ecmp_out_if.get_ip(0))]) + + from_if.add_nhs_route(ipv6(test_ip(2,0)), [str(ecmp_in_if.get_ip(1))]) + ecmp_in_if.add_nhs_route(ipv6(test_ip(2,0)), + [str(ipv6(nh_addr)) for nh_addr in nh_addrs]) + ecmp_out_if.add_nhs_route(ipv6(test_ip(1,0)), + [str(i.get_ip(1)) for i in ecmp_tx_ifaces]) + to_if.add_nhs_route(ipv6(test_ip(1,0)), [str(ecmp_out_if.get_ip(1))]) diff --git a/recipes/switchdev/l3-000-minimal.py b/recipes/switchdev/l3-000-minimal.py index f2a9b2c..c56eff8 100644 --- a/recipes/switchdev/l3-000-minimal.py +++ b/recipes/switchdev/l3-000-minimal.py @@ -21,6 +21,9 @@ def test_ip(major, minor, prefix=[24,64]): def ipv4(test_ip): return test_ip[0]
+def ipv6(test_ip): + return test_ip[1] + def do_task(ctl, hosts, ifaces, aliases): m1, m2, sw = hosts m1_if1, m2_if1, sw_if1, sw_if2 = ifaces @@ -34,6 +37,9 @@ def do_task(ctl, hosts, ifaces, aliases): m1_if1.add_nhs_route(ipv4(test_ip(2,0)), [ipv4(test_ip(1,2,[]))]); m2_if1.add_nhs_route(ipv4(test_ip(1,0)), [ipv4(test_ip(2,2,[]))]);
+ m1_if1.add_nhs_route(ipv6(test_ip(2,0)), [ipv6(test_ip(1,2,[]))], ipv6=True); + m2_if1.add_nhs_route(ipv6(test_ip(1,0)), [ipv6(test_ip(2,2,[]))], ipv6=True); + sleep(30)
tl = TestLib(ctl, aliases) diff --git a/recipes/switchdev/l3-001-router-port.py b/recipes/switchdev/l3-001-router-port.py index 18038c4..021cb13 100644 --- a/recipes/switchdev/l3-001-router-port.py +++ b/recipes/switchdev/l3-001-router-port.py @@ -21,6 +21,9 @@ def test_ip(major, minor, prefix=[24,64]): def ipv4(test_ip): return test_ip[0]
+def ipv6(test_ip): + return test_ip[1] + def do_task(ctl, hosts, ifaces, aliases): m1, m2, sw = hosts m1_if1, m2_if1, sw_if1, sw_if2 = ifaces @@ -34,6 +37,9 @@ def do_task(ctl, hosts, ifaces, aliases): m1_if1.add_nhs_route(ipv4(test_ip(2,0)), [ipv4(test_ip(1,2,[]))]); m2_if1.add_nhs_route(ipv4(test_ip(1,0)), [ipv4(test_ip(2,2,[]))]);
+ m1_if1.add_nhs_route(ipv6(test_ip(2,0)), [ipv6(test_ip(1,2,[]))], ipv6=True); + m2_if1.add_nhs_route(ipv6(test_ip(1,0)), [ipv6(test_ip(2,2,[]))], ipv6=True); + sleep(30)
tl = TestLib(ctl, aliases) diff --git a/recipes/switchdev/l3-002-vlan-interface.py b/recipes/switchdev/l3-002-vlan-interface.py index 3fb6398..d52dee2 100644 --- a/recipes/switchdev/l3-002-vlan-interface.py +++ b/recipes/switchdev/l3-002-vlan-interface.py @@ -21,6 +21,9 @@ def test_ip(major, minor, prefix=[24,64]): def ipv4(test_ip): return test_ip[0]
+def ipv6(test_ip): + return test_ip[1] + def do_task(ctl, hosts, ifaces, aliases): m1, m2, sw = hosts m1_if1, m2_if1, sw_if1, sw_if2 = ifaces @@ -37,6 +40,9 @@ def do_task(ctl, hosts, ifaces, aliases): m1_if1_10.add_nhs_route(ipv4(test_ip(2,0)), [ipv4(test_ip(1,2,[]))]); m2_if1_10.add_nhs_route(ipv4(test_ip(1,0)), [ipv4(test_ip(2,2,[]))]);
+ m1_if1.add_nhs_route(ipv6(test_ip(2,0)), [ipv6(test_ip(1,2,[]))], ipv6=True); + m2_if1.add_nhs_route(ipv6(test_ip(1,0)), [ipv6(test_ip(2,2,[]))], ipv6=True); + sleep(30)
tl = TestLib(ctl, aliases) diff --git a/recipes/switchdev/l3-003-bond-interface.py b/recipes/switchdev/l3-003-bond-interface.py index 9538897..edf87ff 100644 --- a/recipes/switchdev/l3-003-bond-interface.py +++ b/recipes/switchdev/l3-003-bond-interface.py @@ -21,6 +21,9 @@ def test_ip(major, minor, prefix=[24,64]): def ipv4(test_ip): return test_ip[0]
+def ipv6(test_ip): + return test_ip[1] + def do_task(ctl, hosts, ifaces, aliases): m1, m2, sw = hosts m1_if1, m1_if2, m2_if1, m2_if2, sw_if1, sw_if2, sw_if3, sw_if4 = ifaces @@ -34,6 +37,9 @@ def do_task(ctl, hosts, ifaces, aliases): m1_lag1.add_nhs_route(ipv4(test_ip(2,0)), [ipv4(test_ip(1,2,[]))]); m2_lag1.add_nhs_route(ipv4(test_ip(1,0)), [ipv4(test_ip(2,2,[]))]);
+ m1_if1.add_nhs_route(ipv6(test_ip(2,0)), [ipv6(test_ip(1,2,[]))], ipv6=True); + m2_if1.add_nhs_route(ipv6(test_ip(1,0)), [ipv6(test_ip(2,2,[]))], ipv6=True); + sw_lag1 = sw.create_bond(slaves=[sw_if1, sw_if2], options=bond_options, ip=test_ip(1,2)) sw_lag2 = sw.create_bond(slaves=[sw_if3, sw_if4], options=bond_options, diff --git a/recipes/switchdev/l3-004-team-interface.py b/recipes/switchdev/l3-004-team-interface.py index efc255d..77605d3 100644 --- a/recipes/switchdev/l3-004-team-interface.py +++ b/recipes/switchdev/l3-004-team-interface.py @@ -21,6 +21,9 @@ def test_ip(major, minor, prefix=[24,64]): def ipv4(test_ip): return test_ip[0]
+def ipv6(test_ip): + return test_ip[1] + def do_task(ctl, hosts, ifaces, aliases): m1, m2, sw = hosts m1_if1, m1_if2, m2_if1, m2_if2, sw_if1, sw_if2, sw_if3, sw_if4 = ifaces @@ -34,6 +37,9 @@ def do_task(ctl, hosts, ifaces, aliases): m1_lag1.add_nhs_route(ipv4(test_ip(2,0)), [ipv4(test_ip(1,2,[]))]); m2_lag1.add_nhs_route(ipv4(test_ip(1,0)), [ipv4(test_ip(2,2,[]))]);
+ m1_if1.add_nhs_route(ipv6(test_ip(2,0)), [ipv6(test_ip(1,2,[]))], ipv6=True); + m2_if1.add_nhs_route(ipv6(test_ip(1,0)), [ipv6(test_ip(2,2,[]))], ipv6=True); + sw_lag1 = sw.create_team(slaves=[sw_if1, sw_if2], config=team_config, ip=test_ip(1,2)) sw_lag2 = sw.create_team(slaves=[sw_if3, sw_if4], config=team_config, diff --git a/recipes/switchdev/l3-005-ecmp-basic.py b/recipes/switchdev/l3-005-ecmp-basic.py index 2ccce1a..bcccfc5 100644 --- a/recipes/switchdev/l3-005-ecmp-basic.py +++ b/recipes/switchdev/l3-005-ecmp-basic.py @@ -13,15 +13,6 @@ from TestLib import TestLib from time import sleep import ecmp_common
-def test_ip(major, minor, prefix=[24,64]): - return ["192.168.1%d.%d%s" % (major, minor, - "/" + str(prefix[0]) if len(prefix) > 0 else ""), - "2002:%d::%d%s" % (major, minor, - "/" + str(prefix[1]) if len(prefix) > 1 else "")] - -def ipv4(test_ip): - return test_ip[0] - def do_task(ctl, hosts, ifaces, aliases): m1, sw, m2 = hosts m1_if1, sw_if1, sw_if2, sw_if3, m2_if1, m2_if2, m2_if3, m3_if1 = ifaces @@ -30,6 +21,7 @@ def do_task(ctl, hosts, ifaces, aliases): ecmp_m_ifaces = [m2_if1, m2_if2]
m2.config("/proc/sys/net/ipv4/ip_forward", "1") + m2.config("/proc/sys/net/ipv6/conf/all/forwarding", "1")
ecmp_common.create_topology(m1_if1, sw_if1, ecmp_sw_ifaces, ecmp_m_ifaces, m2_if3, m3_if1) diff --git a/recipes/switchdev/l3-007-ecmp-maxsize.py b/recipes/switchdev/l3-007-ecmp-maxsize.py index 5936c5e..794030e 100644 --- a/recipes/switchdev/l3-007-ecmp-maxsize.py +++ b/recipes/switchdev/l3-007-ecmp-maxsize.py @@ -16,15 +16,6 @@ import ecmp_common
MAX_NEXTHOPS = 32
-def test_ip(major, minor, prefix=[24,64]): - return ["192.168.1%d.%d%s" % (major, minor, - "/" + str(prefix[0]) if len(prefix) > 0 else ""), - "2002:%d::%d%s" % (major, minor, - "/" + str(prefix[1]) if len(prefix) > 1 else "")] - -def ipv4(test_ip): - return test_ip[0] - def do_task(ctl, hosts, ifaces, aliases): m1, sw, m2 = hosts m1_if1, sw_if1, sw_if2, sw_if3, m2_if1, m2_if2, m2_if3, m3_if1 = ifaces @@ -33,6 +24,7 @@ def do_task(ctl, hosts, ifaces, aliases): ecmp_m_ifaces = [m2_if1, m2_if2]
m2.config("/proc/sys/net/ipv4/ip_forward", "1") + m2.config("/proc/sys/net/ipv6/conf/all/forwarding", "1")
ecmp_common.create_topology(m1_if1, sw_if1, ecmp_sw_ifaces, ecmp_m_ifaces, m2_if3, m3_if1, num_nexthops = MAX_NEXTHOPS) diff --git a/recipes/switchdev/l3-009-1q_bridge_rif.py b/recipes/switchdev/l3-009-1q_bridge_rif.py index 5acff45..4d44fe2 100644 --- a/recipes/switchdev/l3-009-1q_bridge_rif.py +++ b/recipes/switchdev/l3-009-1q_bridge_rif.py @@ -29,6 +29,9 @@ def test_ip(major, minor, prefix=[24,64]): def ipv4(test_ip): return test_ip[0]
+def ipv6(test_ip): + return test_ip[1] + def do_task(ctl, hosts, ifaces, aliases): """ Create the following topology: @@ -85,6 +88,10 @@ def do_task(ctl, hosts, ifaces, aliases): m2_if1.add_nhs_route(ipv4(test_ip(2, 0)), [str(sw_br_v10.get_ip(0))]) m3_if1.add_nhs_route(ipv4(test_ip(1, 0)), [str(sw_if2.get_ip(0))])
+ m1_if1.add_nhs_route(ipv6(test_ip(2, 0)), [str(sw_br_v10.get_ip(1))], ipv6=True) + m2_if1.add_nhs_route(ipv6(test_ip(2, 0)), [str(sw_br_v10.get_ip(1))], ipv6=True) + m3_if1.add_nhs_route(ipv6(test_ip(1, 0)), [str(sw_if2.get_ip(1))], ipv6=True) + sleep(30) tl = TestLib(ctl, aliases) tl.ping_simple(m2_if1_v10, m1_if1_v10) diff --git a/recipes/switchdev/l3-010-1d_bridge_rif.py b/recipes/switchdev/l3-010-1d_bridge_rif.py index 38c3d9e..1894ffb 100644 --- a/recipes/switchdev/l3-010-1d_bridge_rif.py +++ b/recipes/switchdev/l3-010-1d_bridge_rif.py @@ -29,6 +29,9 @@ def test_ip(major, minor, prefix=[24,64]): def ipv4(test_ip): return test_ip[0]
+def ipv6(test_ip): + return test_ip[1] + def do_task(ctl, hosts, ifaces, aliases): """ Create the following topology: @@ -84,6 +87,10 @@ def do_task(ctl, hosts, ifaces, aliases): m2_if1.add_nhs_route(ipv4(test_ip(2, 0)), [str(sw_br.get_ip(0))]) m3_if1.add_nhs_route(ipv4(test_ip(1, 0)), [str(sw_if2.get_ip(0))])
+ m1_if1.add_nhs_route(ipv6(test_ip(2, 0)), [str(sw_br.get_ip(1))]) + m2_if1.add_nhs_route(ipv6(test_ip(2, 0)), [str(sw_br.get_ip(1))]) + m3_if1.add_nhs_route(ipv6(test_ip(1, 0)), [str(sw_if2.get_ip(1))]) + sleep(30) tl = TestLib(ctl, aliases) tl.ping_simple(m2_if1_v10, m1_if1_v10)
From: Ido Schimmel idosch@mellanox.com
In kernel 4.14 capable drivers started to provide offload indication on a per-nexthop basis, so we need to parse these flags as well.
Signed-off-by: Ido Schimmel idosch@mellanox.com Signed-off-by: Yuval Mintz yuvalm@mellanox.com --- lnst/Slave/NetTestSlave.py | 4 ++-- recipes/switchdev/l3-007-ecmp-maxsize.py | 6 +++--- recipes/switchdev/l3-008-routes_stress.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py index 1626a38..4561492 100644 --- a/lnst/Slave/NetTestSlave.py +++ b/lnst/Slave/NetTestSlave.py @@ -802,10 +802,10 @@ class SlaveMethods: for nh_route_match in nh_route_matchs: nexthop = { "ip" : nh_route_match[1], "dev" : nh_route_match[2], - "flags" : ""} + "flags" : nh_route_match[3]} nh_route = {"prefix" : nh_route_match[0], "nexthops": [ nexthop ], - "flags" : nh_route_match[3] } + "flags" : ""} nh_routes.append(nh_route)
# parse ECMP routes diff --git a/recipes/switchdev/l3-007-ecmp-maxsize.py b/recipes/switchdev/l3-007-ecmp-maxsize.py index 794030e..f6c477a 100644 --- a/recipes/switchdev/l3-007-ecmp-maxsize.py +++ b/recipes/switchdev/l3-007-ecmp-maxsize.py @@ -40,9 +40,9 @@ def do_task(ctl, hosts, ifaces, aliases): if len(nh_routes) != 1: tl.custom(sw, "route", "could not find the ecmp route")
- route_flags = nh_routes[0]["flags"] - if "offload" not in route_flags: - tl.custom(sw, "route", "ecmp route is not offloaded") + for nh in nh_routes[0]["nexthops"]: + if "offload" not in nh["flags"]: + tl.custom(sw, "route", "ecmp route is not offloaded")
do_task(ctl, [ctl.get_host("machine1"), ctl.get_host("switch"), diff --git a/recipes/switchdev/l3-008-routes_stress.py b/recipes/switchdev/l3-008-routes_stress.py index 2187cd2..69738dd 100644 --- a/recipes/switchdev/l3-008-routes_stress.py +++ b/recipes/switchdev/l3-008-routes_stress.py @@ -97,7 +97,7 @@ def do_task(ctl, hosts, ifaces, aliases): dc_routes, nh_routes = sw.get_routes() offloaded_routes_num = 0 for nh_route in nh_routes: - if "offload" in nh_route["flags"]: + if "offload" in nh_route["nexthops"][0]["flags"]: offloaded_routes_num += 1
if offloaded_routes_num < ROUTES_COUNT:
From: Yotam Gigi yotamg@mellanox.com
Change the span recipe to use the clsact qdisc rather than the ingress and egress qdiscs. Using the clsact qdisc it is possible to add both ingress and egress filters, so update the code to accommodate with these changes.
Signed-off-by: Yotam Gigi yotamg@mellanox.com Signed-off-by: Yuval Mintz yuvalm@mellanox.com --- recipes/switchdev/l2-021-span.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/recipes/switchdev/l2-021-span.py b/recipes/switchdev/l2-021-span.py index 336b3c8..f9d6df9 100644 --- a/recipes/switchdev/l2-021-span.py +++ b/recipes/switchdev/l2-021-span.py @@ -21,24 +21,22 @@ class MirredPort: self.mirred_port = mirred_port self.mach = mach
- mach.run("tc qdisc replace dev %s handle 0: root prio" % devname) - mach.run("tc qdisc add dev %s handle ffff: ingress" % devname) + mach.run("tc qdisc add dev %s clsact" % devname) self.pref = [1, 1]
def create_mirror(self, to_port, ingress = False): - ingress_str = "ingress" if ingress else "" - qdisc_handle = "ffff" if ingress else "0" + ingress_str = "ingress" if ingress else "egress" from_dev = self.mirred_port.get_devname() to_dev = to_port.get_devname()
- self.mach.run("tc filter add dev %s parent %s: pref %d matchall \ + self.mach.run("tc filter add dev %s %s pref %d matchall \ skip_sw action mirred egress mirror dev %s" % (from_dev, - qdisc_handle, self.pref[ingress], to_dev)) + ingress_str, self.pref[ingress], to_dev)) self.pref[ingress] += 1
def remove_mirror(self, to_port, ingress = False): from_dev = self.mirred_port.get_devname() - ingress_str = "ingress" if ingress else "" + ingress_str = "ingress" if ingress else "egress" self.pref[ingress] -= 1 self.mach.run("tc filter del dev %s pref %d %s" % (from_dev, self.pref[ingress], ingress_str))
As part of cleanup we're doing, we've discovered we have several lnst patches in our internal development tree that were not sent upstream yet.
Some of the content here relate to recent changes in user APIs -
- #1, #2 from Arkadi relate to user indicationes of whether an FDB entry was externally learned
- #9 from Ido relate to nexthop flags change
- #10 from Yotam handle mirroring changes - support clsact qdisc instead of ingress qdisc [in mlxsw].
The rest of the patches in this series are from Ido, and mostly revolve around adding/improving IPv6 support.
Ondrej, any update about this set?
P.s., checking with our IT department why title got the nasty prefix.
Yuval Mintz yuvalm@mellanox.com writes:
P.s., checking with our IT department why title got the nasty prefix.
BTW this is purely on receive side. The patches on the mailing list don't contain the [Suspected-Phishing] nonsense.
Petr
On Mon, Nov 13, 2017 at 12:13:31PM +0200, Petr Machata wrote:
Yuval Mintz yuvalm@mellanox.com writes:
P.s., checking with our IT department why title got the nasty prefix.
BTW this is purely on receive side. The patches on the mailing list don't contain the [Suspected-Phishing] nonsense.
Petr
I don't have these on my side either...
Sorry about the delay I'll take care of this now and probably apply today.
-Ondrej
On Sun, Oct 29, 2017 at 04:05:08PM +0200, Yuval Mintz wrote:
As part of cleanup we're doing, we've discovered we have several lnst patches in our internal development tree that were not sent upstream yet.
Some of the content here relate to recent changes in user APIs -
- #1, #2 from Arkadi relate to user indicationes of whether an FDB entry was externally learned
- #9 from Ido relate to nexthop flags change
- #10 from Yotam handle mirroring changes - support clsact qdisc instead of ingress qdisc [in mlxsw].
The rest of the patches in this series are from Ido, and mostly revolve around adding/improving IPv6 support.
Arkadi Sharshevsky (2): BridgeTool: Update FDB parsing for new externally learned attribute recipes: switchdev: Change FDB check routine and bridge tests
Ido Schimmel (7): recipes: switchdev: Fix incorrect ping6 parameter recipes: switchdev: Enable multicast querier on bridge InterfaceManager: Don't flush IPv6 link-local addresses recipes: switchdev: Redue ECMP to two links recipes: switchdev: Execute recipe only for IPv4 recipes: switchdev: Add IPv6 support to existing L3 recipes HostAPI: Parse nexthop flags in route dump
Yotam Gigi (1): recipes: switchdev: span: Move to use the clsact qdisc
lnst/Slave/BridgeTool.py | 4 +- lnst/Slave/InterfaceManager.py | 2 +- lnst/Slave/NetTestSlave.py | 4 +- recipes/switchdev/TestLib.py | 25 +++-- recipes/switchdev/ecmp_common.py | 10 ++ recipes/switchdev/l2-000-minimal.py | 3 +- recipes/switchdev/l2-001-bridge.py | 3 +- recipes/switchdev/l2-002-bridge_fdb.py | 101 ++++++--------------- recipes/switchdev/l2-003-bridge_stp.py | 25 ++--- recipes/switchdev/l2-004-bridge_bond.py | 3 +- recipes/switchdev/l2-005-bridge_bond_failover.py | 3 +- recipes/switchdev/l2-006-bridge_team.py | 3 +- recipes/switchdev/l2-007-bridge_team_failover.py | 3 +- recipes/switchdev/l2-008-bridge_vlan1q_sanity.py | 2 +- recipes/switchdev/l2-009-bridge_vlan1q.py | 2 +- recipes/switchdev/l2-010-bridge_vlan1d_sanity.py | 8 +- recipes/switchdev/l2-011-bridge_vlan1d.py | 8 +- .../switchdev/l2-012-bridge_bond_vlan1d_sanity.py | 8 +- recipes/switchdev/l2-013-bridge_bond_vlan1d.py | 8 +- .../switchdev/l2-014-bridge_team_vlan1d_sanity.py | 8 +- recipes/switchdev/l2-015-bridge_team_vlan1d.py | 8 +- recipes/switchdev/l2-017-bridge_fdb_vlan1d.py | 100 ++++++-------------- recipes/switchdev/l2-018-bridge_fdb_team.py | 100 ++++++-------------- recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py | 100 ++++++-------------- recipes/switchdev/l2-021-span.py | 15 ++- recipes/switchdev/l3-000-minimal.py | 6 ++ recipes/switchdev/l3-001-router-port.py | 6 ++ recipes/switchdev/l3-002-vlan-interface.py | 6 ++ recipes/switchdev/l3-003-bond-interface.py | 6 ++ recipes/switchdev/l3-004-team-interface.py | 6 ++ recipes/switchdev/l3-005-ecmp-basic.py | 23 +---- recipes/switchdev/l3-005-ecmp-basic.xml | 4 - recipes/switchdev/l3-006-ecmp-linkdown.py | 13 +-- recipes/switchdev/l3-006-ecmp-linkdown.xml | 7 +- recipes/switchdev/l3-007-ecmp-maxsize.py | 29 ++---- recipes/switchdev/l3-007-ecmp-maxsize.xml | 4 - recipes/switchdev/l3-008-routes_stress.py | 2 +- recipes/switchdev/l3-009-1q_bridge_rif.py | 7 ++ recipes/switchdev/l3-010-1d_bridge_rif.py | 7 ++ recipes/switchdev/tc-001-action-vlan-modify.py | 3 +- recipes/switchdev/tc-002-flower-vlan.py | 3 +- 41 files changed, 280 insertions(+), 408 deletions(-)
-- 2.4.3 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@lists.fedorahosted.org
pushed, thanks.
-Ondrej
lnst-developers@lists.fedorahosted.org