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 A40E3A04C2; Mon, 25 Nov 2019 09:38:55 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 905282BCE; Mon, 25 Nov 2019 09:38:55 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id AB79028EE for ; Mon, 25 Nov 2019 09:38:53 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Nov 2019 00:38:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,241,1571727600"; d="scan'208";a="291313875" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga001.jf.intel.com with ESMTP; 25 Nov 2019 00:38:52 -0800 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 25 Nov 2019 00:38:52 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 25 Nov 2019 00:38:52 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.60]) by shsmsx102.ccr.corp.intel.com ([169.254.2.108]) with mapi id 14.03.0439.000; Mon, 25 Nov 2019 16:38:50 +0800 From: "Wan, Zhe" To: "Zhao, XinfengX" , "dts@dpdk.org" CC: "Zhao, XinfengX" Thread-Topic: [dts] [PATCH V1 2/5] tests: add suite for compressdev qat pmd test Thread-Index: AQHVo2CXRFtD3wgFVE+b1mDfEic30KebkLUg Date: Mon, 25 Nov 2019 08:38:50 +0000 Message-ID: <861C16A15685B44AA870C0D2A97B60458A2891A7@SHSMSX103.ccr.corp.intel.com> References: <1574634769-325555-1-git-send-email-xinfengx.zhao@intel.com> <1574634769-325555-2-git-send-email-xinfengx.zhao@intel.com> In-Reply-To: <1574634769-325555-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWRhZmUzMGUtMDMyMS00MmRhLWFmYmItMjQxNzNiNDFlNzAyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMnE1d0lBcFFSQnhmcE5UQUZmNWlLNXJTVU5SdHRFNVZiKzRtUzJqYlhXeTRiZmpSMlhMc2U4YU5uK20zR2xOYyJ9 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 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" Acked-by: Wan, Zhe -----Original Message----- From: dts On Behalf Of Xinfeng Zhao Sent: 2019=1B$BG/=1B(B11=1B$B7n=1B(B25=1B$BF|=1B(B 6:33 To: dts@dpdk.org Cc: Zhao, XinfengX Subject: [dts] [PATCH V1 2/5] tests: add suite for compressdev qat pmd test 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_compr= essdev_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 #=20 +modification, are permitted provided that the following conditions #=20 +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 #=20 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #=20 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR #=20 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT #=20 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, #=20 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT #=20 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, #=20 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY #=20 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT #=20 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #=20 +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 =3D cc.get_qat_device_list(self) + self._perf_result =3D dict() + + def set_up(self): + pass + + def prepare_dpdk(self): + self.dut.send_expect( + "sed -i 's/CONFIG_RTE_COMPRESSDEV_TEST=3Dn$/CONFIG_RTE_COMPRES= SDEV_TEST=3Dy/' config/common_base", "# ") + self.dut.send_expect( + "sed -i 's/CONFIG_RTE_LIBRTE_PMD_QAT_SYM=3Dn$/CONFIG_RTE_LIBRT= E_PMD_QAT_SYM=3Dy/' config/common_base", "# ") + self.dut.build_install_dpdk(self.dut.target) + + def get_perf_default_device(self, dev_num=3D3): + perf_device_list =3D [] + 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 +=3D list(set(self.device_list). + difference(set(perf_device_list)))[:dev_num-len(perf_d= evice_list)] + else: + perf_device_list =3D perf_device_list[:dev_num] + + return perf_device_list + + def test_qat_pmd_unit_test(self): + cc.default_eals['w'] =3D self.device_list[0] + cc.run_unit(self) + + 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) + + 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) + 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=3Dy$/CONFIG_RTE_COMPRES= SDEV_TEST=3Dn/' config/common_base", "# ") + self.dut.send_expect( + "sed -i 's/CONFIG_RTE_LIBRTE_PMD_QAT_SYM=3Dy$/CONFIG_RTE_LIBRT= E_PMD_QAT_SYM=3Dn/' 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=3D4) -- 2.7.4