On Wed, Feb 13, 2019 at 06:42:36PM +0100, csfakian(a)redhat.com wrote:
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.
Signed-off-by: Christos Sfakianakis <csfakian(a)redhat.com>
---
.../Perf/Measurements/BaseFlowMeasurement.py | 7 ++++-
.../Perf/Measurements/IperfFlowMeasurement.py | 8 +++++-
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 6 ++++-
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, 186 insertions(+), 164 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..78b9bda 100644
--- a/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py
+++ b/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py
@@ -82,7 +82,10 @@ class IperfFlowMeasurement(BaseFlowMeasurement):
def _prepare_server(self, flow):
host = flow.receiver
server_params = dict(bind = ipaddress(flow.receiver_bind),
- oneoff = True)
+ oneoff = True, opts="")
^^^^^^^
What's this? it's not used anywhere... or explained by the commit
message
+
+ if flow.cpupin and flow.parallel_streams == 1:
+ server_params["cpu_bind"] = flow.cpupin
return host.prepare_job(IperfServer(**server_params),
job_level=ResultLevel.NORMAL)
@@ -102,6 +105,9 @@ class IperfFlowMeasurement(BaseFlowMeasurement):
else:
raise RecipeError("Unsupported flow type
'{}'".format(flow.type))
+ if flow.cpupin and flow.parallel_streams == 1:
+ client_params["cpu_bind"] = flow.cpupin
+
I know we did this in the old recipes but it kinds of sets one parameter
as higher priority than a different one (parallel_streams overrides the
cpupin parameter). This isn't very obvious until you actually read the
code that uses the Flow object and a user(tester) might be surprised by
the results being returned... It might be worth thinking about adding an
Exception raise here to indicate an invalid/unsupported combination of
parameters. It could also be placed directly into the Flow object so
when it gets created it immediately returns an error.
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..84a382c 100644
--- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py
+++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py
@@ -77,6 +77,8 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe):
mtu = IntParam(mandatory=False)
dev_intr_cpu = IntParam(default=0)
+ perf_intr_cpu = IntParam(default=0)
+ perf_units = StrParam(default="")
What's perf_units? it's not used anywhere or explained by the commit
message either...
>
> 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_intr_cpu
> + )
>
> flow_measurement = self.params.net_perf_tool([flow])
> yield PerfRecipeConf(
> diff --git a/lnst/Recipes/ENRT/BondRecipe.py b/lnst/Recipes/ENRT/BondRecipe.py
> index 119c437..d2268fb 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 self.params.dev_intr_cpu:
> + 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 self.params.dev_intr_cpu:
> + 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..2ddbec4 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 self.params.dev_intr_cpu:
> + 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 self.params.dev_intr_cpu:
> + 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..e10ea79 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 self.params.dev_intr_cpu:
> + 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 self.params.dev_intr_cpu:
> + 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..92e1e1b 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 self.params.dev_intr_cpu:
> + 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 self.params.dev_intr_cpu:
> + 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..10546e6 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 self.params.dev_intr_cpu:
> + 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 self.params.dev_intr_cpu
> + 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 597579b..6db2ace 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 self.params.dev_intr_cpu:
> + 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 self.params.dev_intr_cpu
> + 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 84fb0ea..5c7ccc6 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()
> @@ -86,14 +87,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 self.params.perf_intr_cpu:
> + raise LnstError("'perf_intr_cpu' (%d) should not be set for
this test" % self.params.perf_intr_cpu)
>
> - for m in self.matched:
> - for dev in m.devices:
> - self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
> + if self.params.dev_intr_cpu:
> + for m in [host1, host2]:
> + m.run("service irqbalance stop")
> + self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
>
> return configuration
>
> @@ -101,7 +101,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 self.params.dev_intr_cpu:
> + 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 e78d420..7d60cc2 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()
> @@ -71,13 +72,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 self.params.dev_intr_cpu:
> + 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 self.params.perf_intr_cpu:
> + for m in [host1, host2]:
> + m.run("service irqbalance stop")
> + self._pin_dev_interrupts(m.eth0, 0)
>
> return configuration
>
> @@ -85,6 +86,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 self.params.perf_intr_cpu:
> + 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 f1c42e6..929e133 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()
> @@ -84,14 +85,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 self.params.perf_intr_cpu:
> + raise LnstError("'perf_intr_cpu' (%d) should not be set for
this test" % self.params.perf_intr_cpu)
>
> - for m in self.matched:
> - for dev in m.devices:
> - self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
> + if self.params.dev_intr_cpu:
> + for m in [host1, host2]:
> + m.run("service irqbalance stop")
> + self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
>
> return configuration
>
> @@ -99,7 +99,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 self.params.dev_intr_cpu:
> + 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 466a2a2..dc6bae6 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()
> @@ -69,13 +70,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 self.params.dev_intr_cpu:
> + 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 self.params.perf_intr_cpu:
> + for m in [host1, host2]:
> + m.run("service irqbalance stop")
> + self._pin_dev_interrupts(m.eth0, 0)
>
> return configuration
>
> @@ -83,6 +84,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 self.params.perf_intr_cpu:
> + 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 162e3c1..8918229 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()
> @@ -111,12 +112,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 self.params.perf_intr_cpu:
> + raise LnstError("'perf_intr_cpu' (%d) should not be set for
this test" % self.params.perf_intr_cpu)
>
> - for m in self.matched:
> - for dev in m.devices:
> - self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
> + if self.params.dev_intr_cpu:
> + 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
>
> @@ -124,5 +127,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 self.params.dev_intr_cpu:
> + 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 c77e03a..3364f82 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()
> @@ -89,14 +90,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 self.params.perf_intr_cpu:
> + raise LnstError("'perf_intr_cpu' (%d) should not be set for
this test" % self.params.perf_intr_cpu)
>
> - for m in self.matched:
> - for dev in m.devices:
> - self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
> + if self.params.dev_intr_cpu:
> + for m in [host1, host2]:
> + m.run("service irqbalance stop")
> + self._pin_dev_interrupts(m.eth1, self.params.dev_intr_cpu)
>
> return configuration
>
> @@ -104,7 +104,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 self.params.dev_intr_cpu:
> + 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 a681355..0d48b7b 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()
> @@ -70,13 +71,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 self.params.dev_intr_cpu:
> + 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 self.params.perf_intr_cpu:
> + for m in [host1, host2]:
> + m.run("service irqbalance stop")
> + self._pin_dev_interrupts(m.eth0, 0)
>
> return configuration
>
> @@ -84,6 +85,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 self.params.perf_intr_cpu:
> + 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 7b640b8..9e5923b 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()
> @@ -81,14 +82,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 self.params.perf_intr_cpu:
> + raise LnstError("'perf_cpu_pin' (%d) should not be set for
this test" % self.params.perf_intr_cpu)
>
> - for m in self.matched:
> - for dev in m.devices:
> - self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
> + if self.params.dev_intr_cpu:
> + for m in [host1, host2]:
> + m.run("service irqbalance stop")
> + self._pin_dev_interrupts(m.eth1, self.params.dev_intr_cpu)
>
> return configuration
>
> @@ -96,7 +96,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 self.params.dev_intr_cpu:
> + 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 9b3dd10..89e9443 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()
> @@ -68,13 +69,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 self.params.dev_intr_cpu:
> + 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 self.params.perf_intr_cpu:
> + for m in [host1, host2]:
> + m.run("service irqbalance stop")
> + self._pin_dev_interrupts(m.eth0, 0)
>
> return configuration
>
> @@ -82,6 +83,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 self.params.perf_intr_cpu:
> + 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 7595dbf..1c3b0ec 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()
> @@ -122,16 +123,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 self.params.perf_intr_cpu:
> + raise LnstError("'perf_intr_cpu' (%d) should not be set for
this test" % self.params.perf_intr_cpu)
>
> - for m in self.matched:
> - for dev in m.devices:
> - self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
> + if self.params.dev_intr_cpu:
> + 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
>
> @@ -139,9 +138,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 self.params.dev_intr_cpu:
> + 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 9104423..d332268 100644
> --- a/lnst/Recipes/ENRT/VlansOverBondRecipe.py
> +++ b/lnst/Recipes/ENRT/VlansOverBondRecipe.py
> @@ -72,10 +72,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 self.params.dev_intr_cpu:
> + 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
> @@ -84,5 +84,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 self.params.dev_intr_cpu:
> + 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 2e929b8..5f5ad0b 100644
> --- a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
> +++ b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
> @@ -75,10 +75,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 self.params.dev_intr_cpu:
> + 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
> @@ -87,5 +87,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 self.params.dev_intr_cpu:
> + 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 96e5933..44497b9 100644
> --- a/lnst/Recipes/ENRT/VlansRecipe.py
> +++ b/lnst/Recipes/ENRT/VlansRecipe.py
> @@ -62,11 +62,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 self.params.dev_intr_cpu:
> + for m in [m1, m2]:
> + m.run("service irqbalance stop")
> + self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
>
> return configuration
>
> @@ -74,5 +73,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 self.params.dev_intr_cpu:
> + for m in [m1, m2]:
> + m.run("service irqbalance start")
> --
> 2.17.1
> _______________________________________________
> LNST-developers mailing list -- lnst-developers(a)lists.fedorahosted.org
> To unsubscribe send an email to lnst-developers-leave(a)lists.fedorahosted.org
> Fedora Code of Conduct:
https://getfedora.org/code-of-conduct.html
> List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives:
https://lists.fedorahosted.org/archives/list/lnst-developers@lists.fedora...