From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 5624A3772 for ; Tue, 12 Mar 2019 07:36:22 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Mar 2019 23:36:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,470,1544515200"; d="scan'208";a="133319817" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga003.jf.intel.com with ESMTP; 11 Mar 2019 23:36:20 -0700 Received: from fmsmsx161.amr.corp.intel.com (10.18.125.9) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 11 Mar 2019 23:36:20 -0700 Received: from shsmsx153.ccr.corp.intel.com (10.239.6.53) by FMSMSX161.amr.corp.intel.com (10.18.125.9) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 11 Mar 2019 23:36:20 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.163]) by SHSMSX153.ccr.corp.intel.com ([169.254.12.121]) with mapi id 14.03.0415.000; Tue, 12 Mar 2019 14:36:17 +0800 From: "Zhao, XinfengX" To: "dts@dpdk.org" Thread-Topic: [dts] [PATCH] add the cryptodev unit-test suite and conf Thread-Index: AQHU18+CAoevkeFSc0uWkRCjMUKrcaYHi67w Date: Tue, 12 Mar 2019 06:36:16 +0000 Message-ID: <44051B25D8C8784BB77FFB604D6A70CA12033926@shsmsx102.ccr.corp.intel.com> References: <1551720017-309432-1-git-send-email-xinfengx.zhao@intel.com> <9DEEADBC57E43F4DA73B571777FECECA41C6B813@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <9DEEADBC57E43F4DA73B571777FECECA41C6B813@SHSMSX104.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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] add the cryptodev unit-test suite and conf 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: , X-List-Received-Date: Tue, 12 Mar 2019 06:36:23 -0000 Tested-by: Zhao, XinfengX -----Original Message----- From: Chen, Zhaoyan=20 Sent: Monday, March 11, 2019 1:59 PM To: Zhao, XinfengX ; dts@dpdk.org Cc: Zhao, XinfengX ; Chen, Zhaoyan Subject: RE: [dts] [PATCH] add the cryptodev unit-test suite and conf acked-by: Zhaoyan Chen Regards, Zhaoyan Chen > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Xinfeng Zhao > Sent: Tuesday, March 5, 2019 1:20 AM > To: dts@dpdk.org > Cc: Zhao, XinfengX > Subject: [dts] [PATCH] add the cryptodev unit-test suite and conf >=20 > Signed-off-by: Xinfeng Zhao > --- > conf/unit_tests_cryptodev_func.cfg | 8 ++ > tests/TestSuite_unit_tests_cryptodev.py | 170 ---------------------= ------ > tests/TestSuite_unit_tests_cryptodev_func.py | 137=20 > +++++++++++++++++++++ > 3 files changed, 145 insertions(+), 170 deletions(-) create mode=20 > 100644 conf/unit_tests_cryptodev_func.cfg > delete mode 100644 tests/TestSuite_unit_tests_cryptodev.py > create mode 100644 tests/TestSuite_unit_tests_cryptodev_func.py >=20 > diff --git a/conf/unit_tests_cryptodev_func.cfg=20 > b/conf/unit_tests_cryptodev_func.cfg > new file mode 100644 > index 0000000..9b80025 > --- /dev/null > +++ b/conf/unit_tests_cryptodev_func.cfg > @@ -0,0 +1,8 @@ > +[suite] > +# Cryptodev common options qat device id crypto_dev_id=3D"37c9" > + > +# eal config > +l=3D"9,10,66" > +socket-mem=3D"2048,0 --legacy-mem" > +n=3D6 > \ No newline at end of file > diff --git a/tests/TestSuite_unit_tests_cryptodev.py > b/tests/TestSuite_unit_tests_cryptodev.py > deleted file mode 100644 > index db6552e..0000000 > --- a/tests/TestSuite_unit_tests_cryptodev.py > +++ /dev/null > @@ -1,170 +0,0 @@ > -# BSD LICENSE > -# > -# Copyright(c) 2016-2017 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 -# = 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=20 > FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE=20 > COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=20 > INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES=20 > (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR=20 > SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION)=20 > HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT,=20 > STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE)=20 > ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED=20 > OF THE POSSIBILITY OF SUCH DAMAGE. > - > -import utils > -from test_case import TestCase > - > - > -class UnitTestsCryptodev(TestCase): > - > - def set_up_all(self): > - > - self.core_config =3D "1S/2C/1T" > - self.number_of_ports =3D 1 > - self.dut_ports =3D self.dut.get_ports(self.nic) > - self.verify(len(self.dut_ports) >=3D self.number_of_ports, > - "Not enough ports for " + self.nic) > - self.ports_socket =3D self.dut.get_numa_id(self.dut_ports[0]) > - > - self.logger.info("core config =3D " + self.core_config) > - self.logger.info("number of ports =3D " + str(self.number_of_por= ts)) > - self.logger.info("dut ports =3D " + str(self.dut_ports)) > - self.logger.info("ports_socket =3D " + str(self.ports_socket)) > - > - self.core_mask =3D utils.create_mask(self.dut.get_core_list( > - self.core_config, > - socket=3Dself.ports_socket)) > - self.port_mask =3D utils.create_mask([self.dut_ports[0]]) > - > - self.tx_port =3D self.tester.get_local_port(self.dut_ports[0]) > - self.rx_port =3D self.tester.get_local_port(self.dut_ports[0]) > - > - self.tx_interface =3D self.tester.get_interface(self.tx_port) > - self.rx_interface =3D self.tester.get_interface(self.rx_port) > - > - self.logger.info("core mask =3D " + self.core_mask) > - self.logger.info("port mask =3D " + self.port_mask) > - self.logger.info("tx interface =3D " + self.tx_interface) > - self.logger.info("rx interface =3D " + self.rx_interface) > - > - # Rebuild the dpdk with cryptodev pmds CONFIG_RTE_LIBRTE_PMD_ZUC= =3Dn > - self.dut.send_expect("export > AESNI_MULTI_BUFFER_LIB_PATH=3D/root/ipsec_043/code/", "#") > - self.dut.send_expect("export > LIBSSO_SNOW3G_PATH=3D/root/libsso_snow3g/snow3g/", "#") > - self.dut.send_expect("export LIBSSO_ZUC_PATH=3D/root/libsso_zuc.= 1.0.1.1- > 8/zuc", "#") > - self.dut.send_expect("export > LIBSSO_KASUMI_PATH=3D/root/LibSSO_0_3_1/isg_cid-wireless_libs/ciphers/ka > sumi/", > "#") > - self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_QAT=3Dn$/CONFIG_RTE_LIBRTE_PMD_QAT=3Dy/' > config/common_base", "# ") > - self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_AESNI_GCM=3Dn$/CONFIG_RTE_LIBRTE_PMD_AESNI_G > CM=3Dy/' config/common_base", "# ") > - self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO=3Dn$/CONFIG_RTE_LIBRTE_PMD_NULL_ > CRYPTO=3Dy/' config/common_base", "# ") > - self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_SNOW3G=3Dn$/CONFIG_RTE_LIBRTE_PMD_SNOW3G=3Dy > /' config/common_base", "# ") > - self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_KASUMI=3Dn$/CONFIG_RTE_LIBRTE_PMD_KASUMI=3Dy/' > config/common_base", "# ") > - self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_OPENSSL=3Dn$/CONFIG_RTE_LIBRTE_PMD_OPENSSL=3Dy > /' config/common_base", "# ") > - self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_AESNI_MB=3Dn$/CONFIG_RTE_LIBRTE_PMD_AESNI_MB > =3Dy/' config/common_base", "# ") > - self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_ZUC=3Dn$/CONFIG_RTE_LIBRTE_PMD_ZUC=3Dy/' > config/common_base", "# ") > - self.dut.skip_setup =3D False > - self.dut.build_install_dpdk(self.dut.target) > - > - # Bind QAT VF devices > - out =3D self.dut.send_expect("lspci -d:443|awk '{print $1}'", "#= ", 10) > - self.dut.send_expect('echo "8086 0443" > > /sys/bus/pci/drivers/igb_uio/new_id', "# ", 10) > - for line in out.replace("\r", "\n").replace("\n\n", "\n").split(= "\n"): > - cmd =3D "echo 0000:{} > > /sys/bus/pci/devices/0000\:{}/driver/unbind".format(line, line.replace(":= ", "\:")) > - self.dut.send_expect(cmd, "# ", 10) > - cmd =3D "echo 0000:{} > /sys/bus/pci/drivers/igb_uio/bind".f= ormat(line) > - self.dut.send_expect(cmd, "# ", 10) > - > - def set_up(self): > - pass > - > - def tear_down(self): > - self.dut.kill_all() > - > - def tear_down_all(self): > - self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_QAT=3Dy$/CONFIG_RTE_LIBRTE_PMD_QAT=3Dn/' > config/common_base", "# ") > - self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_AESNI_GCM=3Dy$/CONFIG_RTE_LIBRTE_PMD_AESNI_G > CM=3Dn/' config/common_base", "# ") > - self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO=3Dy$/CONFIG_RTE_LIBRTE_PMD_NULL_ > CRYPTO=3Dn/' config/common_base", "# ") > - self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_SNOW3G=3Dy$/CONFIG_RTE_LIBRTE_PMD_SNOW3G=3Dn > /' config/common_base", "# ") > - self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_KASUMI=3Dy$/CONFIG_RTE_LIBRTE_PMD_KASUMI=3Dn/' > config/common_base", "# ") > - self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_OPENSSL=3Dy$/CONFIG_RTE_LIBRTE_PMD_OPENSSL=3Dn > /' config/common_base", "# ") > - self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_AESNI_MB=3Dy$/CONFIG_RTE_LIBRTE_PMD_AESNI_MB > =3Dn/' config/common_base", "# ") > - self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_ZUC=3Dy$/CONFIG_RTE_LIBRTE_PMD_ZUC=3Dn/' > config/common_base", "# ") > - self.dut.build_install_dpdk(self.dut.target) > - > - def test_cryptodev_qat_autotest(self): > - self.__run_unit_test("cryptodev_qat_autotest") > - > - def test_cryptodev_qat_perftest(self): > - self.__run_unit_test("cryptodev_qat_perftest") > - > - def test_cryptodev_aesni_mb_perftest(self): > - self.__run_unit_test("cryptodev_aesni_mb_perftest") > - > - def test_cryptodev_sw_snow3g_perftest(self): > - self.__run_unit_test("cryptodev_sw_snow3g_perftest") > - > - def test_cryptodev_qat_snow3g_perftest(self): > - self.__run_unit_test("cryptodev_qat_snow3g_perftest") > - > - def test_cryptodev_aesni_gcm_perftest(self): > - self.__run_unit_test("cryptodev_aesni_gcm_perftest") > - > - def test_cryptodev_openssl_perftest(self): > - self.__run_unit_test("cryptodev_openssl_perftest") > - > - def test_cryptodev_qat_continual_perftest(self): > - self.__run_unit_test("cryptodev_qat_continual_perftest") > - > - def test_cryptodev_aesni_mb_autotest(self): > - self.__run_unit_test("cryptodev_aesni_mb_autotest") > - > - def test_cryptodev_openssl_autotest(self): > - self.__run_unit_test("cryptodev_openssl_autotest") > - > - def test_cryptodev_aesni_gcm_autotest(self): > - self.__run_unit_test("cryptodev_aesni_gcm_autotest") > - > - def test_cryptodev_null_autotest(self): > - self.__run_unit_test("cryptodev_null_autotest") > - > - def test_cryptodev_sw_snow3g_autotest(self): > - self.__run_unit_test("cryptodev_sw_snow3g_autotest") > - > - def test_cryptodev_sw_kasumi_autotest(self): > - self.__run_unit_test("cryptodev_sw_kasumi_autotest") > - > - def test_cryptodev_sw_zuc_autotest(self): > - self.__run_unit_test("cryptodev_sw_zuc_autotest") > - > - def __run_unit_test(self, testsuite, timeout=3D600): > - self.logger.info("STEP_TEST: " + testsuite) > - self.dut.send_expect("dmesg -C", "# ", 30) > - self.dut.send_expect("./{target}/app/test -n 1 -c > 0xf".format(target=3Dself.dut.target), "RTE>>", 30) > - out =3D "" > - try: > - out =3D self.dut.send_expect(testsuite, "RTE>>", timeout) > - self.dut.send_expect("quit", "# ", 30) > - except Exception, ex: > - self.logger.error("Cryptodev Unit Tests Exception") > - dmesg =3D self.dut.alt_session.send_expect("dmesg", "# ", 30= ) > - self.logger.error("dmesg info:") > - self.logger.error(dmesg) > - > - self.logger.info(out) > - self.verify("Test OK" in out, "Test Failed") > diff --git a/tests/TestSuite_unit_tests_cryptodev_func.py > b/tests/TestSuite_unit_tests_cryptodev_func.py > new file mode 100644 > index 0000000..3b62e04 > --- /dev/null > +++ b/tests/TestSuite_unit_tests_cryptodev_func.py > @@ -0,0 +1,137 @@ > +# BSD LICENSE > +# > +# Copyright(c) 2016-2017 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 # > +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #=20 > +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 #=20 > +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 #=20 > +(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 json > +import utils > +from test_case import TestCase > + > +import cryptodev_common as cc > + > + > +class UnitTestsCryptodev(TestCase): > + > + def set_up_all(self): > + self._app_path =3D "./{target}/app/test".format(target=3Dself.du= t.target) > + if not cc.is_build_skip(self): > + cc.build_dpdk_with_cryptodev(self) > + cc.bind_qat_device(self, "vfio-pci") > + > + def set_up(self): > + pass > + > + def tear_down(self): > + self.dut.kill_all() > + > + def tear_down_all(self): > + cc.clear_dpdk_config(self) > + > + def test_cryptodev_qat_autotest(self): > + eal_opt_str =3D cc.get_eal_opt_str(self) > + self.__run_unit_test("cryptodev_qat_autotest", eal_opt_str) > + > + def _test_cryptodev_qat_perftest(self): > + eal_opt_str =3D cc.get_eal_opt_str(self) > + self.__run_unit_test("cryptodev_qat_perftest", eal_opt_str) > + > + def _test_cryptodev_qat_continual_perftest(self): > + eal_opt_str =3D cc.get_eal_opt_str(self) > + self.__run_unit_test("cryptodev_qat_continual_perftest", > + eal_opt_str) > + > + def _test_cryptodev_qat_snow3g_perftest(self): > + eal_opt_str =3D cc.get_eal_opt_str(self) > + self.__run_unit_test("cryptodev_qat_snow3g_perftest", > + eal_opt_str) > + > + def test_cryptodev_aesni_mb_autotest(self): > + eal_opt_str =3D cc.get_eal_opt_str(self) > + self.__run_unit_test("cryptodev_aesni_mb_autotest", > + eal_opt_str) > + > + def _test_cryptodev_aesni_mb_perftest(self): > + eal_opt_str =3D cc.get_eal_opt_str(self) > + self.__run_unit_test("cryptodev_aesni_mb_perftest", > + eal_opt_str) > + > + def test_cryptodev_aesni_gcm_autotest(self): > + eal_opt_str =3D cc.get_eal_opt_str(self) > + self.__run_unit_test("cryptodev_aesni_gcm_autotest", > + eal_opt_str) > + > + def _test_cryptodev_aesni_gcm_perftest(self): > + eal_opt_str =3D cc.get_eal_opt_str(self) > + self.__run_unit_test("cryptodev_aesni_gcm_perftest", > + eal_opt_str) > + > + def test_cryptodev_sw_snow3g_autotest(self): > + eal_opt_str =3D cc.get_eal_opt_str(self) > + self.__run_unit_test("cryptodev_sw_snow3g_autotest", > + eal_opt_str) > + > + def _test_cryptodev_sw_snow3g_perftest(self): > + eal_opt_str =3D cc.get_eal_opt_str(self) > + self.__run_unit_test("cryptodev_sw_snow3g_perftest", > + eal_opt_str) > + > + def test_cryptodev_sw_kasumi_autotest(self): > + eal_opt_str =3D cc.get_eal_opt_str(self) > + self.__run_unit_test("cryptodev_sw_kasumi_autotest", > + eal_opt_str) > + > + def test_cryptodev_sw_zuc_autotest(self): > + eal_opt_str =3D cc.get_eal_opt_str(self) > + self.__run_unit_test("cryptodev_sw_zuc_autotest",=20 > + eal_opt_str) > + > + def test_cryptodev_null_autotest(self): > + eal_opt_str =3D cc.get_eal_opt_str(self) > + self.__run_unit_test("cryptodev_null_autotest", eal_opt_str) > + > + def test_cryptodev_openssl_autotest(self): > + eal_opt_str =3D cc.get_eal_opt_str(self) > + self.__run_unit_test("cryptodev_openssl_autotest",=20 > + eal_opt_str) > + > + def _test_cryptodev_openssl_perftest(self): > + eal_opt_str =3D cc.get_eal_opt_str(self) > + self.__run_unit_test("cryptodev_openssl_perftest",=20 > + eal_opt_str) > + > + def test_cryptodev_scheduler_autotest(self): > + eal_opt_str =3D cc.get_eal_opt_str(self) > + self.__run_unit_test("cryptodev_scheduler_autotest", > + eal_opt_str) > + > + def __run_unit_test(self, testsuite, eal_opt_str, timeout=3D600): > + self.logger.info("STEP_TEST: " + testsuite) > + self.dut.send_expect("dmesg -C", "# ", 30) > + cmd_str =3D cc.get_dpdk_app_cmd_str(self._app_path, eal_opt_str) > + self.dut.send_expect(cmd_str, "RTE>>", 30) > + > + out =3D "" > + try: > + out =3D self.dut.send_expect(testsuite, "RTE>>", timeout) > + self.dut.send_expect("quit", "# ", 30) > + except Exception, ex: > + self.logger.error("Cryptodev Unit Tests Exception") > + dmesg =3D self.dut.alt_session.send_expect("dmesg", "# ", 30= ) > + self.logger.error("dmesg info:") > + self.logger.error(dmesg) > + > + self.logger.info(out) > + self.verify("Test OK" in out, "Test Failed") > -- > 2.7.4