From: Christos Sfakianakis csfakian@redhat.com
This patche set includes various parameter-handling cases that have been missing from the new recipes (present in the old recipes). Details follow.
======================================================================== edit perf pinnings in Recipes
This patch handles the pinning of the perf tool to a specific CPU per the old recipes. No units are hadnled since '-J' for JSON outputs seems to overwrite them ======================================================================== fix syntax errors and offloads
This patch fixes syntax error and offload settings in 3 of the ENRT recipes. ======================================================================== handle/enable bidirectional perfs
This patch enables perf tests to be done from both sides. The main reason for this is that this feature is used in 8 cases from phase 2: - active_backup_team - round_robin_team - active_backup_double_team - round_robin_double_team - acive_backup_team_vs_active_backup_bond - acive_backup_team_vs_round_robin_bond - round_robin_team_vs_active_backup_bond - round_robin_team_vs_round_robin_bond A suitable parameter is added in BaseEnrtRecipe as well as in TeamRecipe, TeamVsBondRecipe, DoubleTeamRecipe files. In the old recipes, all perf tests from one side are completed before client/server roles are inverted. In the current patch, that order is not preserved (this should not affect the results). ======================================================================== handle adaptive coalescing
This patch* inlcudes modifications in the Device module and in some ENRT recipes that hanlde adaptive coalescence.In the Device module, methods are added to read, modify, or restore the coalescence settings of a target device. The handling is different from the old recipes' in that rx and tx parts are handled independently. In addition, 3 scenarios are handled (skip/enable/disable) vs 2 in the old recipes (skip/disable) .No verification checks are made, since it is expected that these will be part of the future recipe-wide verification class. ======================================================================== use coalescence tuning
This patch makes use of the previous patch in ENRT recipes. ======================================================================== add qdisc tuning for multi-perf cases
This patch* handles traffic control settings for multi-perf scenarios. No handling is added in the deconfiguration phase of the ENRT recipes, since this is expected to be done via the already present code in the Device module. ======================================================================= add {udp,sctp}-specific checks
This patch* adds checks for UDP/SCTP and specific offloads per the old recipes. The iptables commands for SCTP are executed multiple times (once for every offload combination) in the current design, but this should have no effect in functionality. ======================================================================= * Due to the fact that the target devices are ethernet and we currently cannot filter them out of 2 arbitrary perf configuration endpoints, it was not possible to apply these changes in BaseEnrtRecipe; the top-level recipes had to be used.
Christos Sfakianakis (7): lnst.Recipes.ENRT: edit perf pinnings in Recipes lnst.Recipes.ENRT: fix syntax errors and offloads lnst.Recipes.ENRT: handle/enable bidirectional perfs lnst.Devices.Device: handle adaptive coalescing lnst.Recipes.ENRT: use coalescence tuning lnst.Recipes.ENRT: add qdisc tuning for multi-perf cases lnst.Recipes.ENRT.BaseEnrtRecipe: add {udp,sctp}-specific checks
lnst/Devices/Device.py | 77 +++++++++++++++++++ .../Perf/Measurements/BaseFlowMeasurement.py | 7 +- .../Perf/Measurements/IperfFlowMeasurement.py | 14 ++++ lnst/Recipes/ENRT/BaseEnrtRecipe.py | 51 +++++++++++- lnst/Recipes/ENRT/BondRecipe.py | 24 ++++-- lnst/Recipes/ENRT/DoubleBondRecipe.py | 29 +++++-- lnst/Recipes/ENRT/DoubleTeamRecipe.py | 32 ++++++-- lnst/Recipes/ENRT/SimplePerfRecipe.py | 25 ++++-- lnst/Recipes/ENRT/TeamRecipe.py | 27 +++++-- lnst/Recipes/ENRT/TeamVsBondRecipe.py | 32 ++++++-- .../VirtualBridgeVlanInGuestMirroredRecipe.py | 25 +++--- .../ENRT/VirtualBridgeVlanInGuestRecipe.py | 23 +++--- .../VirtualBridgeVlanInHostMirroredRecipe.py | 25 +++--- .../ENRT/VirtualBridgeVlanInHostRecipe.py | 23 +++--- .../ENRT/VirtualBridgeVlansOverBondRecipe.py | 25 ++++-- ...rtualOvsBridgeVlanInGuestMirroredRecipe.py | 25 +++--- .../ENRT/VirtualOvsBridgeVlanInGuestRecipe.py | 23 +++--- ...irtualOvsBridgeVlanInHostMirroredRecipe.py | 25 +++--- .../ENRT/VirtualOvsBridgeVlanInHostRecipe.py | 23 +++--- .../VirtualOvsBridgeVlansOverBondRecipe.py | 31 ++++---- lnst/Recipes/ENRT/VlansOverBondRecipe.py | 24 ++++-- lnst/Recipes/ENRT/VlansOverTeamRecipe.py | 24 ++++-- lnst/Recipes/ENRT/VlansRecipe.py | 25 ++++-- 23 files changed, 471 insertions(+), 168 deletions(-)
From: Christos Sfakianakis csfakian@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@redhat.com --- .../Perf/Measurements/BaseFlowMeasurement.py | 7 ++++- .../Perf/Measurements/IperfFlowMeasurement.py | 14 ++++++++++ lnst/Recipes/ENRT/BaseEnrtRecipe.py | 5 +++- 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, 192 insertions(+), 163 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..45303fe 100644 --- a/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py +++ b/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py @@ -84,6 +84,13 @@ class IperfFlowMeasurement(BaseFlowMeasurement): server_params = dict(bind = ipaddress(flow.receiver_bind), oneoff = True)
+ if flow.cpupin: + if flow.parallel_streams == 1: + server_params["cpu_bind"] = flow.cpupin + else: + raise RecipeError("Unsupported combination of non-zero cpupin " + "with parallel perf streams.") + return host.prepare_job(IperfServer(**server_params), job_level=ResultLevel.NORMAL)
@@ -102,6 +109,13 @@ class IperfFlowMeasurement(BaseFlowMeasurement): else: raise RecipeError("Unsupported flow type '{}'".format(flow.type))
+ if flow.cpupin: + if flow.parallel_streams == 1: + client_params["cpu_bind"] = flow.cpupin + else: + raise RecipeError("Unsupported combination of non-zero cpupin " + "with parallel perf streams.") + 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..5dc3a5c 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -77,6 +77,7 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): mtu = IntParam(mandatory=False)
dev_intr_cpu = IntParam(default=0) + perf_intr_cpu = IntParam(default=0)
perf_duration = IntParam(default=60) perf_iterations = IntParam(default=5) @@ -199,7 +200,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 fe39d13..612b5dc 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 2fd74ae..47f53cf 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 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
@@ -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 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 8bb7582..a72e8d4 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 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
@@ -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 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 1a7c4d0..04d3bba 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 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
@@ -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 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 2a2f905..62c19ec 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 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
@@ -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 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 e5d0b9b..aeacc12 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 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
@@ -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 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 f0041fc..77e979e 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 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
@@ -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 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 df44ae2..b5d38a7 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 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
@@ -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 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 58d2a9b..2e464c0 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 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
@@ -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 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 64830bd..cceda69 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 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 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 c9c5413..acaa39f 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 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
@@ -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 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 2720bcf..da988c7 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 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 @@ -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 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 0e93d31..813e7c3 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 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 @@ -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 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 3eab6de..ffd98f7 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 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
@@ -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 self.params.dev_intr_cpu: + for m in [m1, m2]: + m.run("service irqbalance start")
On Tue, Mar 05, 2019 at 05:09:05PM +0100, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@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@redhat.com
.../Perf/Measurements/BaseFlowMeasurement.py | 7 ++++- .../Perf/Measurements/IperfFlowMeasurement.py | 14 ++++++++++ lnst/Recipes/ENRT/BaseEnrtRecipe.py | 5 +++- 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, 192 insertions(+), 163 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._cpupinclass 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..45303fe 100644 --- a/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py +++ b/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py @@ -84,6 +84,13 @@ class IperfFlowMeasurement(BaseFlowMeasurement): server_params = dict(bind = ipaddress(flow.receiver_bind), oneoff = True)
if flow.cpupin:if flow.parallel_streams == 1:server_params["cpu_bind"] = flow.cpupinelse:raise RecipeError("Unsupported combination of non-zero cpupin ""with parallel perf streams.")return host.prepare_job(IperfServer(**server_params), job_level=ResultLevel.NORMAL)@@ -102,6 +109,13 @@ class IperfFlowMeasurement(BaseFlowMeasurement): else: raise RecipeError("Unsupported flow type '{}'".format(flow.type))
if flow.cpupin:if flow.parallel_streams == 1:client_params["cpu_bind"] = flow.cpupinelse:raise RecipeError("Unsupported combination of non-zero cpupin ""with parallel perf streams.")if flow.parallel_streams > 1: client_params["parallel"] = flow.parallel_streamsdiff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py index d7d1aec..5dc3a5c 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -77,6 +77,7 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): mtu = IntParam(mandatory=False)
dev_intr_cpu = IntParam(default=0)
- perf_intr_cpu = IntParam(default=0)
I think, the default value be "None" or there should be no default value (parameter being optional). Reason being, cpus are indexed from 0 and it's therefore a perfectly acceptable value to pin a process or interrupts to.
Which means that the dev_intr_cpu default value is also wrong and should be fixed.
perf_duration = IntParam(default=60) perf_iterations = IntParam(default=5)@@ -199,7 +200,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_cpufor 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..612b5dc 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_cpufor 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..47f53cf 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 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)
The old code also stopped irqbalance for guests. Is it intentional that they're skipped here? It also happens in all the following recipes where guests are involved.
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 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 8bb7582..a72e8d4 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 self.params.dev_intr_cpu:raise LnstError("'dev_intr_cpu' (%d) should not be set for this test" % self.params.dev_intr_cpu)
In the previous recipe it was the perf_intr_cpu that "should not be set", is this intentional or a mistake? I also noticed it switches in between a couple of times in the following recipes...
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)
I'm also not sure about this pin devices to 0 in this case. The parameter is not set indicating it shouldn't be touch but we still configure it to 0?
For now I'm just interested in if it's a mistake or intentional.
But I have this to say for a later discussion: It kind of looks susipicous wihtout additional explanation somewhere. Maybe we should take a global look at how to do interrupts and cpu pinning and come up with some generic solution.
At this point it also looks like there's a lot of code repetition in individual recipes as well so we might be able to improve on this in a later patchset.
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 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 1a7c4d0..04d3bba 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 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@@ -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 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 2a2f905..62c19ec 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 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@@ -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 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 e5d0b9b..aeacc12 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 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@@ -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 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 f0041fc..77e979e 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 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@@ -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 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 df44ae2..b5d38a7 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 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@@ -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 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 58d2a9b..2e464c0 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 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@@ -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 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 64830bd..cceda69 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 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 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 c9c5413..acaa39f 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 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@@ -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 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 2720bcf..da988c7 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 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@@ -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 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 0e93d31..813e7c3 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 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@@ -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 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 3eab6de..ffd98f7 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 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@@ -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 self.params.dev_intr_cpu:for m in [m1, m2]:m.run("service irqbalance start")-- 2.17.1 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@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.fedorahos...
----- Original Message -----
From: "Ondrej Lichtner" olichtne@redhat.com To: csfakian@redhat.com Cc: lnst-developers@lists.fedorahosted.org Sent: Friday, March 8, 2019 7:17:30 PM Subject: Re: [PATCH-next 1/7] lnst.Recipes.ENRT: edit perf pinnings in Recipes
On Tue, Mar 05, 2019 at 05:09:05PM +0100, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@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@redhat.com
.../Perf/Measurements/BaseFlowMeasurement.py | 7 ++++- .../Perf/Measurements/IperfFlowMeasurement.py | 14 ++++++++++ lnst/Recipes/ENRT/BaseEnrtRecipe.py | 5 +++- 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, 192 insertions(+), 163 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._cpupinclass 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..45303fe 100644 --- a/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py +++ b/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py @@ -84,6 +84,13 @@ class IperfFlowMeasurement(BaseFlowMeasurement): server_params = dict(bind = ipaddress(flow.receiver_bind), oneoff = True)
if flow.cpupin:if flow.parallel_streams == 1:server_params["cpu_bind"] = flow.cpupinelse:raise RecipeError("Unsupported combination of non-zerocpupin "
"with parallel perf streams.")return host.prepare_job(IperfServer(**server_params), job_level=ResultLevel.NORMAL)@@ -102,6 +109,13 @@ class IperfFlowMeasurement(BaseFlowMeasurement): else: raise RecipeError("Unsupported flow type '{}'".format(flow.type))
if flow.cpupin:if flow.parallel_streams == 1:client_params["cpu_bind"] = flow.cpupinelse:raise RecipeError("Unsupported combination of non-zerocpupin "
"with parallel perf streams.")if flow.parallel_streams > 1: client_params["parallel"] = flow.parallel_streamsdiff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py index d7d1aec..5dc3a5c 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -77,6 +77,7 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): mtu = IntParam(mandatory=False)
dev_intr_cpu = IntParam(default=0)
- perf_intr_cpu = IntParam(default=0)
I think, the default value be "None" or there should be no default value (parameter being optional). Reason being, cpus are indexed from 0 and it's therefore a perfectly acceptable value to pin a process or interrupts to.
Which means that the dev_intr_cpu default value is also wrong and should be fixed.
Ok, I will make that change. In the master code, the checks are of the form "if netdev_cpupin: ...", so if it is set to zero, nothing happens. I doubt this means "pinned to CPU zero anyway", so that case might actually be missed. In any case, doing it the way you said ensures intended handling.
perf_duration = IntParam(default=60) perf_iterations = IntParam(default=5)@@ -199,7 +200,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_cpufor 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..612b5dc 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_cpufor 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..47f53cf 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 self.params.perf_intr_cpu:raise LnstError("'perf_intr_cpu' (%d) should not be set forthis 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)The old code also stopped irqbalance for guests. Is it intentional that they're skipped here? It also happens in all the following recipes where guests are involved.
Only the 2 baremetal hosts seem to be touched explicitly in the old recipes (for irqbalance). Can you give an example in case I am mistaken?
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 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 8bb7582..a72e8d4 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 self.params.dev_intr_cpu:raise LnstError("'dev_intr_cpu' (%d) should not be set forthis test" % self.params.dev_intr_cpu)
In the previous recipe it was the perf_intr_cpu that "should not be set", is this intentional or a mistake? I also noticed it switches in between a couple of times in the following recipes...
Yes, I was following the checks on a recipe-by-recipe basis, for example: ../phase1/virtual_bridge_vlan_in_guest_mirrored.py --> nperf_cpupin is not defined in the code. ../phase1/virtual_bridge_vlan_in_guest.py --> netdev_cpupin is not defined and '0' is used for it at line 76 (where 'netdev_cpupin' would go). Hence the seemingly inconsistent checks in the group of recipes.
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)I'm also not sure about this pin devices to 0 in this case. The parameter is not set indicating it shouldn't be touch but we still configure it to 0?
For now I'm just interested in if it's a mistake or intentional.
Yes, this happens in the corresponding old recipe (a force-pinning to 0 needs to be done there for some reason? Not sure).
But I have this to say for a later discussion: It kind of looks susipicous wihtout additional explanation somewhere. Maybe we should take a global look at how to do interrupts and cpu pinning and come up with some generic solution.
At this point it also looks like there's a lot of code repetition in individual recipes as well so we might be able to improve on this in a later patchset.
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 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 1a7c4d0..04d3bba 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 self.params.perf_intr_cpu:raise LnstError("'perf_intr_cpu' (%d) should not be set forthis 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@@ -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 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 2a2f905..62c19ec 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 self.params.dev_intr_cpu:raise LnstError("'dev_intr_cpu' (%d) should not be set forthis 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@@ -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 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 e5d0b9b..aeacc12 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 self.params.perf_intr_cpu:raise LnstError("'perf_intr_cpu' (%d) should not be set forthis 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@@ -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 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 f0041fc..77e979e 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 self.params.perf_intr_cpu:raise LnstError("'perf_intr_cpu' (%d) should not be set forthis 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@@ -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 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 df44ae2..b5d38a7 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 self.params.dev_intr_cpu:raise LnstError("'dev_intr_cpu' (%d) should not be set forthis 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@@ -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 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 58d2a9b..2e464c0 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 self.params.perf_intr_cpu:raise LnstError("'perf_cpu_pin' (%d) should not be set forthis 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@@ -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 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 64830bd..cceda69 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 self.params.dev_intr_cpu:raise LnstError("'dev_intr_cpu' (%d) should not be set forthis 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 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 c9c5413..acaa39f 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 self.params.perf_intr_cpu:raise LnstError("'perf_intr_cpu' (%d) should not be set forthis 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@@ -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 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 2720bcf..da988c7 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 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@@ -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 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 0e93d31..813e7c3 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 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@@ -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 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 3eab6de..ffd98f7 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 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@@ -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 self.params.dev_intr_cpu:for m in [m1, m2]:m.run("service irqbalance start")-- 2.17.1 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@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.fedorahos...
Fri, Mar 08, 2019 at 07:17:30PM CET, olichtne@redhat.com wrote:
On Tue, Mar 05, 2019 at 05:09:05PM +0100, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@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@redhat.com
.../Perf/Measurements/BaseFlowMeasurement.py | 7 ++++- .../Perf/Measurements/IperfFlowMeasurement.py | 14 ++++++++++ lnst/Recipes/ENRT/BaseEnrtRecipe.py | 5 +++- 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, 192 insertions(+), 163 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._cpupinclass 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..45303fe 100644 --- a/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py +++ b/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py @@ -84,6 +84,13 @@ class IperfFlowMeasurement(BaseFlowMeasurement): server_params = dict(bind = ipaddress(flow.receiver_bind), oneoff = True)
if flow.cpupin:if flow.parallel_streams == 1:server_params["cpu_bind"] = flow.cpupinelse:raise RecipeError("Unsupported combination of non-zero cpupin ""with parallel perf streams.")return host.prepare_job(IperfServer(**server_params), job_level=ResultLevel.NORMAL)@@ -102,6 +109,13 @@ class IperfFlowMeasurement(BaseFlowMeasurement): else: raise RecipeError("Unsupported flow type '{}'".format(flow.type))
if flow.cpupin:if flow.parallel_streams == 1:client_params["cpu_bind"] = flow.cpupinelse:raise RecipeError("Unsupported combination of non-zero cpupin ""with parallel perf streams.")if flow.parallel_streams > 1: client_params["parallel"] = flow.parallel_streamsdiff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py index d7d1aec..5dc3a5c 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -77,6 +77,7 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): mtu = IntParam(mandatory=False)
dev_intr_cpu = IntParam(default=0)
- perf_intr_cpu = IntParam(default=0)
I think, the default value be "None" or there should be no default value (parameter being optional). Reason being, cpus are indexed from 0 and it's therefore a perfectly acceptable value to pin a process or interrupts to.
Which means that the dev_intr_cpu default value is also wrong and should be fixed.
Agree, both these parameters are optional and if they're not specified no action should be taken, i.e.
no dev_intr_cpu -> no pinning of device interrupts is done (e.g. in parallel test) no perf_tool_cpu -> no parameter is passed to iperf/netperf
perf_duration = IntParam(default=60) perf_iterations = IntParam(default=5)@@ -199,7 +200,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_cpufor 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..612b5dc 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_cpufor 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..47f53cf 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 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)The old code also stopped irqbalance for guests. Is it intentional that they're skipped here? It also happens in all the following recipes where guests are involved.
I think that stopping irqbalance inside guests makes NO sense. Also the code on master branch stops the service on baremetal machines only.
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 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 8bb7582..a72e8d4 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 self.params.dev_intr_cpu:raise LnstError("'dev_intr_cpu' (%d) should not be set for this test" % self.params.dev_intr_cpu)In the previous recipe it was the perf_intr_cpu that "should not be set", is this intentional or a mistake? I also noticed it switches in between a couple of times in the following recipes...
This ...
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)I'm also not sure about this pin devices to 0 in this case. The parameter is not set indicating it shouldn't be touch but we still configure it to 0?
For now I'm just interested in if it's a mistake or intentional.
and this ...
I think this is a mistake in old master branch code for all non-mirrored tests that were left unmaintained. Many fixes went into mirrored versions but they did not land in the non-mirrored. As I wrote in the other email we should fix these tests to match the mirrored versions if we want to keep them.
But I have this to say for a later discussion: It kind of looks susipicous wihtout additional explanation somewhere. Maybe we should take a global look at how to do interrupts and cpu pinning and come up with some generic solution.
At this point it also looks like there's a lot of code repetition in individual recipes as well so we might be able to improve on this in a later patchset.
Agree.
-Jan
----- Original Message -----
From: "Jan Tluka" jtluka@redhat.com To: "Ondrej Lichtner" olichtne@redhat.com Cc: csfakian@redhat.com, lnst-developers@lists.fedorahosted.org Sent: Tuesday, March 12, 2019 2:06:18 PM Subject: Re: [PATCH-next 1/7] lnst.Recipes.ENRT: edit perf pinnings in Recipes
Fri, Mar 08, 2019 at 07:17:30PM CET, olichtne@redhat.com wrote:
On Tue, Mar 05, 2019 at 05:09:05PM +0100, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@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@redhat.com
.../Perf/Measurements/BaseFlowMeasurement.py | 7 ++++- .../Perf/Measurements/IperfFlowMeasurement.py | 14 ++++++++++ lnst/Recipes/ENRT/BaseEnrtRecipe.py | 5 +++- 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, 192 insertions(+), 163 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._cpupinclass 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..45303fe 100644 --- a/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py +++ b/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py @@ -84,6 +84,13 @@ class IperfFlowMeasurement(BaseFlowMeasurement): server_params = dict(bind = ipaddress(flow.receiver_bind), oneoff = True)
if flow.cpupin:if flow.parallel_streams == 1:server_params["cpu_bind"] = flow.cpupinelse:raise RecipeError("Unsupported combination of non-zerocpupin "
"with parallel perf streams.")return host.prepare_job(IperfServer(**server_params), job_level=ResultLevel.NORMAL)@@ -102,6 +109,13 @@ class IperfFlowMeasurement(BaseFlowMeasurement): else: raise RecipeError("Unsupported flow type '{}'".format(flow.type))
if flow.cpupin:if flow.parallel_streams == 1:client_params["cpu_bind"] = flow.cpupinelse:raise RecipeError("Unsupported combination of non-zerocpupin "
"with parallel perf streams.")if flow.parallel_streams > 1: client_params["parallel"] = flow.parallel_streamsdiff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py index d7d1aec..5dc3a5c 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -77,6 +77,7 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): mtu = IntParam(mandatory=False)
dev_intr_cpu = IntParam(default=0)
- perf_intr_cpu = IntParam(default=0)
I think, the default value be "None" or there should be no default value (parameter being optional). Reason being, cpus are indexed from 0 and it's therefore a perfectly acceptable value to pin a process or interrupts to.
Which means that the dev_intr_cpu default value is also wrong and should be fixed.
Agree, both these parameters are optional and if they're not specified no action should be taken, i.e.
no dev_intr_cpu -> no pinning of device interrupts is done (e.g. in parallel test) no perf_tool_cpu -> no parameter is passed to iperf/netperf
Sure, will fix it.
perf_duration = IntParam(default=60) perf_iterations = IntParam(default=5)@@ -199,7 +200,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_cpufor 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..612b5dc 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_cpufor 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..47f53cf 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 self.params.perf_intr_cpu:raise LnstError("'perf_intr_cpu' (%d) should not be set forthis 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)
The old code also stopped irqbalance for guests. Is it intentional that they're skipped here? It also happens in all the following recipes where guests are involved.
I think that stopping irqbalance inside guests makes NO sense. Also the code on master branch stops the service on baremetal machines only.
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 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 8bb7582..a72e8d4 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 self.params.dev_intr_cpu:raise LnstError("'dev_intr_cpu' (%d) should not be set forthis test" % self.params.dev_intr_cpu)
In the previous recipe it was the perf_intr_cpu that "should not be set", is this intentional or a mistake? I also noticed it switches in between a couple of times in the following recipes...
This ...
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)I'm also not sure about this pin devices to 0 in this case. The parameter is not set indicating it shouldn't be touch but we still configure it to 0?
For now I'm just interested in if it's a mistake or intentional.
and this ...
I think this is a mistake in old master branch code for all non-mirrored tests that were left unmaintained. Many fixes went into mirrored versions but they did not land in the non-mirrored. As I wrote in the other email we should fix these tests to match the mirrored versions if we want to keep them.
But I have this to say for a later discussion: It kind of looks susipicous wihtout additional explanation somewhere. Maybe we should take a global look at how to do interrupts and cpu pinning and come up with some generic solution.
At this point it also looks like there's a lot of code repetition in individual recipes as well so we might be able to improve on this in a later patchset.
Agree.
-Jan
Tue, Mar 05, 2019 at 05:09:05PM CET, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@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.
Name of the variable perf_intr_cpu actually makes no sense. There are no interrupts when pinning a process (perf tool) to cpu. The interrupts apply to network devices only.
I suggest to rename this as: perf_intr_cpu => perf_cpu
Signed-off-by: Christos Sfakianakis csfakian@redhat.com
.../Perf/Measurements/BaseFlowMeasurement.py | 7 ++++- .../Perf/Measurements/IperfFlowMeasurement.py | 14 ++++++++++ lnst/Recipes/ENRT/BaseEnrtRecipe.py | 5 +++- 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, 192 insertions(+), 163 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._cpupinclass 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..45303fe 100644 --- a/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py +++ b/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py @@ -84,6 +84,13 @@ class IperfFlowMeasurement(BaseFlowMeasurement): server_params = dict(bind = ipaddress(flow.receiver_bind), oneoff = True)
if flow.cpupin:if flow.parallel_streams == 1:server_params["cpu_bind"] = flow.cpupinelse:raise RecipeError("Unsupported combination of non-zero cpupin ""with parallel perf streams.")return host.prepare_job(IperfServer(**server_params), job_level=ResultLevel.NORMAL)@@ -102,6 +109,13 @@ class IperfFlowMeasurement(BaseFlowMeasurement): else: raise RecipeError("Unsupported flow type '{}'".format(flow.type))
if flow.cpupin:if flow.parallel_streams == 1:client_params["cpu_bind"] = flow.cpupinelse:raise RecipeError("Unsupported combination of non-zero cpupin ""with parallel perf streams.")if flow.parallel_streams > 1: client_params["parallel"] = flow.parallel_streamsdiff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py index d7d1aec..5dc3a5c 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -77,6 +77,7 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): mtu = IntParam(mandatory=False)
dev_intr_cpu = IntParam(default=0)
perf_intr_cpu = IntParam(default=0)
perf_duration = IntParam(default=60) perf_iterations = IntParam(default=5)
@@ -199,7 +200,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
Missing colon after if statement! ^^^^
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..612b5dc 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
Missing colon after if statement! ^^^^
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..47f53cf 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 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@@ -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 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 8bb7582..a72e8d4 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 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@@ -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 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 1a7c4d0..04d3bba 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 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@@ -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 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 2a2f905..62c19ec 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 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@@ -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 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 e5d0b9b..aeacc12 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 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@@ -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 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 f0041fc..77e979e 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 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@@ -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 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 df44ae2..b5d38a7 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 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@@ -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 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 58d2a9b..2e464c0 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 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@@ -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 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 64830bd..cceda69 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 self.params.dev_intr_cpu:raise LnstError("'dev_intr_cpu' (%d) should not be set for this test" % self.params.dev_intr_cpu)
Shouldn't the condition check be for perf_intr_cpu? We definitely want to pin NIC interrupts on host.
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)
Oh, I see. The non-mirrored test cases were unmaintained for quite a long time and they do not have all changes added to mirrored versions. In that case, let's just use all virtual non-mirrored cases from this patch set and fix it later.
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 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 c9c5413..acaa39f 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 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@@ -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 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 2720bcf..da988c7 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 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@@ -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 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 0e93d31..813e7c3 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 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)
Just a note that we should make device naming as consistent as possible. E.g. here we have eth1, eth2 but in previous recipe the names start at eth0, eth1.
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 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 3eab6de..ffd98f7 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 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@@ -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 self.params.dev_intr_cpu:for m in [m1, m2]:m.run("service irqbalance start")-- 2.17.1 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@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.fedorahos...
----- Original Message -----
From: "Jan Tluka" jtluka@redhat.com To: csfakian@redhat.com Cc: lnst-developers@lists.fedorahosted.org Sent: Tuesday, March 12, 2019 1:52:53 PM Subject: Re: [PATCH-next 1/7] lnst.Recipes.ENRT: edit perf pinnings in Recipes
Tue, Mar 05, 2019 at 05:09:05PM CET, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@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.
Name of the variable perf_intr_cpu actually makes no sense. There are no interrupts when pinning a process (perf tool) to cpu. The interrupts apply to network devices only.
I suggest to rename this as: perf_intr_cpu => perf_cpu
Winner is perf_tool_cpu :)
Signed-off-by: Christos Sfakianakis csfakian@redhat.com
.../Perf/Measurements/BaseFlowMeasurement.py | 7 ++++- .../Perf/Measurements/IperfFlowMeasurement.py | 14 ++++++++++ lnst/Recipes/ENRT/BaseEnrtRecipe.py | 5 +++- 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, 192 insertions(+), 163 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._cpupinclass 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..45303fe 100644 --- a/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py +++ b/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py @@ -84,6 +84,13 @@ class IperfFlowMeasurement(BaseFlowMeasurement): server_params = dict(bind = ipaddress(flow.receiver_bind), oneoff = True)
if flow.cpupin:if flow.parallel_streams == 1:server_params["cpu_bind"] = flow.cpupinelse:raise RecipeError("Unsupported combination of non-zerocpupin "
"with parallel perf streams.")return host.prepare_job(IperfServer(**server_params), job_level=ResultLevel.NORMAL)@@ -102,6 +109,13 @@ class IperfFlowMeasurement(BaseFlowMeasurement): else: raise RecipeError("Unsupported flow type '{}'".format(flow.type))
if flow.cpupin:if flow.parallel_streams == 1:client_params["cpu_bind"] = flow.cpupinelse:raise RecipeError("Unsupported combination of non-zerocpupin "
"with parallel perf streams.")if flow.parallel_streams > 1: client_params["parallel"] = flow.parallel_streamsdiff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py index d7d1aec..5dc3a5c 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -77,6 +77,7 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): mtu = IntParam(mandatory=False)
dev_intr_cpu = IntParam(default=0)
perf_intr_cpu = IntParam(default=0)
perf_duration = IntParam(default=60) perf_iterations = IntParam(default=5)
@@ -199,7 +200,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_cpuMissing colon after if statement! ^^^^
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..612b5dc 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_cpuMissing colon after if statement! ^^^^
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..47f53cf 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 self.params.perf_intr_cpu:raise LnstError("'perf_intr_cpu' (%d) should not be set forthis 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@@ -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 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 8bb7582..a72e8d4 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 self.params.dev_intr_cpu:raise LnstError("'dev_intr_cpu' (%d) should not be set for thistest" % 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@@ -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 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 1a7c4d0..04d3bba 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 self.params.perf_intr_cpu:raise LnstError("'perf_intr_cpu' (%d) should not be set forthis 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@@ -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 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 2a2f905..62c19ec 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 self.params.dev_intr_cpu:raise LnstError("'dev_intr_cpu' (%d) should not be set for thistest" % 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@@ -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 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 e5d0b9b..aeacc12 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 self.params.perf_intr_cpu:raise LnstError("'perf_intr_cpu' (%d) should not be set forthis 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@@ -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 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 f0041fc..77e979e 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 self.params.perf_intr_cpu:raise LnstError("'perf_intr_cpu' (%d) should not be set forthis 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@@ -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 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 df44ae2..b5d38a7 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 self.params.dev_intr_cpu:raise LnstError("'dev_intr_cpu' (%d) should not be set for thistest" % 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@@ -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 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 58d2a9b..2e464c0 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 self.params.perf_intr_cpu:raise LnstError("'perf_cpu_pin' (%d) should not be set for thistest" % 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@@ -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 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 64830bd..cceda69 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 self.params.dev_intr_cpu:raise LnstError("'dev_intr_cpu' (%d) should not be set for thistest" % self.params.dev_intr_cpu)
Shouldn't the condition check be for perf_intr_cpu? We definitely want to pin NIC interrupts on host.
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)Oh, I see. The non-mirrored test cases were unmaintained for quite a long time and they do not have all changes added to mirrored versions. In that case, let's just use all virtual non-mirrored cases from this patch set and fix it later.
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 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 c9c5413..acaa39f 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 self.params.perf_intr_cpu:raise LnstError("'perf_intr_cpu' (%d) should not be set forthis 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@@ -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 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 2720bcf..da988c7 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 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@@ -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 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 0e93d31..813e7c3 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 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)Just a note that we should make device naming as consistent as possible. E.g. here we have eth1, eth2 but in previous recipe the names start at eth0, eth1.
I will fix it and follow this scheme: - All device names are indexed from 0: eth0, eth1, tap0, tap1, team0, br0. - Vlan devices are named according to their ID (vlan10, vlan20) - All machine names are indexed from 1 and named host* or guest*: host1, host2, guest1, guest2 etc
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 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 3eab6de..ffd98f7 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 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@@ -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 self.params.dev_intr_cpu:for m in [m1, m2]:m.run("service irqbalance start")-- 2.17.1 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@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.fedorahos...
From: Christos Sfakianakis csfakian@redhat.com
Correct last offload combination in VirtualBridgeVlansOverBondRecipe, set 'tx' to 'off'. Fix missing colon error in TeamRecipe and TeamVsBondRecipe.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- lnst/Recipes/ENRT/TeamRecipe.py | 2 +- lnst/Recipes/ENRT/TeamVsBondRecipe.py | 2 +- lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lnst/Recipes/ENRT/TeamRecipe.py b/lnst/Recipes/ENRT/TeamRecipe.py index 10546e6..6b95ccd 100644 --- a/lnst/Recipes/ENRT/TeamRecipe.py +++ b/lnst/Recipes/ENRT/TeamRecipe.py @@ -70,6 +70,6 @@ class TeamRecipe(BaseEnrtRecipe): m1, m2 = self.matched.m1, self.matched.m2
#TODO better service handling through HostAPI - if self.params.dev_intr_cpu + 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 612b5dc..7e83e15 100644 --- a/lnst/Recipes/ENRT/TeamVsBondRecipe.py +++ b/lnst/Recipes/ENRT/TeamVsBondRecipe.py @@ -83,6 +83,6 @@ class TeamVsBondRecipe(BaseEnrtRecipe): m1, m2 = self.matched.m1, self.matched.m2
#TODO better service handling through HostAPI - if self.params.dev_intr_cpu + if self.params.dev_intr_cpu: for m in [m1, m2]: m.run("service irqbalance start") diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py index aeacc12..089267f 100644 --- a/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py +++ b/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py @@ -40,7 +40,7 @@ class VirtualBridgeVlansOverBondRecipe(BaseEnrtRecipe): dict(gro="on", gso="on", tso="on", tx="on"), dict(gro="off", gso="on", tso="on", tx="on"), dict(gro="on", gso="off", tso="off", tx="on"), - dict(gro="on", gso="on", tso="off", tx="on"))) + dict(gro="on", gso="on", tso="off", tx="off")))
bonding_mode = StrParam(mandatory=True) miimon_value = IntParam(mandatory=True)
From: Christos Sfakianakis csfakian@redhat.com
Enable hadnling of perf tests from both sides in BaseEnrtRecipe. Add this feature in 3 of the recipes (it is used in their old variants). Do not define the corresponding parameter in BaseEnrtRecipe, as it is only used with these 3 recipes.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- lnst/Recipes/ENRT/BaseEnrtRecipe.py | 24 ++++++++++++++++++++++++ lnst/Recipes/ENRT/DoubleTeamRecipe.py | 3 ++- lnst/Recipes/ENRT/TeamRecipe.py | 3 ++- lnst/Recipes/ENRT/TeamVsBondRecipe.py | 3 ++- 4 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py index 5dc3a5c..df4b456 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -176,6 +176,20 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): destination = server_netns, destination_address = server_bind)
+ def _create_reverse_flow(self, flow): + rev_flow = PerfFlow( + type = flow.type, + generator = flow.receiver, + generator_bind = flow.receiver_bind, + receiver = flow.generator, + receiver_bind = flow.generator_bind, + msg_size = flow.msg_size, + duration = flow.duration, + parallel_streams = flow.parallel_streams, + cpupin = flow.cpupin + ) + return rev_flow + def generate_perf_configurations(self, main_config, sub_config): client_nic = main_config.endpoint1 server_nic = main_config.endpoint2 @@ -212,6 +226,16 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): ], iterations=self.params.perf_iterations)
+ if "perf_reverse" in self.params and self.params.perf_reverse: + reverse_flow = self._create_reverse_flow(flow) + reverse_flow_measurement = self.params.net_perf_tool([reverse_flow]) + yield PerfRecipeConf( + measurements=[ + self.params.cpu_perf_tool([server_netns, client_netns]), + reverse_flow_measurement + ], + iterations=self.params.perf_iterations) + def _pin_dev_interrupts(self, dev, cpu): netns = dev.netns
diff --git a/lnst/Recipes/ENRT/DoubleTeamRecipe.py b/lnst/Recipes/ENRT/DoubleTeamRecipe.py index e10ea79..1dd5899 100644 --- a/lnst/Recipes/ENRT/DoubleTeamRecipe.py +++ b/lnst/Recipes/ENRT/DoubleTeamRecipe.py @@ -2,7 +2,7 @@ Implements scenario similar to regression_tests/phase2/ ({active_backup,round_robin}_double_team.xml + team_test.py) """ -from lnst.Common.Parameters import Param, IntParam, StrParam +from lnst.Common.Parameters import Param, IntParam, StrParam, BoolParam from lnst.Common.IpAddress import ipaddress from lnst.Controller import HostReq, DeviceReq from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration @@ -23,6 +23,7 @@ class DoubleTeamRecipe(BaseEnrtRecipe): dict(gro="on", gso="off", tso="off", tx="on"), dict(gro="on", gso="on", tso="off", tx="off")))
+ perf_reverse = BoolParam(default=True) runner_name = StrParam(mandatory=True)
def test_wide_configuration(self): diff --git a/lnst/Recipes/ENRT/TeamRecipe.py b/lnst/Recipes/ENRT/TeamRecipe.py index 6b95ccd..35bd988 100644 --- a/lnst/Recipes/ENRT/TeamRecipe.py +++ b/lnst/Recipes/ENRT/TeamRecipe.py @@ -2,7 +2,7 @@ Implements scenario similar to regression_tests/phase2/ ({active_backup,round_robin}_team.xml + team_test.py) """ -from lnst.Common.Parameters import Param, IntParam, StrParam +from lnst.Common.Parameters import Param, IntParam, StrParam, BoolParam from lnst.Common.IpAddress import ipaddress from lnst.Controller import HostReq, DeviceReq from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration @@ -22,6 +22,7 @@ class TeamRecipe(BaseEnrtRecipe): dict(gro="on", gso="off", tso="off", tx="on"), dict(gro="on", gso="on", tso="off", tx="off")))
+ perf_reverse = BoolParam(default=True) runner_name = StrParam(mandatory=True)
def test_wide_configuration(self): diff --git a/lnst/Recipes/ENRT/TeamVsBondRecipe.py b/lnst/Recipes/ENRT/TeamVsBondRecipe.py index 7e83e15..69d038f 100644 --- a/lnst/Recipes/ENRT/TeamVsBondRecipe.py +++ b/lnst/Recipes/ENRT/TeamVsBondRecipe.py @@ -3,7 +3,7 @@ Implements scenario similar to regression_tests/phase2/ ({active_backup,round_robin}_team_vs_{active_backup,round_robin} _bond.xml + team_test.py) """ -from lnst.Common.Parameters import Param, IntParam, StrParam +from lnst.Common.Parameters import Param, IntParam, StrParam, BoolParam from lnst.Common.IpAddress import ipaddress from lnst.Controller import HostReq, DeviceReq from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration @@ -25,6 +25,7 @@ class TeamVsBondRecipe(BaseEnrtRecipe): dict(gro="on", gso="off", tso="off", tx="on"), dict(gro="on", gso="on", tso="off", tx="off")))
+ perf_reverse = BoolParam(default=True) runner_name = StrParam(mandatory = True) bonding_mode = StrParam(mandatory = True) miimon_value = IntParam(mandatory = True)
On Tue, Mar 05, 2019 at 05:09:07PM +0100, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Enable hadnling of perf tests from both sides in BaseEnrtRecipe. Add this feature in 3 of the recipes (it is used in their old variants). Do not define the corresponding parameter in BaseEnrtRecipe, as it is only used with these 3 recipes.
I actually would like the parameter defined in the Base class, without a default value and set as mandatory=False. Then the 3 recipes can have a default=True.
But since the parameter is in the base class the tester now has the ability to set it to True if he wants. If it's not defined in the BaseEnrtRecipe class then he can only choose to turn it off for the 3 recipes.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 24 ++++++++++++++++++++++++ lnst/Recipes/ENRT/DoubleTeamRecipe.py | 3 ++- lnst/Recipes/ENRT/TeamRecipe.py | 3 ++- lnst/Recipes/ENRT/TeamVsBondRecipe.py | 3 ++- 4 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py index 5dc3a5c..df4b456 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -176,6 +176,20 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): destination = server_netns, destination_address = server_bind)
- def _create_reverse_flow(self, flow):
rev_flow = PerfFlow(type = flow.type,generator = flow.receiver,generator_bind = flow.receiver_bind,receiver = flow.generator,receiver_bind = flow.generator_bind,msg_size = flow.msg_size,duration = flow.duration,parallel_streams = flow.parallel_streams,cpupin = flow.cpupin)return rev_flow
In a class it's often more readable to place helper/private methods like this to the bottom of the class or at least bellow their use. When I'm reading the class implementation from top to bottom I'll first see this method without having to see the context of when/why it's used.
On the other hand if it's correctly named, and well implemented when I'm reading the generate_perf_configurations method and see that it calls a "create_reverse_flow" method I have a reasonable understanding of what it does and understand it's use in the context, then if I'm interested in the specifics of it's implementation I can "drill down" and continue reading it's implementation.
Not an issue, just a style choice. I took this from the "Clean code" book, I don't fully agree with everything it says but it has some good ideas and points, and I like this particular one :).
def generate_perf_configurations(self, main_config, sub_config): client_nic = main_config.endpoint1 server_nic = main_config.endpoint2@@ -212,6 +226,16 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): ], iterations=self.params.perf_iterations)
if "perf_reverse" in self.params and self.params.perf_reverse:reverse_flow = self._create_reverse_flow(flow)reverse_flow_measurement = self.params.net_perf_tool([reverse_flow])yield PerfRecipeConf(measurements=[self.params.cpu_perf_tool([server_netns, client_netns]),reverse_flow_measurement],iterations=self.params.perf_iterations)- def _pin_dev_interrupts(self, dev, cpu): netns = dev.netns
diff --git a/lnst/Recipes/ENRT/DoubleTeamRecipe.py b/lnst/Recipes/ENRT/DoubleTeamRecipe.py index e10ea79..1dd5899 100644 --- a/lnst/Recipes/ENRT/DoubleTeamRecipe.py +++ b/lnst/Recipes/ENRT/DoubleTeamRecipe.py @@ -2,7 +2,7 @@ Implements scenario similar to regression_tests/phase2/ ({active_backup,round_robin}_double_team.xml + team_test.py) """ -from lnst.Common.Parameters import Param, IntParam, StrParam +from lnst.Common.Parameters import Param, IntParam, StrParam, BoolParam from lnst.Common.IpAddress import ipaddress from lnst.Controller import HostReq, DeviceReq from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration @@ -23,6 +23,7 @@ class DoubleTeamRecipe(BaseEnrtRecipe): dict(gro="on", gso="off", tso="off", tx="on"), dict(gro="on", gso="on", tso="off", tx="off")))
perf_reverse = BoolParam(default=True) runner_name = StrParam(mandatory=True)
def test_wide_configuration(self):
diff --git a/lnst/Recipes/ENRT/TeamRecipe.py b/lnst/Recipes/ENRT/TeamRecipe.py index 6b95ccd..35bd988 100644 --- a/lnst/Recipes/ENRT/TeamRecipe.py +++ b/lnst/Recipes/ENRT/TeamRecipe.py @@ -2,7 +2,7 @@ Implements scenario similar to regression_tests/phase2/ ({active_backup,round_robin}_team.xml + team_test.py) """ -from lnst.Common.Parameters import Param, IntParam, StrParam +from lnst.Common.Parameters import Param, IntParam, StrParam, BoolParam from lnst.Common.IpAddress import ipaddress from lnst.Controller import HostReq, DeviceReq from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration @@ -22,6 +22,7 @@ class TeamRecipe(BaseEnrtRecipe): dict(gro="on", gso="off", tso="off", tx="on"), dict(gro="on", gso="on", tso="off", tx="off")))
perf_reverse = BoolParam(default=True) runner_name = StrParam(mandatory=True)
def test_wide_configuration(self):
diff --git a/lnst/Recipes/ENRT/TeamVsBondRecipe.py b/lnst/Recipes/ENRT/TeamVsBondRecipe.py index 7e83e15..69d038f 100644 --- a/lnst/Recipes/ENRT/TeamVsBondRecipe.py +++ b/lnst/Recipes/ENRT/TeamVsBondRecipe.py @@ -3,7 +3,7 @@ Implements scenario similar to regression_tests/phase2/ ({active_backup,round_robin}_team_vs_{active_backup,round_robin} _bond.xml + team_test.py) """ -from lnst.Common.Parameters import Param, IntParam, StrParam +from lnst.Common.Parameters import Param, IntParam, StrParam, BoolParam from lnst.Common.IpAddress import ipaddress from lnst.Controller import HostReq, DeviceReq from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration @@ -25,6 +25,7 @@ class TeamVsBondRecipe(BaseEnrtRecipe): dict(gro="on", gso="off", tso="off", tx="on"), dict(gro="on", gso="on", tso="off", tx="off")))
- perf_reverse = BoolParam(default=True) runner_name = StrParam(mandatory = True) bonding_mode = StrParam(mandatory = True) miimon_value = IntParam(mandatory = True)
-- 2.17.1 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@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.fedorahos...
----- Original Message -----
From: "Ondrej Lichtner" olichtne@redhat.com To: csfakian@redhat.com Cc: lnst-developers@lists.fedorahosted.org Sent: Friday, March 8, 2019 7:24:08 PM Subject: Re: [PATCH-next 3/7] lnst.Recipes.ENRT: handle/enable bidirectional perfs
On Tue, Mar 05, 2019 at 05:09:07PM +0100, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Enable hadnling of perf tests from both sides in BaseEnrtRecipe. Add this feature in 3 of the recipes (it is used in their old variants). Do not define the corresponding parameter in BaseEnrtRecipe, as it is only used with these 3 recipes.
I actually would like the parameter defined in the Base class, without a default value and set as mandatory=False. Then the 3 recipes can have a default=True.
But since the parameter is in the base class the tester now has the ability to set it to True if he wants. If it's not defined in the BaseEnrtRecipe class then he can only choose to turn it off for the 3 recipes.
Sure, I will fix it.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 24 ++++++++++++++++++++++++ lnst/Recipes/ENRT/DoubleTeamRecipe.py | 3 ++- lnst/Recipes/ENRT/TeamRecipe.py | 3 ++- lnst/Recipes/ENRT/TeamVsBondRecipe.py | 3 ++- 4 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py index 5dc3a5c..df4b456 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -176,6 +176,20 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): destination = server_netns, destination_address = server_bind)
- def _create_reverse_flow(self, flow):
rev_flow = PerfFlow(type = flow.type,generator = flow.receiver,generator_bind = flow.receiver_bind,receiver = flow.generator,receiver_bind = flow.generator_bind,msg_size = flow.msg_size,duration = flow.duration,parallel_streams = flow.parallel_streams,cpupin = flow.cpupin)return rev_flowIn a class it's often more readable to place helper/private methods like this to the bottom of the class or at least bellow their use. When I'm reading the class implementation from top to bottom I'll first see this method without having to see the context of when/why it's used.
On the other hand if it's correctly named, and well implemented when I'm reading the generate_perf_configurations method and see that it calls a "create_reverse_flow" method I have a reasonable understanding of what it does and understand it's use in the context, then if I'm interested in the specifics of it's implementation I can "drill down" and continue reading it's implementation.
Not an issue, just a style choice. I took this from the "Clean code" book, I don't fully agree with everything it says but it has some good ideas and points, and I like this particular one :).
Makes sense, I will transfer it to the bottom of the module.
def generate_perf_configurations(self, main_config, sub_config): client_nic = main_config.endpoint1 server_nic = main_config.endpoint2@@ -212,6 +226,16 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): ], iterations=self.params.perf_iterations)
if "perf_reverse" in self.params andself.params.perf_reverse:
reverse_flow = self._create_reverse_flow(flow)reverse_flow_measurement =self.params.net_perf_tool([reverse_flow])
yield PerfRecipeConf(measurements=[self.params.cpu_perf_tool([server_netns,client_netns]),
reverse_flow_measurement],iterations=self.params.perf_iterations)- def _pin_dev_interrupts(self, dev, cpu): netns = dev.netns
diff --git a/lnst/Recipes/ENRT/DoubleTeamRecipe.py b/lnst/Recipes/ENRT/DoubleTeamRecipe.py index e10ea79..1dd5899 100644 --- a/lnst/Recipes/ENRT/DoubleTeamRecipe.py +++ b/lnst/Recipes/ENRT/DoubleTeamRecipe.py @@ -2,7 +2,7 @@ Implements scenario similar to regression_tests/phase2/ ({active_backup,round_robin}_double_team.xml + team_test.py) """ -from lnst.Common.Parameters import Param, IntParam, StrParam +from lnst.Common.Parameters import Param, IntParam, StrParam, BoolParam from lnst.Common.IpAddress import ipaddress from lnst.Controller import HostReq, DeviceReq from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration @@ -23,6 +23,7 @@ class DoubleTeamRecipe(BaseEnrtRecipe): dict(gro="on", gso="off", tso="off", tx="on"), dict(gro="on", gso="on", tso="off", tx="off")))
perf_reverse = BoolParam(default=True) runner_name = StrParam(mandatory=True)
def test_wide_configuration(self):
diff --git a/lnst/Recipes/ENRT/TeamRecipe.py b/lnst/Recipes/ENRT/TeamRecipe.py index 6b95ccd..35bd988 100644 --- a/lnst/Recipes/ENRT/TeamRecipe.py +++ b/lnst/Recipes/ENRT/TeamRecipe.py @@ -2,7 +2,7 @@ Implements scenario similar to regression_tests/phase2/ ({active_backup,round_robin}_team.xml + team_test.py) """ -from lnst.Common.Parameters import Param, IntParam, StrParam +from lnst.Common.Parameters import Param, IntParam, StrParam, BoolParam from lnst.Common.IpAddress import ipaddress from lnst.Controller import HostReq, DeviceReq from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration @@ -22,6 +22,7 @@ class TeamRecipe(BaseEnrtRecipe): dict(gro="on", gso="off", tso="off", tx="on"), dict(gro="on", gso="on", tso="off", tx="off")))
perf_reverse = BoolParam(default=True) runner_name = StrParam(mandatory=True)
def test_wide_configuration(self):
diff --git a/lnst/Recipes/ENRT/TeamVsBondRecipe.py b/lnst/Recipes/ENRT/TeamVsBondRecipe.py index 7e83e15..69d038f 100644 --- a/lnst/Recipes/ENRT/TeamVsBondRecipe.py +++ b/lnst/Recipes/ENRT/TeamVsBondRecipe.py @@ -3,7 +3,7 @@ Implements scenario similar to regression_tests/phase2/ ({active_backup,round_robin}_team_vs_{active_backup,round_robin} _bond.xml + team_test.py) """ -from lnst.Common.Parameters import Param, IntParam, StrParam +from lnst.Common.Parameters import Param, IntParam, StrParam, BoolParam from lnst.Common.IpAddress import ipaddress from lnst.Controller import HostReq, DeviceReq from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration @@ -25,6 +25,7 @@ class TeamVsBondRecipe(BaseEnrtRecipe): dict(gro="on", gso="off", tso="off", tx="on"), dict(gro="on", gso="on", tso="off", tx="off")))
- perf_reverse = BoolParam(default=True) runner_name = StrParam(mandatory = True) bonding_mode = StrParam(mandatory = True) miimon_value = IntParam(mandatory = True)
-- 2.17.1 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@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.fedorahos...
From: Christos Sfakianakis csfakian@redhat.com
Add methods for handling coalescence settings. Raise error when the settings can not be obtained or written to the device. Need not verify the settings after a write command (to be done for all parameters during validation stage). Raise no errors during original configuration stage (_get_if_data, _store_cleanup_data).
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- lnst/Devices/Device.py | 77 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+)
diff --git a/lnst/Devices/Device.py b/lnst/Devices/Device.py index 20cddcf..ed3ed28 100644 --- a/lnst/Devices/Device.py +++ b/lnst/Devices/Device.py @@ -228,6 +228,13 @@ class Device(object): "mtu": self.mtu, "driver": self.driver, "devlink": self._devlink} + try: + ad_rx_coal, ad_tx_coal = self._read_adaptive_coalescing() + except DeviceError: + ad_rx_coal, ad_tx_coal = None, None + if_data["adaptive_rx_coalescing"] = ad_rx_coal + if_data["adaptive_tx_coalescing"] = ad_tx_coal + return if_data
def _vars(self): @@ -268,6 +275,12 @@ class Device(object): "mtu": self.mtu, "name": self.name, "hwaddr": self.hwaddr} + try: + ad_rx_coal, ad_tx_coal = self._read_adaptive_coalescing() + except DeviceError: + ad_rx_coal, ad_tx_coal = None, None + self._cleanup_data["adaptive_rx_coalescing"] = ad_rx_coal + self._cleanup_data["adaptive_tx_coalescing"] = ad_tx_coal
def restore_original_data(self): """Restores initial configuration from stored values""" @@ -284,6 +297,14 @@ class Device(object): if self.hwaddr != self._cleanup_data["hwaddr"]: self.hwaddr = self._cleanup_data["hwaddr"]
+ try: + def_ad_rx_coal = self._cleanup_data["adaptive_rx_coalescing"] + def_ad_tx_coal = self._cleanup_data["adaptive_tx_coalescing"] + if self._read_adaptive_coalescing() != [def_ad_rx_coal, def_ad_tx_coal]: + self._write_adaptive_coalescing(def_ad_rx_coal, def_ad_tx_coal) + except DeviceError: + pass + self._cleanup_data = None
def _create(self): @@ -365,6 +386,30 @@ class Device(object): self._update_attr(str(addr), "IFLA_ADDRESS") self._nl_sync("set")
+ @property + def adaptive_rx_coalescing(self): + return self._read_adaptive_coalescing()[0] == 'on' + + @adaptive_rx_coalescing.setter + def adaptive_rx_coalescing(self, value): + rx_val = 'off' + if value: + rx_val = 'on' + tx_val = self._read_adaptive_coalescing()[1] + self._write_adaptive_coalescing(rx_val, tx_val) + + @property + def adaptive_tx_coalescing(self): + return self._read_adaptive_coalescing()[1] == 'on' + + @adaptive_tx_coalescing.setter + def adaptive_tx_coalescing(self, value): + tx_val = 'off' + if value: + tx_val = 'on' + rx_val = self._read_adaptive_coalescing()[0] + self._write_adaptive_coalescing(rx_val, tx_val) + @property def state(self): """state attribute @@ -603,6 +648,38 @@ class Device(object): """disable automatic negotiation of speed for this device""" exec_cmd("ethtool -s %s autoneg off" % self.name)
+ def _read_adaptive_coalescing(self): + try: + res = exec_cmd("ethtool -c %s" % self.name) + except: + raise DeviceError("Could not read coalescence values of " + "%s." % self.name) + regex = "Adaptive RX: (on|off) TX: (on|off)" + try: + res = re.search(regex, res[0]).groups() + except AttributeError: + raise DeviceError("No values for coalescence of %s." % + self.name) + return list(res) + + def _write_adaptive_coalescing(self, rx_val, tx_val): + if self._read_adaptive_coalescing() == [rx_val, tx_val]: + return + try: + exec_cmd("ethtool -C %s adaptive-rx %s adaptive-tx %s" % + (self.name, rx_val, tx_val)) + except: + raise DeviceConfigError("Not allowed to modify coalescence " + "settings for %s." % self.name) + + def _restore_coalescing(self): + rx_val = self._cleanup_data["adaptive_rx_coalescing"] + tx_val = self._cleanup_data["adaptive_tx_coalescing"] + self._write_adaptive_coalescing(rx_val, tx_val) + + def restore_coalescing(self): + self._restore_coalescing() + #TODO implement proper Route objects #consider the same as with tc? # def route_add(self, dest):
On Tue, Mar 05, 2019 at 05:09:08PM +0100, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Add methods for handling coalescence settings. Raise error when the settings can not be obtained or written to the device. Need not verify the settings after a write command (to be done for all parameters during validation stage). Raise no errors during original configuration stage (_get_if_data, _store_cleanup_data).
Signed-off-by: Christos Sfakianakis csfakian@redhat.com
lnst/Devices/Device.py | 77 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+)
diff --git a/lnst/Devices/Device.py b/lnst/Devices/Device.py index 20cddcf..ed3ed28 100644 --- a/lnst/Devices/Device.py +++ b/lnst/Devices/Device.py @@ -228,6 +228,13 @@ class Device(object): "mtu": self.mtu, "driver": self.driver, "devlink": self._devlink}
try:ad_rx_coal, ad_tx_coal = self._read_adaptive_coalescing()except DeviceError:ad_rx_coal, ad_tx_coal = None, Noneif_data["adaptive_rx_coalescing"] = ad_rx_coalif_data["adaptive_tx_coalescing"] = ad_tx_coalreturn if_datadef _vars(self):
@@ -268,6 +275,12 @@ class Device(object): "mtu": self.mtu, "name": self.name, "hwaddr": self.hwaddr}
try:ad_rx_coal, ad_tx_coal = self._read_adaptive_coalescing()except DeviceError:ad_rx_coal, ad_tx_coal = None, Noneself._cleanup_data["adaptive_rx_coalescing"] = ad_rx_coalself._cleanup_data["adaptive_tx_coalescing"] = ad_tx_coaldef restore_original_data(self): """Restores initial configuration from stored values"""
@@ -284,6 +297,14 @@ class Device(object): if self.hwaddr != self._cleanup_data["hwaddr"]: self.hwaddr = self._cleanup_data["hwaddr"]
try:def_ad_rx_coal = self._cleanup_data["adaptive_rx_coalescing"]def_ad_tx_coal = self._cleanup_data["adaptive_tx_coalescing"]if self._read_adaptive_coalescing() != [def_ad_rx_coal, def_ad_tx_coal]:self._write_adaptive_coalescing(def_ad_rx_coal, def_ad_tx_coal)except DeviceError:pass
Why not just use the restore_coalescing method?
self._cleanup_data = None def _create(self):@@ -365,6 +386,30 @@ class Device(object): self._update_attr(str(addr), "IFLA_ADDRESS") self._nl_sync("set")
- @property
- def adaptive_rx_coalescing(self):
return self._read_adaptive_coalescing()[0] == 'on'- @adaptive_rx_coalescing.setter
- def adaptive_rx_coalescing(self, value):
rx_val = 'off'if value:rx_val = 'on'tx_val = self._read_adaptive_coalescing()[1]self._write_adaptive_coalescing(rx_val, tx_val)- @property
- def adaptive_tx_coalescing(self):
return self._read_adaptive_coalescing()[1] == 'on'- @adaptive_tx_coalescing.setter
- def adaptive_tx_coalescing(self, value):
tx_val = 'off'if value:tx_val = 'on'rx_val = self._read_adaptive_coalescing()[0]self._write_adaptive_coalescing(rx_val, tx_val)- @property def state(self): """state attribute
@@ -603,6 +648,38 @@ class Device(object): """disable automatic negotiation of speed for this device""" exec_cmd("ethtool -s %s autoneg off" % self.name)
- def _read_adaptive_coalescing(self):
try:res = exec_cmd("ethtool -c %s" % self.name)except:raise DeviceError("Could not read coalescence values of ""%s." % self.name)regex = "Adaptive RX: (on|off) TX: (on|off)"try:res = re.search(regex, res[0]).groups()except AttributeError:raise DeviceError("No values for coalescence of %s." %self.name)return list(res)- def _write_adaptive_coalescing(self, rx_val, tx_val):
if self._read_adaptive_coalescing() == [rx_val, tx_val]:returntry:exec_cmd("ethtool -C %s adaptive-rx %s adaptive-tx %s" %(self.name, rx_val, tx_val))except:raise DeviceConfigError("Not allowed to modify coalescence ""settings for %s." % self.name)- def _restore_coalescing(self):
rx_val = self._cleanup_data["adaptive_rx_coalescing"]tx_val = self._cleanup_data["adaptive_tx_coalescing"]self._write_adaptive_coalescing(rx_val, tx_val)- def restore_coalescing(self):
self._restore_coalescing()
Why is this 2 methods? Why not just have the public one with the code of the private one?
#TODO implement proper Route objects #consider the same as with tc? # def route_add(self, dest):-- 2.17.1 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@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.fedorahos...
----- Original Message -----
From: "Ondrej Lichtner" olichtne@redhat.com To: csfakian@redhat.com Cc: lnst-developers@lists.fedorahosted.org Sent: Friday, March 8, 2019 7:34:35 PM Subject: Re: [PATCH-next 4/7] lnst.Devices.Device: handle adaptive coalescing
On Tue, Mar 05, 2019 at 05:09:08PM +0100, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Add methods for handling coalescence settings. Raise error when the settings can not be obtained or written to the device. Need not verify the settings after a write command (to be done for all parameters during validation stage). Raise no errors during original configuration stage (_get_if_data, _store_cleanup_data).
Signed-off-by: Christos Sfakianakis csfakian@redhat.com
lnst/Devices/Device.py | 77 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+)
diff --git a/lnst/Devices/Device.py b/lnst/Devices/Device.py index 20cddcf..ed3ed28 100644 --- a/lnst/Devices/Device.py +++ b/lnst/Devices/Device.py @@ -228,6 +228,13 @@ class Device(object): "mtu": self.mtu, "driver": self.driver, "devlink": self._devlink}
try:ad_rx_coal, ad_tx_coal = self._read_adaptive_coalescing()except DeviceError:ad_rx_coal, ad_tx_coal = None, Noneif_data["adaptive_rx_coalescing"] = ad_rx_coalif_data["adaptive_tx_coalescing"] = ad_tx_coalreturn if_datadef _vars(self):
@@ -268,6 +275,12 @@ class Device(object): "mtu": self.mtu, "name": self.name, "hwaddr": self.hwaddr}
try:ad_rx_coal, ad_tx_coal = self._read_adaptive_coalescing()except DeviceError:ad_rx_coal, ad_tx_coal = None, Noneself._cleanup_data["adaptive_rx_coalescing"] = ad_rx_coalself._cleanup_data["adaptive_tx_coalescing"] = ad_tx_coaldef restore_original_data(self): """Restores initial configuration from stored values"""
@@ -284,6 +297,14 @@ class Device(object): if self.hwaddr != self._cleanup_data["hwaddr"]: self.hwaddr = self._cleanup_data["hwaddr"]
try:def_ad_rx_coal = self._cleanup_data["adaptive_rx_coalescing"]def_ad_tx_coal = self._cleanup_data["adaptive_tx_coalescing"]if self._read_adaptive_coalescing() != [def_ad_rx_coal,def_ad_tx_coal]:
self._write_adaptive_coalescing(def_ad_rx_coal,def_ad_tx_coal)
except DeviceError:passWhy not just use the restore_coalescing method?
Good point, will use that method in the try clause instead.
self._cleanup_data = None def _create(self):@@ -365,6 +386,30 @@ class Device(object): self._update_attr(str(addr), "IFLA_ADDRESS") self._nl_sync("set")
- @property
- def adaptive_rx_coalescing(self):
return self._read_adaptive_coalescing()[0] == 'on'- @adaptive_rx_coalescing.setter
- def adaptive_rx_coalescing(self, value):
rx_val = 'off'if value:rx_val = 'on'tx_val = self._read_adaptive_coalescing()[1]self._write_adaptive_coalescing(rx_val, tx_val)- @property
- def adaptive_tx_coalescing(self):
return self._read_adaptive_coalescing()[1] == 'on'- @adaptive_tx_coalescing.setter
- def adaptive_tx_coalescing(self, value):
tx_val = 'off'if value:tx_val = 'on'rx_val = self._read_adaptive_coalescing()[0]self._write_adaptive_coalescing(rx_val, tx_val)- @property def state(self): """state attribute
@@ -603,6 +648,38 @@ class Device(object): """disable automatic negotiation of speed for this device""" exec_cmd("ethtool -s %s autoneg off" % self.name)
- def _read_adaptive_coalescing(self):
try:res = exec_cmd("ethtool -c %s" % self.name)except:raise DeviceError("Could not read coalescence values of ""%s." % self.name)regex = "Adaptive RX: (on|off) TX: (on|off)"try:res = re.search(regex, res[0]).groups()except AttributeError:raise DeviceError("No values for coalescence of %s." %self.name)return list(res)- def _write_adaptive_coalescing(self, rx_val, tx_val):
if self._read_adaptive_coalescing() == [rx_val, tx_val]:returntry:exec_cmd("ethtool -C %s adaptive-rx %s adaptive-tx %s" %(self.name, rx_val, tx_val))except:raise DeviceConfigError("Not allowed to modify coalescence ""settings for %s." % self.name)- def _restore_coalescing(self):
rx_val = self._cleanup_data["adaptive_rx_coalescing"]tx_val = self._cleanup_data["adaptive_tx_coalescing"]self._write_adaptive_coalescing(rx_val, tx_val)- def restore_coalescing(self):
self._restore_coalescing()Why is this 2 methods? Why not just have the public one with the code of the private one?
I will make the private method public, thanks.
#TODO implement proper Route objects #consider the same as with tc? # def route_add(self, dest):-- 2.17.1 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@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.fedorahos...
From: Christos Sfakianakis csfakian@redhat.com
Use 'adaptive_rx_coalescing'/adaptive_tx_coalescing parameters of BaseEnrtRecipe and updated Device API to modify adaptive coalescence when opted.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- lnst/Recipes/ENRT/BaseEnrtRecipe.py | 3 ++- lnst/Recipes/ENRT/BondRecipe.py | 7 +++++++ lnst/Recipes/ENRT/DoubleBondRecipe.py | 9 +++++++++ lnst/Recipes/ENRT/DoubleTeamRecipe.py | 9 +++++++++ lnst/Recipes/ENRT/SimplePerfRecipe.py | 7 +++++++ lnst/Recipes/ENRT/TeamRecipe.py | 7 +++++++ lnst/Recipes/ENRT/TeamVsBondRecipe.py | 9 +++++++++ lnst/Recipes/ENRT/VlansOverBondRecipe.py | 7 +++++++ lnst/Recipes/ENRT/VlansOverTeamRecipe.py | 7 +++++++ lnst/Recipes/ENRT/VlansRecipe.py | 7 +++++++ 10 files changed, 71 insertions(+), 1 deletion(-)
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py index df4b456..ba4ff41 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -72,7 +72,8 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe):
driver = StrParam(default="ixgbe")
- adaptive_coalescing = BoolParam(default=True) + adaptive_rx_coalescing = BoolParam(mandatory=False) + adaptive_tx_coalescing = BoolParam(mandatory=False)
mtu = IntParam(mandatory=False)
diff --git a/lnst/Recipes/ENRT/BondRecipe.py b/lnst/Recipes/ENRT/BondRecipe.py index d2268fb..4132f93 100644 --- a/lnst/Recipes/ENRT/BondRecipe.py +++ b/lnst/Recipes/ENRT/BondRecipe.py @@ -54,6 +54,13 @@ class BondRecipe(BaseEnrtRecipe): m2.eth0.ip_add(ipaddress(net_addr6 + "::2/64")) m2.eth0.up()
+ if "adaptive_rx_coalescing" in self.params: + for dev in [m1.eth0, m1.eth1, m2.eth0]: + dev.adaptive_rx_coalescing = self.params.adaptive_rx_coalescing + if "adaptive_tx_coalescing" in self.params: + for dev in [m1.eth0, m1.eth1, m2.eth0]: + dev.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing + #TODO better service handling through HostAPI if self.params.dev_intr_cpu: for m in [m1, m2]: diff --git a/lnst/Recipes/ENRT/DoubleBondRecipe.py b/lnst/Recipes/ENRT/DoubleBondRecipe.py index 2ddbec4..a135aee 100644 --- a/lnst/Recipes/ENRT/DoubleBondRecipe.py +++ b/lnst/Recipes/ENRT/DoubleBondRecipe.py @@ -53,6 +53,15 @@ class DoubleBondRecipe(BaseEnrtRecipe): m.eth1.up() m.bond.up()
+ if "adaptive_tx_coalescing" in self.params: + for m in [m1, m2]: + for dev in [m.eth0, m.eth1]: + dev.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing + if "adaptive_tx_coalescing" in self.params: + for m in [m1, m2]: + for dev in [m.eth0, m.eth1]: + dev.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing + #TODO better service handling through HostAPI if self.params.dev_intr_cpu: for m in [m1, m2]: diff --git a/lnst/Recipes/ENRT/DoubleTeamRecipe.py b/lnst/Recipes/ENRT/DoubleTeamRecipe.py index 1dd5899..cfd7715 100644 --- a/lnst/Recipes/ENRT/DoubleTeamRecipe.py +++ b/lnst/Recipes/ENRT/DoubleTeamRecipe.py @@ -67,6 +67,15 @@ class DoubleTeamRecipe(BaseEnrtRecipe): m2.eth2.up() m2.team.up()
+ if "adaptive_rx_coalescing" in self.params: + for m in [m1, m2]: + for dev in [m.eth1, m.eth2]: + dev.adaptive_rx_coalescing = self.params.adaptive_rx_coalescing + if "adaptive_tx_coalescing" in self.params: + for m in [m1, m2]: + for dev in [m.eth1, m.eth2]: + dev.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing + #TODO better service handling through HostAPI if self.params.dev_intr_cpu: for m in [m1, m2]: diff --git a/lnst/Recipes/ENRT/SimplePerfRecipe.py b/lnst/Recipes/ENRT/SimplePerfRecipe.py index 92e1e1b..32a4fa8 100644 --- a/lnst/Recipes/ENRT/SimplePerfRecipe.py +++ b/lnst/Recipes/ENRT/SimplePerfRecipe.py @@ -51,6 +51,13 @@ class SimplePerfRecipe(BaseEnrtRecipe): m2.eth0.ip_add(ipaddress("fc00::2/64")) m2.eth0.up()
+ if "adaptive_rx_coalescing" in self.params: + for m in [m1, m2]: + m.eth0.adaptive_rx_coalescing = self.params.adaptive_rx_coalescing + if "adaptive_tx_coalescing" in self.params: + for m in [m1, m2]: + m.eth0.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing + #TODO better service handling through HostAPI if self.params.dev_intr_cpu: for m in [m1, m2]: diff --git a/lnst/Recipes/ENRT/TeamRecipe.py b/lnst/Recipes/ENRT/TeamRecipe.py index 35bd988..036a36e 100644 --- a/lnst/Recipes/ENRT/TeamRecipe.py +++ b/lnst/Recipes/ENRT/TeamRecipe.py @@ -58,6 +58,13 @@ class TeamRecipe(BaseEnrtRecipe): m1.team.up() m2.eth1.up()
+ if "adaptive_rx_coalescing" in self.params: + for dev in [m1.eth1, m1.eth2, m2.eth1]: + dev.adaptive_rx_coalescing = self.params.adaptive_rx_coalescing + if "adaptive_tx_coalescing" in self.params: + for dev in [m1.eth1, m1.eth2, m2.eth1]: + dev.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing + #TODO better service handling through HostAPI if self.params.dev_intr_cpu: for m in [m1, m2]: diff --git a/lnst/Recipes/ENRT/TeamVsBondRecipe.py b/lnst/Recipes/ENRT/TeamVsBondRecipe.py index 69d038f..ccf2b21 100644 --- a/lnst/Recipes/ENRT/TeamVsBondRecipe.py +++ b/lnst/Recipes/ENRT/TeamVsBondRecipe.py @@ -71,6 +71,15 @@ class TeamVsBondRecipe(BaseEnrtRecipe): m2.eth2.up() m2.bond.up()
+ if "adaptive_rx_coalescing" in self.params: + for m in [m1, m2]: + for dev in [m.eth1, m.eth2]: + dev.adaptive_rx_coalescing = self.params.adaptive_rx_coalescing + if "adaptive_tx_coalescing" in self.params: + for m in [m1, m2]: + for dev in [m.eth1, m.eth2]: + dev.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing + #TODO better service handling through HostAPI if self.params.dev_intr_cpu: for m in [m1, m2]: diff --git a/lnst/Recipes/ENRT/VlansOverBondRecipe.py b/lnst/Recipes/ENRT/VlansOverBondRecipe.py index da988c7..2eae23e 100644 --- a/lnst/Recipes/ENRT/VlansOverBondRecipe.py +++ b/lnst/Recipes/ENRT/VlansOverBondRecipe.py @@ -75,6 +75,13 @@ class VlansOverBondRecipe(BaseEnrtRecipe): m2.vlan1.up() m2.vlan2.up()
+ if "adaptive_rx_coalescing" in self.params: + for dev in [m1.eth0, m1.eth1, m2.eth0]: + dev.adaptive_rx_coalescing = self.params.adaptive_rx_coalescing + if "adaptive_tx_coalescing" in self.params: + for dev in [m1.eth0, m1.eth1, m2.eth0]: + dev.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing + #TODO better service handling through HostAPI if self.params.dev_intr_cpu: for m in [m1, m2]: diff --git a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py index 813e7c3..c5cd954 100644 --- a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py +++ b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py @@ -75,6 +75,13 @@ class VlansOverTeamRecipe(BaseEnrtRecipe): m2.vlan1.up() m2.vlan2.up()
+ if "adaptive_rx_coalescing" in self.params: + for dev in [m1.eth1, m1.eth2, m2.eth1]: + dev.adaptive_rx_coalescing = self.params.adaptive_rx_coalescing + if "adaptive_tx_coalescing" in self.params: + for dev in [m1.eth1, m1.eth2, m2.eth1]: + dev.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing + #TODO better service handling through HostAPI if self.params.dev_intr_cpu: for m in [m1, m2]: diff --git a/lnst/Recipes/ENRT/VlansRecipe.py b/lnst/Recipes/ENRT/VlansRecipe.py index ffd98f7..6786724 100644 --- a/lnst/Recipes/ENRT/VlansRecipe.py +++ b/lnst/Recipes/ENRT/VlansRecipe.py @@ -65,6 +65,13 @@ class VlansRecipe(BaseEnrtRecipe): m2.vlan1.up() m2.vlan2.up()
+ if "adaptive_rx_coalescing" in self.params: + for m in [m1, m2]: + m.eth0.adaptive_rx_coalescing = self.params.adaptive_rx_coalescing + if "adaptive_tx_coalescing" in self.params: + for m in [m1, m2]: + m.eth0.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing + #TODO better service handling through HostAPI if self.params.dev_intr_cpu: for m in [m1, m2]:
From: Christos Sfakianakis csfakian@redhat.com
Change tc qdisc to mq for the ethernet devices' root when parallel perf streams are used. This feature has existed in the old recipes.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- lnst/Recipes/ENRT/BondRecipe.py | 4 ++++ lnst/Recipes/ENRT/DoubleBondRecipe.py | 5 +++++ lnst/Recipes/ENRT/DoubleTeamRecipe.py | 5 +++++ lnst/Recipes/ENRT/SimplePerfRecipe.py | 4 ++++ lnst/Recipes/ENRT/TeamRecipe.py | 4 ++++ lnst/Recipes/ENRT/TeamVsBondRecipe.py | 5 +++++ lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py | 4 ++++ lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py | 4 ++++ lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py | 4 ++++ lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py | 4 ++++ lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py | 5 +++++ .../ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py | 4 ++++ lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py | 4 ++++ .../Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py | 4 ++++ lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py | 4 ++++ lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py | 5 +++++ lnst/Recipes/ENRT/VlansOverBondRecipe.py | 4 ++++ lnst/Recipes/ENRT/VlansOverTeamRecipe.py | 4 ++++ lnst/Recipes/ENRT/VlansRecipe.py | 4 ++++ 19 files changed, 81 insertions(+)
diff --git a/lnst/Recipes/ENRT/BondRecipe.py b/lnst/Recipes/ENRT/BondRecipe.py index 4132f93..3a75373 100644 --- a/lnst/Recipes/ENRT/BondRecipe.py +++ b/lnst/Recipes/ENRT/BondRecipe.py @@ -68,6 +68,10 @@ class BondRecipe(BaseEnrtRecipe): for dev in [m1.eth0, m1.eth1, m2.eth0]: self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if self.params.perf_parallel_streams > 1: + for m, d in [(m1, m1.eth0), (m1, m1.eth1), (m2, m2.eth0)]: + m.run("tc qdisc replace dev %s root mq" % d.name) + return configuration
def test_wide_deconfiguration(self, config): diff --git a/lnst/Recipes/ENRT/DoubleBondRecipe.py b/lnst/Recipes/ENRT/DoubleBondRecipe.py index a135aee..44b11d2 100644 --- a/lnst/Recipes/ENRT/DoubleBondRecipe.py +++ b/lnst/Recipes/ENRT/DoubleBondRecipe.py @@ -69,6 +69,11 @@ class DoubleBondRecipe(BaseEnrtRecipe): for dev in [m.eth0, m.eth1]: self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
+ if self.params.perf_parallel_streams > 1: + for m in [m1, m2]: + for dev in [m.eth0, m.eth1]: + m.run("tc qdisc replace dev %s root mq" % dev.name) + return configuration
def test_wide_deconfiguration(self, config): diff --git a/lnst/Recipes/ENRT/DoubleTeamRecipe.py b/lnst/Recipes/ENRT/DoubleTeamRecipe.py index cfd7715..7ca5de1 100644 --- a/lnst/Recipes/ENRT/DoubleTeamRecipe.py +++ b/lnst/Recipes/ENRT/DoubleTeamRecipe.py @@ -83,6 +83,11 @@ class DoubleTeamRecipe(BaseEnrtRecipe): for dev in [m.eth1, m.eth2]: self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if self.params.perf_parallel_streams > 1: + for m in [m1, m2]: + for dev in [m.eth1, m.eth2]: + m.run("tc qdisc replace dev %s root mq" % dev.name) + return configuration
def test_wide_deconfiguration(self, config): diff --git a/lnst/Recipes/ENRT/SimplePerfRecipe.py b/lnst/Recipes/ENRT/SimplePerfRecipe.py index 32a4fa8..9512c7a 100644 --- a/lnst/Recipes/ENRT/SimplePerfRecipe.py +++ b/lnst/Recipes/ENRT/SimplePerfRecipe.py @@ -64,6 +64,10 @@ class SimplePerfRecipe(BaseEnrtRecipe): m.run("service irqbalance stop") self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
+ if self.params.perf_parallel_streams > 1: + for m in [m1, m2]: + m.run("tc qdisc replace dev %s root mq" % m.eth0.name) + return configuration
def test_wide_deconfiguration(self, config): diff --git a/lnst/Recipes/ENRT/TeamRecipe.py b/lnst/Recipes/ENRT/TeamRecipe.py index 036a36e..3d0b6f3 100644 --- a/lnst/Recipes/ENRT/TeamRecipe.py +++ b/lnst/Recipes/ENRT/TeamRecipe.py @@ -72,6 +72,10 @@ class TeamRecipe(BaseEnrtRecipe): for dev in [m1.eth1, m1.eth2, m2.eth1]: self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if self.params.perf_parallel_streams > 1: + for m, d in [(m1, m1.eth1), (m1, m1.eth2), (m2, m2.eth1)]: + m.run("tc qdisc replace dev %s root mq" % d.name) + return configuration
def test_wide_deconfiguration(self, config): diff --git a/lnst/Recipes/ENRT/TeamVsBondRecipe.py b/lnst/Recipes/ENRT/TeamVsBondRecipe.py index ccf2b21..698b786 100644 --- a/lnst/Recipes/ENRT/TeamVsBondRecipe.py +++ b/lnst/Recipes/ENRT/TeamVsBondRecipe.py @@ -87,6 +87,11 @@ class TeamVsBondRecipe(BaseEnrtRecipe): for dev in [m.eth1, m.eth2]: self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if self.params.perf_parallel_streams > 1: + for m in [m1, m2]: + for dev in [m.eth1, m.eth2]: + m.run("tc qdisc replace dev %s root mq" % dev.name) + return configuration
def test_wide_deconfiguration(self, config): diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py index 47f53cf..3c8346f 100644 --- a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py +++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py @@ -101,6 +101,10 @@ class VirtualBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe): m.run("service irqbalance stop") self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
+ if self.params.perf_parallel_streams > 1: + for m in [host1, host2]: + m.run("tc qdisc replace dev %s root mq" % m.eth0.name) + return configuration
def test_wide_deconfiguration(self, config): diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py index a72e8d4..aae90b7 100644 --- a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py +++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py @@ -83,6 +83,10 @@ class VirtualBridgeVlanInGuestRecipe(BaseEnrtRecipe): m.run("service irqbalance stop") self._pin_dev_interrupts(m.eth0, 0)
+ if self.params.perf_parallel_streams > 1: + for m in [host1, host2]: + m.run("tc qdisc replace dev %s root mq" % m.eth0.name) + return configuration
def test_wide_deconfiguration(self, config): diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py index 04d3bba..e4f5c62 100644 --- a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py +++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py @@ -99,6 +99,10 @@ class VirtualBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe): m.run("service irqbalance stop") self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
+ if self.params.perf_parallel_streams > 1: + for m in [host1, host2]: + m.run("tc qdisc replace dev %s root mq" % m.eth0.name) + return configuration
def test_wide_deconfiguration(self, config): diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py index 62c19ec..da2713e 100644 --- a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py +++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py @@ -82,6 +82,10 @@ class VirtualBridgeVlanInHostRecipe(BaseEnrtRecipe): m.run("service irqbalance stop") self._pin_dev_interrupts(m.eth0, 0)
+ if self.params.perf_parallel_streams > 1: + for m in [host1, host2]: + m.run("tc qdisc replace dev %s root mq" % m.eth0.name) + return configuration
def test_wide_deconfiguration(self, config): diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py index 089267f..9d0609e 100644 --- a/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py +++ b/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py @@ -131,6 +131,11 @@ class VirtualBridgeVlansOverBondRecipe(BaseEnrtRecipe): for dev in [m.eth0, m.eth1]: self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if self.params.perf_parallel_streams > 1: + for m in [host1, host2]: + for dev in [m.eth0, m.eth1]: + m.run("tc qdisc replace dev %s root mq" % dev.name) + return configuration
def test_wide_deconfiguration(self, config): diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py index 77e979e..43dff0a 100644 --- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py @@ -104,6 +104,10 @@ class VirtualOvsBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe): m.run("service irqbalance stop") self._pin_dev_interrupts(m.eth1, self.params.dev_intr_cpu)
+ if self.params.perf_parallel_streams > 1: + for m in [host1, host2]: + m.run("tc qdisc replace dev %s root mq" % m.eth1.name) + return configuration
def test_wide_deconfiguration(self, config): diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py index b5d38a7..a04ce84 100644 --- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py @@ -83,6 +83,10 @@ class VirtualOvsBridgeVlanInGuestRecipe(BaseEnrtRecipe): m.run("service irqbalance stop") self._pin_dev_interrupts(m.eth0, 0)
+ if self.params.perf_parallel_streams > 1: + for m in [host1, host2]: + m.run("tc qdisc replace dev %s root mq" % m.eth0.name) + return configuration
def test_wide_deconfiguration(self, config): diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py index 2e464c0..d7048ae 100644 --- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py @@ -94,6 +94,10 @@ class VirtualOvsBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe): m.run("service irqbalance stop") self._pin_dev_interrupts(m.eth1, self.params.dev_intr_cpu)
+ if self.params.perf_parallel_streams > 1: + for m in [host1, host2]: + m.run("tc qdisc replace dev %s root mq" % m.eth1.name) + return configuration
def test_wide_deconfiguration(self, config): diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py index cceda69..ae214eb 100644 --- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py @@ -80,6 +80,10 @@ class VirtualOvsBridgeVlanInHostRecipe(BaseEnrtRecipe): m.run("service irqbalance stop") self._pin_dev_interrupts(m.eth0, 0)
+ if self.params.perf_parallel_streams > 1: + for m in [host1, host2]: + m.run("tc qdisc replace dev %s root mq" % m.eth0.name) + return configuration
def test_wide_deconfiguration(self, config): diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py b/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py index acaa39f..4dd29e8 100644 --- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py @@ -140,6 +140,11 @@ class VirtualOvsBridgeVlansOverBondRecipe(BaseEnrtRecipe): for dev in [m.eth1, m.eth2]: self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if self.params.perf_parallel_streams > 1: + for m in [host1, host2]: + for dev in [m.eth1, m.eth2]: + m.run("tc qdisc replace dev %s root mq" % dev.name) + return configuration
def test_wide_deconfiguration(self, config): diff --git a/lnst/Recipes/ENRT/VlansOverBondRecipe.py b/lnst/Recipes/ENRT/VlansOverBondRecipe.py index 2eae23e..7af3b93 100644 --- a/lnst/Recipes/ENRT/VlansOverBondRecipe.py +++ b/lnst/Recipes/ENRT/VlansOverBondRecipe.py @@ -89,6 +89,10 @@ class VlansOverBondRecipe(BaseEnrtRecipe): for dev in [m1.eth0, m1.eth1, m2.eth0]: self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if self.params.perf_parallel_streams > 1: + for m, d in [(m1, m1.eth0), (m1, m1.eth1), (m2, m2.eth0)]: + m.run("tc qdisc replace dev %s root mq" % d.name) + return configuration
def test_wide_deconfiguration(self, config): diff --git a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py index c5cd954..e685e82 100644 --- a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py +++ b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py @@ -89,6 +89,10 @@ class VlansOverTeamRecipe(BaseEnrtRecipe): for dev in [m1.eth1, m1.eth2, m2.eth1]: self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+ if self.params.perf_parallel_streams > 1: + for m, d in [(m1, m1.eth1), (m1, m1.eth2), (m2, m2.eth1)]: + m.run("tc qdisc replace dev %s root mq" % d.name) + return configuration
def test_wide_deconfiguration(self, config): diff --git a/lnst/Recipes/ENRT/VlansRecipe.py b/lnst/Recipes/ENRT/VlansRecipe.py index 6786724..de476cd 100644 --- a/lnst/Recipes/ENRT/VlansRecipe.py +++ b/lnst/Recipes/ENRT/VlansRecipe.py @@ -78,6 +78,10 @@ class VlansRecipe(BaseEnrtRecipe): m.run("service irqbalance stop") self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
+ if self.params.perf_parallel_streams > 1: + for m in [m1, m2]: + m.run("tc qdisc replace dev %s root mq" % m.eth0.name) + return configuration
def test_wide_deconfiguration(self, config):
From: Christos Sfakianakis csfakian@redhat.com
Add checks related to UDP/SCTP that are present in the old recipes. In particular, skip ('gro', 'off') offload setting with UDP perf tests. Also, allow only 'gso' option to be set to 'off' with SCTP. Finally, make sure SCTP will go out through the test interfaces only.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- lnst/Recipes/ENRT/BaseEnrtRecipe.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py index ba4ff41..d97902a 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -132,6 +132,12 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): client_netns = client_nic.netns server_netns = server_nic.netns
+ if 'sctp_stream' in self.params.perf_tests: + client_netns.run("iptables -I OUTPUT ! -o %s -p sctp -j DROP" % + client_nic.name) + server_netns.run("iptables -I OUTPUT ! -o %s -p sctp -j DROP" % + server_nic.name) + ethtool_offload_string = "" for name, value in sub_config.offload_settings.items(): ethtool_offload_string += " %s %s" % (name, value) @@ -147,6 +153,12 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): client_netns = client_nic.netns server_netns = server_nic.netns
+ if 'sctp_stream' in self.params.perf_tests: + client_netns.run("iptables -D OUTPUT ! -o %s -p sctp -j DROP" % + client_nic.name) + server_netns.run("iptables -D OUTPUT ! -o %s -p sctp -j DROP" % + server_nic.name) + ethtool_offload_string = "" for name, value in sub_config.offload_settings.items(): ethtool_offload_string += " %s %s" % (name, "on") @@ -207,6 +219,13 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): server_bind = server_nic.ips_filter(family=family)[0]
for perf_test in self.params.perf_tests: + offload_pairs = sub_config.offload_settings.items() + if ((perf_test == 'udp_stream' and ('gro', 'off') in offload_pairs) + or + (perf_test == 'sctp_stream' and not list(val[0] for val in + offload_pairs if val[1] == 'off') in [[], ['gso']])): + continue + flow = PerfFlow( type = perf_test, generator = client_netns,
Tue, Mar 05, 2019 at 05:09:11PM CET, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Add checks related to UDP/SCTP that are present in the old recipes. In particular, skip ('gro', 'off') offload setting with UDP perf tests. Also, allow only 'gso' option to be set to 'off' with SCTP. Finally, make sure SCTP will go out through the test interfaces only.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py index ba4ff41..d97902a 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -132,6 +132,12 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): client_netns = client_nic.netns server_netns = server_nic.netns
if 'sctp_stream' in self.params.perf_tests:client_netns.run("iptables -I OUTPUT ! -o %s -p sctp -j DROP" %client_nic.name)server_netns.run("iptables -I OUTPUT ! -o %s -p sctp -j DROP" %server_nic.name)ethtool_offload_string = "" for name, value in sub_config.offload_settings.items(): ethtool_offload_string += " %s %s" % (name, value)@@ -147,6 +153,12 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): client_netns = client_nic.netns server_netns = server_nic.netns
if 'sctp_stream' in self.params.perf_tests:client_netns.run("iptables -D OUTPUT ! -o %s -p sctp -j DROP" %client_nic.name)server_netns.run("iptables -D OUTPUT ! -o %s -p sctp -j DROP" %server_nic.name)ethtool_offload_string = "" for name, value in sub_config.offload_settings.items(): ethtool_offload_string += " %s %s" % (name, "on")@@ -207,6 +219,13 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): server_bind = server_nic.ips_filter(family=family)[0]
for perf_test in self.params.perf_tests:
offload_pairs = sub_config.offload_settings.items()if ((perf_test == 'udp_stream' and ('gro', 'off') in offload_pairs)
I believe that you have reverted the second condition compared to the original code (master branch). There it is:
if nperf_protocols.find("udp") > -1 and ("gro", "off") not in setting:
For UDP we don't care about any combination where gro is turned off as it does not have any impact.
or(perf_test == 'sctp_stream' and not list(val[0] for val inoffload_pairs if val[1] == 'off') in [[], ['gso']])):continueflow = PerfFlow( type = perf_test, generator = client_netns,-- 2.17.1 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@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.fedorahos...
Tue, Mar 12, 2019 at 02:22:04PM CET, jtluka@redhat.com wrote:
Tue, Mar 05, 2019 at 05:09:11PM CET, csfakian@redhat.com wrote:
for perf_test in self.params.perf_tests:
offload_pairs = sub_config.offload_settings.items()if ((perf_test == 'udp_stream' and ('gro', 'off') in offload_pairs)I believe that you have reverted the second condition compared to the original code (master branch). There it is:
if nperf_protocols.find("udp") > -1 and ("gro", "off") not in setting:
For UDP we don't care about any combination where gro is turned off as it does not have any impact.
Scratch that. Christos explained offline that I did not notice the 'continue' statement below.
or(perf_test == 'sctp_stream' and not list(val[0] for val inoffload_pairs if val[1] == 'off') in [[], ['gso']])):continueflow = PerfFlow( type = perf_test, generator = client_netns,
lnst-developers@lists.fedorahosted.org