From: Ondrej Lichtner <olichtne(a)redhat.com>
The TRexFlowMeasurement object now needs to be initialized with a list
of cores to use for the TRexServer process instead of hard coded values.
This requires a change to the OvSDPDKPvPRecipe which previously removed
a parameter that was intended to be used for this but skipped.
The same parameter needs to be added to the VhostNetPvPRecipe which also
uses the TRexFlowMeasurement.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
.../Perf/Measurements/TRexFlowMeasurement.py | 5 +++--
lnst/Recipes/ENRT/OvS_DPDK_PvP.py | 20 +++++++++++-------
lnst/Recipes/ENRT/VhostNetPvPRecipe.py | 21 ++++++++++++-------
3 files changed, 30 insertions(+), 16 deletions(-)
diff --git a/lnst/RecipeCommon/Perf/Measurements/TRexFlowMeasurement.py
b/lnst/RecipeCommon/Perf/Measurements/TRexFlowMeasurement.py
index 32fbf8c..5f5c705 100644
--- a/lnst/RecipeCommon/Perf/Measurements/TRexFlowMeasurement.py
+++ b/lnst/RecipeCommon/Perf/Measurements/TRexFlowMeasurement.py
@@ -16,9 +16,10 @@
from lnst.Tests.TRex import TRexServer, TRexClient
class TRexFlowMeasurement(BaseFlowMeasurement):
- def __init__(self, flows, trex_dir):
+ def __init__(self, flows, trex_dir, server_cpu_cores):
self._flows = flows
self._trex_dir = trex_dir
+ self._server_cpu_cores = server_cpu_cores
self._conf = dict(flows=flows, trex_dir=trex_dir)
self._running_measurements = []
self._finished_measurements = []
@@ -69,7 +70,7 @@ def _prepare_tests(self, flows):
TRexServer(
trex_dir=self._trex_dir,
flows=flow_tuples,
- cores=["2", "3", "4"]))
+ cores=self._server_cpu_cores))
client_job = generator.prepare_job(
TRexClient(
trex_dir=self._trex_dir,
diff --git a/lnst/Recipes/ENRT/OvS_DPDK_PvP.py b/lnst/Recipes/ENRT/OvS_DPDK_PvP.py
index cd6161d..b76a5b7 100644
--- a/lnst/Recipes/ENRT/OvS_DPDK_PvP.py
+++ b/lnst/Recipes/ENRT/OvS_DPDK_PvP.py
@@ -54,6 +54,7 @@ class OvSDPDKPvPRecipe(BasePvPRecipe):
guest_dpdk_cores = StrParam(mandatory=True)
guest_testpmd_cores = StrParam(mandatory=True)
+ host1_dpdk_cores = StrParam(mandatory=True)
host2_pmd_cores = StrParam(mandatory=True)
host2_l_cores = StrParam(mandatory=True)
socket_mem = IntParam(default=2048)
@@ -145,13 +146,18 @@ def generate_perf_config(self, config):
cpupin=None))
return PerfRecipeConf(
- measurements=[
- self.params.cpu_perf_tool([config.generator.host,
- config.dut.host,
- config.guest.host]),
- TRexFlowMeasurement(flows, self.params.trex_dir)
- ],
- iterations=self.params.perf_iterations)
+ measurements=[
+ self.params.cpu_perf_tool(
+ [config.generator.host, config.dut.host, config.guest.host]
+ ),
+ TRexFlowMeasurement(
+ flows,
+ self.params.trex_dir,
+ self.params.host1_dpdk_cores.split(","),
+ ),
+ ],
+ iterations=self.params.perf_iterations,
+ )
def test_wide_deconfiguration(self, config):
try:
diff --git a/lnst/Recipes/ENRT/VhostNetPvPRecipe.py
b/lnst/Recipes/ENRT/VhostNetPvPRecipe.py
index 780e22f..f512fd2 100644
--- a/lnst/Recipes/ENRT/VhostNetPvPRecipe.py
+++ b/lnst/Recipes/ENRT/VhostNetPvPRecipe.py
@@ -31,6 +31,8 @@ class VhostNetPvPRecipe(BasePvPRecipe):
host_req.eth0 = DeviceReq(label="net1",
driver=RecipeParam("driver"))
host_req.eth1 = DeviceReq(label="net1",
driver=RecipeParam("driver"))
+ host1_dpdk_cores = StrParam(mandatory=True)
+
vhost_cpus = StrParam(mandatory=True) # The CPUs used by vhost-net kernel threads
# TODO: Study the possibility of adding more forwarding engines
@@ -134,13 +136,18 @@ def generate_perf_config(self, config):
)
return PerfRecipeConf(
- measurements=[
- self.params.cpu_perf_tool([config.generator.host,
- config.dut.host,
- config.guest.host]),
- TRexFlowMeasurement(flows, self.params.trex_dir)
- ],
- iterations=self.params.perf_iterations)
+ measurements=[
+ self.params.cpu_perf_tool(
+ [config.generator.host, config.dut.host, config.guest.host]
+ ),
+ TRexFlowMeasurement(
+ flows,
+ self.params.trex_dir,
+ self.params.host1_dpdk_cores.split(","),
+ ),
+ ],
+ iterations=self.params.perf_iterations,
+ )
def test_wide_deconfiguration(self, config):
try:
--
2.24.1