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 from
RecipeCommon.IRQ to lock NIC IRQs to CPU#0. Additionally the irqbalance
daemon is stopped before the test if CPU pinning is requested and started
again after the test.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
recipes/regression_tests/phase1/3_vlans.py | 14 ++++++++++++
.../regression_tests/phase1/3_vlans_over_bond.py | 14 ++++++++++++
recipes/regression_tests/phase1/bonding_test.py | 25 ++++++++++++++++++++++
.../phase1/virtual_bridge_2_vlans_over_bond.py | 12 +++++++++++
.../phase1/virtual_bridge_vlan_in_guest.py | 14 ++++++++++++
.../phase1/virtual_bridge_vlan_in_host.py | 14 ++++++++++++
.../regression_tests/phase2/3_vlans_over_team.py | 14 ++++++++++++
recipes/regression_tests/phase2/team_test.py | 24 +++++++++++++++++++++
...l_ovs_bridge_2_vlans_over_active_backup_bond.py | 13 +++++++++++
.../phase2/virtual_ovs_bridge_vlan_in_guest.py | 14 ++++++++++++
.../phase2/virtual_ovs_bridge_vlan_in_host.py | 14 ++++++++++++
11 files changed, 172 insertions(+)
diff --git a/recipes/regression_tests/phase1/3_vlans.py
b/recipes/regression_tests/phase1/3_vlans.py
index fa2e02d..0613372 100644
--- a/recipes/regression_tests/phase1/3_vlans.py
+++ b/recipes/regression_tests/phase1/3_vlans.py
@@ -3,6 +3,8 @@ from lnst.Controller.Task import ctl
from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
+from lnst.RecipeCommon.IRQ import pin_dev_irqs
+
# ------
# SETUP
# ------
@@ -52,6 +54,14 @@ for vlan in vlans:
vlan_if2 = m2.get_interface(vlan)
vlan_if2.set_mtu(mtu)
+if nperf_cpupin:
+ m1.run("service irqbalance stop")
+ m2.run("service irqbalance stop")
+
+ # this will pin devices irqs to cpu #0
+ for m, d in [ (m1, m1_phy1), (m2, m2_phy1) ]:
+ pin_dev_irqs(m, d, 0)
+
ctl.wait(15)
ping_mod = ctl.get_module("IcmpPing",
@@ -298,3 +308,7 @@ for offload in offloads:
dev_features += " %s %s" % (offload, "on")
m1.run("ethtool -K %s %s" % (m1_phy1.get_devname(), dev_features))
m2.run("ethtool -K %s %s" % (m2_phy1.get_devname(), dev_features))
+
+if nperf_cpupin:
+ m1.run("service irqbalance start")
+ m2.run("service irqbalance start")
diff --git a/recipes/regression_tests/phase1/3_vlans_over_bond.py
b/recipes/regression_tests/phase1/3_vlans_over_bond.py
index 3b9b582..dbeb5a9 100644
--- a/recipes/regression_tests/phase1/3_vlans_over_bond.py
+++ b/recipes/regression_tests/phase1/3_vlans_over_bond.py
@@ -3,6 +3,8 @@ from lnst.Controller.Task import ctl
from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
+from lnst.RecipeCommon.IRQ import pin_dev_irqs
+
# ------
# SETUP
# ------
@@ -53,6 +55,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("service irqbalance stop")
+ m2.run("service irqbalance stop")
+
+ for m, d in [ (m1, m1_phy1), (m1, m1_phy2), (m2, m2_phy1) ]:
+ pin_dev_irqs(m, d, 0)
+
ctl.wait(15)
ping_mod = ctl.get_module("IcmpPing",
@@ -298,3 +308,7 @@ for offload in offloads:
m1.run("ethtool -K %s %s" % (m1_phy1.get_devname(), dev_features))
m1.run("ethtool -K %s %s" % (m1_phy2.get_devname(), dev_features))
m2.run("ethtool -K %s %s" % (m2_phy1.get_devname(), dev_features))
+
+if nperf_cpupin:
+ m1.run("service irqbalance start")
+ m2.run("service irqbalance start")
diff --git a/recipes/regression_tests/phase1/bonding_test.py
b/recipes/regression_tests/phase1/bonding_test.py
index cc93af0..dfa9f1d 100644
--- a/recipes/regression_tests/phase1/bonding_test.py
+++ b/recipes/regression_tests/phase1/bonding_test.py
@@ -3,6 +3,8 @@ from lnst.Controller.Task import ctl
from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
+from lnst.RecipeCommon.IRQ import pin_dev_irqs
+
# ------
# SETUP
# ------
@@ -45,6 +47,25 @@ test_if1.set_mtu(mtu)
test_if2 = m2.get_interface("test_if")
test_if2.set_mtu(mtu)
+if nperf_cpupin:
+ m1.run("service irqbalance stop")
+ m2.run("service irqbalance stop")
+
+ m1_phy1 = m1.get_interface("eth1")
+ m1_phy2 = m1.get_interface("eth2")
+ dev_list = [(m1, m1_phy1), (m1, m1_phy2)]
+
+ if test_if2.get_type() == "bond":
+ m2_phy1 = m2.get_interface("eth1")
+ m2_phy2 = m2.get_interface("eth2")
+ dev_list.extend([(m2, m2_phy1), (m2, m2_phy2)])
+ else:
+ dev_list.append((m2, test_if2))
+
+ # this will pin devices irqs to cpu #0
+ for m, d in dev_list:
+ pin_dev_irqs(m, d, 0)
+
ping_mod = ctl.get_module("IcmpPing",
options={
"addr" : test_if2.get_ip(0),
@@ -259,3 +280,7 @@ for offload in offloads:
dev_features += " %s %s" % (offload, "on")
m1.run("ethtool -K %s %s" % (test_if1.get_devname(), dev_features))
m2.run("ethtool -K %s %s" % (test_if2.get_devname(), dev_features))
+
+if nperf_cpupin:
+ m1.run("service irqbalance start")
+ m2.run("service irqbalance start")
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 1b908cf..f5a2971 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
@@ -3,6 +3,8 @@ from lnst.Controller.Task import ctl
from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
+from lnst.RecipeCommon.IRQ import pin_dev_irqs
+
# ------
# SETUP
# ------
@@ -57,6 +59,13 @@ g2_guestnic = g2.get_interface("guestnic")
g3_guestnic = g3.get_interface("guestnic")
g4_guestnic = g4.get_interface("guestnic")
+h1.run("service irqbalance stop")
+h2.run("service irqbalance stop")
+
+# this will pin devices irqs to cpu #0
+for m, d in [ (h1, h1_nic1), (h2, h2_nic1) , (h1, h1_nic2), (h2, h2_nic2) ]:
+ pin_dev_irqs(m, d, 0)
+
ping_mod = ctl.get_module("IcmpPing",
options={
"addr" : g3_guestnic.get_ip(0),
@@ -371,3 +380,6 @@ g1.run("ethtool -K %s %s" % (g1_guestnic.get_devname(),
dev_features))
g2.run("ethtool -K %s %s" % (g2_guestnic.get_devname(), dev_features))
g3.run("ethtool -K %s %s" % (g3_guestnic.get_devname(), dev_features))
g4.run("ethtool -K %s %s" % (g4_guestnic.get_devname(), dev_features))
+
+h1.run("service irqbalance start")
+h2.run("service irqbalance start")
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 d15929a..eaae7a5 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py
@@ -3,6 +3,8 @@ from lnst.Controller.Task import ctl
from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
+from lnst.RecipeCommon.IRQ import pin_dev_irqs
+
# ------
# SETUP
# ------
@@ -50,6 +52,14 @@ g1_guestnic = g1.get_interface("guestnic")
h1_nic = h1.get_interface("nic")
h2_nic = h2.get_interface("nic")
+if nperf_cpupin:
+ h1.run("service irqbalance stop")
+ h2.run("service irqbalance stop")
+
+ # this will pin devices irqs to cpu #0
+ for m, d in [ (h1, h1_nic), (h2, h2_nic) ]:
+ pin_dev_irqs(m, d, 0)
+
ping_mod = ctl.get_module("IcmpPing",
options={
"addr" : h2_vlan10.get_ip(0),
@@ -296,3 +306,7 @@ for offload in offloads:
g1.run("ethtool -K %s %s" % (g1_guestnic.get_devname(), dev_features))
h1.run("ethtool -K %s %s" % (h1_nic.get_devname(), dev_features))
h2.run("ethtool -K %s %s" % (h2_nic.get_devname(), dev_features))
+
+if nperf_cpupin:
+ h1.run("service irqbalance start")
+ h2.run("service irqbalance start")
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 ed12b67..304a551 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py
@@ -3,6 +3,8 @@ from lnst.Controller.Task import ctl
from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
+from lnst.RecipeCommon.IRQ import pin_dev_irqs
+
# ------
# SETUP
# ------
@@ -49,6 +51,14 @@ g1_guestnic= g1.get_interface("guestnic")
h1_nic = h1.get_interface("nic")
h2_nic = h2.get_interface("nic")
+if nperf_cpupin:
+ h1.run("service irqbalance stop")
+ h2.run("service irqbalance stop")
+
+ # this will pin devices irqs to cpu #0
+ for m, d in [ (h1, h1_nic), (h2, h2_nic) ]:
+ pin_dev_irqs(m, d, 0)
+
ping_mod = ctl.get_module("IcmpPing",
options={
"addr" : h2_vlan10.get_ip(0),
@@ -296,3 +306,7 @@ for offload in offloads:
g1.run("ethtool -K %s %s" % (g1_guestnic.get_devname(), dev_features))
h1.run("ethtool -K %s %s" % (h1_nic.get_devname(), dev_features))
h2.run("ethtool -K %s %s" % (h2_nic.get_devname(), dev_features))
+
+if nperf_cpupin:
+ h1.run("service irqbalance start")
+ h2.run("service irqbalance start")
diff --git a/recipes/regression_tests/phase2/3_vlans_over_team.py
b/recipes/regression_tests/phase2/3_vlans_over_team.py
index 99161a1..e81bf65 100644
--- a/recipes/regression_tests/phase2/3_vlans_over_team.py
+++ b/recipes/regression_tests/phase2/3_vlans_over_team.py
@@ -3,6 +3,8 @@ from lnst.Controller.Task import ctl
from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
+from lnst.RecipeCommon.IRQ import pin_dev_irqs
+
# ------
# SETUP
# ------
@@ -53,6 +55,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("service irqbalance stop")
+ m2.run("service irqbalance stop")
+
+ for m, d in [ (m1, m1_phy1), (m1, m1_phy2), (m2, m2_phy1) ]:
+ pin_dev_irqs(m, d, 0)
+
ctl.wait(15)
ping_mod = ctl.get_module("IcmpPing",
@@ -298,3 +308,7 @@ for offload in offloads:
m1.run("ethtool -K %s %s" % (m1_phy1.get_devname(), dev_features))
m1.run("ethtool -K %s %s" % (m1_phy2.get_devname(), dev_features))
m2.run("ethtool -K %s %s" % (m2_phy1.get_devname(), dev_features))
+
+if nperf_cpupin:
+ m1.run("service irqbalance start")
+ m2.run("service irqbalance start")
diff --git a/recipes/regression_tests/phase2/team_test.py
b/recipes/regression_tests/phase2/team_test.py
index 8a1d275..516242b 100644
--- a/recipes/regression_tests/phase2/team_test.py
+++ b/recipes/regression_tests/phase2/team_test.py
@@ -3,6 +3,8 @@ from lnst.Controller.Task import ctl
from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
+from lnst.RecipeCommon.IRQ import pin_dev_irqs
+
# ------
# SETUP
# ------
@@ -44,6 +46,24 @@ test_if1.set_mtu(mtu)
test_if2 = m2.get_interface("test_if")
test_if2.set_mtu(mtu)
+if nperf_cpupin:
+ m1.run("service irqbalance stop")
+ m2.run("service irqbalance stop")
+
+ m1_phy1 = m1.get_interface("eth1")
+ m1_phy2 = m1.get_interface("eth2")
+ dev_list = [(m1, m1_phy1), (m1, m1_phy2)]
+
+ if test_if2.get_type() == "team":
+ m2_phy1 = m2.get_interface("eth1")
+ m2_phy2 = m2.get_interface("eth2")
+ dev_list.extend([(m2, m2_phy1), (m2, m2_phy2)])
+ else:
+ dev_list.append((m2, test_if2))
+
+ # this will pin devices irqs to cpu #0
+ for m, d in dev_list:
+ pin_dev_irqs(m, d, 0)
ping_mod = ctl.get_module("IcmpPing",
options={
@@ -417,3 +437,7 @@ for offload in offloads:
dev_features += " %s %s" % (offload, "on")
m1.run("ethtool -K %s %s" % (test_if1.get_devname(), dev_features))
m2.run("ethtool -K %s %s" % (test_if2.get_devname(), dev_features))
+
+if nperf_cpupin:
+ m1.run("service irqbalance start")
+ m2.run("service irqbalance start")
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 240f056..d687136 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
@@ -3,6 +3,8 @@ from lnst.Controller.Task import ctl
from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
+from lnst.RecipeCommon.IRQ import pin_dev_irqs
+
# ------
# SETUP
# ------
@@ -54,6 +56,14 @@ g2_guestnic = g2.get_interface("guestnic")
g3_guestnic = g3.get_interface("guestnic")
g4_guestnic = g4.get_interface("guestnic")
+h1.run("service irqbalance stop")
+h2.run("service irqbalance stop")
+
+# this will pin devices irqs to cpu #0
+for m, d in [ (h1, h1_nic1), (h2, h2_nic1) , (h1, h1_nic2), (h2, h2_nic2) ]:
+ pin_dev_irqs(m, d, 0)
+
+
ping_mod = ctl.get_module("IcmpPing",
options={
"addr" : g3_guestnic.get_ip(0),
@@ -349,3 +359,6 @@ g1.run("ethtool -K %s %s" % (g1_guestnic.get_devname(),
dev_features))
g2.run("ethtool -K %s %s" % (g2_guestnic.get_devname(), dev_features))
g3.run("ethtool -K %s %s" % (g3_guestnic.get_devname(), dev_features))
g4.run("ethtool -K %s %s" % (g4_guestnic.get_devname(), dev_features))
+
+h1.run("service irqbalance start")
+h2.run("service irqbalance start")
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 8ac0da4..79f388b 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
@@ -3,6 +3,8 @@ from lnst.Controller.Task import ctl
from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
+from lnst.RecipeCommon.IRQ import pin_dev_irqs
+
# ------
# SETUP
# ------
@@ -47,6 +49,14 @@ h1_nic = h1.get_interface("nic")
h2_nic = h2.get_interface("nic")
g1_guestnic = g1.get_interface("guestnic")
+if nperf_cpupin:
+ h1.run("service irqbalance stop")
+ h2.run("service irqbalance stop")
+
+ # this will pin devices irqs to cpu #0
+ for m, d in [ (h1, h1_nic), (h2, h2_nic) ]:
+ pin_dev_irqs(m, d, 0)
+
ping_mod = ctl.get_module("IcmpPing",
options={
"addr" : h2_vlan10.get_ip(0),
@@ -284,3 +294,7 @@ for offload in offloads:
h1.run("ethtool -K %s %s" % (h1_nic.get_devname(), dev_features))
g1.run("ethtool -K %s %s" % (g1_guestnic.get_devname(), dev_features))
h2.run("ethtool -K %s %s" % (h2_nic.get_devname(), dev_features))
+
+if nperf_cpupin:
+ h1.run("service irqbalance start")
+ h2.run("service irqbalance start")
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 5dae9da..e6d3d9e 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
@@ -3,6 +3,8 @@ from lnst.Controller.Task import ctl
from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
+from lnst.RecipeCommon.IRQ import pin_dev_irqs
+
# ------
# SETUP
# ------
@@ -46,6 +48,14 @@ g1_guestnic = g1.get_interface("guestnic")
h1_nic = h1.get_interface("nic")
h2_nic = h2.get_interface("nic")
+if nperf_cpupin:
+ h1.run("service irqbalance stop")
+ h2.run("service irqbalance stop")
+
+ # this will pin devices irqs to cpu #0
+ for m, d in [ (h1, h1_nic), (h2, h2_nic) ]:
+ pin_dev_irqs(m, d, 0)
+
ping_mod = ctl.get_module("IcmpPing",
options={
"addr" : h2_vlan10.get_ip(0),
@@ -284,3 +294,7 @@ for offload in offloads:
h1.run("ethtool -K %s %s" % (h1_nic.get_devname(), dev_features))
g1.run("ethtool -K %s %s" % (g1_guestnic.get_devname(), dev_features))
h2.run("ethtool -K %s %s" % (h2_nic.get_devname(), dev_features))
+
+if nperf_cpupin:
+ h1.run("service irqbalance start")
+ h2.run("service irqbalance start")
--
2.4.3