* Re: [dts] [PATCH V1] tests: add new features for compression test
2019-12-16 23:06 ` [dts] [PATCH V1] tests: add new features for compression test Xinfeng Zhao
@ 2019-12-17 8:26 ` Wan, Zhe
2019-12-20 8:02 ` Tu, Lijuan
1 sibling, 0 replies; 5+ messages in thread
From: Wan, Zhe @ 2019-12-17 8:26 UTC (permalink / raw)
To: Zhao, XinfengX, dts; +Cc: Zhao, XinfengX
Acked-by: Wan, Zhe <zhe.wan@intel.com>
Thanks!
BR,
Wan,Zhe
-----Original Message-----
From: dts <dts-bounces@dpdk.org> On Behalf Of Xinfeng Zhao
Sent: 2019年12月17日 7:06
To: dts@dpdk.org
Cc: Zhao, XinfengX <xinfengx.zhao@intel.com>
Subject: [dts] [PATCH V1] tests: add new features for compression test
Signed-off-by: Xinfeng Zhao <xinfengx.zhao@intel.com>
---
tests/TestSuite_compressdev_isal_pmd.py | 22 +++++++-- tests/TestSuite_compressdev_qat_pmd.py | 61 +++++++++++++++++++++++-- tests/TestSuite_compressdev_zlib_pmd.py | 23 ++++++++--
tests/compress_common.py | 45 +++++++++++++++---
4 files changed, 133 insertions(+), 18 deletions(-)
diff --git a/tests/TestSuite_compressdev_isal_pmd.py b/tests/TestSuite_compressdev_isal_pmd.py
index 8d7e22e..070eedb 100644
--- a/tests/TestSuite_compressdev_isal_pmd.py
+++ b/tests/TestSuite_compressdev_isal_pmd.py
@@ -33,6 +33,7 @@
import os
from test_case import TestCase
import json
+import copy
import compress_common as cc
class TestCompressdevIsalPmd(TestCase):
@@ -42,9 +43,12 @@ class TestCompressdevIsalPmd(TestCase):
cc.default_eals.update({'w': "0000:00:00.0", "vdev": "compress_isal"})
cc.default_opts.update({"driver-name": "compress_isal"})
self._perf_result = dict()
+ self.eals = copy.deepcopy(cc.default_eals)
+ self.opts = copy.deepcopy(cc.default_opts)
def set_up(self):
- pass
+ cc.default_eals = copy.deepcopy(self.eals)
+ cc.default_opts = copy.deepcopy(self.opts)
def prepare_dpdk(self):
self.dut.send_expect(
@@ -58,12 +62,22 @@ class TestCompressdevIsalPmd(TestCase):
def test_isal_pmd_fixed_func(self):
cc.default_opts.update({"huffman-enc": "fixed"})
- result = cc.run_perf(self)
- self._perf_result.update(result)
+ result = cc.run_compress_func(self)
def test_isal_pmd_dynamic_func(self):
cc.default_opts.update({"huffman-enc": "dynamic"})
- result = cc.run_perf(self)
+ result = cc.run_compress_func(self)
+
+ def test_isal_pmd_fixed_perf(self):
+ cc.default_opts.update({"huffman-enc": "fixed", "extended-input-sz": 3244032,
+ "max-num-sgl-segs": 1})
+ result = cc.run_compress_perf(self)
+ self._perf_result.update(result)
+
+ def test_isal_pmd_dynamic_perf(self):
+ cc.default_opts.update({"huffman-enc": "dynamic", "extended-input-sz": 3244032,
+ "max-num-sgl-segs": 1})
+ result = cc.run_compress_perf(self)
self._perf_result.update(result)
def tear_down(self):
diff --git a/tests/TestSuite_compressdev_qat_pmd.py b/tests/TestSuite_compressdev_qat_pmd.py
index 40b3fac..696ad1d 100644
--- a/tests/TestSuite_compressdev_qat_pmd.py
+++ b/tests/TestSuite_compressdev_qat_pmd.py
@@ -33,6 +33,7 @@
import os
from test_case import TestCase
import json
+import copy
import compress_common as cc
@@ -41,12 +42,16 @@ class TestCompressdevQatPmd(TestCase):
def set_up_all(self):
self.prepare_dpdk()
cc.bind_qat_device(self, self.drivername)
+ cc.default_eals.update({"vdev": None})
cc.default_opts.update({"driver-name": "compress_qat"})
self.device_list = cc.get_qat_device_list(self)
self._perf_result = dict()
+ self.eals = copy.deepcopy(cc.default_eals)
+ self.opts = copy.deepcopy(cc.default_opts)
def set_up(self):
- pass
+ cc.default_eals = copy.deepcopy(self.eals)
+ cc.default_opts = copy.deepcopy(self.opts)
def prepare_dpdk(self):
self.dut.send_expect(
@@ -75,13 +80,61 @@ class TestCompressdevQatPmd(TestCase):
def test_qat_pmd_fixed_func(self):
cc.default_eals['w'] = ' -w '.join(self.get_perf_default_device())
cc.default_opts.update({"huffman-enc": "fixed"})
- result = cc.run_perf(self)
- self._perf_result.update(result)
+ result = cc.run_compress_func(self)
def test_qat_pmd_dynamic_func(self):
cc.default_eals['w'] = ' -w '.join(self.get_perf_default_device())
cc.default_opts.update({"huffman-enc": "dynamic"})
- result = cc.run_perf(self)
+ result = cc.run_compress_func(self)
+
+ def test_qat_pmd_big_sgl_fixed_func(self):
+ cc.default_eals['w'] = ' -w '.join(self.get_perf_default_device())
+ cc.default_opts.update({"huffman-enc": "fixed", "seg-sz": 1024,
+ "extended-input-sz": 1048576, "max-num-sgl-segs": 1003})
+ result = cc.run_compress_func(self)
+
+ def test_qat_pmd_big_sgl_dynamic_func(self):
+ cc.default_eals['w'] = ' -w '.join(self.get_perf_default_device())
+ cc.default_opts.update({"huffman-enc": "dynamic", "seg-sz": 1024,
+ "extended-input-sz": 1048576, "max-num-sgl-segs": 1003})
+ result = cc.run_compress_func(self)
+
+ def test_qat_pmd_big_seg_fixed_func(self):
+ cc.default_eals['w'] = ' -w '.join(self.get_perf_default_device())
+ cc.default_opts.update({"huffman-enc": "fixed", "seg-sz": 59460,
+ "extended-input-sz": 1048576, "max-num-sgl-segs": 18})
+ result = cc.run_compress_func(self)
+
+ def test_qat_pmd_big_seg_dynamic_func(self):
+ cc.default_eals['w'] = ' -w '.join(self.get_perf_default_device())
+ cc.default_opts.update({"huffman-enc": "dynamic", "seg-sz": 59460,
+ "extended-input-sz": 1048576, "max-num-sgl-segs": 18})
+ result = cc.run_compress_func(self)
+
+ def test_qat_pmd_external_mbufs_fixed_func(self):
+ cc.default_eals['w'] = ' -w '.join(self.get_perf_default_device())
+ cc.default_opts.update({"huffman-enc": "fixed", "max-num-sgl-segs": 16,
+ "seg-sz": 2048, "external-mbufs": '', "extended-input-sz": 300000})
+ result = cc.run_compress_func(self)
+
+ def test_qat_pmd_external_mbufs_dynamic_func(self):
+ cc.default_eals['w'] = ' -w '.join(self.get_perf_default_device())
+ cc.default_opts.update({"huffman-enc": "dynamic", "max-num-sgl-segs": 16,
+ "seg-sz": 2048, "external-mbufs": '', "extended-input-sz": 300000})
+ result = cc.run_compress_func(self)
+
+ def test_qat_pmd_fixed_perf(self):
+ cc.default_eals['w'] = ' -w '.join(self.get_perf_default_device())
+ cc.default_opts.update({"huffman-enc": "fixed", "extended-input-sz": 3244032,
+ "max-num-sgl-segs": 1})
+ result = cc.run_compress_perf(self)
+ self._perf_result.update(result)
+
+ def test_qat_pmd_dynamic_perf(self):
+ cc.default_eals['w'] = ' -w '.join(self.get_perf_default_device())
+ cc.default_opts.update({"huffman-enc": "dynamic", "extended-input-sz": 3244032,
+ "max-num-sgl-segs": 1})
+ result = cc.run_compress_perf(self)
self._perf_result.update(result)
def tear_down(self):
diff --git a/tests/TestSuite_compressdev_zlib_pmd.py b/tests/TestSuite_compressdev_zlib_pmd.py
index 31d7194..ea935c2 100644
--- a/tests/TestSuite_compressdev_zlib_pmd.py
+++ b/tests/TestSuite_compressdev_zlib_pmd.py
@@ -33,6 +33,7 @@
import os
from test_case import TestCase
import json
+import copy
import compress_common as cc
class TestCompressdevZlibPmd(TestCase):
@@ -43,8 +44,12 @@ class TestCompressdevZlibPmd(TestCase):
cc.default_opts.update({"driver-name": "compress_zlib"})
self._perf_result = dict()
+ self.eals = copy.deepcopy(cc.default_eals)
+ self.opts = copy.deepcopy(cc.default_opts)
+
def set_up(self):
- pass
+ cc.default_eals = copy.deepcopy(self.eals)
+ cc.default_opts = copy.deepcopy(self.opts)
def prepare_dpdk(self):
self.dut.send_expect(
@@ -58,12 +63,22 @@ class TestCompressdevZlibPmd(TestCase):
def test_zlib_pmd_fixed_func(self):
cc.default_opts.update({"huffman-enc": "fixed"})
- result = cc.run_perf(self)
- self._perf_result.update(result)
+ result = cc.run_compress_func(self)
def test_zlib_pmd_dynamic_func(self):
cc.default_opts.update({"huffman-enc": "dynamic"})
- result = cc.run_perf(self)
+ result = cc.run_compress_func(self)
+
+ def test_zlib_pmd_fixed_perf(self):
+ cc.default_opts.update({"huffman-enc": "fixed", "extended-input-sz": 3244032,
+ "max-num-sgl-segs": 1})
+ result = cc.run_compress_perf(self)
+ self._perf_result.update(result)
+
+ def test_zlib_pmd_dynamic_perf(self):
+ cc.default_opts.update({"huffman-enc": "dynamic", "extended-input-sz": 3244032,
+ "max-num-sgl-segs": 1})
+ result = cc.run_compress_perf(self)
self._perf_result.update(result)
def tear_down(self):
diff --git a/tests/compress_common.py b/tests/compress_common.py index 0a3c7ff..5d681e4 100644
--- a/tests/compress_common.py
+++ b/tests/compress_common.py
@@ -39,12 +39,12 @@ conf = SuiteConf('compressdev_sample')
default_opts = {
"driver-name": None,
- "seg-sz": 2048,
+ "seg-sz": None,
"burst-sz": None,
"compress-level": "1:1:9",
"extended-input-sz": None,
"num-iter": 10,
- "max-num-sgl-segs": 16,
+ "max-num-sgl-segs": None,
"external-mbufs": None,
"huffman-enc": "dynamic",
"ptest": None,
@@ -52,7 +52,7 @@ default_opts = {
}
default_eals = {
- "l": "0-6",
+ "l": "0-3",
"c": None,
"n": None,
"w": None,
@@ -136,12 +136,11 @@ def run_unit(test_case, eal={}):
test_case.verify("Test OK" in out, "Test Failed")
-def run_perf(test_case, eal={}, opt={}):
+def run_compress_func(test_case, eal={}, opt={}):
eal_str = get_opt_str(test_case, default_eals, eal)
opt_str = get_opt_str(test_case, default_opts, opt)
input_file = get_input_file(test_case)
- result = {}
for each_file in input_file:
test_case.logger.info("Testing file: {}".format(each_file))
@@ -157,12 +156,46 @@ def run_perf(test_case, eal={}, opt={}):
test_case.verify("failed" not in out and "FATAL" not in out,
"Test Failed: Parameter or the value error")
+ res = parse_perf_output(out)
+ test_case.verify(res, "Test Failed: can't get performance
+ data")
+
+def run_compress_perf(test_case, eal={}, opt={}):
+ eal_str = get_opt_str(test_case, default_eals, eal)
+ opt_str = get_opt_str(test_case, default_opts, opt)
+ input_file = get_input_file(test_case)
+
+ result = {}
+ for each_file in input_file:
+ file_name = os.path.basename(each_file).split('.')[0]
+ if file_name == "calgary":
+ perf_file = each_file
+ break
+ else:
+ perf_file = ''
+
+ test_case.verify(perf_file, "Test Failed: can not found the test
+ file: calgary")
+
+ for each_seg in [1, 2, 4, 8, 16, 32]:
+ test_case.logger.info("Testing file: {}, seg-sz: {}".format(perf_file, each_seg * 1024))
+ cmdline = "./{target}/app/dpdk-test-compress-perf {eal}\
+ -- --input-file {file} --seg-sz {seg} {opt}"
+
+ cmdline = cmdline.format(target = test_case.dut.target,
+ eal = eal_str,
+ file = perf_file,
+ seg = each_seg * 1024,
+ opt = opt_str)
+
+ out = test_case.dut.send_expect(cmdline, "# ", 300)
+ test_case.verify("failed" not in out and "FATAL" not in out,
+ "Test Failed: Parameter or the value error")
+
case_name = test_case._suite_result.test_case
res = format_perf_data(case_name, out)
test_case.verify(res, "Test Failed: can't get performance data")
file_name = os.path.basename(each_file).split('.')[0]
- result.update({case_name + '_' + file_name: res})
+ result.update({case_name + '_' + str(each_seg) + 'k': res})
return result
--
2.17.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dts] [PATCH V1] tests: add new features for compression test
2019-12-16 23:06 ` [dts] [PATCH V1] tests: add new features for compression test Xinfeng Zhao
2019-12-17 8:26 ` Wan, Zhe
@ 2019-12-20 8:02 ` Tu, Lijuan
1 sibling, 0 replies; 5+ messages in thread
From: Tu, Lijuan @ 2019-12-20 8:02 UTC (permalink / raw)
To: Zhao, XinfengX, dts; +Cc: Zhao, XinfengX
Applied, thanks
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Xinfeng Zhao
> Sent: Tuesday, December 17, 2019 7:06 AM
> To: dts@dpdk.org
> Cc: Zhao, XinfengX <xinfengx.zhao@intel.com>
> Subject: [dts] [PATCH V1] tests: add new features for compression test
>
> Signed-off-by: Xinfeng Zhao <xinfengx.zhao@intel.com>
> ---
> tests/TestSuite_compressdev_isal_pmd.py | 22 +++++++--
> tests/TestSuite_compressdev_qat_pmd.py | 61 +++++++++++++++++++++++-
> - tests/TestSuite_compressdev_zlib_pmd.py | 23 ++++++++--
> tests/compress_common.py | 45 +++++++++++++++---
> 4 files changed, 133 insertions(+), 18 deletions(-)
>
> diff --git a/tests/TestSuite_compressdev_isal_pmd.py
> b/tests/TestSuite_compressdev_isal_pmd.py
> index 8d7e22e..070eedb 100644
> --- a/tests/TestSuite_compressdev_isal_pmd.py
> +++ b/tests/TestSuite_compressdev_isal_pmd.py
> @@ -33,6 +33,7 @@
> import os
> from test_case import TestCase
> import json
> +import copy
> import compress_common as cc
>
> class TestCompressdevIsalPmd(TestCase):
> @@ -42,9 +43,12 @@ class TestCompressdevIsalPmd(TestCase):
> cc.default_eals.update({'w': "0000:00:00.0", "vdev": "compress_isal"})
> cc.default_opts.update({"driver-name": "compress_isal"})
> self._perf_result = dict()
> + self.eals = copy.deepcopy(cc.default_eals)
> + self.opts = copy.deepcopy(cc.default_opts)
>
> def set_up(self):
> - pass
> + cc.default_eals = copy.deepcopy(self.eals)
> + cc.default_opts = copy.deepcopy(self.opts)
>
> def prepare_dpdk(self):
> self.dut.send_expect(
> @@ -58,12 +62,22 @@ class TestCompressdevIsalPmd(TestCase):
>
> def test_isal_pmd_fixed_func(self):
> cc.default_opts.update({"huffman-enc": "fixed"})
> - result = cc.run_perf(self)
> - self._perf_result.update(result)
> + result = cc.run_compress_func(self)
>
> def test_isal_pmd_dynamic_func(self):
> cc.default_opts.update({"huffman-enc": "dynamic"})
> - result = cc.run_perf(self)
> + result = cc.run_compress_func(self)
> +
> + def test_isal_pmd_fixed_perf(self):
> + cc.default_opts.update({"huffman-enc": "fixed", "extended-input-sz":
> 3244032,
> + "max-num-sgl-segs": 1})
> + result = cc.run_compress_perf(self)
> + self._perf_result.update(result)
> +
> + def test_isal_pmd_dynamic_perf(self):
> + cc.default_opts.update({"huffman-enc": "dynamic", "extended-input-
> sz": 3244032,
> + "max-num-sgl-segs": 1})
> + result = cc.run_compress_perf(self)
> self._perf_result.update(result)
>
> def tear_down(self):
> diff --git a/tests/TestSuite_compressdev_qat_pmd.py
> b/tests/TestSuite_compressdev_qat_pmd.py
> index 40b3fac..696ad1d 100644
> --- a/tests/TestSuite_compressdev_qat_pmd.py
> +++ b/tests/TestSuite_compressdev_qat_pmd.py
> @@ -33,6 +33,7 @@
> import os
> from test_case import TestCase
> import json
> +import copy
> import compress_common as cc
>
>
> @@ -41,12 +42,16 @@ class TestCompressdevQatPmd(TestCase):
> def set_up_all(self):
> self.prepare_dpdk()
> cc.bind_qat_device(self, self.drivername)
> + cc.default_eals.update({"vdev": None})
> cc.default_opts.update({"driver-name": "compress_qat"})
> self.device_list = cc.get_qat_device_list(self)
> self._perf_result = dict()
> + self.eals = copy.deepcopy(cc.default_eals)
> + self.opts = copy.deepcopy(cc.default_opts)
>
> def set_up(self):
> - pass
> + cc.default_eals = copy.deepcopy(self.eals)
> + cc.default_opts = copy.deepcopy(self.opts)
>
> def prepare_dpdk(self):
> self.dut.send_expect(
> @@ -75,13 +80,61 @@ class TestCompressdevQatPmd(TestCase):
> def test_qat_pmd_fixed_func(self):
> cc.default_eals['w'] = ' -w '.join(self.get_perf_default_device())
> cc.default_opts.update({"huffman-enc": "fixed"})
> - result = cc.run_perf(self)
> - self._perf_result.update(result)
> + result = cc.run_compress_func(self)
>
> def test_qat_pmd_dynamic_func(self):
> cc.default_eals['w'] = ' -w '.join(self.get_perf_default_device())
> cc.default_opts.update({"huffman-enc": "dynamic"})
> - result = cc.run_perf(self)
> + result = cc.run_compress_func(self)
> +
> + def test_qat_pmd_big_sgl_fixed_func(self):
> + cc.default_eals['w'] = ' -w '.join(self.get_perf_default_device())
> + cc.default_opts.update({"huffman-enc": "fixed", "seg-sz": 1024,
> + "extended-input-sz": 1048576, "max-num-sgl-segs": 1003})
> + result = cc.run_compress_func(self)
> +
> + def test_qat_pmd_big_sgl_dynamic_func(self):
> + cc.default_eals['w'] = ' -w '.join(self.get_perf_default_device())
> + cc.default_opts.update({"huffman-enc": "dynamic", "seg-sz": 1024,
> + "extended-input-sz": 1048576, "max-num-sgl-segs": 1003})
> + result = cc.run_compress_func(self)
> +
> + def test_qat_pmd_big_seg_fixed_func(self):
> + cc.default_eals['w'] = ' -w '.join(self.get_perf_default_device())
> + cc.default_opts.update({"huffman-enc": "fixed", "seg-sz": 59460,
> + "extended-input-sz": 1048576, "max-num-sgl-segs": 18})
> + result = cc.run_compress_func(self)
> +
> + def test_qat_pmd_big_seg_dynamic_func(self):
> + cc.default_eals['w'] = ' -w '.join(self.get_perf_default_device())
> + cc.default_opts.update({"huffman-enc": "dynamic", "seg-sz": 59460,
> + "extended-input-sz": 1048576, "max-num-sgl-segs": 18})
> + result = cc.run_compress_func(self)
> +
> + def test_qat_pmd_external_mbufs_fixed_func(self):
> + cc.default_eals['w'] = ' -w '.join(self.get_perf_default_device())
> + cc.default_opts.update({"huffman-enc": "fixed", "max-num-sgl-segs":
> 16,
> + "seg-sz": 2048, "external-mbufs": '', "extended-input-sz": 300000})
> + result = cc.run_compress_func(self)
> +
> + def test_qat_pmd_external_mbufs_dynamic_func(self):
> + cc.default_eals['w'] = ' -w '.join(self.get_perf_default_device())
> + cc.default_opts.update({"huffman-enc": "dynamic", "max-num-sgl-
> segs": 16,
> + "seg-sz": 2048, "external-mbufs": '', "extended-input-sz": 300000})
> + result = cc.run_compress_func(self)
> +
> + def test_qat_pmd_fixed_perf(self):
> + cc.default_eals['w'] = ' -w '.join(self.get_perf_default_device())
> + cc.default_opts.update({"huffman-enc": "fixed", "extended-input-sz":
> 3244032,
> + "max-num-sgl-segs": 1})
> + result = cc.run_compress_perf(self)
> + self._perf_result.update(result)
> +
> + def test_qat_pmd_dynamic_perf(self):
> + cc.default_eals['w'] = ' -w '.join(self.get_perf_default_device())
> + cc.default_opts.update({"huffman-enc": "dynamic", "extended-input-
> sz": 3244032,
> + "max-num-sgl-segs": 1})
> + result = cc.run_compress_perf(self)
> self._perf_result.update(result)
>
> def tear_down(self):
> diff --git a/tests/TestSuite_compressdev_zlib_pmd.py
> b/tests/TestSuite_compressdev_zlib_pmd.py
> index 31d7194..ea935c2 100644
> --- a/tests/TestSuite_compressdev_zlib_pmd.py
> +++ b/tests/TestSuite_compressdev_zlib_pmd.py
> @@ -33,6 +33,7 @@
> import os
> from test_case import TestCase
> import json
> +import copy
> import compress_common as cc
>
> class TestCompressdevZlibPmd(TestCase):
> @@ -43,8 +44,12 @@ class TestCompressdevZlibPmd(TestCase):
> cc.default_opts.update({"driver-name": "compress_zlib"})
> self._perf_result = dict()
>
> + self.eals = copy.deepcopy(cc.default_eals)
> + self.opts = copy.deepcopy(cc.default_opts)
> +
> def set_up(self):
> - pass
> + cc.default_eals = copy.deepcopy(self.eals)
> + cc.default_opts = copy.deepcopy(self.opts)
>
> def prepare_dpdk(self):
> self.dut.send_expect(
> @@ -58,12 +63,22 @@ class TestCompressdevZlibPmd(TestCase):
>
> def test_zlib_pmd_fixed_func(self):
> cc.default_opts.update({"huffman-enc": "fixed"})
> - result = cc.run_perf(self)
> - self._perf_result.update(result)
> + result = cc.run_compress_func(self)
>
> def test_zlib_pmd_dynamic_func(self):
> cc.default_opts.update({"huffman-enc": "dynamic"})
> - result = cc.run_perf(self)
> + result = cc.run_compress_func(self)
> +
> + def test_zlib_pmd_fixed_perf(self):
> + cc.default_opts.update({"huffman-enc": "fixed", "extended-input-sz":
> 3244032,
> + "max-num-sgl-segs": 1})
> + result = cc.run_compress_perf(self)
> + self._perf_result.update(result)
> +
> + def test_zlib_pmd_dynamic_perf(self):
> + cc.default_opts.update({"huffman-enc": "dynamic", "extended-input-
> sz": 3244032,
> + "max-num-sgl-segs": 1})
> + result = cc.run_compress_perf(self)
> self._perf_result.update(result)
>
> def tear_down(self):
> diff --git a/tests/compress_common.py b/tests/compress_common.py index
> 0a3c7ff..5d681e4 100644
> --- a/tests/compress_common.py
> +++ b/tests/compress_common.py
> @@ -39,12 +39,12 @@ conf = SuiteConf('compressdev_sample')
>
> default_opts = {
> "driver-name": None,
> - "seg-sz": 2048,
> + "seg-sz": None,
> "burst-sz": None,
> "compress-level": "1:1:9",
> "extended-input-sz": None,
> "num-iter": 10,
> - "max-num-sgl-segs": 16,
> + "max-num-sgl-segs": None,
> "external-mbufs": None,
> "huffman-enc": "dynamic",
> "ptest": None,
> @@ -52,7 +52,7 @@ default_opts = {
> }
>
> default_eals = {
> - "l": "0-6",
> + "l": "0-3",
> "c": None,
> "n": None,
> "w": None,
> @@ -136,12 +136,11 @@ def run_unit(test_case, eal={}):
>
> test_case.verify("Test OK" in out, "Test Failed")
>
> -def run_perf(test_case, eal={}, opt={}):
> +def run_compress_func(test_case, eal={}, opt={}):
> eal_str = get_opt_str(test_case, default_eals, eal)
> opt_str = get_opt_str(test_case, default_opts, opt)
> input_file = get_input_file(test_case)
>
> - result = {}
> for each_file in input_file:
> test_case.logger.info("Testing file: {}".format(each_file))
>
> @@ -157,12 +156,46 @@ def run_perf(test_case, eal={}, opt={}):
> test_case.verify("failed" not in out and "FATAL" not in out,
> "Test Failed: Parameter or the value error")
>
> + res = parse_perf_output(out)
> + test_case.verify(res, "Test Failed: can't get performance
> + data")
> +
> +def run_compress_perf(test_case, eal={}, opt={}):
> + eal_str = get_opt_str(test_case, default_eals, eal)
> + opt_str = get_opt_str(test_case, default_opts, opt)
> + input_file = get_input_file(test_case)
> +
> + result = {}
> + for each_file in input_file:
> + file_name = os.path.basename(each_file).split('.')[0]
> + if file_name == "calgary":
> + perf_file = each_file
> + break
> + else:
> + perf_file = ''
> +
> + test_case.verify(perf_file, "Test Failed: can not found the test
> + file: calgary")
> +
> + for each_seg in [1, 2, 4, 8, 16, 32]:
> + test_case.logger.info("Testing file: {}, seg-sz: {}".format(perf_file,
> each_seg * 1024))
> + cmdline = "./{target}/app/dpdk-test-compress-perf {eal}\
> + -- --input-file {file} --seg-sz {seg} {opt}"
> +
> + cmdline = cmdline.format(target = test_case.dut.target,
> + eal = eal_str,
> + file = perf_file,
> + seg = each_seg * 1024,
> + opt = opt_str)
> +
> + out = test_case.dut.send_expect(cmdline, "# ", 300)
> + test_case.verify("failed" not in out and "FATAL" not in out,
> + "Test Failed: Parameter or the value error")
> +
> case_name = test_case._suite_result.test_case
> res = format_perf_data(case_name, out)
> test_case.verify(res, "Test Failed: can't get performance data")
>
> file_name = os.path.basename(each_file).split('.')[0]
> - result.update({case_name + '_' + file_name: res})
> + result.update({case_name + '_' + str(each_seg) + 'k': res})
>
> return result
>
> --
> 2.17.1
^ permalink raw reply [flat|nested] 5+ messages in thread