From patchwork Tue Dec 12 18:05:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Varalakshmi S X-Patchwork-Id: 135055 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 249D0436D0; Tue, 12 Dec 2023 11:14:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 06F5842DBD; Tue, 12 Dec 2023 11:14:20 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 82A164026E for ; Tue, 12 Dec 2023 11:14:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702376057; x=1733912057; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=aXVYuVhwfVJnVULnztxuVafSf9cyAPqHWwQ/jT/mMfU=; b=SXam+iVyDhfMsSL58eVYO0FsBuEFWPw63PMn4Qp4ZJ8HWuzJdWYd7zMx NJo+BynKTuHoO95OeaHGa0RybXkEx6cROV+FSF3+be9qtS1cWJBrfd+Jp v5bTqhReooQyk9er+ywU+aUviGiXplmofIRvtd0bSTbBNudW80Qb0KMTm pjsfD4VvYMh5QSG+Nm6HokOptLbghQQ3lknOmSsFbHhqEV/b3miiVLy+n UFzqxtmt1GlDsgTPdoyc7gFx+hWb6MyUhKQwfrehhbh0sY3AO9uuZgXjr aPw8M8C6j51ECi+R3iCBn2XKEK7582QVq1xR0TfqnRD7KnsoN98vyfGUy w==; X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="385194997" X-IronPort-AV: E=Sophos;i="6.04,269,1695711600"; d="scan'208";a="385194997" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2023 02:14:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="896863669" X-IronPort-AV: E=Sophos;i="6.04,269,1695711600"; d="scan'208";a="896863669" Received: from unknown (HELO localhost.localdomain) ([10.239.252.226]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2023 02:14:14 -0800 From: Varalakshmi S To: dts@dpdk.org Cc: varalakshmi.s@intel.com Subject: [PATCH V1] tests/TestSuite_ipsec_gw_cryptodev_func.py tests/TestSuite_crypto_perf_cryptodev_perf.py tests/TestSuite_l2fwd_cryptodev_func.py Included changes for qat_legacy_capa flag Date: Tue, 12 Dec 2023 18:05:16 +0000 Message-Id: <20231212180516.2484728-1-varalakshmi.s@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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 Signed-off-by: Varalakshmi S --- tests/TestSuite_crypto_perf_cryptodev_perf.py | 13 ++- tests/TestSuite_ipsec_gw_cryptodev_func.py | 5 + tests/TestSuite_l2fwd_cryptodev_func.py | 92 ++++++++++++++----- 3 files changed, 84 insertions(+), 26 deletions(-) diff --git a/tests/TestSuite_crypto_perf_cryptodev_perf.py b/tests/TestSuite_crypto_perf_cryptodev_perf.py index 0531b9c6..7c4f8de6 100644 --- a/tests/TestSuite_crypto_perf_cryptodev_perf.py +++ b/tests/TestSuite_crypto_perf_cryptodev_perf.py @@ -349,6 +349,11 @@ class TestCryptoPerfCryptodevPerf(TestCase): dev = "crypto_aesni_mb" elif self.get_case_cfg()["devtype"] == "crypto_qat": w = cc.get_qat_devices(self, cpm_num=1, num=num) + legacy_capa_flag=",qat_legacy_capa=1" + i = 0 + for s in w: + w[i] = s+legacy_capa_flag + i = i + 1 device["a"] = " -a ".join(w) device["vdev"] = None elif self.get_case_cfg()["devtype"] == "crypto_openssl": @@ -364,6 +369,7 @@ class TestCryptoPerfCryptodevPerf(TestCase): elif self.get_case_cfg()["devtype"] == "crypto_scheduler": dev = "crypto_scheduler" w = cc.get_qat_devices(self, cpm_num=3, num=num * 3) + if not w: return {} vdev_list = [] @@ -371,7 +377,12 @@ class TestCryptoPerfCryptodevPerf(TestCase): vdev = "{}{},worker={}_qat_sym,worker={}_qat_sym,worker={}_qat_sym,mode=round-robin".format( dev, i, w[i * 3], w[i * 3 + 1], w[i * 3 + 2] ) - vdev_list.append(vdev) + vdev_list.append(vdev) + legacy_capa_flag=",qat_legacy_capa=1" + i = 0 + for s in w: + w[i] = s+legacy_capa_flag + i = i + 1 device["a"] = " -a ".join(w) device["vdev"] = " --vdev ".join(vdev_list) else: diff --git a/tests/TestSuite_ipsec_gw_cryptodev_func.py b/tests/TestSuite_ipsec_gw_cryptodev_func.py index d9f6f626..fe4222d5 100644 --- a/tests/TestSuite_ipsec_gw_cryptodev_func.py +++ b/tests/TestSuite_ipsec_gw_cryptodev_func.py @@ -225,6 +225,11 @@ class TestIPsecGwCryptodevFunc(TestCase): dev = "crypto_aesni_mb" elif self.get_case_cfg()["devtype"] == "crypto_qat": w = cc.get_qat_devices(self, cpm_num=1, num=num) + legacy_capa_flag=",qat_legacy_capa=1" + i = 0 + for s in w: + w[i] = s+legacy_capa_flag + i = i + 1 device["a"] = " -a ".join(w) device["vdev"] = None elif self.get_case_cfg()["devtype"] == "crypto_openssl": diff --git a/tests/TestSuite_l2fwd_cryptodev_func.py b/tests/TestSuite_l2fwd_cryptodev_func.py index a1f562ab..efeff5b3 100644 --- a/tests/TestSuite_l2fwd_cryptodev_func.py +++ b/tests/TestSuite_l2fwd_cryptodev_func.py @@ -1,12 +1,10 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2016-2017 Intel Corporation # - import binascii import hashlib import hmac import time - # Manually Install the CryptoMobile Python Library, # Before running this test suite # Web link : https://github.com/mitshell/CryptoMobile @@ -181,7 +179,14 @@ class TestL2fwdCryptodevFunc(TestCase): self.__execute_l2fwd_crypto_test(test_vectors, "openssl_DES_CBC_00") def test_scheduler_rr_AES_CBC_auto(self): - vdev = "-a " + " -a ".join(cc.get_qat_devices(self, num=3)) + + w = cc.get_qat_devices(self, num=3) + legacy_capa_flag=",qat_legacy_capa=1" + i = 0 + for s in w: + w[i] = s+legacy_capa_flag + i = i + 1 + vdev = "-a" + " -a ".join(w) vdev += ( " --vdev crypto_scheduler0,worker=%s_qat_sym,worker=%s_qat_sym,worker=%s_qat_sym,\ mode=round-robin" @@ -201,7 +206,14 @@ class TestL2fwdCryptodevFunc(TestCase): self.__execute_l2fwd_crypto_test(test_vectors, "scheduler_AES_GCM_00") def test_scheduler_psb_AES_CBC_auto(self): - vdev = "-a " + " -a ".join(cc.get_qat_devices(self, num=2)) + w = cc.get_qat_devices(self, num=2) + legacy_capa_flag=",qat_legacy_capa=1" + i = 0 + for s in w: + w[i] = s+legacy_capa_flag + i = i + 1 + vdev = "-a" + " -a ".join(w) + vdev += ( " --vdev crypto_scheduler0,worker=%s_qat_sym,worker=%s_qat_sym,\ mode=packet-size-distr" @@ -224,7 +236,14 @@ class TestL2fwdCryptodevFunc(TestCase): self.__execute_l2fwd_crypto_test(test_vectors, "scheduler_AES_GCM_00") def test_scheduler_fo_AES_CBC_auto(self): - vdev = "-a " + " -a ".join(cc.get_qat_devices(self, num=2)) + w = cc.get_qat_devices(self, num=2) + legacy_capa_flag=",qat_legacy_capa=1" + i = 0 + for s in w: + w[i] = s+legacy_capa_flag + i = i + 1 + vdev = "-a" + " -a ".join(w) + vdev += ( " --vdev crypto_scheduler0,worker=%s_qat_sym,worker=%s_qat_sym,\ mode=fail-over" @@ -247,7 +266,13 @@ class TestL2fwdCryptodevFunc(TestCase): self.__execute_l2fwd_crypto_test(test_vectors, "scheduler_AES_GCM_00") def test_scheduler_mm_AES_CBC_auto(self): - vdev = "-a " + " -a ".join(cc.get_qat_devices(self, num=2)) + w = cc.get_qat_devices(self, num=2) + legacy_capa_flag=",qat_legacy_capa=1" + i = 0 + for s in w: + w[i] = s+legacy_capa_flag + i = i + 1 + vdev = "-a" + " -a ".join(w) vdev += ( " --vdev crypto_scheduler0,worker=%s_qat_sym,worker=%s_qat_sym\ mode=multi-core" @@ -506,6 +531,8 @@ class TestL2fwdCryptodevFunc(TestCase): pass def __test_vector_to_cmd(self, test_vector, core_mask="", port_mask=""): + + Enable_legacy_Flag=0 cores = ",".join(self.core_list) eal_opt_str = cc.get_eal_opt_str(self, {"l": cores}, add_port=True) @@ -513,24 +540,6 @@ class TestL2fwdCryptodevFunc(TestCase): PORT_MASK = "" if port_mask == "" else " -p " + port_mask QUEUE_NUM = "" - vdev = "" - if test_vector["vdev"].find("scheduler") != -1: - vdev = test_vector["vdev"] - self.vector.append("Scheduler_" + test_vector["mode"]) - elif self.__check_field_in_vector(test_vector, "vdev"): - vdev = ( - "--vdev " - + test_vector["vdev"] - + "1" - + " --vdev " - + test_vector["vdev"] - + "2" - + " -a 0000:00:00.0" - ) - self.vector.append(test_vector["vdev"].upper()) - else: - vdev = "-a " + " -a ".join(cc.get_qat_devices(self, num=2)) - self.vector.append("QAT") chain = "" if self.__check_field_in_vector(test_vector, "chain"): @@ -579,6 +588,9 @@ class TestL2fwdCryptodevFunc(TestCase): else: if self.__check_field_in_vector(test_vector, "cipher_algo"): cipher_algo = " --cipher_algo " + test_vector["cipher_algo"] + cipher_algo_list={"des-docsisbpi","3des-cbc","3des-ctr"} + if(test_vector["cipher_algo"] in cipher_algo_list): + Enable_legacy_Flag=1 self.vector.append(test_vector["cipher_algo"]) if self.__check_field_in_vector(test_vector, "cipher_op"): cipher_op = " --cipher_op " + test_vector["cipher_op"] @@ -597,8 +609,10 @@ class TestL2fwdCryptodevFunc(TestCase): if self.__check_field_in_vector(test_vector, "auth_algo"): auth_algo = " --auth_algo " + test_vector["auth_algo"] + auth_algo_list={'md5-hmac' , 'sha1-hmac', 'sha2-512-hmac','sha2-224-hmac'} + if(test_vector["auth_algo"] in auth_algo_list): + Enable_legacy_Flag=1 self.vector.append(test_vector["auth_algo"]) - if self.__check_field_in_vector(test_vector, "auth_op"): auth_op = " --auth_op " + test_vector["auth_op"] self.vector.append(test_vector["auth_op"].lower()) @@ -630,6 +644,33 @@ class TestL2fwdCryptodevFunc(TestCase): if self.__check_field_in_vector(test_vector, "digest_size"): digest_size = " --digest " + str(test_vector["digest_size"]) self.vector.append("digest_%d" % test_vector["digest_size"]) + vdev = "" + if test_vector["vdev"].find("scheduler") != -1: + vdev = test_vector["vdev"] + self.vector.append("Scheduler_" + test_vector["mode"]) + elif self.__check_field_in_vector(test_vector, "vdev"): + vdev = ( + "--vdev " + + test_vector["vdev"] + + "1" + + " --vdev " + + test_vector["vdev"] + + "2" + + " -a 0000:00:00.0" + ) + self.vector.append(test_vector["vdev"].upper()) + else: + if (Enable_legacy_Flag == 0): + vdev = "-a " + " -a ".join(cc.get_qat_devices(self, num=2)) + else: + w = cc.get_qat_devices(self, num=2) + legacy_capa_flag=",qat_legacy_capa=1" + i = 0 + for s in w: + w[i] = s+legacy_capa_flag + i = i + 1 + vdev = "-a " + " -a ".join(w) + self.vector.append("QAT") cmd_str = " ".join( [ @@ -2263,3 +2304,4 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16 "output_hash": "*", }, } +