From: Christos Sfakianakis csfakian@redhat.com
Hi,
this is the second version of the patch set. Changes include:
* lnst.Recipes.ENRT.BaseEnrtRecipe + Rename 'perf_intr_cpu' to 'perf_tool_cpu'. + Make 'dev_intr_cpu' and 'perf_tool_cpu' optional. + Make 'perf_reverse' optional and available to all recipes. + Rewrite 'create_reverse_flow' method at the bottom. + Add CPU validity check in '_pin_dev_interrupts'. + Extend try..finally clause in 'test' to cover ping test errors. * lnst.Devices.Device.py + Remove _restore_coalescing method from Device module, make it public. + Use the previous method instead of '_write_adaptive__coalescing' in 'restore_original_data'. * lnst.Recipes.ENRT + Modify checks for -now- optional parameters 'dev_intr_cpu' and 'perf_tool_cpu'.
Thanks,
Christos ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Previous message:
This patch 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 (8): lnst.Recipes.ENRT: edit perf pinnings in Recipes lnst.Recipes.ENRT: fix 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.Recipes.ENRT: ensure deconfiguration stage
lnst/Devices/Device.py | 71 ++++++++++++ .../Perf/Measurements/BaseFlowMeasurement.py | 7 +- .../Perf/Measurements/IperfFlowMeasurement.py | 18 ++++ lnst/Recipes/ENRT/BaseEnrtRecipe.py | 101 ++++++++++++++---- 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, 500 insertions(+), 187 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.
v2: Rename 'perf_intr_cpu' to 'perf_tool_cpu' as this is not connected to interrupts. Make both 'perf_tool_cpu' and 'dev_intr_cpu' optional. Add CPU validity check in '_pin_dev_interrupts', as tests with invalid 'dev_intr_cpu' value result in no warnings. For 'perf_tool_cpu', this is taken care of via the underlying perf tool.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- .../Perf/Measurements/BaseFlowMeasurement.py | 7 ++++- .../Perf/Measurements/IperfFlowMeasurement.py | 18 +++++++++++++ lnst/Recipes/ENRT/BaseEnrtRecipe.py | 19 +++++++++++--- lnst/Recipes/ENRT/BondRecipe.py | 13 +++++----- lnst/Recipes/ENRT/DoubleBondRecipe.py | 15 ++++++----- lnst/Recipes/ENRT/DoubleTeamRecipe.py | 15 ++++++----- lnst/Recipes/ENRT/SimplePerfRecipe.py | 14 +++++----- lnst/Recipes/ENRT/TeamRecipe.py | 13 +++++----- lnst/Recipes/ENRT/TeamVsBondRecipe.py | 15 ++++++----- .../VirtualBridgeVlanInGuestMirroredRecipe.py | 21 +++++++-------- .../ENRT/VirtualBridgeVlanInGuestRecipe.py | 19 +++++++------- .../VirtualBridgeVlanInHostMirroredRecipe.py | 21 +++++++-------- .../ENRT/VirtualBridgeVlanInHostRecipe.py | 19 +++++++------- .../ENRT/VirtualBridgeVlansOverBondRecipe.py | 18 ++++++++----- ...rtualOvsBridgeVlanInGuestMirroredRecipe.py | 21 +++++++-------- .../ENRT/VirtualOvsBridgeVlanInGuestRecipe.py | 19 +++++++------- ...irtualOvsBridgeVlanInHostMirroredRecipe.py | 21 +++++++-------- .../ENRT/VirtualOvsBridgeVlanInHostRecipe.py | 19 +++++++------- .../VirtualOvsBridgeVlansOverBondRecipe.py | 26 ++++++++----------- lnst/Recipes/ENRT/VlansOverBondRecipe.py | 13 +++++----- lnst/Recipes/ENRT/VlansOverTeamRecipe.py | 13 +++++----- lnst/Recipes/ENRT/VlansRecipe.py | 14 +++++----- 22 files changed, 207 insertions(+), 166 deletions(-)
diff --git a/lnst/RecipeCommon/Perf/Measurements/BaseFlowMeasurement.py b/lnst/RecipeCommon/Perf/Measurements/BaseFlowMeasurement.py index da0b5f4..faac895 100644 --- a/lnst/RecipeCommon/Perf/Measurements/BaseFlowMeasurement.py +++ b/lnst/RecipeCommon/Perf/Measurements/BaseFlowMeasurement.py @@ -8,7 +8,7 @@ class Flow(object): type, generator, generator_bind, receiver, receiver_bind, - msg_size, duration, parallel_streams): + msg_size, duration, parallel_streams, cpupin): self._type = type
self._generator = generator @@ -19,6 +19,7 @@ class Flow(object): self._msg_size = msg_size self._duration = duration self._parallel_streams = parallel_streams + self._cpupin = cpupin
@property def type(self): @@ -52,6 +53,10 @@ class Flow(object): def parallel_streams(self): return self._parallel_streams
+ @property + def cpupin(self): + return self._cpupin + class NetworkFlowTest(object): def __init__(self, flow, server_job, client_job): self._flow = flow diff --git a/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py b/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py index 2f8ae98..8ffd815 100644 --- a/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py +++ b/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py @@ -84,6 +84,15 @@ class IperfFlowMeasurement(BaseFlowMeasurement): server_params = dict(bind = ipaddress(flow.receiver_bind), oneoff = True)
+ if flow.cpupin >= 0: + if flow.parallel_streams == 1: + server_params["cpu_bind"] = flow.cpupin + else: + raise RecipeError("Unsupported combination of single cpupin " + "with parallel perf streams.") + elif not flow.cpupin is None: + raise RecipeError("Negative perf cpupin value provided.") + return host.prepare_job(IperfServer(**server_params), job_level=ResultLevel.NORMAL)
@@ -102,6 +111,15 @@ class IperfFlowMeasurement(BaseFlowMeasurement): else: raise RecipeError("Unsupported flow type '{}'".format(flow.type))
+ if flow.cpupin >= 0: + if flow.parallel_streams == 1: + client_params["cpu_bind"] = flow.cpupin + else: + raise RecipeError("Unsupported combination of single cpupin " + "with parallel perf streams.") + elif not flow.cpupin is None: + raise RecipeError("Negative perf cpupin value provided.") + if flow.parallel_streams > 1: client_params["parallel"] = flow.parallel_streams
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py index d7d1aec..a637486 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -1,8 +1,9 @@ +import re from lnst.Common.LnstError import LnstError from lnst.Common.Parameters import Param, IntParam, StrParam, BoolParam from lnst.Common.IpAddress import AF_INET, AF_INET6 - -from lnst.Controller.Recipe import BaseRecipe +from lnst.Common.ExecCmd import exec_cmd +from lnst.Controller.Recipe import BaseRecipe, RecipeError
from lnst.RecipeCommon.Ping import PingTestAndEvaluate, PingConf from lnst.RecipeCommon.Perf.Recipe import Recipe as PerfRecipe @@ -76,7 +77,8 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe):
mtu = IntParam(mandatory=False)
- dev_intr_cpu = IntParam(default=0) + dev_intr_cpu = IntParam(mandatory=False) + perf_tool_cpu = IntParam(mandatory=False)
perf_duration = IntParam(default=60) perf_iterations = IntParam(default=5) @@ -199,7 +201,9 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): receiver_bind = server_bind, msg_size = self.params.perf_msg_size, duration = self.params.perf_duration, - parallel_streams = self.params.perf_parallel_streams) + parallel_streams = self.params.perf_parallel_streams, + cpupin = self.params.perf_tool_cpu if "perf_tool_cpu" in self.params else None + )
flow_measurement = self.params.net_perf_tool([flow]) yield PerfRecipeConf( @@ -211,6 +215,13 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe):
def _pin_dev_interrupts(self, dev, cpu): netns = dev.netns + cpu_info = netns.run("lscpu").stdout + regex = "CPU(s): *([0-9]*)" + num_cpus = int(re.search(regex, cpu_info).groups()[0]) + if cpu < 0 or cpu > num_cpus - 1: + raise RecipeError("Invalid CPU value given: %d. Accepted value %s." % + (cpu, "is: 0" if num_cpus == 1 else "are: 0..%d" % + (num_cpus - 1)))
res = netns.run("grep {} /proc/interrupts | cut -f1 -d: | sed 's/ //'" .format(dev.name)) diff --git a/lnst/Recipes/ENRT/BondRecipe.py b/lnst/Recipes/ENRT/BondRecipe.py index 119c437..60626d1 100644 --- a/lnst/Recipes/ENRT/BondRecipe.py +++ b/lnst/Recipes/ENRT/BondRecipe.py @@ -55,10 +55,10 @@ class BondRecipe(BaseEnrtRecipe): m2.eth0.up()
#TODO better service handling through HostAPI - m1.run("service irqbalance stop") - m2.run("service irqbalance stop") - for m in self.matched: - for dev in m.devices: + if "dev_intr_cpu" in self.params: + for m in [m1, m2]: + m.run("service irqbalance stop") + for dev in [m1.eth0, m1.eth1, m2.eth0]: self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
return configuration @@ -67,5 +67,6 @@ class BondRecipe(BaseEnrtRecipe): m1, m2 = self.matched.m1, self.matched.m2
#TODO better service handling through HostAPI - m1.run("service irqbalance start") - m2.run("service irqbalance start") + if "dev_intr_cpu" in self.params: + for m in [m1, m2]: + m.run("service irqbalance start") diff --git a/lnst/Recipes/ENRT/DoubleBondRecipe.py b/lnst/Recipes/ENRT/DoubleBondRecipe.py index b5b6512..2f9c637 100644 --- a/lnst/Recipes/ENRT/DoubleBondRecipe.py +++ b/lnst/Recipes/ENRT/DoubleBondRecipe.py @@ -54,11 +54,11 @@ class DoubleBondRecipe(BaseEnrtRecipe): m.bond.up()
#TODO better service handling through HostAPI - m1.run("service irqbalance stop") - m2.run("service irqbalance stop") - for m in self.matched: - for dev in m.devices: - self._pin_dev_interrupts(dev, self.params.dev_intr_cpu) + if "dev_intr_cpu" in self.params: + for m in [m1, m2]: + m.run("service irqbalance stop") + for dev in [m.eth0, m.eth1]: + self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
return configuration
@@ -66,5 +66,6 @@ class DoubleBondRecipe(BaseEnrtRecipe): m1, m2 = self.matched.m1, self.matched.m2
#TODO better service handling through HostAPI - m1.run("service irqbalance start") - m2.run("service irqbalance start") + if "dev_intr_cpu" in self.params: + for m in [m1, m2]: + m.run("service irqbalance start") diff --git a/lnst/Recipes/ENRT/DoubleTeamRecipe.py b/lnst/Recipes/ENRT/DoubleTeamRecipe.py index 54b38de..26f4d41 100644 --- a/lnst/Recipes/ENRT/DoubleTeamRecipe.py +++ b/lnst/Recipes/ENRT/DoubleTeamRecipe.py @@ -67,11 +67,11 @@ class DoubleTeamRecipe(BaseEnrtRecipe): m2.team.up()
#TODO better service handling through HostAPI - m1.run("service irqbalance stop") - m2.run("service irqbalance stop") - for m in self.matched: - for dev in m.devices: - self._pin_dev_interrupts(dev, self.params.dev_intr_cpu) + if "dev_intr_cpu" in self.params: + for m in [m1, m2]: + m.run("service irqbalance stop") + for dev in [m.eth1, m.eth2]: + self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
return configuration
@@ -79,5 +79,6 @@ class DoubleTeamRecipe(BaseEnrtRecipe): m1, m2 = self.matched.m1, self.matched.m2
#TODO better service handling through HostAPI - m1.run("service irqbalance start") - m2.run("service irqbalance start") + if "dev_intr_cpu" in self.params: + for m in [m1, m2]: + m.run("service irqbalance start") diff --git a/lnst/Recipes/ENRT/SimplePerfRecipe.py b/lnst/Recipes/ENRT/SimplePerfRecipe.py index 004e43d..0c5ab6c 100644 --- a/lnst/Recipes/ENRT/SimplePerfRecipe.py +++ b/lnst/Recipes/ENRT/SimplePerfRecipe.py @@ -52,11 +52,10 @@ class SimplePerfRecipe(BaseEnrtRecipe): m2.eth0.up()
#TODO better service handling through HostAPI - m1.run("service irqbalance stop") - m2.run("service irqbalance stop") - for m in self.matched: - for dev in m.devices: - self._pin_dev_interrupts(dev, self.params.dev_intr_cpu) + if "dev_intr_cpu" in self.params: + for m in [m1, m2]: + m.run("service irqbalance stop") + self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
return configuration
@@ -64,8 +63,9 @@ class SimplePerfRecipe(BaseEnrtRecipe): m1, m2 = self.matched.m1, self.matched.m2
#TODO better service handling through HostAPI - m1.run("service irqbalance start") - m2.run("service irqbalance start") + if "dev_intr_cpu" in self.params: + for m in [m1, m2]: + m.run("service irqbalance start")
# redo # m1.eth0.adaptive_tx_coalescing = self.saved_coalescing_state["m1_if"]["tx"] diff --git a/lnst/Recipes/ENRT/TeamRecipe.py b/lnst/Recipes/ENRT/TeamRecipe.py index 6173ec6..846ca9c 100644 --- a/lnst/Recipes/ENRT/TeamRecipe.py +++ b/lnst/Recipes/ENRT/TeamRecipe.py @@ -58,10 +58,10 @@ class TeamRecipe(BaseEnrtRecipe): m2.eth1.up()
#TODO better service handling through HostAPI - m1.run("service irqbalance stop") - m2.run("service irqbalance stop") - for m in self.matched: - for dev in m.devices: + if "dev_intr_cpu" in self.params: + for m in [m1, m2]: + m.run("service irqbalance stop") + for dev in [m1.eth1, m1.eth2, m2.eth1]: self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
return configuration @@ -70,5 +70,6 @@ class TeamRecipe(BaseEnrtRecipe): m1, m2 = self.matched.m1, self.matched.m2
#TODO better service handling through HostAPI - m1.run("service irqbalance start") - m2.run("service irqbalance start") + if "dev_intr_cpu" in self.params: + for m in [m1, m2]: + m.run("service irqbalance start") diff --git a/lnst/Recipes/ENRT/TeamVsBondRecipe.py b/lnst/Recipes/ENRT/TeamVsBondRecipe.py index fe39d13..0536704 100644 --- a/lnst/Recipes/ENRT/TeamVsBondRecipe.py +++ b/lnst/Recipes/ENRT/TeamVsBondRecipe.py @@ -71,11 +71,11 @@ class TeamVsBondRecipe(BaseEnrtRecipe): m2.bond.up()
#TODO better service handling through HostAPI - m1.run("service irqbalance stop") - m2.run("service irqbalance stop") - for m in self.matched: - for dev in m.devices: - self._pin_dev_interrupts(dev, self.params.dev_intr_cpu) + if "dev_intr_cpu" in self.params: + for m in [m1, m2]: + m.run("service irqbalance stop") + for dev in [m.eth1, m.eth2]: + self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
return configuration
@@ -83,5 +83,6 @@ class TeamVsBondRecipe(BaseEnrtRecipe): m1, m2 = self.matched.m1, self.matched.m2
#TODO better service handling through HostAPI - m1.run("service irqbalance start") - m2.run("service irqbalance start") + if "dev_intr_cpu" in self.params: + for m in [m1, m2]: + m.run("service irqbalance start") diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py index 2fd74ae..d47dacd 100644 --- a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py +++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py @@ -8,6 +8,7 @@ from lnst.Controller import HostReq, DeviceReq from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration from lnst.Devices import VlanDevice from lnst.Devices import BridgeDevice +from lnst.Common.LnstError import LnstError
class VirtualBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe): host1 = HostReq() @@ -92,14 +93,13 @@ class VirtualBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe): guest2.vlan1.up()
#TODO better service handling through HostAPI - host1.run("service irqbalance stop") - host2.run("service irqbalance stop") - guest1.run("service irqbalance stop") - guest2.run("service irqbalance stop") + if "perf_tool_cpu" in self.params: + raise LnstError("'perf_tool_cpu' (%d) should not be set for this test" % self.params.perf_tool_cpu)
- for m in self.matched: - for dev in m.devices: - self._pin_dev_interrupts(dev, self.params.dev_intr_cpu) + if "dev_intr_cpu" in self.params: + for m in [host1, host2]: + m.run("service irqbalance stop") + self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
return configuration
@@ -107,7 +107,6 @@ class VirtualBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe): host1, host2, guest1, guest2 = self.matched.host1, self.matched.host2, self.matched.guest1, self.matched.guest2
#TODO better service handling through HostAPI - host1.run("service irqbalance start") - host2.run("service irqbalance start") - guest1.run("service irqbalance start") - guest2.run("service irqbalance start") + if "dev_intr_cpu" in self.params: + for m in [host1, host2]: + m.run("service irqbalance start") diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py index 8bb7582..b7e5d4c 100644 --- a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py +++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py @@ -8,6 +8,7 @@ from lnst.Controller import HostReq, DeviceReq from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration from lnst.Devices import VlanDevice from lnst.Devices import BridgeDevice +from lnst.Common.LnstError import LnstError
class VirtualBridgeVlanInGuestRecipe(BaseEnrtRecipe): host1 = HostReq() @@ -74,13 +75,13 @@ class VirtualBridgeVlanInGuestRecipe(BaseEnrtRecipe): guest1.vlan1.up()
#TODO better service handling through HostAPI - host1.run("service irqbalance stop") - host2.run("service irqbalance stop") - guest1.run("service irqbalance stop") + if "dev_intr_cpu" in self.params: + raise LnstError("'dev_intr_cpu' (%d) should not be set for this test" % self.params.dev_intr_cpu)
- for m in self.matched: - for dev in m.devices: - self._pin_dev_interrupts(dev, self.params.dev_intr_cpu) + if "perf_tool_cpu" in self.params: + for m in [host1, host2]: + m.run("service irqbalance stop") + self._pin_dev_interrupts(m.eth0, 0)
return configuration
@@ -88,6 +89,6 @@ class VirtualBridgeVlanInGuestRecipe(BaseEnrtRecipe): host1, host2, guest1 = self.matched.host1, self.matched.host2, self.matched.guest1
#TODO better service handling through HostAPI - host1.run("service irqbalance start") - host2.run("service irqbalance start") - guest1.run("service irqbalance start") + if "perf_tool_cpu" in self.params: + for m in [host1, hpst2]: + m.run("service irqbalance start") diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py index 1a7c4d0..a2ad29e 100644 --- a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py +++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py @@ -8,6 +8,7 @@ from lnst.Controller import HostReq, DeviceReq from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration from lnst.Devices import VlanDevice from lnst.Devices import BridgeDevice +from lnst.Common.LnstError import LnstError
class VirtualBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe): host1 = HostReq() @@ -90,14 +91,13 @@ class VirtualBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe): guest2.eth0.up()
#TODO better service handling through HostAPI - host1.run("service irqbalance stop") - host2.run("service irqbalance stop") - guest1.run("service irqbalance stop") - guest2.run("service irqbalance stop") + if "perf_tool_cpu" in self.params: + raise LnstError("'perf_tool_cpu' (%d) should not be set for this test" % self.params.perf_tool_cpu)
- for m in self.matched: - for dev in m.devices: - self._pin_dev_interrupts(dev, self.params.dev_intr_cpu) + if "dev_intr_cpu" in self.params: + for m in [host1, host2]: + m.run("service irqbalance stop") + self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
return configuration
@@ -105,7 +105,6 @@ class VirtualBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe): host1, host2, guest1, guest2 = self.matched.host1, self.matched.host2, self.matched.guest1, self.matched.guest2
#TODO better service handling through HostAPI - host1.run("service irqbalance start") - host2.run("service irqbalance start") - guest1.run("service irqbalance start") - guest2.run("service irqbalance start") + if "dev_intr_cpu" in self.params: + for m in [host1, host2]: + m.run("service irqbalance start") diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py index 2a2f905..0a7bda1 100644 --- a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py +++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py @@ -8,6 +8,7 @@ from lnst.Controller import HostReq, DeviceReq from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration from lnst.Devices import VlanDevice from lnst.Devices import BridgeDevice +from lnst.Common.LnstError import LnstError
class VirtualBridgeVlanInHostRecipe(BaseEnrtRecipe): host1 = HostReq() @@ -73,13 +74,13 @@ class VirtualBridgeVlanInHostRecipe(BaseEnrtRecipe): guest1.eth0.up()
#TODO better service handling through HostAPI - host1.run("service irqbalance stop") - host2.run("service irqbalance stop") - guest1.run("service irqbalance stop") + if "dev_intr_cpu" in self.params: + raise LnstError("'dev_intr_cpu' (%d) should not be set for this test" % self.params.dev_intr_cpu)
- for m in self.matched: - for dev in m.devices: - self._pin_dev_interrupts(dev, self.params.dev_intr_cpu) + if "perf_tool_cpu" in self.params: + for m in [host1, host2]: + m.run("service irqbalance stop") + self._pin_dev_interrupts(m.eth0, 0)
return configuration
@@ -87,6 +88,6 @@ class VirtualBridgeVlanInHostRecipe(BaseEnrtRecipe): host1, host2, guest1 = self.matched.host1, self.matched.host2, self.matched.guest1
#TODO better service handling through HostAPI - host1.run("service irqbalance start") - host2.run("service irqbalance start") - guest1.run("service irqbalance start") + if "perf_tool_cpu" in self.params: + for m in [host1, host2]: + m.run("service irqbalance start") diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py index e5d0b9b..225dc54 100644 --- a/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py +++ b/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py @@ -9,6 +9,7 @@ from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration from lnst.Devices import VlanDevice from lnst.Devices import BondDevice from lnst.Devices import BridgeDevice +from lnst.Common.LnstError import LnstError
class VirtualBridgeVlansOverBondRecipe(BaseEnrtRecipe): host1 = HostReq() @@ -121,12 +122,14 @@ class VirtualBridgeVlansOverBondRecipe(BaseEnrtRecipe): g2.eth0.up()
#TODO better service handling through HostAPI - for m in (host1, host2, guest1, guest2, guest3, guest4): - host1.run("service irqbalance stop") + if "perf_tool_cpu" in self.params: + raise LnstError("'perf_tool_cpu' (%d) should not be set for this test" % self.params.perf_tool_cpu)
- for m in self.matched: - for dev in m.devices: - self._pin_dev_interrupts(dev, self.params.dev_intr_cpu) + if "dev_intr_cpu" in self.params: + for m in [host1, host2]: + m.run("service irqbalance stop") + for dev in [m.eth0, m.eth1]: + self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
return configuration
@@ -134,5 +137,6 @@ class VirtualBridgeVlansOverBondRecipe(BaseEnrtRecipe): host1, host2, guest1, guest2, guest3, guest4 = self.matched.host1, self.matched.host2, self.matched.guest1, self.matched.guest2, self.matched.guest3, self.matched.guest4
#TODO better service handling through HostAPI - for m in (host1, host2, guest1, guest2, guest3, guest4): - host1.run("service irqbalance start") + if "dev_intr_cpu" in self.params: + for m in [host1, host2]: + m.run("service irqbalance start") diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py index f0041fc..bc7b5ba 100644 --- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py @@ -9,6 +9,7 @@ from lnst.Controller import HostReq, DeviceReq from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration from lnst.Devices import VlanDevice from lnst.Devices import OvsBridgeDevice +from lnst.Common.LnstError import LnstError
class VirtualOvsBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe): host1 = HostReq() @@ -95,14 +96,13 @@ class VirtualOvsBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe): guest2.vlan1.up()
#TODO better service handling through HostAPI - host1.run("service irqbalance stop") - host2.run("service irqbalance stop") - guest1.run("service irqbalance stop") - guest2.run("service irqbalance stop") + if "perf_tool_cpu" in self.params: + raise LnstError("'perf_tool_cpu' (%d) should not be set for this test" % self.params.perf_tool_cpu)
- for m in self.matched: - for dev in m.devices: - self._pin_dev_interrupts(dev, self.params.dev_intr_cpu) + if "dev_intr_cpu" in self.params: + for m in [host1, host2]: + m.run("service irqbalance stop") + self._pin_dev_interrupts(m.eth1, self.params.dev_intr_cpu)
return configuration
@@ -110,7 +110,6 @@ class VirtualOvsBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe): host1, host2, guest1, guest2 = self.matched.host1, self.matched.host2, self.matched.guest1, self.matched.guest2
#TODO better service handling through HostAPI - host1.run("service irqbalance start") - host2.run("service irqbalance start") - guest1.run("service irqbalance start") - guest2.run("service irqbalance start") + if "dev_intr_cpu" in self.params: + for m in [host1, host2]: + m.run("service irqbalance start") diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py index df44ae2..e1471be 100644 --- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py @@ -8,6 +8,7 @@ from lnst.Controller import HostReq, DeviceReq from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration from lnst.Devices import VlanDevice from lnst.Devices import OvsBridgeDevice +from lnst.Common.LnstError import LnstError
class VirtualOvsBridgeVlanInGuestRecipe(BaseEnrtRecipe): host1 = HostReq() @@ -74,13 +75,13 @@ class VirtualOvsBridgeVlanInGuestRecipe(BaseEnrtRecipe): guest1.vlan1.up()
#TODO better service handling through HostAPI - host1.run("service irqbalance stop") - host2.run("service irqbalance stop") - guest1.run("service irqbalance stop") + if "dev_intr_cpu" in self.params: + raise LnstError("'dev_intr_cpu' (%d) should not be set for this test" % self.params.dev_intr_cpu)
- for m in self.matched: - for dev in m.devices: - self._pin_dev_interrupts(dev, self.params.dev_intr_cpu) + if "perf_tool_cpu" in self.params: + for m in [host1, host2]: + m.run("service irqbalance stop") + self._pin_dev_interrupts(m.eth0, 0)
return configuration
@@ -88,6 +89,6 @@ class VirtualOvsBridgeVlanInGuestRecipe(BaseEnrtRecipe): host1, host2, guest1 = self.matched.host1, self.matched.host2, self.matched.guest1
#TODO better service handling through HostAPI - host1.run("service irqbalance start") - host2.run("service irqbalance start") - guest1.run("service irqbalance start") + if "perf_tool_cpu" in self.params: + for m in [host1, host2]: + m.run("service irqbalance start") diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py index 58d2a9b..0b53b13 100644 --- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py @@ -9,6 +9,7 @@ from lnst.Controller import HostReq, DeviceReq from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration from lnst.Devices import VlanDevice from lnst.Devices import OvsBridgeDevice +from lnst.Common.LnstError import LnstError
class VirtualOvsBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe): host1 = HostReq() @@ -85,14 +86,13 @@ class VirtualOvsBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe): guest2.eth0.up()
#TODO better service handling through HostAPI - host1.run("service irqbalance stop") - host2.run("service irqbalance stop") - guest1.run("service irqbalance stop") - guest2.run("service irqbalance stop") + if "perf_tool_cpu" in self.params: + raise LnstError("'perf_cpu_pin' (%d) should not be set for this test" % self.params.perf_tool_cpu)
- for m in self.matched: - for dev in m.devices: - self._pin_dev_interrupts(dev, self.params.dev_intr_cpu) + if "dev_intr_cpu" in self.params: + for m in [host1, host2]: + m.run("service irqbalance stop") + self._pin_dev_interrupts(m.eth1, self.params.dev_intr_cpu)
return configuration
@@ -100,7 +100,6 @@ class VirtualOvsBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe): host1, host2, guest1, guest2 = self.matched.host1, self.matched.host2, self.matched.guest1, self.matched.guest2
#TODO better service handling through HostAPI - host1.run("service irqbalance start") - host2.run("service irqbalance start") - guest1.run("service irqbalance start") - guest2.run("service irqbalance start") + if "dev_intr_cpu" in self.params: + for m in [host1, host2]: + m.run("service irqbalance start") diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py index 64830bd..9f6ba54 100644 --- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py @@ -8,6 +8,7 @@ from lnst.Controller import HostReq, DeviceReq from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration from lnst.Devices import VlanDevice from lnst.Devices import OvsBridgeDevice +from lnst.Common.LnstError import LnstError
class VirtualOvsBridgeVlanInHostRecipe(BaseEnrtRecipe): host1 = HostReq() @@ -71,13 +72,13 @@ class VirtualOvsBridgeVlanInHostRecipe(BaseEnrtRecipe): guest1.eth0.up()
#TODO better service handling through HostAPI - host1.run("service irqbalance stop") - host2.run("service irqbalance stop") - guest1.run("service irqbalance stop") + if "dev_intr_cpu" in self.params: + raise LnstError("'dev_intr_cpu' (%d) should not be set for this test" % self.params.dev_intr_cpu)
- for m in self.matched: - for dev in m.devices: - self._pin_dev_interrupts(dev, self.params.dev_intr_cpu) + if "perf_tool_cpu" in self.params: + for m in [host1, host2]: + m.run("service irqbalance stop") + self._pin_dev_interrupts(m.eth0, 0)
return configuration
@@ -85,6 +86,6 @@ class VirtualOvsBridgeVlanInHostRecipe(BaseEnrtRecipe): host1, host2, guest1 = self.matched.host1, self.matched.host2, self.matched.guest1
#TODO better service handling through HostAPI - host1.run("service irqbalance start") - host2.run("service irqbalance start") - guest1.run("service irqbalance start") + if "perf_tool_cpu" in self.params: + for m in [host1, host2]: + m.run("service irqbalance start") diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py b/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py index c9c5413..03aca6e 100644 --- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py @@ -10,6 +10,7 @@ from lnst.Controller import HostReq, DeviceReq from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration from lnst.Devices import VlanDevice from lnst.Devices import OvsBridgeDevice +from lnst.Common.LnstError import LnstError
class VirtualOvsBridgeVlansOverBondRecipe(BaseEnrtRecipe): host1 = HostReq() @@ -130,16 +131,14 @@ class VirtualOvsBridgeVlansOverBondRecipe(BaseEnrtRecipe): guest4.eth0.up()
#TODO better service handling through HostAPI - host1.run("service irqbalance stop") - host2.run("service irqbalance stop") - guest1.run("service irqbalance stop") - guest2.run("service irqbalance stop") - guest3.run("service irqbalance stop") - guest4.run("service irqbalance stop") + if "perf_tool_cpu" in self.params: + raise LnstError("'perf_tool_cpu' (%d) should not be set for this test" % self.params.perf_tool_cpu)
- for m in self.matched: - for dev in m.devices: - self._pin_dev_interrupts(dev, self.params.dev_intr_cpu) + if "dev_intr_cpu" in self.params: + for m in [host1, host2]: + m.run("service irqbalance stop") + for dev in [m.eth1, m.eth2]: + self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
return configuration
@@ -147,9 +146,6 @@ class VirtualOvsBridgeVlansOverBondRecipe(BaseEnrtRecipe): host1, host2, guest1, guest2, guest3, guest4 = self.matched.host1, self.matched.host2, self.matched.guest1, self.matched.guest2, self.matched.guest3, self.matched.guest4
#TODO better service handling through HostAPI - host1.run("service irqbalance start") - host2.run("service irqbalance start") - guest1.run("service irqbalance start") - guest2.run("service irqbalance start") - guest3.run("service irqbalance start") - guest4.run("service irqbalance start") + if "dev_intr_cpu" in self.params: + for m in [host1, host2]: + m.run("service irqbalance start") diff --git a/lnst/Recipes/ENRT/VlansOverBondRecipe.py b/lnst/Recipes/ENRT/VlansOverBondRecipe.py index 2720bcf..9b0925a 100644 --- a/lnst/Recipes/ENRT/VlansOverBondRecipe.py +++ b/lnst/Recipes/ENRT/VlansOverBondRecipe.py @@ -76,10 +76,10 @@ class VlansOverBondRecipe(BaseEnrtRecipe): m2.vlan2.up()
#TODO better service handling through HostAPI - m1.run("service irqbalance stop") - m2.run("service irqbalance stop") - for m in self.matched: - for dev in m.devices: + if "dev_intr_cpu" in self.params: + for m in [m1, m2]: + m.run("service irqbalance stop") + for dev in [m1.eth0, m1.eth1, m2.eth0]: self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
return configuration @@ -88,5 +88,6 @@ class VlansOverBondRecipe(BaseEnrtRecipe): m1, m2 = self.matched.m1, self.matched.m2
#TODO better service handling through HostAPI - m1.run("service irqbalance start") - m2.run("service irqbalance start") + if "dev_intr_cpu" in self.params: + for m in [m1, m2]: + m1.run("service irqbalance start") diff --git a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py index 0e93d31..da2068e 100644 --- a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py +++ b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py @@ -76,10 +76,10 @@ class VlansOverTeamRecipe(BaseEnrtRecipe): m2.vlan2.up()
#TODO better service handling through HostAPI - m1.run("service irqbalance stop") - m2.run("service irqbalance stop") - for m in self.matched: - for dev in m.devices: + if "dev_intr_cpu" in self.params: + for m in [m1, m2]: + m.run("service irqbalance stop") + for dev in [m1.eth1, m1.eth2, m2.eth1]: self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
return configuration @@ -88,5 +88,6 @@ class VlansOverTeamRecipe(BaseEnrtRecipe): m1, m2 = self.matched.m1, self.matched.m2
#TODO better service handling through HostAPI - m1.run("service irqbalance start") - m2.run("service irqbalance start") + if "dev_intr_cpu" in self.params: + for m in [m1, m2]: + m.run("service irqbalance start") diff --git a/lnst/Recipes/ENRT/VlansRecipe.py b/lnst/Recipes/ENRT/VlansRecipe.py index 3eab6de..bc056f0 100644 --- a/lnst/Recipes/ENRT/VlansRecipe.py +++ b/lnst/Recipes/ENRT/VlansRecipe.py @@ -66,11 +66,10 @@ class VlansRecipe(BaseEnrtRecipe): m2.vlan2.up()
#TODO better service handling through HostAPI - m1.run("service irqbalance stop") - m2.run("service irqbalance stop") - for m in self.matched: - for dev in m.devices: - self._pin_dev_interrupts(dev, self.params.dev_intr_cpu) + if "dev_intr_cpu" in self.params: + for m in [m1, m2]: + m.run("service irqbalance stop") + self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
return configuration
@@ -78,5 +77,6 @@ class VlansRecipe(BaseEnrtRecipe): m1, m2 = self.matched.m1, self.matched.m2
#TODO better service handling through HostAPI - m1.run("service irqbalance start") - m2.run("service irqbalance start") + if "dev_intr_cpu" in self.params: + for m in [m1, m2]: + m.run("service irqbalance start")
From: Christos Sfakianakis csfakian@redhat.com
Correct last offload combination in VirtualBridgeVlansOverBondRecipe, set 'tx' to 'off'.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py index 225dc54..22ede3f 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).
v2: Make perf_reverse optional and available to all recipes for added flexibility to the tester. Move 'create_reverse_flow' to the bottom of BaseEnrtRecipe.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- lnst/Recipes/ENRT/BaseEnrtRecipe.py | 25 +++++++++++++++++++++++++ lnst/Recipes/ENRT/DoubleTeamRecipe.py | 3 ++- lnst/Recipes/ENRT/TeamRecipe.py | 3 ++- lnst/Recipes/ENRT/TeamVsBondRecipe.py | 3 ++- 4 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py index a637486..2618617 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -84,6 +84,7 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): perf_iterations = IntParam(default=5) perf_parallel_streams = IntParam(default=1) perf_msg_size = IntParam(default=123) + perf_reverse = BoolParam(mandatory=False)
perf_usr_comment = StrParam(default="")
@@ -213,6 +214,30 @@ 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 _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 _pin_dev_interrupts(self, dev, cpu): netns = dev.netns cpu_info = netns.run("lscpu").stdout diff --git a/lnst/Recipes/ENRT/DoubleTeamRecipe.py b/lnst/Recipes/ENRT/DoubleTeamRecipe.py index 26f4d41..e0c727a 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 846ca9c..f2e4ad3 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 0536704..3abfe73 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)
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).
v2: Make '_restore_coalescing' method public. Use it in 'restore_original _data'.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- lnst/Devices/Device.py | 71 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+)
diff --git a/lnst/Devices/Device.py b/lnst/Devices/Device.py index 20cddcf..d9aa023 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,11 @@ class Device(object): if self.hwaddr != self._cleanup_data["hwaddr"]: self.hwaddr = self._cleanup_data["hwaddr"]
+ try: + self.restore_coalescing() + except DeviceError: + pass + self._cleanup_data = None
def _create(self): @@ -365,6 +383,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 +645,35 @@ 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) + #TODO implement proper Route objects #consider the same as with tc? # def route_add(self, dest):
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 2618617..314bf45 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -73,7 +73,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 60626d1..ce812c6 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 "dev_intr_cpu" in self.params: for m in [m1, m2]: diff --git a/lnst/Recipes/ENRT/DoubleBondRecipe.py b/lnst/Recipes/ENRT/DoubleBondRecipe.py index 2f9c637..883f072 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 "dev_intr_cpu" in self.params: for m in [m1, m2]: diff --git a/lnst/Recipes/ENRT/DoubleTeamRecipe.py b/lnst/Recipes/ENRT/DoubleTeamRecipe.py index e0c727a..b5ebd49 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 "dev_intr_cpu" in self.params: for m in [m1, m2]: diff --git a/lnst/Recipes/ENRT/SimplePerfRecipe.py b/lnst/Recipes/ENRT/SimplePerfRecipe.py index 0c5ab6c..c3bc394 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 "dev_intr_cpu" in self.params: for m in [m1, m2]: diff --git a/lnst/Recipes/ENRT/TeamRecipe.py b/lnst/Recipes/ENRT/TeamRecipe.py index f2e4ad3..7090b0a 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 "dev_intr_cpu" in self.params: for m in [m1, m2]: diff --git a/lnst/Recipes/ENRT/TeamVsBondRecipe.py b/lnst/Recipes/ENRT/TeamVsBondRecipe.py index 3abfe73..94cb6e5 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 "dev_intr_cpu" in self.params: for m in [m1, m2]: diff --git a/lnst/Recipes/ENRT/VlansOverBondRecipe.py b/lnst/Recipes/ENRT/VlansOverBondRecipe.py index 9b0925a..f890c89 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 "dev_intr_cpu" in self.params: for m in [m1, m2]: diff --git a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py index da2068e..a089513 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 "dev_intr_cpu" in self.params: for m in [m1, m2]: diff --git a/lnst/Recipes/ENRT/VlansRecipe.py b/lnst/Recipes/ENRT/VlansRecipe.py index bc056f0..e57bc10 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 "dev_intr_cpu" in self.params: 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 ce812c6..8305ddd 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 883f072..23d695b 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 b5ebd49..6449b3a 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 c3bc394..2c3f717 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 7090b0a..ea2dd7a 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 94cb6e5..8a5b8b3 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 d47dacd..9cd66a9 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 b7e5d4c..44c5212 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 a2ad29e..73a6f01 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 0a7bda1..fe3a07e 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 22ede3f..316eb4f 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 bc7b5ba..bb90d16 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 e1471be..ff05dd5 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 0b53b13..dd6a188 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 9f6ba54..656d28a 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 03aca6e..d56e759 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 f890c89..38eb328 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 a089513..438fe20 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 e57bc10..fa11015 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.
v2: Skip offload settings which contain 'off' values unless ('gso', 'off') is also contained in them when using SCTP.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- lnst/Recipes/ENRT/BaseEnrtRecipe.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py index 314bf45..d79b386 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -134,6 +134,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) @@ -149,6 +155,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") @@ -195,6 +207,14 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): server_bind = server_nic.ips_filter(family=family)[0]
for perf_test in self.params.perf_tests: + offload_values = sub_config.offload_settings.values() + offload_items = sub_config.offload_settings.items() + if ((perf_test == 'udp_stream' and ('gro', 'off') in offload_items) + or + (perf_test == 'sctp_stream' and 'off' in offload_values and + ('gso', 'on') in offload_items)): + continue + flow = PerfFlow( type = perf_test, generator = client_netns,
From: Christos Sfakianakis csfakian@redhat.com
Add error handling in BaseEnrtRecipe to make sure hosts are deconfigured (e.g offloads back to all-'on', iptable rules reverted) in case of errors during perf tests (e.g iperf3: unrecognized option '--sctp').
v2: Extend error handling to cover both ping and perf tests.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- lnst/Recipes/ENRT/BaseEnrtRecipe.py | 34 +++++++++++++++-------------- 1 file changed, 18 insertions(+), 16 deletions(-)
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py index d79b386..d21d4bd 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -98,22 +98,24 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe): def test(self): main_config = self.test_wide_configuration()
- for sub_config in self.generate_sub_configurations(main_config): - self.apply_sub_configuration(main_config, sub_config) - - for ping_config in self.generate_ping_configurations(main_config, - sub_config): - result = self.ping_test(ping_config) - self.ping_evaluate_and_report(ping_config, result) - - for perf_config in self.generate_perf_configurations(main_config, - sub_config): - result = self.perf_test(perf_config) - self.perf_report_and_evaluate(result) - - self.remove_sub_configuration(main_config, sub_config) - - self.test_wide_deconfiguration(main_config) + try: + for sub_config in self.generate_sub_configurations(main_config): + self.apply_sub_configuration(main_config, sub_config) + + try: + for ping_config in self.generate_ping_configurations(main_config, + sub_config): + result = self.ping_test(ping_config) + self.ping_evaluate_and_report(ping_config, result) + + for perf_config in self.generate_perf_configurations(main_config, + sub_config): + result = self.perf_test(perf_config) + self.perf_report_and_evaluate(result) + finally: + self.remove_sub_configuration(main_config, sub_config) + finally: + self.test_wide_deconfiguration(main_config)
def test_wide_configuration(self): raise NotImplementedError("Method must be defined by a child class.")
On Wed, Mar 13, 2019 at 04:04:18PM +0100, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Hi,
this is the second version of the patch set. Changes include:
- lnst.Recipes.ENRT.BaseEnrtRecipe
- Rename 'perf_intr_cpu' to 'perf_tool_cpu'.
- Make 'dev_intr_cpu' and 'perf_tool_cpu' optional.
- Make 'perf_reverse' optional and available to all recipes.
- Rewrite 'create_reverse_flow' method at the bottom.
- Add CPU validity check in '_pin_dev_interrupts'.
- Extend try..finally clause in 'test' to cover ping test errors.
- lnst.Devices.Device.py
- Remove _restore_coalescing method from Device module, make it public.
- Use the previous method instead of '_write_adaptive__coalescing' in 'restore_original_data'.
- lnst.Recipes.ENRT
- Modify checks for -now- optional parameters 'dev_intr_cpu' and 'perf_tool_cpu'.
Thanks,
Christos
looks good, pushed.
Thanks, Ondrej
lnst-developers@lists.fedorahosted.org