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 79E05A04C2; Mon, 25 Nov 2019 08:18:28 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6139A378E; Mon, 25 Nov 2019 08:18:28 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 8FA462952 for ; Mon, 25 Nov 2019 08:18:26 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Nov 2019 23:18:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,240,1571727600"; d="scan'208";a="408221461" Received: from unknown (HELO dpdk-xinfengx-dut242.sh.intel.com) ([10.67.116.161]) by fmsmga005.fm.intel.com with ESMTP; 24 Nov 2019 23:18:25 -0800 From: Xinfeng Zhao To: dts@dpdk.org Cc: Xinfeng Zhao Date: Mon, 25 Nov 2019 06:32:46 +0800 Message-Id: <1574634769-325555-2-git-send-email-xinfengx.zhao@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1574634769-325555-1-git-send-email-xinfengx.zhao@intel.com> References: <1574634769-325555-1-git-send-email-xinfengx.zhao@intel.com> Subject: [dts] [PATCH V1 2/5] tests: add suite for compressdev qat pmd 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_qat_pmd.py | 102 +++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 tests/TestSuite_compressdev_qat_pmd.py diff --git a/tests/TestSuite_compressdev_qat_pmd.py b/tests/TestSuite_compressdev_qat_pmd.py new file mode 100644 index 0000000..40b3fac --- /dev/null +++ b/tests/TestSuite_compressdev_qat_pmd.py @@ -0,0 +1,102 @@ +# BSD LICENSE +# +# Copyright(c) 2019 Intel Corporation. All rights reserved. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Intel Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +import os +from test_case import TestCase +import json +import compress_common as cc + + +class TestCompressdevQatPmd(TestCase): + + def set_up_all(self): + self.prepare_dpdk() + cc.bind_qat_device(self, self.drivername) + cc.default_opts.update({"driver-name": "compress_qat"}) + self.device_list = cc.get_qat_device_list(self) + self._perf_result = dict() + + def set_up(self): + pass + + def prepare_dpdk(self): + self.dut.send_expect( + "sed -i 's/CONFIG_RTE_COMPRESSDEV_TEST=n$/CONFIG_RTE_COMPRESSDEV_TEST=y/' config/common_base", "# ") + self.dut.send_expect( + "sed -i 's/CONFIG_RTE_LIBRTE_PMD_QAT_SYM=n$/CONFIG_RTE_LIBRTE_PMD_QAT_SYM=y/' config/common_base", "# ") + self.dut.build_install_dpdk(self.dut.target) + + def get_perf_default_device(self, dev_num=3): + perf_device_list = [] + for each in self.device_list: + if each.endswith("01.0"): + perf_device_list.append(each) + if len(perf_device_list) < dev_num: + perf_device_list += list(set(self.device_list). + difference(set(perf_device_list)))[:dev_num-len(perf_device_list)] + else: + perf_device_list = perf_device_list[:dev_num] + + return perf_device_list + + def test_qat_pmd_unit_test(self): + cc.default_eals['w'] = self.device_list[0] + cc.run_unit(self) + + 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) + + 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) + self._perf_result.update(result) + + def tear_down(self): + pass + + def tear_down_all(self): + self.dut.kill_all() + + self.dut.send_expect( + "sed -i 's/CONFIG_RTE_COMPRESSDEV_TEST=y$/CONFIG_RTE_COMPRESSDEV_TEST=n/' config/common_base", "# ") + self.dut.send_expect( + "sed -i 's/CONFIG_RTE_LIBRTE_PMD_QAT_SYM=y$/CONFIG_RTE_LIBRTE_PMD_QAT_SYM=n/' config/common_base", "# ") + self.dut.build_install_dpdk(self.dut.target) + + if not self._perf_result: + return + with open(self.logger.log_path + "/" + self.suite_name + ".json", "w") as fv: + json.dump(self._perf_result, fv, indent=4) -- 2.7.4