From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BAE3EA04F7; Fri, 20 Dec 2019 09:02:59 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7A0B9F90; Fri, 20 Dec 2019 09:02:59 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 83E05235 for ; Fri, 20 Dec 2019 09:02:57 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Dec 2019 00:02:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,335,1571727600"; d="scan'208";a="222450498" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga001.fm.intel.com with ESMTP; 20 Dec 2019 00:02:56 -0800 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 20 Dec 2019 00:02:56 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 20 Dec 2019 00:02:55 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.19]) by shsmsx102.ccr.corp.intel.com ([169.254.2.109]) with mapi id 14.03.0439.000; Fri, 20 Dec 2019 16:02:53 +0800 From: "Tu, Lijuan" To: "Zhao, XinfengX" , "dts@dpdk.org" CC: "Zhao, XinfengX" Thread-Topic: [dts] [PATCH V1] tests: add new features for compression test Thread-Index: AQHVtKou369e2oL7j0CBJkY4BKRGVKfCrmfg Date: Fri, 20 Dec 2019 08:02:53 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB8A1A7@SHSMSX101.ccr.corp.intel.com> References: <1576537580-298524-1-git-send-email-xinfengx.zhao@intel.com> <1576537580-298524-2-git-send-email-xinfengx.zhao@intel.com> In-Reply-To: <1576537580-298524-2-git-send-email-xinfengx.zhao@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V1] tests: add new features for compression test X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" 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 > Subject: [dts] [PATCH V1] tests: add new features for compression test >=20 > Signed-off-by: Xinfeng Zhao > --- > 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(-) >=20 > 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 >=20 > class TestCompressdevIsalPmd(TestCase): > @@ -42,9 +43,12 @@ class TestCompressdevIsalPmd(TestCase): > cc.default_eals.update({'w': "0000:00:00.0", "vdev": "compress_i= sal"}) > cc.default_opts.update({"driver-name": "compress_isal"}) > self._perf_result =3D dict() > + self.eals =3D copy.deepcopy(cc.default_eals) > + self.opts =3D copy.deepcopy(cc.default_opts) >=20 > def set_up(self): > - pass > + cc.default_eals =3D copy.deepcopy(self.eals) > + cc.default_opts =3D copy.deepcopy(self.opts) >=20 > def prepare_dpdk(self): > self.dut.send_expect( > @@ -58,12 +62,22 @@ class TestCompressdevIsalPmd(TestCase): >=20 > def test_isal_pmd_fixed_func(self): > cc.default_opts.update({"huffman-enc": "fixed"}) > - result =3D cc.run_perf(self) > - self._perf_result.update(result) > + result =3D cc.run_compress_func(self) >=20 > def test_isal_pmd_dynamic_func(self): > cc.default_opts.update({"huffman-enc": "dynamic"}) > - result =3D cc.run_perf(self) > + result =3D 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 =3D 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-inpu= t- > sz": 3244032, > + "max-num-sgl-segs": 1}) > + result =3D cc.run_compress_perf(self) > self._perf_result.update(result) >=20 > 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 >=20 >=20 > @@ -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 =3D cc.get_qat_device_list(self) > self._perf_result =3D dict() > + self.eals =3D copy.deepcopy(cc.default_eals) > + self.opts =3D copy.deepcopy(cc.default_opts) >=20 > def set_up(self): > - pass > + cc.default_eals =3D copy.deepcopy(self.eals) > + cc.default_opts =3D copy.deepcopy(self.opts) >=20 > 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'] =3D ' -w '.join(self.get_perf_default_devic= e()) > cc.default_opts.update({"huffman-enc": "fixed"}) > - result =3D cc.run_perf(self) > - self._perf_result.update(result) > + result =3D cc.run_compress_func(self) >=20 > def test_qat_pmd_dynamic_func(self): > cc.default_eals['w'] =3D ' -w '.join(self.get_perf_default_devic= e()) > cc.default_opts.update({"huffman-enc": "dynamic"}) > - result =3D cc.run_perf(self) > + result =3D cc.run_compress_func(self) > + > + def test_qat_pmd_big_sgl_fixed_func(self): > + cc.default_eals['w'] =3D ' -w '.join(self.get_perf_default_devic= e()) > + cc.default_opts.update({"huffman-enc": "fixed", "seg-sz": 1024, > + "extended-input-sz": 1048576, "max-num-sgl-segs": 1003}) > + result =3D cc.run_compress_func(self) > + > + def test_qat_pmd_big_sgl_dynamic_func(self): > + cc.default_eals['w'] =3D ' -w '.join(self.get_perf_default_devic= e()) > + cc.default_opts.update({"huffman-enc": "dynamic", "seg-sz": 1024= , > + "extended-input-sz": 1048576, "max-num-sgl-segs": 1003}) > + result =3D cc.run_compress_func(self) > + > + def test_qat_pmd_big_seg_fixed_func(self): > + cc.default_eals['w'] =3D ' -w '.join(self.get_perf_default_devic= e()) > + cc.default_opts.update({"huffman-enc": "fixed", "seg-sz": 59460, > + "extended-input-sz": 1048576, "max-num-sgl-segs": 18}) > + result =3D cc.run_compress_func(self) > + > + def test_qat_pmd_big_seg_dynamic_func(self): > + cc.default_eals['w'] =3D ' -w '.join(self.get_perf_default_devic= e()) > + cc.default_opts.update({"huffman-enc": "dynamic", "seg-sz": 5946= 0, > + "extended-input-sz": 1048576, "max-num-sgl-segs": 18}) > + result =3D cc.run_compress_func(self) > + > + def test_qat_pmd_external_mbufs_fixed_func(self): > + cc.default_eals['w'] =3D ' -w '.join(self.get_perf_default_devic= e()) > + cc.default_opts.update({"huffman-enc": "fixed", "max-num-sgl-seg= s": > 16, > + "seg-sz": 2048, "external-mbufs": '', "extended-input-sz": 3= 00000}) > + result =3D cc.run_compress_func(self) > + > + def test_qat_pmd_external_mbufs_dynamic_func(self): > + cc.default_eals['w'] =3D ' -w '.join(self.get_perf_default_devic= e()) > + cc.default_opts.update({"huffman-enc": "dynamic", "max-num-sgl- > segs": 16, > + "seg-sz": 2048, "external-mbufs": '', "extended-input-sz": 3= 00000}) > + result =3D cc.run_compress_func(self) > + > + def test_qat_pmd_fixed_perf(self): > + cc.default_eals['w'] =3D ' -w '.join(self.get_perf_default_devic= e()) > + cc.default_opts.update({"huffman-enc": "fixed", "extended-input-= sz": > 3244032, > + "max-num-sgl-segs": 1}) > + result =3D cc.run_compress_perf(self) > + self._perf_result.update(result) > + > + def test_qat_pmd_dynamic_perf(self): > + cc.default_eals['w'] =3D ' -w '.join(self.get_perf_default_devic= e()) > + cc.default_opts.update({"huffman-enc": "dynamic", "extended-inpu= t- > sz": 3244032, > + "max-num-sgl-segs": 1}) > + result =3D cc.run_compress_perf(self) > self._perf_result.update(result) >=20 > 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 >=20 > class TestCompressdevZlibPmd(TestCase): > @@ -43,8 +44,12 @@ class TestCompressdevZlibPmd(TestCase): > cc.default_opts.update({"driver-name": "compress_zlib"}) > self._perf_result =3D dict() >=20 > + self.eals =3D copy.deepcopy(cc.default_eals) > + self.opts =3D copy.deepcopy(cc.default_opts) > + > def set_up(self): > - pass > + cc.default_eals =3D copy.deepcopy(self.eals) > + cc.default_opts =3D copy.deepcopy(self.opts) >=20 > def prepare_dpdk(self): > self.dut.send_expect( > @@ -58,12 +63,22 @@ class TestCompressdevZlibPmd(TestCase): >=20 > def test_zlib_pmd_fixed_func(self): > cc.default_opts.update({"huffman-enc": "fixed"}) > - result =3D cc.run_perf(self) > - self._perf_result.update(result) > + result =3D cc.run_compress_func(self) >=20 > def test_zlib_pmd_dynamic_func(self): > cc.default_opts.update({"huffman-enc": "dynamic"}) > - result =3D cc.run_perf(self) > + result =3D 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 =3D 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-inpu= t- > sz": 3244032, > + "max-num-sgl-segs": 1}) > + result =3D cc.run_compress_perf(self) > self._perf_result.update(result) >=20 > 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 =3D SuiteConf('compressdev_sample') >=20 > default_opts =3D { > "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 =3D { > } >=20 > default_eals =3D { > - "l": "0-6", > + "l": "0-3", > "c": None, > "n": None, > "w": None, > @@ -136,12 +136,11 @@ def run_unit(test_case, eal=3D{}): >=20 > test_case.verify("Test OK" in out, "Test Failed") >=20 > -def run_perf(test_case, eal=3D{}, opt=3D{}): > +def run_compress_func(test_case, eal=3D{}, opt=3D{}): > eal_str =3D get_opt_str(test_case, default_eals, eal) > opt_str =3D get_opt_str(test_case, default_opts, opt) > input_file =3D get_input_file(test_case) >=20 > - result =3D {} > for each_file in input_file: > test_case.logger.info("Testing file: {}".format(each_file)) >=20 > @@ -157,12 +156,46 @@ def run_perf(test_case, eal=3D{}, opt=3D{}): > test_case.verify("failed" not in out and "FATAL" not in out, > "Test Failed: Parameter or the value error") >=20 > + res =3D parse_perf_output(out) > + test_case.verify(res, "Test Failed: can't get performance > + data") > + > +def run_compress_perf(test_case, eal=3D{}, opt=3D{}): > + eal_str =3D get_opt_str(test_case, default_eals, eal) > + opt_str =3D get_opt_str(test_case, default_opts, opt) > + input_file =3D get_input_file(test_case) > + > + result =3D {} > + for each_file in input_file: > + file_name =3D os.path.basename(each_file).split('.')[0] > + if file_name =3D=3D "calgary": > + perf_file =3D each_file > + break > + else: > + perf_file =3D '' > + > + 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 =3D "./{target}/app/dpdk-test-compress-perf {eal}\ > + -- --input-file {file} --seg-sz {seg} {opt}" > + > + cmdline =3D cmdline.format(target =3D test_case.dut.target, > + eal =3D eal_str, > + file =3D perf_file, > + seg =3D each_seg * 1024, > + opt =3D opt_str) > + > + out =3D 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 =3D test_case._suite_result.test_case > res =3D format_perf_data(case_name, out) > test_case.verify(res, "Test Failed: can't get performance data") >=20 > file_name =3D os.path.basename(each_file).split('.')[0] > - result.update({case_name + '_' + file_name: res}) > + result.update({case_name + '_' + str(each_seg) + 'k': res}) >=20 > return result >=20 > -- > 2.17.1