This series is contains a series of patches needed to get the OvS_DPDK_PvP recipe to work.
They mostly contain small fixes here and there. An exception is PATCH 6/7 that is a workaround that could potentially affect other tests. Special care should be taken with that one.
*** BLURB HERE ***
Adrian Moreno (7): lnst.Controller.RecipeResults: check if netns exists lnst.Tests.Trex: open temp file in non-binary mode lnst.Tests.TestPMD: encode commands to testpmd lnst.Recipes.ENRT.OvS_DPDK_PvP: minor fixes TRexFlowMeasurement: fix stat names and missing member lnst.Devices.RemoteDevice: disable coalescing caching TRexFlowMeasurement: wait for the server to start
lnst/Controller/RecipeResults.py | 6 +++--- lnst/Devices/RemoteDevice.py | 2 +- .../Perf/Measurements/TRexFlowMeasurement.py | 8 ++++++-- lnst/Recipes/ENRT/OvS_DPDK_PvP.py | 11 ++++++----- lnst/Tests/TRex.py | 2 +- lnst/Tests/TestPMD.py | 6 +++--- 6 files changed, 20 insertions(+), 15 deletions(-)
RemoteDevice initialized it's netns attribute to None. Therefore, it's possible that it is still None when the DeviceResult intances access it.
Signed-off-by: Adrian Moreno amorenoz@redhat.com --- lnst/Controller/RecipeResults.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lnst/Controller/RecipeResults.py b/lnst/Controller/RecipeResults.py index dac609a..38a4170 100644 --- a/lnst/Controller/RecipeResults.py +++ b/lnst/Controller/RecipeResults.py @@ -129,7 +129,7 @@ class DeviceCreateResult(DeviceConfigResult): return "Creating Device {hostid}{netns}.{dev_id} = {cls_name}({args}{comma}{kwargs})".format( hostid=self.device.host.hostid, netns=".{}".format(self.device.netns.name) - if self.device.netns.name + if self.device.netns and self.device.netns.name else "", dev_id=self.device._id, cls_name=dev_clsname, @@ -166,7 +166,7 @@ class DeviceMethodCallResult(DeviceConfigResult): host=self.device.host.hostid, netns=( ".{}".format(self.device.netns.name) - if self.device.netns.name + if self.device.netns and self.device.netns.name else "" ), dev_id=self.device._id, @@ -204,7 +204,7 @@ class DeviceAttrSetResult(DeviceConfigResult): host=self.device.host.hostid, netns=( ".{}".format(self.device.netns.name) - if self.device.netns.name + if self.device.netns and self.device.netns.name else "" ), dev_id=self.device._id,
The default open mode for NamedTemporaryFile is 'wb+'. Force non-binary 'w+' mode so that yaml.dump() works.
Signed-off-by: Adrian Moreno amorenoz@redhat.com --- lnst/Tests/TRex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lnst/Tests/TRex.py b/lnst/Tests/TRex.py index aa65231..e09be00 100644 --- a/lnst/Tests/TRex.py +++ b/lnst/Tests/TRex.py @@ -136,7 +136,7 @@ class TRexServer(TRexCommon): {'src_mac': str(src["mac_addr"]), 'dest_mac': str(dst["mac_addr"])})
- with tempfile.NamedTemporaryFile() as cfg_file: + with tempfile.NamedTemporaryFile(mode="w+") as cfg_file: yaml.dump(trex_server_conf, cfg_file) cfg_file.flush() os.fsync(cfg_file.file.fileno())
Popen.stdin expects data in binary format so encode the commands before sending them.
Signed-off-by: Adrian Moreno amorenoz@redhat.com --- lnst/Tests/TestPMD.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lnst/Tests/TestPMD.py b/lnst/Tests/TestPMD.py index ef975bb..59c69aa 100644 --- a/lnst/Tests/TestPMD.py +++ b/lnst/Tests/TestPMD.py @@ -38,12 +38,12 @@ class TestPMD(BaseTestModule): stderr=subprocess.PIPE, close_fds=True)
- process.stdin.write("start tx_first\n") + process.stdin.write(str.encode("start tx_first\n"))
self.wait_for_interrupt()
- process.stdin.write("stop\n") - process.stdin.write("quit\n") + process.stdin.write(str.encode("stop\n")) + process.stdin.write(str.encode("quit\n"))
out, err = process.communicate() self._res_data = {"stdout": out, "stderr": err}
* Adapt host requirement to pool definition * Call PerfFlow with cpupin=None. It's a mandatory parameter but it's only used in IperfFlowMeasurement * Remove redundant 'systemctl ovs-vswitchd restart ' * ET.toString generates an encoded byte array. Properly decode it before before sending it to libvirt
Signed-off-by: Adrian Moreno amorenoz@redhat.com --- lnst/Recipes/ENRT/OvS_DPDK_PvP.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/lnst/Recipes/ENRT/OvS_DPDK_PvP.py b/lnst/Recipes/ENRT/OvS_DPDK_PvP.py index 0004c79..fd9e25f 100644 --- a/lnst/Recipes/ENRT/OvS_DPDK_PvP.py +++ b/lnst/Recipes/ENRT/OvS_DPDK_PvP.py @@ -52,7 +52,7 @@ class OvSDPDKPvPRecipe(PingTestAndEvaluate, PerfRecipe): m1.eth0 = DeviceReq(label="net1", driver=RecipeParam("driver")) m1.eth1 = DeviceReq(label="net1", driver=RecipeParam("driver"))
- m2 = HostReq(has_guest="True") + m2 = HostReq(with_guest="yes") m2.eth0 = DeviceReq(label="net1", driver=RecipeParam("driver")) m2.eth1 = DeviceReq(label="net1", driver=RecipeParam("driver"))
@@ -197,7 +197,8 @@ class OvSDPDKPvPRecipe(PingTestAndEvaluate, PerfRecipe): receiver_bind = dst_bind, msg_size = self.params.perf_msg_size, duration = self.params.perf_duration, - parallel_streams = self.params.perf_streams)) + parallel_streams = self.params.perf_streams, + cpupin=None))
return PerfRecipeConf( measurements=[ @@ -287,8 +288,6 @@ class OvSDPDKPvPRecipe(PingTestAndEvaluate, PerfRecipe): .format(self.params.host2_l_cores)) host.run("systemctl restart openvswitch")
- host.run("systemctl restart openvswitch") - #TODO use an actual OvS Device object #TODO config.dut.nics.append(CachedRemoteDevice(m2.ovs)) host.run("ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev") @@ -373,7 +372,9 @@ class OvSDPDKPvPRecipe(PingTestAndEvaluate, PerfRecipe): virtctl = guest_conf.virtctl guest_xml = guest_conf.libvirt_xml
- virtctl.createXML(ET.tostring(guest_xml)) + str_xml = ET.tostring(guest_xml, encoding='utf8', method='xml') + virtctl.createXML(str_xml.decode('utf8')) +
guest_ip_job = host.run("gethostip -d {}".format(guest_conf.name)) guest_ip = guest_ip_job.stdout.strip()
* _conf member is assumed to exist in all FlowMeasurement subclasses * fix cpu_stat attributes names
Signed-off-by: Adrian Moreno amorenoz@redhat.com --- lnst/RecipeCommon/Perf/Measurements/TRexFlowMeasurement.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lnst/RecipeCommon/Perf/Measurements/TRexFlowMeasurement.py b/lnst/RecipeCommon/Perf/Measurements/TRexFlowMeasurement.py index 11449d0..3aba4cd 100644 --- a/lnst/RecipeCommon/Perf/Measurements/TRexFlowMeasurement.py +++ b/lnst/RecipeCommon/Perf/Measurements/TRexFlowMeasurement.py @@ -19,6 +19,7 @@ class TRexFlowMeasurement(BaseFlowMeasurement): def __init__(self, flows, trex_dir): self._flows = flows self._trex_dir = trex_dir + self._conf = dict(flows=flows, trex_dir=trex_dir) self._running_measurements = [] self._finished_measurements = []
@@ -115,9 +116,9 @@ class TRexFlowMeasurement(BaseFlowMeasurement):
if not job.passed: results.generator_results.append(PerfInterval(0, 0, "packets")) - results.generator_cpu.append(PerfInterval(0, 0, "cpu_percent")) + results.generator_cpu_stats.append(PerfInterval(0, 0, "cpu_percent")) results.receiver_results.append(PerfInterval(0, 0, "packets")) - results.receiver_cpu.append(PerfInterval(0, 0, "cpu_percent")) + results.receiver_cpu_stats.append(PerfInterval(0, 0, "cpu_percent")) else: prev_time = job.result["start_time"] prev_tx_val = 0
When devices that do not support coalescing are present, the tests fail with the folloing error message:
lnst.Common.DeviceError.DeviceError: No values for coalescence of eth1.
This came up with adding a VM as a host in OvSDPDKPvPRecipe. This patch is just a workaround added just to make it work.
Signed-off-by: Adrian Moreno amorenoz@redhat.com Signed-off-by: Ondrej Lichtner olichtne@redhat.com --- lnst/Devices/RemoteDevice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lnst/Devices/RemoteDevice.py b/lnst/Devices/RemoteDevice.py index 17bc52b..daf898e 100644 --- a/lnst/Devices/RemoteDevice.py +++ b/lnst/Devices/RemoteDevice.py @@ -145,7 +145,7 @@ class RemoteDevice(object):
def __iter__(self): for x in dir(self._dev_cls): - if x[0] == '_' or x[0:1] == "__": + if x[0] == '_' or x[0:1] == "__" or "coalescing" in x: continue attr = getattr(self._dev_cls, x)
There is a race condition as it's possible that the client is run before the server starts listening on the zmq port.
Wait 5 seconds before starting the client.
Signed-off-by: Adrian Moreno amorenoz@redhat.com --- lnst/RecipeCommon/Perf/Measurements/TRexFlowMeasurement.py | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/lnst/RecipeCommon/Perf/Measurements/TRexFlowMeasurement.py b/lnst/RecipeCommon/Perf/Measurements/TRexFlowMeasurement.py index 3aba4cd..32fbf8c 100644 --- a/lnst/RecipeCommon/Perf/Measurements/TRexFlowMeasurement.py +++ b/lnst/RecipeCommon/Perf/Measurements/TRexFlowMeasurement.py @@ -33,6 +33,9 @@ class TRexFlowMeasurement(BaseFlowMeasurement): for test in tests: test.server_job.start(bg=True)
+ #wait for Trex server to start + time.sleep(5) + for test in tests: test.client_job.start(bg=True)
On Wed, Sep 25, 2019 at 04:59:47PM +0200, Adrian Moreno wrote:
This series is contains a series of patches needed to get the OvS_DPDK_PvP recipe to work.
They mostly contain small fixes here and there. An exception is PATCH 6/7 that is a workaround that could potentially affect other tests. Special care should be taken with that one.
*** BLURB HERE ***
Adrian Moreno (7): lnst.Controller.RecipeResults: check if netns exists lnst.Tests.Trex: open temp file in non-binary mode lnst.Tests.TestPMD: encode commands to testpmd lnst.Recipes.ENRT.OvS_DPDK_PvP: minor fixes TRexFlowMeasurement: fix stat names and missing member lnst.Devices.RemoteDevice: disable coalescing caching TRexFlowMeasurement: wait for the server to start
lnst/Controller/RecipeResults.py | 6 +++--- lnst/Devices/RemoteDevice.py | 2 +- .../Perf/Measurements/TRexFlowMeasurement.py | 8 ++++++-- lnst/Recipes/ENRT/OvS_DPDK_PvP.py | 11 ++++++----- lnst/Tests/TRex.py | 2 +- lnst/Tests/TestPMD.py | 6 +++--- 6 files changed, 20 insertions(+), 15 deletions(-)
-- 2.21.0
Patchset looks good, I'll skip the "lnst.Devices.RemoteDevice: disable coalescing caching" patch as discussed on IRC, I'll send my own patch set that solves the issue a little better instead of just hiding the error as a temporary workaround.
Thanks, -Ondrej
On 9/30/19 3:00 PM, Ondrej Lichtner wrote:
On Wed, Sep 25, 2019 at 04:59:47PM +0200, Adrian Moreno wrote:
This series is contains a series of patches needed to get the OvS_DPDK_PvP recipe to work.
They mostly contain small fixes here and there. An exception is PATCH 6/7 that is a workaround that could potentially affect other tests. Special care should be taken with that one.
*** BLURB HERE ***
Adrian Moreno (7): lnst.Controller.RecipeResults: check if netns exists lnst.Tests.Trex: open temp file in non-binary mode lnst.Tests.TestPMD: encode commands to testpmd lnst.Recipes.ENRT.OvS_DPDK_PvP: minor fixes TRexFlowMeasurement: fix stat names and missing member lnst.Devices.RemoteDevice: disable coalescing caching TRexFlowMeasurement: wait for the server to start
lnst/Controller/RecipeResults.py | 6 +++--- lnst/Devices/RemoteDevice.py | 2 +- .../Perf/Measurements/TRexFlowMeasurement.py | 8 ++++++-- lnst/Recipes/ENRT/OvS_DPDK_PvP.py | 11 ++++++----- lnst/Tests/TRex.py | 2 +- lnst/Tests/TestPMD.py | 6 +++--- 6 files changed, 20 insertions(+), 15 deletions(-)
-- 2.21.0
Patchset looks good, I'll skip the "lnst.Devices.RemoteDevice: disable coalescing caching" patch as discussed on IRC, I'll send my own patch set that solves the issue a little better instead of just hiding the error as a temporary workaround.
Sounds good.
Thanks
Thanks, -Ondrej
lnst-developers@lists.fedorahosted.org