From: Christos Sfakianakis <csfakian(a)redhat.com>
Add 'perf_intr_cpu' parameter to account for affinity
of perf tool. Combine it with the existing 'dev_intr_cpu'
parameter to mirror the old 'nperf_cpupin', 'netdev_cpupin'
parameters and handle the pinnings for each scenario.
v2:
Rename 'perf_intr_cpu' to 'perf_tool_cpu' as this is not
connected to interrupts. Make both 'perf_tool_cpu' and
'dev_intr_cpu' optional. Add CPU validity check in
'_pin_dev_interrupts', as tests with invalid 'dev_intr_cpu'
value result in no warnings. For 'perf_tool_cpu', this is
taken care of via the underlying perf tool.
Signed-off-by: Christos Sfakianakis <csfakian(a)redhat.com>
---
.../Perf/Measurements/BaseFlowMeasurement.py | 7 ++++-
.../Perf/Measurements/IperfFlowMeasurement.py | 18 +++++++++++++
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 19 +++++++++++---
lnst/Recipes/ENRT/BondRecipe.py | 13 +++++-----
lnst/Recipes/ENRT/DoubleBondRecipe.py | 15 ++++++-----
lnst/Recipes/ENRT/DoubleTeamRecipe.py | 15 ++++++-----
lnst/Recipes/ENRT/SimplePerfRecipe.py | 14 +++++-----
lnst/Recipes/ENRT/TeamRecipe.py | 13 +++++-----
lnst/Recipes/ENRT/TeamVsBondRecipe.py | 15 ++++++-----
.../VirtualBridgeVlanInGuestMirroredRecipe.py | 21 +++++++--------
.../ENRT/VirtualBridgeVlanInGuestRecipe.py | 19 +++++++-------
.../VirtualBridgeVlanInHostMirroredRecipe.py | 21 +++++++--------
.../ENRT/VirtualBridgeVlanInHostRecipe.py | 19 +++++++-------
.../ENRT/VirtualBridgeVlansOverBondRecipe.py | 18 ++++++++-----
...rtualOvsBridgeVlanInGuestMirroredRecipe.py | 21 +++++++--------
.../ENRT/VirtualOvsBridgeVlanInGuestRecipe.py | 19 +++++++-------
...irtualOvsBridgeVlanInHostMirroredRecipe.py | 21 +++++++--------
.../ENRT/VirtualOvsBridgeVlanInHostRecipe.py | 19 +++++++-------
.../VirtualOvsBridgeVlansOverBondRecipe.py | 26 ++++++++-----------
lnst/Recipes/ENRT/VlansOverBondRecipe.py | 13 +++++-----
lnst/Recipes/ENRT/VlansOverTeamRecipe.py | 13 +++++-----
lnst/Recipes/ENRT/VlansRecipe.py | 14 +++++-----
22 files changed, 207 insertions(+), 166 deletions(-)
diff --git a/lnst/RecipeCommon/Perf/Measurements/BaseFlowMeasurement.py
b/lnst/RecipeCommon/Perf/Measurements/BaseFlowMeasurement.py
index da0b5f4..faac895 100644
--- a/lnst/RecipeCommon/Perf/Measurements/BaseFlowMeasurement.py
+++ b/lnst/RecipeCommon/Perf/Measurements/BaseFlowMeasurement.py
@@ -8,7 +8,7 @@ class Flow(object):
type,
generator, generator_bind,
receiver, receiver_bind,
- msg_size, duration, parallel_streams):
+ msg_size, duration, parallel_streams, cpupin):
self._type = type
self._generator = generator
@@ -19,6 +19,7 @@ class Flow(object):
self._msg_size = msg_size
self._duration = duration
self._parallel_streams = parallel_streams
+ self._cpupin = cpupin
@property
def type(self):
@@ -52,6 +53,10 @@ class Flow(object):
def parallel_streams(self):
return self._parallel_streams
+ @property
+ def cpupin(self):
+ return self._cpupin
+
class NetworkFlowTest(object):
def __init__(self, flow, server_job, client_job):
self._flow = flow
diff --git a/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py
b/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py
index 2f8ae98..8ffd815 100644
--- a/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py
+++ b/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py
@@ -84,6 +84,15 @@ class IperfFlowMeasurement(BaseFlowMeasurement):
server_params = dict(bind = ipaddress(flow.receiver_bind),
oneoff = True)
+ if flow.cpupin >= 0:
+ if flow.parallel_streams == 1:
+ server_params["cpu_bind"] = flow.cpupin
+ else:
+ raise RecipeError("Unsupported combination of single cpupin "
+ "with parallel perf streams.")
+ elif not flow.cpupin is None:
+ raise RecipeError("Negative perf cpupin value provided.")
+
return host.prepare_job(IperfServer(**server_params),
job_level=ResultLevel.NORMAL)
@@ -102,6 +111,15 @@ class IperfFlowMeasurement(BaseFlowMeasurement):
else:
raise RecipeError("Unsupported flow type
'{}'".format(flow.type))
+ if flow.cpupin >= 0:
+ if flow.parallel_streams == 1:
+ client_params["cpu_bind"] = flow.cpupin
+ else:
+ raise RecipeError("Unsupported combination of single cpupin "
+ "with parallel perf streams.")
+ elif not flow.cpupin is None:
+ raise RecipeError("Negative perf cpupin value provided.")
+
if flow.parallel_streams > 1:
client_params["parallel"] = flow.parallel_streams
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py
index d7d1aec..a637486 100644
--- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py
+++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py
@@ -1,8 +1,9 @@
+import re
from lnst.Common.LnstError import LnstError
from lnst.Common.Parameters import Param, IntParam, StrParam, BoolParam
from lnst.Common.IpAddress import AF_INET, AF_INET6
-
-from lnst.Controller.Recipe import BaseRecipe
+from lnst.Common.ExecCmd import exec_cmd
+from lnst.Controller.Recipe import BaseRecipe, RecipeError
from lnst.RecipeCommon.Ping import PingTestAndEvaluate, PingConf
from lnst.RecipeCommon.Perf.Recipe import Recipe as PerfRecipe
@@ -76,7 +77,8 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe):
mtu = IntParam(mandatory=False)
- dev_intr_cpu = IntParam(default=0)
+ dev_intr_cpu = IntParam(mandatory=False)
+ perf_tool_cpu = IntParam(mandatory=False)
perf_duration = IntParam(default=60)
perf_iterations = IntParam(default=5)
@@ -199,7 +201,9 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe):
receiver_bind = server_bind,
msg_size = self.params.perf_msg_size,
duration = self.params.perf_duration,
- parallel_streams = self.params.perf_parallel_streams)
+ parallel_streams = self.params.perf_parallel_streams,
+ cpupin = self.params.perf_tool_cpu if "perf_tool_cpu"
in self.params else None
+ )
flow_measurement = self.params.net_perf_tool([flow])
yield PerfRecipeConf(
@@ -211,6 +215,13 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe):
def _pin_dev_interrupts(self, dev, cpu):
netns = dev.netns
+ cpu_info = netns.run("lscpu").stdout
+ regex = "CPU\(s\): *([0-9]*)"
+ num_cpus = int(re.search(regex, cpu_info).groups()[0])
+ if cpu < 0 or cpu > num_cpus - 1:
+ raise RecipeError("Invalid CPU value given: %d. Accepted value %s."
%
+ (cpu, "is: 0" if num_cpus == 1 else "are:
0..%d" %
+ (num_cpus - 1)))
res = netns.run("grep {} /proc/interrupts | cut -f1 -d: | sed 's/
//'"
.format(dev.name))
diff --git a/lnst/Recipes/ENRT/BondRecipe.py b/lnst/Recipes/ENRT/BondRecipe.py
index 119c437..60626d1 100644
--- a/lnst/Recipes/ENRT/BondRecipe.py
+++ b/lnst/Recipes/ENRT/BondRecipe.py
@@ -55,10 +55,10 @@ class BondRecipe(BaseEnrtRecipe):
m2.eth0.up()
#TODO better service handling through HostAPI
- m1.run("service irqbalance stop")
- m2.run("service irqbalance stop")
- for m in self.matched:
- for dev in m.devices:
+ if "dev_intr_cpu" in self.params:
+ for m in [m1, m2]:
+ m.run("service irqbalance stop")
+ for dev in [m1.eth0, m1.eth1, m2.eth0]:
self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
return configuration
@@ -67,5 +67,6 @@ class BondRecipe(BaseEnrtRecipe):
m1, m2 = self.matched.m1, self.matched.m2
#TODO better service handling through HostAPI
- m1.run("service irqbalance start")
- m2.run("service irqbalance start")
+ if "dev_intr_cpu" in self.params:
+ for m in [m1, m2]:
+ m.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/DoubleBondRecipe.py
b/lnst/Recipes/ENRT/DoubleBondRecipe.py
index b5b6512..2f9c637 100644
--- a/lnst/Recipes/ENRT/DoubleBondRecipe.py
+++ b/lnst/Recipes/ENRT/DoubleBondRecipe.py
@@ -54,11 +54,11 @@ class DoubleBondRecipe(BaseEnrtRecipe):
m.bond.up()
#TODO better service handling through HostAPI
- m1.run("service irqbalance stop")
- m2.run("service irqbalance stop")
- for m in self.matched:
- for dev in m.devices:
- self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if "dev_intr_cpu" in self.params:
+ for m in [m1, m2]:
+ m.run("service irqbalance stop")
+ for dev in [m.eth0, m.eth1]:
+ self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
return configuration
@@ -66,5 +66,6 @@ class DoubleBondRecipe(BaseEnrtRecipe):
m1, m2 = self.matched.m1, self.matched.m2
#TODO better service handling through HostAPI
- m1.run("service irqbalance start")
- m2.run("service irqbalance start")
+ if "dev_intr_cpu" in self.params:
+ for m in [m1, m2]:
+ m.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/DoubleTeamRecipe.py
b/lnst/Recipes/ENRT/DoubleTeamRecipe.py
index 54b38de..26f4d41 100644
--- a/lnst/Recipes/ENRT/DoubleTeamRecipe.py
+++ b/lnst/Recipes/ENRT/DoubleTeamRecipe.py
@@ -67,11 +67,11 @@ class DoubleTeamRecipe(BaseEnrtRecipe):
m2.team.up()
#TODO better service handling through HostAPI
- m1.run("service irqbalance stop")
- m2.run("service irqbalance stop")
- for m in self.matched:
- for dev in m.devices:
- self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if "dev_intr_cpu" in self.params:
+ for m in [m1, m2]:
+ m.run("service irqbalance stop")
+ for dev in [m.eth1, m.eth2]:
+ self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
return configuration
@@ -79,5 +79,6 @@ class DoubleTeamRecipe(BaseEnrtRecipe):
m1, m2 = self.matched.m1, self.matched.m2
#TODO better service handling through HostAPI
- m1.run("service irqbalance start")
- m2.run("service irqbalance start")
+ if "dev_intr_cpu" in self.params:
+ for m in [m1, m2]:
+ m.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/SimplePerfRecipe.py
b/lnst/Recipes/ENRT/SimplePerfRecipe.py
index 004e43d..0c5ab6c 100644
--- a/lnst/Recipes/ENRT/SimplePerfRecipe.py
+++ b/lnst/Recipes/ENRT/SimplePerfRecipe.py
@@ -52,11 +52,10 @@ class SimplePerfRecipe(BaseEnrtRecipe):
m2.eth0.up()
#TODO better service handling through HostAPI
- m1.run("service irqbalance stop")
- m2.run("service irqbalance stop")
- for m in self.matched:
- for dev in m.devices:
- self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if "dev_intr_cpu" in self.params:
+ for m in [m1, m2]:
+ m.run("service irqbalance stop")
+ self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
return configuration
@@ -64,8 +63,9 @@ class SimplePerfRecipe(BaseEnrtRecipe):
m1, m2 = self.matched.m1, self.matched.m2
#TODO better service handling through HostAPI
- m1.run("service irqbalance start")
- m2.run("service irqbalance start")
+ if "dev_intr_cpu" in self.params:
+ for m in [m1, m2]:
+ m.run("service irqbalance start")
# redo
# m1.eth0.adaptive_tx_coalescing =
self.saved_coalescing_state["m1_if"]["tx"]
diff --git a/lnst/Recipes/ENRT/TeamRecipe.py b/lnst/Recipes/ENRT/TeamRecipe.py
index 6173ec6..846ca9c 100644
--- a/lnst/Recipes/ENRT/TeamRecipe.py
+++ b/lnst/Recipes/ENRT/TeamRecipe.py
@@ -58,10 +58,10 @@ class TeamRecipe(BaseEnrtRecipe):
m2.eth1.up()
#TODO better service handling through HostAPI
- m1.run("service irqbalance stop")
- m2.run("service irqbalance stop")
- for m in self.matched:
- for dev in m.devices:
+ if "dev_intr_cpu" in self.params:
+ for m in [m1, m2]:
+ m.run("service irqbalance stop")
+ for dev in [m1.eth1, m1.eth2, m2.eth1]:
self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
return configuration
@@ -70,5 +70,6 @@ class TeamRecipe(BaseEnrtRecipe):
m1, m2 = self.matched.m1, self.matched.m2
#TODO better service handling through HostAPI
- m1.run("service irqbalance start")
- m2.run("service irqbalance start")
+ if "dev_intr_cpu" in self.params:
+ for m in [m1, m2]:
+ m.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/TeamVsBondRecipe.py
b/lnst/Recipes/ENRT/TeamVsBondRecipe.py
index fe39d13..0536704 100644
--- a/lnst/Recipes/ENRT/TeamVsBondRecipe.py
+++ b/lnst/Recipes/ENRT/TeamVsBondRecipe.py
@@ -71,11 +71,11 @@ class TeamVsBondRecipe(BaseEnrtRecipe):
m2.bond.up()
#TODO better service handling through HostAPI
- m1.run("service irqbalance stop")
- m2.run("service irqbalance stop")
- for m in self.matched:
- for dev in m.devices:
- self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if "dev_intr_cpu" in self.params:
+ for m in [m1, m2]:
+ m.run("service irqbalance stop")
+ for dev in [m.eth1, m.eth2]:
+ self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
return configuration
@@ -83,5 +83,6 @@ class TeamVsBondRecipe(BaseEnrtRecipe):
m1, m2 = self.matched.m1, self.matched.m2
#TODO better service handling through HostAPI
- m1.run("service irqbalance start")
- m2.run("service irqbalance start")
+ if "dev_intr_cpu" in self.params:
+ for m in [m1, m2]:
+ m.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py
b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py
index 2fd74ae..d47dacd 100644
--- a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py
@@ -8,6 +8,7 @@ from lnst.Controller import HostReq, DeviceReq
from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration
from lnst.Devices import VlanDevice
from lnst.Devices import BridgeDevice
+from lnst.Common.LnstError import LnstError
class VirtualBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe):
host1 = HostReq()
@@ -92,14 +93,13 @@ class VirtualBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe):
guest2.vlan1.up()
#TODO better service handling through HostAPI
- host1.run("service irqbalance stop")
- host2.run("service irqbalance stop")
- guest1.run("service irqbalance stop")
- guest2.run("service irqbalance stop")
+ if "perf_tool_cpu" in self.params:
+ raise LnstError("'perf_tool_cpu' (%d) should not be set for this
test" % self.params.perf_tool_cpu)
- for m in self.matched:
- for dev in m.devices:
- self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if "dev_intr_cpu" in self.params:
+ for m in [host1, host2]:
+ m.run("service irqbalance stop")
+ self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
return configuration
@@ -107,7 +107,6 @@ class VirtualBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe):
host1, host2, guest1, guest2 = self.matched.host1, self.matched.host2,
self.matched.guest1, self.matched.guest2
#TODO better service handling through HostAPI
- host1.run("service irqbalance start")
- host2.run("service irqbalance start")
- guest1.run("service irqbalance start")
- guest2.run("service irqbalance start")
+ if "dev_intr_cpu" in self.params:
+ for m in [host1, host2]:
+ m.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py
b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py
index 8bb7582..b7e5d4c 100644
--- a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py
@@ -8,6 +8,7 @@ from lnst.Controller import HostReq, DeviceReq
from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration
from lnst.Devices import VlanDevice
from lnst.Devices import BridgeDevice
+from lnst.Common.LnstError import LnstError
class VirtualBridgeVlanInGuestRecipe(BaseEnrtRecipe):
host1 = HostReq()
@@ -74,13 +75,13 @@ class VirtualBridgeVlanInGuestRecipe(BaseEnrtRecipe):
guest1.vlan1.up()
#TODO better service handling through HostAPI
- host1.run("service irqbalance stop")
- host2.run("service irqbalance stop")
- guest1.run("service irqbalance stop")
+ if "dev_intr_cpu" in self.params:
+ raise LnstError("'dev_intr_cpu' (%d) should not be set for this
test" % self.params.dev_intr_cpu)
- for m in self.matched:
- for dev in m.devices:
- self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if "perf_tool_cpu" in self.params:
+ for m in [host1, host2]:
+ m.run("service irqbalance stop")
+ self._pin_dev_interrupts(m.eth0, 0)
return configuration
@@ -88,6 +89,6 @@ class VirtualBridgeVlanInGuestRecipe(BaseEnrtRecipe):
host1, host2, guest1 = self.matched.host1, self.matched.host2,
self.matched.guest1
#TODO better service handling through HostAPI
- host1.run("service irqbalance start")
- host2.run("service irqbalance start")
- guest1.run("service irqbalance start")
+ if "perf_tool_cpu" in self.params:
+ for m in [host1, hpst2]:
+ m.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py
b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py
index 1a7c4d0..a2ad29e 100644
--- a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py
@@ -8,6 +8,7 @@ from lnst.Controller import HostReq, DeviceReq
from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration
from lnst.Devices import VlanDevice
from lnst.Devices import BridgeDevice
+from lnst.Common.LnstError import LnstError
class VirtualBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe):
host1 = HostReq()
@@ -90,14 +91,13 @@ class VirtualBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe):
guest2.eth0.up()
#TODO better service handling through HostAPI
- host1.run("service irqbalance stop")
- host2.run("service irqbalance stop")
- guest1.run("service irqbalance stop")
- guest2.run("service irqbalance stop")
+ if "perf_tool_cpu" in self.params:
+ raise LnstError("'perf_tool_cpu' (%d) should not be set for this
test" % self.params.perf_tool_cpu)
- for m in self.matched:
- for dev in m.devices:
- self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if "dev_intr_cpu" in self.params:
+ for m in [host1, host2]:
+ m.run("service irqbalance stop")
+ self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
return configuration
@@ -105,7 +105,6 @@ class VirtualBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe):
host1, host2, guest1, guest2 = self.matched.host1, self.matched.host2,
self.matched.guest1, self.matched.guest2
#TODO better service handling through HostAPI
- host1.run("service irqbalance start")
- host2.run("service irqbalance start")
- guest1.run("service irqbalance start")
- guest2.run("service irqbalance start")
+ if "dev_intr_cpu" in self.params:
+ for m in [host1, host2]:
+ m.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py
b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py
index 2a2f905..0a7bda1 100644
--- a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py
@@ -8,6 +8,7 @@ from lnst.Controller import HostReq, DeviceReq
from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration
from lnst.Devices import VlanDevice
from lnst.Devices import BridgeDevice
+from lnst.Common.LnstError import LnstError
class VirtualBridgeVlanInHostRecipe(BaseEnrtRecipe):
host1 = HostReq()
@@ -73,13 +74,13 @@ class VirtualBridgeVlanInHostRecipe(BaseEnrtRecipe):
guest1.eth0.up()
#TODO better service handling through HostAPI
- host1.run("service irqbalance stop")
- host2.run("service irqbalance stop")
- guest1.run("service irqbalance stop")
+ if "dev_intr_cpu" in self.params:
+ raise LnstError("'dev_intr_cpu' (%d) should not be set for this
test" % self.params.dev_intr_cpu)
- for m in self.matched:
- for dev in m.devices:
- self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if "perf_tool_cpu" in self.params:
+ for m in [host1, host2]:
+ m.run("service irqbalance stop")
+ self._pin_dev_interrupts(m.eth0, 0)
return configuration
@@ -87,6 +88,6 @@ class VirtualBridgeVlanInHostRecipe(BaseEnrtRecipe):
host1, host2, guest1 = self.matched.host1, self.matched.host2,
self.matched.guest1
#TODO better service handling through HostAPI
- host1.run("service irqbalance start")
- host2.run("service irqbalance start")
- guest1.run("service irqbalance start")
+ if "perf_tool_cpu" in self.params:
+ for m in [host1, host2]:
+ m.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py
b/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py
index e5d0b9b..225dc54 100644
--- a/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py
@@ -9,6 +9,7 @@ from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe,
EnrtConfiguration
from lnst.Devices import VlanDevice
from lnst.Devices import BondDevice
from lnst.Devices import BridgeDevice
+from lnst.Common.LnstError import LnstError
class VirtualBridgeVlansOverBondRecipe(BaseEnrtRecipe):
host1 = HostReq()
@@ -121,12 +122,14 @@ class VirtualBridgeVlansOverBondRecipe(BaseEnrtRecipe):
g2.eth0.up()
#TODO better service handling through HostAPI
- for m in (host1, host2, guest1, guest2, guest3, guest4):
- host1.run("service irqbalance stop")
+ if "perf_tool_cpu" in self.params:
+ raise LnstError("'perf_tool_cpu' (%d) should not be set for this
test" % self.params.perf_tool_cpu)
- for m in self.matched:
- for dev in m.devices:
- self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if "dev_intr_cpu" in self.params:
+ for m in [host1, host2]:
+ m.run("service irqbalance stop")
+ for dev in [m.eth0, m.eth1]:
+ self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
return configuration
@@ -134,5 +137,6 @@ class VirtualBridgeVlansOverBondRecipe(BaseEnrtRecipe):
host1, host2, guest1, guest2, guest3, guest4 = self.matched.host1,
self.matched.host2, self.matched.guest1, self.matched.guest2, self.matched.guest3,
self.matched.guest4
#TODO better service handling through HostAPI
- for m in (host1, host2, guest1, guest2, guest3, guest4):
- host1.run("service irqbalance start")
+ if "dev_intr_cpu" in self.params:
+ for m in [host1, host2]:
+ m.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py
b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py
index f0041fc..bc7b5ba 100644
--- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py
@@ -9,6 +9,7 @@ from lnst.Controller import HostReq, DeviceReq
from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration
from lnst.Devices import VlanDevice
from lnst.Devices import OvsBridgeDevice
+from lnst.Common.LnstError import LnstError
class VirtualOvsBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe):
host1 = HostReq()
@@ -95,14 +96,13 @@ class VirtualOvsBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe):
guest2.vlan1.up()
#TODO better service handling through HostAPI
- host1.run("service irqbalance stop")
- host2.run("service irqbalance stop")
- guest1.run("service irqbalance stop")
- guest2.run("service irqbalance stop")
+ if "perf_tool_cpu" in self.params:
+ raise LnstError("'perf_tool_cpu' (%d) should not be set for this
test" % self.params.perf_tool_cpu)
- for m in self.matched:
- for dev in m.devices:
- self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if "dev_intr_cpu" in self.params:
+ for m in [host1, host2]:
+ m.run("service irqbalance stop")
+ self._pin_dev_interrupts(m.eth1, self.params.dev_intr_cpu)
return configuration
@@ -110,7 +110,6 @@ class VirtualOvsBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe):
host1, host2, guest1, guest2 = self.matched.host1, self.matched.host2,
self.matched.guest1, self.matched.guest2
#TODO better service handling through HostAPI
- host1.run("service irqbalance start")
- host2.run("service irqbalance start")
- guest1.run("service irqbalance start")
- guest2.run("service irqbalance start")
+ if "dev_intr_cpu" in self.params:
+ for m in [host1, host2]:
+ m.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py
b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py
index df44ae2..e1471be 100644
--- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py
@@ -8,6 +8,7 @@ from lnst.Controller import HostReq, DeviceReq
from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration
from lnst.Devices import VlanDevice
from lnst.Devices import OvsBridgeDevice
+from lnst.Common.LnstError import LnstError
class VirtualOvsBridgeVlanInGuestRecipe(BaseEnrtRecipe):
host1 = HostReq()
@@ -74,13 +75,13 @@ class VirtualOvsBridgeVlanInGuestRecipe(BaseEnrtRecipe):
guest1.vlan1.up()
#TODO better service handling through HostAPI
- host1.run("service irqbalance stop")
- host2.run("service irqbalance stop")
- guest1.run("service irqbalance stop")
+ if "dev_intr_cpu" in self.params:
+ raise LnstError("'dev_intr_cpu' (%d) should not be set for this
test" % self.params.dev_intr_cpu)
- for m in self.matched:
- for dev in m.devices:
- self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if "perf_tool_cpu" in self.params:
+ for m in [host1, host2]:
+ m.run("service irqbalance stop")
+ self._pin_dev_interrupts(m.eth0, 0)
return configuration
@@ -88,6 +89,6 @@ class VirtualOvsBridgeVlanInGuestRecipe(BaseEnrtRecipe):
host1, host2, guest1 = self.matched.host1, self.matched.host2,
self.matched.guest1
#TODO better service handling through HostAPI
- host1.run("service irqbalance start")
- host2.run("service irqbalance start")
- guest1.run("service irqbalance start")
+ if "perf_tool_cpu" in self.params:
+ for m in [host1, host2]:
+ m.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py
b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py
index 58d2a9b..0b53b13 100644
--- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py
@@ -9,6 +9,7 @@ from lnst.Controller import HostReq, DeviceReq
from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration
from lnst.Devices import VlanDevice
from lnst.Devices import OvsBridgeDevice
+from lnst.Common.LnstError import LnstError
class VirtualOvsBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe):
host1 = HostReq()
@@ -85,14 +86,13 @@ class VirtualOvsBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe):
guest2.eth0.up()
#TODO better service handling through HostAPI
- host1.run("service irqbalance stop")
- host2.run("service irqbalance stop")
- guest1.run("service irqbalance stop")
- guest2.run("service irqbalance stop")
+ if "perf_tool_cpu" in self.params:
+ raise LnstError("'perf_cpu_pin' (%d) should not be set for this
test" % self.params.perf_tool_cpu)
- for m in self.matched:
- for dev in m.devices:
- self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if "dev_intr_cpu" in self.params:
+ for m in [host1, host2]:
+ m.run("service irqbalance stop")
+ self._pin_dev_interrupts(m.eth1, self.params.dev_intr_cpu)
return configuration
@@ -100,7 +100,6 @@ class VirtualOvsBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe):
host1, host2, guest1, guest2 = self.matched.host1, self.matched.host2,
self.matched.guest1, self.matched.guest2
#TODO better service handling through HostAPI
- host1.run("service irqbalance start")
- host2.run("service irqbalance start")
- guest1.run("service irqbalance start")
- guest2.run("service irqbalance start")
+ if "dev_intr_cpu" in self.params:
+ for m in [host1, host2]:
+ m.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py
b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py
index 64830bd..9f6ba54 100644
--- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py
@@ -8,6 +8,7 @@ from lnst.Controller import HostReq, DeviceReq
from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration
from lnst.Devices import VlanDevice
from lnst.Devices import OvsBridgeDevice
+from lnst.Common.LnstError import LnstError
class VirtualOvsBridgeVlanInHostRecipe(BaseEnrtRecipe):
host1 = HostReq()
@@ -71,13 +72,13 @@ class VirtualOvsBridgeVlanInHostRecipe(BaseEnrtRecipe):
guest1.eth0.up()
#TODO better service handling through HostAPI
- host1.run("service irqbalance stop")
- host2.run("service irqbalance stop")
- guest1.run("service irqbalance stop")
+ if "dev_intr_cpu" in self.params:
+ raise LnstError("'dev_intr_cpu' (%d) should not be set for this
test" % self.params.dev_intr_cpu)
- for m in self.matched:
- for dev in m.devices:
- self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if "perf_tool_cpu" in self.params:
+ for m in [host1, host2]:
+ m.run("service irqbalance stop")
+ self._pin_dev_interrupts(m.eth0, 0)
return configuration
@@ -85,6 +86,6 @@ class VirtualOvsBridgeVlanInHostRecipe(BaseEnrtRecipe):
host1, host2, guest1 = self.matched.host1, self.matched.host2,
self.matched.guest1
#TODO better service handling through HostAPI
- host1.run("service irqbalance start")
- host2.run("service irqbalance start")
- guest1.run("service irqbalance start")
+ if "perf_tool_cpu" in self.params:
+ for m in [host1, host2]:
+ m.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py
b/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py
index c9c5413..03aca6e 100644
--- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py
@@ -10,6 +10,7 @@ from lnst.Controller import HostReq, DeviceReq
from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration
from lnst.Devices import VlanDevice
from lnst.Devices import OvsBridgeDevice
+from lnst.Common.LnstError import LnstError
class VirtualOvsBridgeVlansOverBondRecipe(BaseEnrtRecipe):
host1 = HostReq()
@@ -130,16 +131,14 @@ class VirtualOvsBridgeVlansOverBondRecipe(BaseEnrtRecipe):
guest4.eth0.up()
#TODO better service handling through HostAPI
- host1.run("service irqbalance stop")
- host2.run("service irqbalance stop")
- guest1.run("service irqbalance stop")
- guest2.run("service irqbalance stop")
- guest3.run("service irqbalance stop")
- guest4.run("service irqbalance stop")
+ if "perf_tool_cpu" in self.params:
+ raise LnstError("'perf_tool_cpu' (%d) should not be set for this
test" % self.params.perf_tool_cpu)
- for m in self.matched:
- for dev in m.devices:
- self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if "dev_intr_cpu" in self.params:
+ for m in [host1, host2]:
+ m.run("service irqbalance stop")
+ for dev in [m.eth1, m.eth2]:
+ self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
return configuration
@@ -147,9 +146,6 @@ class VirtualOvsBridgeVlansOverBondRecipe(BaseEnrtRecipe):
host1, host2, guest1, guest2, guest3, guest4 = self.matched.host1,
self.matched.host2, self.matched.guest1, self.matched.guest2, self.matched.guest3,
self.matched.guest4
#TODO better service handling through HostAPI
- host1.run("service irqbalance start")
- host2.run("service irqbalance start")
- guest1.run("service irqbalance start")
- guest2.run("service irqbalance start")
- guest3.run("service irqbalance start")
- guest4.run("service irqbalance start")
+ if "dev_intr_cpu" in self.params:
+ for m in [host1, host2]:
+ m.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VlansOverBondRecipe.py
b/lnst/Recipes/ENRT/VlansOverBondRecipe.py
index 2720bcf..9b0925a 100644
--- a/lnst/Recipes/ENRT/VlansOverBondRecipe.py
+++ b/lnst/Recipes/ENRT/VlansOverBondRecipe.py
@@ -76,10 +76,10 @@ class VlansOverBondRecipe(BaseEnrtRecipe):
m2.vlan2.up()
#TODO better service handling through HostAPI
- m1.run("service irqbalance stop")
- m2.run("service irqbalance stop")
- for m in self.matched:
- for dev in m.devices:
+ if "dev_intr_cpu" in self.params:
+ for m in [m1, m2]:
+ m.run("service irqbalance stop")
+ for dev in [m1.eth0, m1.eth1, m2.eth0]:
self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
return configuration
@@ -88,5 +88,6 @@ class VlansOverBondRecipe(BaseEnrtRecipe):
m1, m2 = self.matched.m1, self.matched.m2
#TODO better service handling through HostAPI
- m1.run("service irqbalance start")
- m2.run("service irqbalance start")
+ if "dev_intr_cpu" in self.params:
+ for m in [m1, m2]:
+ m1.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
index 0e93d31..da2068e 100644
--- a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
+++ b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
@@ -76,10 +76,10 @@ class VlansOverTeamRecipe(BaseEnrtRecipe):
m2.vlan2.up()
#TODO better service handling through HostAPI
- m1.run("service irqbalance stop")
- m2.run("service irqbalance stop")
- for m in self.matched:
- for dev in m.devices:
+ if "dev_intr_cpu" in self.params:
+ for m in [m1, m2]:
+ m.run("service irqbalance stop")
+ for dev in [m1.eth1, m1.eth2, m2.eth1]:
self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
return configuration
@@ -88,5 +88,6 @@ class VlansOverTeamRecipe(BaseEnrtRecipe):
m1, m2 = self.matched.m1, self.matched.m2
#TODO better service handling through HostAPI
- m1.run("service irqbalance start")
- m2.run("service irqbalance start")
+ if "dev_intr_cpu" in self.params:
+ for m in [m1, m2]:
+ m.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VlansRecipe.py b/lnst/Recipes/ENRT/VlansRecipe.py
index 3eab6de..bc056f0 100644
--- a/lnst/Recipes/ENRT/VlansRecipe.py
+++ b/lnst/Recipes/ENRT/VlansRecipe.py
@@ -66,11 +66,10 @@ class VlansRecipe(BaseEnrtRecipe):
m2.vlan2.up()
#TODO better service handling through HostAPI
- m1.run("service irqbalance stop")
- m2.run("service irqbalance stop")
- for m in self.matched:
- for dev in m.devices:
- self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if "dev_intr_cpu" in self.params:
+ for m in [m1, m2]:
+ m.run("service irqbalance stop")
+ self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
return configuration
@@ -78,5 +77,6 @@ class VlansRecipe(BaseEnrtRecipe):
m1, m2 = self.matched.m1, self.matched.m2
#TODO better service handling through HostAPI
- m1.run("service irqbalance start")
- m2.run("service irqbalance start")
+ if "dev_intr_cpu" in self.params:
+ for m in [m1, m2]:
+ m.run("service irqbalance start")
--
2.17.1