While tuning the regression tests we have found out that keeping NIC IRQs on one CPU gives stable results. This patch uses pin_dev_irqs test tool to lock NIC IRQs to CPU#0.
Signed-off-by: Jan Tluka jtluka@redhat.com --- recipes/regression_tests/phase1/3_vlans.py | 14 +++++++++-- .../regression_tests/phase1/3_vlans_over_bond.py | 15 ++++++++++-- recipes/regression_tests/phase1/bonding_test.py | 27 +++++++++++++++++++--- .../phase1/virtual_bridge_2_vlans_over_bond.py | 12 ++++++++++ .../phase1/virtual_bridge_vlan_in_guest.py | 12 +++++++++- .../phase1/virtual_bridge_vlan_in_host.py | 10 +++++++- .../regression_tests/phase2/3_vlans_over_team.py | 14 +++++++++-- recipes/regression_tests/phase2/team_test.py | 25 ++++++++++++++++++-- ...l_ovs_bridge_2_vlans_over_active_backup_bond.py | 10 ++++++++ .../phase2/virtual_ovs_bridge_vlan_in_guest.py | 11 ++++++++- .../phase2/virtual_ovs_bridge_vlan_in_host.py | 11 ++++++++- 11 files changed, 146 insertions(+), 15 deletions(-)
diff --git a/recipes/regression_tests/phase1/3_vlans.py b/recipes/regression_tests/phase1/3_vlans.py index c4d229b..e807ed4 100644 --- a/recipes/regression_tests/phase1/3_vlans.py +++ b/recipes/regression_tests/phase1/3_vlans.py @@ -15,8 +15,10 @@ product_name = ctl.get_alias("product_name") m1 = ctl.get_host("testmachine1") m2 = ctl.get_host("testmachine2")
-m1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"]) -m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"]) +m1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"], + tools=["pin_dev_irqs"]) +m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"], + tools=["pin_dev_irqs"])
# ------ # TESTS @@ -49,6 +51,14 @@ for vlan in vlans: vlan_if2 = m2.get_interface(vlan) vlan_if2.set_mtu(mtu)
+if nperf_cpupin: + # this will pin devices irqs to cpu #0 + m1.run("./pin_dev_irqs.sh %s %s" % (m1_phy1.get_devname(), 0), + tool="pin_dev_irqs") + + m2.run("./pin_dev_irqs.sh %s %s" % (m2_phy1.get_devname(), 0), + tool="pin_dev_irqs") + ctl.wait(15)
ping_mod = ctl.get_module("IcmpPing", diff --git a/recipes/regression_tests/phase1/3_vlans_over_bond.py b/recipes/regression_tests/phase1/3_vlans_over_bond.py index e998480..19b5d67 100644 --- a/recipes/regression_tests/phase1/3_vlans_over_bond.py +++ b/recipes/regression_tests/phase1/3_vlans_over_bond.py @@ -15,8 +15,10 @@ product_name = ctl.get_alias("product_name") m1 = ctl.get_host("testmachine1") m2 = ctl.get_host("testmachine2")
-m1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"]) -m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"]) +m1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"], + tools=["pin_dev_irqs"]) +m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"], + tools=["pin_dev_irqs"])
# ------ # TESTS @@ -50,6 +52,15 @@ for vlan in vlans: vlan_if2 = m2.get_interface(vlan) vlan_if2.set_mtu(mtu)
+if nperf_cpupin: + # this will pin devices irqs to cpu #0 + for phy_dev in [ m1_phy1, m1_phy2 ]: + m1.run("./pin_dev_irqs.sh %s %s" % (phy_dev.get_devname(), 0), + tool="pin_dev_irqs") + + m2.run("./pin_dev_irqs.sh %s %s" % (m2_phy1.get_devname(), 0), + tool="pin_dev_irqs") + ctl.wait(15)
ping_mod = ctl.get_module("IcmpPing", diff --git a/recipes/regression_tests/phase1/bonding_test.py b/recipes/regression_tests/phase1/bonding_test.py index 8909ca0..56ca632 100644 --- a/recipes/regression_tests/phase1/bonding_test.py +++ b/recipes/regression_tests/phase1/bonding_test.py @@ -15,9 +15,10 @@ product_name = ctl.get_alias("product_name") m1 = ctl.get_host("testmachine1") m2 = ctl.get_host("testmachine2")
-m1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"]) -m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"]) - +m1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"], + tools=["pin_dev_irqs"]) +m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"], + tools=["pin_dev_irqs"])
# ------ # TESTS @@ -42,6 +43,17 @@ test_if1.set_mtu(mtu) test_if2 = m2.get_interface("test_if") test_if2.set_mtu(mtu)
+m1_phy1 = m1.get_interface("eth1") +m1_phy2 = m1.get_interface("eth2") + +m2_phydevs = [] +if test_if2.get_driver().get_val() == "bonding": + m2_phy1 = m2.get_interface("eth1") + m2_phy2 = m2.get_interface("eth2") + m2_phydevs.extend([m2_phy1, m2_phy2]) +else: + m2_phydevs.append(test_if2) + ping_mod = ctl.get_module("IcmpPing", options={ "addr" : test_if2.get_ip(0), @@ -118,6 +130,15 @@ netperf_cli_udp6 = ctl.get_module("Netperf", "-i %s -L %s -6" % (nperf_max_runs, test_if2.get_ip(1)) })
+if nperf_cpupin: + # this will pin devices irqs to cpu #0 + for phy_dev in [ m1_phy1, m1_phy2 ]: + m1.run("./pin_dev_irqs.sh %s %s" % (phy_dev.get_devname(), 0), + tool="pin_dev_irqs") + for phy_dev in m2_phydevs: + m2.run("./pin_dev_irqs.sh %s %s" % (phy_dev.get_devname(), 0), + tool="pin_dev_irqs") + ctl.wait(15)
for setting in offload_settings: diff --git a/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py b/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py index 8b580a9..68a5833 100644 --- a/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py +++ b/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py @@ -14,6 +14,7 @@ product_name = ctl.get_alias("product_name")
# Host 1 + guests 1 and 2 h1 = ctl.get_host("host1") +h1.sync_resources(tools=["pin_dev_irqs"]) g1 = ctl.get_host("guest1") g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"]) g2 = ctl.get_host("guest2") @@ -21,6 +22,7 @@ g2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# Host 2 + guests 3 and 4 h2 = ctl.get_host("host2") +h2.sync_resources(tools=["pin_dev_irqs"]) g3 = ctl.get_host("guest3") g3.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"]) g4 = ctl.get_host("guest4") @@ -42,6 +44,7 @@ nperf_reserve = int(ctl.get_alias("nperf_reserve")) nperf_confidence = ctl.get_alias("nperf_confidence") nperf_max_runs = int(ctl.get_alias("nperf_max_runs"))
+ mtu = ctl.get_alias("mtu") enable_udp_perf = ctl.get_alias("enable_udp_perf")
@@ -198,6 +201,15 @@ g2.get_interface("guestnic").set_mtu(mtu) g3.get_interface("guestnic").set_mtu(mtu) g4.get_interface("guestnic").set_mtu(mtu)
+ +# this will pin devices irqs to cpu #0 +for phy_dev in [ h1_nic1, h1_nic2 ]: + h1.run("./pin_dev_irqs.sh %s %s" % (phy_dev.get_devname(), 0), + tool="pin_dev_irqs") +for phy_dev in [ h2_nic1, h2_nic2 ]: + h2.run("./pin_dev_irqs.sh %s %s" % (phy_dev.get_devname(), 0), + tool="pin_dev_irqs") + ctl.wait(15)
for setting in offload_settings: diff --git a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py index de46b51..317a64c 100644 --- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py +++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py @@ -13,12 +13,14 @@ perf_api = ctl.connect_PerfRepo(mapping_file) product_name = ctl.get_alias("product_name")
h1 = ctl.get_host("host1") +h1.sync_resources(tools=["pin_dev_irqs"]) g1 = ctl.get_host("guest1")
h2 = ctl.get_host("host2")
g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"]) -h2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"]) +h2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"], + tools=["pin_dev_irqs"])
# ------ # TESTS @@ -134,6 +136,14 @@ g1.get_interface("vlan10").set_mtu(mtu)
h2.get_interface("nic").set_mtu(mtu)
+ +if nperf_cpupin: + # this will pin devices irqs to cpu #0 + h1.run("./pin_dev_irqs.sh %s %s" % (h1_nic.get_devname(), 0), + tool="pin_dev_irqs") + h2.run("./pin_dev_irqs.sh %s %s" % (h2_nic.get_devname(), 0), + tool="pin_dev_irqs") + ctl.wait(15)
for setting in offload_settings: diff --git a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py index 1ea1d46..947d8f8 100644 --- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py +++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py @@ -13,12 +13,14 @@ perf_api = ctl.connect_PerfRepo(mapping_file) product_name = ctl.get_alias("product_name")
h1 = ctl.get_host("host1") +h1.sync_resources(tools=["pin_dev_irqs"]) g1 = ctl.get_host("guest1")
h2 = ctl.get_host("host2")
g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"]) -h2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"]) +h2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"], + tools=["pin_dev_irqs"])
# ------ # TESTS @@ -134,6 +136,12 @@ g1.get_interface("guestnic").set_mtu(mtu) h2.get_interface("nic").set_mtu(mtu) h2.get_interface("vlan10").set_mtu(mtu)
+# this will pin devices irqs to cpu #0 +h1.run("./pin_dev_irqs.sh %s %s" % (h1_nic.get_devname(), 0), + tool="pin_dev_irqs") +h2.run("./pin_dev_irqs.sh %s %s" % (h2_nic.get_devname(), 0), + tool="pin_dev_irqs") + ctl.wait(15)
for setting in offload_settings: diff --git a/recipes/regression_tests/phase2/3_vlans_over_team.py b/recipes/regression_tests/phase2/3_vlans_over_team.py index de7f955..1c800bc 100644 --- a/recipes/regression_tests/phase2/3_vlans_over_team.py +++ b/recipes/regression_tests/phase2/3_vlans_over_team.py @@ -15,8 +15,10 @@ product_name = ctl.get_alias("product_name") m1 = ctl.get_host("testmachine1") m2 = ctl.get_host("testmachine2")
-m1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"]) -m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"]) +m1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"], + tools=["pin_dev_irqs"]) +m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"], + tools=["pin_dev_irqs"])
# ------ # TESTS @@ -50,6 +52,14 @@ for vlan in vlans: vlan_if2 = m2.get_interface(vlan) vlan_if2.set_mtu(mtu)
+if nperf_cpupin: + # this will pin devices irqs to cpu #0 + for phy_dev in (m1_phy1, m1_phy2): + m1.run("./pin_dev_irqs.sh %s %s" % (phy_dev.get_devname(), 0), + tool="pin_dev_irqs") + + m2.run("./pin_dev_irqs.sh %s %s" % (m2_phy1.get_devname(), 0), + tool="pin_dev_irqs")
ctl.wait(15)
diff --git a/recipes/regression_tests/phase2/team_test.py b/recipes/regression_tests/phase2/team_test.py index 50e8364..3aa7574 100644 --- a/recipes/regression_tests/phase2/team_test.py +++ b/recipes/regression_tests/phase2/team_test.py @@ -15,8 +15,10 @@ product_name = ctl.get_alias("product_name") m1 = ctl.get_host("testmachine1") m2 = ctl.get_host("testmachine2")
-m1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"]) -m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"]) +m1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"], + tools=["pin_dev_irqs"]) +m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"], + tools=["pin_dev_irqs"])
# ------ # TESTS @@ -41,6 +43,16 @@ test_if1.set_mtu(mtu) test_if2 = m2.get_interface("test_if") test_if2.set_mtu(mtu)
+m1_phy1 = m1.get_interface("eth1") +m1_phy2 = m1.get_interface("eth2") + +m2_phydevs = [] +if test_if2.get_driver().get_val() in ["team", "bonding"]: + m2_phy1 = m2.get_interface("eth1") + m2_phy2 = m2.get_interface("eth2") + m2_phydevs.extend([m2_phy1, m2_phy2]) +else: + m2_phydevs.append(test_if2)
ping_mod = ctl.get_module("IcmpPing", options={ @@ -118,6 +130,15 @@ netperf_cli_udp6 = ctl.get_module("Netperf", "-i %s -L %s -6" % (nperf_max_runs, test_if2.get_ip(1)) })
+if nperf_cpupin: + # this will pin devices irqs to cpu #0 + for phy_dev in (m1_phy1, m1_phy2): + m1.run("./pin_dev_irqs.sh %s %s" % (phy_dev.get_devname(), 0), + tool="pin_dev_irqs") + for phy_dev in m2_phydevs: + m2.run("./pin_dev_irqs.sh %s %s" % (phy_dev.get_devname(), 0), + tool="pin_dev_irqs") + ctl.wait(15)
for setting in offload_settings: diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py b/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py index 6f02921..200df20 100644 --- a/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py +++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py @@ -14,6 +14,7 @@ product_name = ctl.get_alias("product_name")
# Host 1 + guests 1 and 2 h1 = ctl.get_host("host1") +h1.sync_resources(tools=["pin_dev_irqs"]) g1 = ctl.get_host("guest1") g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"]) g2 = ctl.get_host("guest2") @@ -21,6 +22,7 @@ g2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# Host 2 + guests 3 and 4 h2 = ctl.get_host("host2") +h2.sync_resources(tools=["pin_dev_irqs"]) g3 = ctl.get_host("guest3") g3.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"]) g4 = ctl.get_host("guest4") @@ -175,6 +177,14 @@ ping_mod6_bad2 = ctl.get_module("Icmp6Ping", "interval" : 0.1 })
+# this will pin devices irqs to cpu #0 +for phy_dev in [ h1_nic1, h1_nic2 ]: + h1.run("./pin_dev_irqs.sh %s %s" % (phy_dev.get_devname(), 0), + tool="pin_dev_irqs") +for phy_dev in [ h2_nic1, h2_nic2 ]: + h2.run("./pin_dev_irqs.sh %s %s" % (phy_dev.get_devname(), 0), + tool="pin_dev_irqs") + ctl.wait(15)
for setting in offload_settings: diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.py b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.py index 32c1335..8acc0cc 100644 --- a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.py +++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.py @@ -13,12 +13,14 @@ perf_api = ctl.connect_PerfRepo(mapping_file) product_name = ctl.get_alias("product_name")
h1 = ctl.get_host("host1") +h1.sync_resources(tools=["pin_dev_irqs"]) g1 = ctl.get_host("guest1")
h2 = ctl.get_host("host2")
g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"]) -h2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"]) +h2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"], + tools=["pin_dev_irqs"])
# ------ # TESTS @@ -121,6 +123,13 @@ netperf_cli_udp6 = ctl.get_module("Netperf", "-i %s -L %s -6" % (nperf_max_runs, h2_vlan10.get_ip(1)) })
+if nperf_cpupin: + # this will pin devices irqs to cpu #0 + h1.run("./pin_dev_irqs.sh %s %s" % (h1_nic.get_devname(), 0), + tool="pin_dev_irqs") + h2.run("./pin_dev_irqs.sh %s %s" % (h2_nic.get_devname(), 0), + tool="pin_dev_irqs") + ctl.wait(15)
for setting in offload_settings: diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.py b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.py index 209b85a..713a4ce 100644 --- a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.py +++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.py @@ -18,7 +18,9 @@ g1 = ctl.get_host("guest1") h2 = ctl.get_host("host2")
g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"]) -h2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"]) +h1.sync_resources(tools=["pin_dev_irqs"]) +h2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"], + tools=["pin_dev_irqs"])
# ------ # TESTS @@ -119,6 +121,13 @@ netperf_cli_udp6 = ctl.get_module("Netperf", "netperf_opts" : "-i %s -L %s -6" % (nperf_max_runs, h2_vlan10.get_ip(1)) }) + +# this will pin devices irqs to cpu #0 +h1.run("./pin_dev_irqs.sh %s %s" % (h1_nic.get_devname(), 0), + tool="pin_dev_irqs") +h2.run("./pin_dev_irqs.sh %s %s" % (h2_nic.get_devname(), 0), + tool="pin_dev_irqs") + ctl.wait(15)
for setting in offload_settings: