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 22C8AA04FA; Tue, 17 Dec 2019 08:18:11 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 125791BEDE; Tue, 17 Dec 2019 08:18:11 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 5342A1BEDE for ; Tue, 17 Dec 2019 08:18:09 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Dec 2019 23:18:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,324,1571727600"; d="scan'208";a="240309027" Received: from unknown (HELO dpdk-xinfengx-dut242.sh.intel.com) ([10.67.116.161]) by fmsmga004.fm.intel.com with ESMTP; 16 Dec 2019 23:18:07 -0800 From: Xinfeng Zhao To: dts@dpdk.org Cc: Xinfeng Zhao Date: Tue, 17 Dec 2019 07:06:20 +0800 Message-Id: <1576537580-298524-2-git-send-email-xinfengx.zhao@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1576537580-298524-1-git-send-email-xinfengx.zhao@intel.com> References: <1576537580-298524-1-git-send-email-xinfengx.zhao@intel.com> Subject: [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" 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(-) 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