Adaptive interrupt coalescing can have impact on netperf test stability.
The test will turn it off before performing the tests. It will be restored
to the original settings once the test completes.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
recipes/regression_tests/phase1/3_vlans.py | 22 ++++++++++-
.../regression_tests/phase1/3_vlans_over_bond.py | 22 ++++++++++-
recipes/regression_tests/phase1/bonding_test.py | 43 ++++++++++++++-------
recipes/regression_tests/phase1/simple_netperf.py | 21 ++++++++++-
.../regression_tests/phase2/3_vlans_over_team.py | 22 ++++++++++-
recipes/regression_tests/phase2/team_test.py | 44 +++++++++++++++-------
6 files changed, 140 insertions(+), 34 deletions(-)
diff --git a/recipes/regression_tests/phase1/3_vlans.py
b/recipes/regression_tests/phase1/3_vlans.py
index 4c1e99e..2b72f4e 100644
--- a/recipes/regression_tests/phase1/3_vlans.py
+++ b/recipes/regression_tests/phase1/3_vlans.py
@@ -19,8 +19,9 @@ 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", "Custom"])
+m2.sync_resources(modules=["IcmpPing", "Icmp6Ping",
"Netperf", "Custom"])
+
# ------
# TESTS
@@ -71,6 +72,19 @@ for vlan in vlans:
vlan_if2 = m2.get_interface(vlan)
vlan_if2.set_mtu(mtu)
+coalesce_status = ctl.get_module('Custom')
+
+for d in [ m1_phy1, m2_phy1 ]:
+ # disable any interrupt coalescing settings
+ cdata = d.save_coalesce()
+ cdata['use_adaptive_tx_coalesce'] = 0
+ cdata['use_adaptive_rx_coalesce'] = 0
+ if not d.set_coalesce(cdata):
+ coalesce_status.set_options({'fail': True,
+ 'msg': "Failed to set coalesce
options"\
+ " on device %s" %
d.get_devname()})
+ d.get_host().run(coalesce_status)
+
if nperf_cpupin:
m1.run("service irqbalance stop")
m2.run("service irqbalance stop")
@@ -478,3 +492,7 @@ if nperf_protocols.find("sctp") > -1:
m1_vlan1.get_devname())
m2.run("iptables -D OUTPUT ! -o %s -p sctp -j DROP" %
m2_vlan1.get_devname())
+
+for d in [ m1_phy1, m2_phy1 ]:
+ # restore any interrupt coalescing settings
+ d.restore_coalesce()
diff --git a/recipes/regression_tests/phase1/3_vlans_over_bond.py
b/recipes/regression_tests/phase1/3_vlans_over_bond.py
index d30da40..8cf0e7e 100644
--- a/recipes/regression_tests/phase1/3_vlans_over_bond.py
+++ b/recipes/regression_tests/phase1/3_vlans_over_bond.py
@@ -19,8 +19,9 @@ 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", "Custom"])
+m2.sync_resources(modules=["IcmpPing", "Icmp6Ping",
"Netperf", "Custom"])
+
# ------
# TESTS
@@ -72,6 +73,19 @@ for vlan in vlans:
vlan_if2 = m2.get_interface(vlan)
vlan_if2.set_mtu(mtu)
+coalesce_status = ctl.get_module('Custom')
+
+for d in [ m1_phy1, m1_phy2, m2_phy1 ]:
+ # disable any interrupt coalescing settings
+ cdata = d.save_coalesce()
+ cdata['use_adaptive_tx_coalesce'] = 0
+ cdata['use_adaptive_rx_coalesce'] = 0
+ if not d.set_coalesce(cdata):
+ coalesce_status.set_options({'fail': True,
+ 'msg': "Failed to set coalesce
options"\
+ " on device %s" %
d.get_devname()})
+ d.get_host().run(coalesce_status)
+
if nperf_cpupin:
# this will pin devices irqs to cpu #0
m1.run("service irqbalance stop")
@@ -479,3 +493,7 @@ if nperf_protocols.find("sctp") > -1:
m1_vlan1.get_devname())
m2.run("iptables -D OUTPUT ! -o %s -p sctp -j DROP" %
m2_vlan1.get_devname())
+
+for d in [ m1_phy1, m1_phy2, m2_phy1 ]:
+ # restore any interrupt coalescing settings
+ d.restore_coalesce()
diff --git a/recipes/regression_tests/phase1/bonding_test.py
b/recipes/regression_tests/phase1/bonding_test.py
index c2c7ae3..324a455 100644
--- a/recipes/regression_tests/phase1/bonding_test.py
+++ b/recipes/regression_tests/phase1/bonding_test.py
@@ -19,8 +19,8 @@ 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", "Custom"])
+m2.sync_resources(modules=["IcmpPing", "Icmp6Ping",
"Netperf", "Custom"])
# ------
@@ -63,21 +63,34 @@ 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")
+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))
+
+coalesce_status = ctl.get_module('Custom')
+
+for _, d in dev_list:
+ # disable any interrupt coalescing settings
+ cdata = d.save_coalesce()
+ cdata['use_adaptive_tx_coalesce'] = 0
+ cdata['use_adaptive_rx_coalesce'] = 0
+ if not d.set_coalesce(cdata):
+ coalesce_status.set_options({'fail': True,
+ 'msg': "Failed to set coalesce
options"\
+ " on device %s" %
d.get_devname()})
+ d.get_host().run(coalesce_status)
+
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)
@@ -457,3 +470,7 @@ if nperf_protocols.find("sctp") > -1:
test_if1.get_devname())
m2.run("iptables -D OUTPUT ! -o %s -p sctp -j DROP" %
test_if2.get_devname())
+
+for _, d in dev_list:
+ # restore any interrupt coalescing settings
+ d.restore_coalesce()
diff --git a/recipes/regression_tests/phase1/simple_netperf.py
b/recipes/regression_tests/phase1/simple_netperf.py
index 88e2314..e159953 100644
--- a/recipes/regression_tests/phase1/simple_netperf.py
+++ b/recipes/regression_tests/phase1/simple_netperf.py
@@ -19,8 +19,8 @@ product_name = ctl.get_alias("product_name")
m1 = ctl.get_host("machine1")
m2 = ctl.get_host("machine2")
-m1.sync_resources(modules=["Netperf"])
-m2.sync_resources(modules=["Netperf"])
+m1.sync_resources(modules=["Netperf", "Custom"])
+m2.sync_resources(modules=["Netperf", "Custom"])
# ------
# TESTS
@@ -64,6 +64,19 @@ m2_testiface = m2.get_interface("testiface")
m1_testiface.set_mtu(mtu)
m2_testiface.set_mtu(mtu)
+coalesce_status = ctl.get_module('Custom')
+
+for d in [ m1_testiface, m2_testiface ]:
+ # disable any interrupt coalescing settings
+ cdata = d.save_coalesce()
+ cdata['use_adaptive_tx_coalesce'] = 0
+ cdata['use_adaptive_rx_coalesce'] = 0
+ if not d.set_coalesce(cdata):
+ coalesce_status.set_options({'fail': True,
+ 'msg': "Failed to set coalesce
options"\
+ " on device %s" %
d.get_devname()})
+ d.get_host().run(coalesce_status)
+
if nperf_cpupin:
m1.run("service irqbalance stop")
m2.run("service irqbalance stop")
@@ -416,3 +429,7 @@ if nperf_protocols.find("sctp") > -1:
m1_testiface.get_devname())
m2.run("iptables -D OUTPUT ! -o %s -p sctp -j DROP" %
m2_testiface.get_devname())
+
+for d in [ m1_testiface, m2_testiface ]:
+ # restore any interrupt coalescing settings
+ d.restore_coalesce()
diff --git a/recipes/regression_tests/phase2/3_vlans_over_team.py
b/recipes/regression_tests/phase2/3_vlans_over_team.py
index 8f6747e..c4ea8e8 100644
--- a/recipes/regression_tests/phase2/3_vlans_over_team.py
+++ b/recipes/regression_tests/phase2/3_vlans_over_team.py
@@ -19,8 +19,9 @@ 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", "Custom"])
+m2.sync_resources(modules=["IcmpPing", "Icmp6Ping",
"Netperf", "Custom"])
+
# ------
# TESTS
@@ -72,6 +73,19 @@ for vlan in vlans:
vlan_if2 = m2.get_interface(vlan)
vlan_if2.set_mtu(mtu)
+coalesce_status = ctl.get_module('Custom')
+
+for d in [ m1_phy1, m1_phy2, m2_phy1 ]:
+ # disable any interrupt coalescing settings
+ cdata = d.save_coalesce()
+ cdata['use_adaptive_tx_coalesce'] = 0
+ cdata['use_adaptive_rx_coalesce'] = 0
+ if not d.set_coalesce(cdata):
+ coalesce_status.set_options({'fail': True,
+ 'msg': "Failed to set coalesce
options"\
+ " on device %s" %
d.get_devname()})
+ d.get_host().run(coalesce_status)
+
if nperf_cpupin:
# this will pin devices irqs to cpu #0
m1.run("service irqbalance stop")
@@ -479,3 +493,7 @@ if nperf_protocols.find("sctp") > -1:
m1_vlan1.get_devname())
m2.run("iptables -D OUTPUT ! -o %s -p sctp -j DROP" %
m2_vlan1.get_devname())
+
+for d in [ m1_phy1, m1_phy2, m2_phy1 ]:
+ # restore any interrupt coalescing settings
+ d.restore_coalesce()
diff --git a/recipes/regression_tests/phase2/team_test.py
b/recipes/regression_tests/phase2/team_test.py
index 22ca042..2fa03dd 100644
--- a/recipes/regression_tests/phase2/team_test.py
+++ b/recipes/regression_tests/phase2/team_test.py
@@ -19,8 +19,9 @@ 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", "Custom"])
+m2.sync_resources(modules=["IcmpPing", "Icmp6Ping",
"Netperf", "Custom"])
+
# ------
# TESTS
@@ -62,21 +63,34 @@ 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")
+dev_list = [(m1, m1_phy1), (m1, m1_phy2)]
+
+if test_if2.get_type() in [ "team", "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))
+
+coalesce_status = ctl.get_module('Custom')
+
+for _, d in dev_list:
+ # disable any interrupt coalescing settings
+ cdata = d.save_coalesce()
+ cdata['use_adaptive_tx_coalesce'] = 0
+ cdata['use_adaptive_rx_coalesce'] = 0
+ if not d.set_coalesce(cdata):
+ coalesce_status.set_options({'fail': True,
+ 'msg': "Failed to set coalesce
options"\
+ " on device %s" %
d.get_devname()})
+ d.get_host().run(coalesce_status)
+
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() in [ "team", "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)
@@ -712,3 +726,7 @@ if nperf_protocols.find("sctp") > -1:
test_if1.get_devname())
m2.run("iptables -D OUTPUT ! -o %s -p sctp -j DROP" %
test_if2.get_devname())
+
+for _, d in dev_list:
+ # restore any interrupt coalescing settings
+ d.restore_coalesce()
--
2.9.5