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 878CFA04FB; Tue, 17 Dec 2019 09:26:45 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 60119374C; Tue, 17 Dec 2019 09:26:45 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id C8C1E34EF for ; Tue, 17 Dec 2019 09:26:42 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Dec 2019 00:26:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,324,1571727600"; d="scan'208";a="266506769" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by FMSMGA003.fm.intel.com with ESMTP; 17 Dec 2019 00:26:41 -0800 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 17 Dec 2019 00:26:41 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 17 Dec 2019 00:26:40 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.29]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.214]) with mapi id 14.03.0439.000; Tue, 17 Dec 2019 16:26:39 +0800 From: "Wan, Zhe" To: "Zhao, XinfengX" , "dts@dpdk.org" CC: "Zhao, XinfengX" Thread-Topic: [dts] [PATCH V1] tests: add new features for compression test Thread-Index: AQHVtKouvGCCCw1nq0y4dnKSNFeWAqe9/erA Date: Tue, 17 Dec 2019 08:26:38 +0000 Message-ID: <861C16A15685B44AA870C0D2A97B60458A29F36C@SHSMSX103.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: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDY1NWViZTEtODQ4OS00OTk5LWEyZTktY2M3N2YxOTUxMTUwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiNzB1ekpCWDRFXC9LbEJuTEVHUFF5MGs5OVhzTmdxKzIxMWkwdkRjTXgzQ1ZGY3dSSmM5SFVsUXhrcEJHUXBUa1IifQ== 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="iso-2022-jp" 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" Acked-by: Wan, Zhe Thanks! BR, Wan,Zhe -----Original Message----- From: dts On Behalf Of Xinfeng Zhao Sent: 2019=1B$BG/=1B(B12=1B$B7n=1B(B17=1B$BF|=1B(B 7:06 To: dts@dpdk.org Cc: Zhao, XinfengX Subject: [dts] [PATCH V1] tests: add new features for compression test Signed-off-by: Xinfeng Zhao --- tests/TestSuite_compressdev_isal_pmd.py | 22 +++++++-- tests/TestSuite_co= mpressdev_qat_pmd.py | 61 +++++++++++++++++++++++-- tests/TestSuite_compr= essdev_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_comp= ressdev_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_isa= l"}) 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-input-= 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_compr= essdev_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_device(= )) 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_device(= )) 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_device(= )) + 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_device(= )) + 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_device(= )) + 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_device(= )) + cc.default_opts.update({"huffman-enc": "dynamic", "seg-sz": 59460, + "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_device(= )) + cc.default_opts.update({"huffman-enc": "fixed", "max-num-sgl-segs"= : 16, + "seg-sz": 2048, "external-mbufs": '', "extended-input-sz": 300= 000}) + 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_device(= )) + cc.default_opts.update({"huffman-enc": "dynamic", "max-num-sgl-seg= s": 16, + "seg-sz": 2048, "external-mbufs": '', "extended-input-sz": 300= 000}) + 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_device(= )) + 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_device(= )) + cc.default_opts.update({"huffman-enc": "dynamic", "extended-input-= 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_comp= ressdev_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-input-= 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 0a3c= 7ff..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=20 + 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=20 + file: calgary") + + for each_seg in [1, 2, 4, 8, 16, 32]: + test_case.logger.info("Testing file: {}, seg-sz: {}".format(perf_f= ile, 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