[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

Message ID 20231212180516.2484728-1-varalakshmi.s@intel.com (mailing list archive)
State New
Headers
Series [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 |

Commit Message

Varalakshmi S Dec. 12, 2023, 6:05 p.m. UTC
  Signed-off-by: Varalakshmi S <varalakshmi.s@intel.com>
---
 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(-)
  

Patch

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": "*",
     },
 }
+