examples/dpdk-qat: various updates
authorBruce Richardson <bruce.richardson@intel.com>
Mon, 10 Feb 2014 13:33:44 +0000 (13:33 +0000)
committerDavid Marchand <david.marchand@6wind.com>
Wed, 26 Feb 2014 09:47:59 +0000 (10:47 +0100)
Updates including support for IntelĀ® Communications Chipset
8925 to 8955 Series.
Add support for the wireless KASUMI algorithm.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
examples/dpdk_qat/config_files/coleto/dh895xcc_qa_dev0.conf [new file with mode: 0644]
examples/dpdk_qat/crypto.c
examples/dpdk_qat/crypto.h

diff --git a/examples/dpdk_qat/config_files/coleto/dh895xcc_qa_dev0.conf b/examples/dpdk_qat/config_files/coleto/dh895xcc_qa_dev0.conf
new file mode 100644 (file)
index 0000000..fd139e2
--- /dev/null
@@ -0,0 +1,65 @@
+[GENERAL]
+ServicesEnabled = cy;dc
+ConfigVersion = 2
+cyHmacAuthMode = 1
+dcTotalSRAMAvailable = 0
+Firmware_MofPath = dh895xcc/mof_firmware.bin
+Firmware_MmpPath = dh895xcc/mmp_firmware.bin
+statsGeneral = 1
+statsDc = 1
+statsDh = 1
+statsDrbg = 1
+statsDsa = 1
+statsEcc = 1
+statsKeyGen = 1
+statsLn = 1
+statsPrime = 1
+statsRsa = 1
+statsSym = 1
+SRIOV_Enabled = 0
+ProcDebug = 1
+
+[KERNEL]
+NumberCyInstances = 0
+NumberDcInstances = 0
+
+[SSL]
+NumberCyInstances = 8
+NumberDcInstances = 0
+NumProcesses = 1
+LimitDevAccess = 0
+
+Cy0Name = "SSL0"
+Cy0IsPolled = 1
+Cy0CoreAffinity = 0
+
+Cy1Name = "SSL1"
+Cy1IsPolled = 1
+Cy1CoreAffinity = 1
+
+Cy2Name = "SSL2"
+Cy2IsPolled = 1
+Cy2CoreAffinity = 2
+
+Cy3Name = "SSL3"
+Cy3IsPolled = 1
+Cy3CoreAffinity = 3
+
+
+Cy4Name = "SSL4"
+Cy4IsPolled = 1
+Cy4CoreAffinity = 4
+
+
+Cy5Name = "SSL5"
+Cy5IsPolled = 1
+Cy5CoreAffinity = 5
+
+Cy6Name = "SSL6"
+Cy6IsPolled = 1
+Cy6CoreAffinity = 6
+
+
+Cy7Name = "SSL7"
+Cy7IsPolled = 1
+Cy7CoreAffinity = 7
index 9321862..7606d3d 100644 (file)
@@ -87,6 +87,7 @@
 #define SHA384_AUTH_KEY_LENGTH_IN_BYTES                (384 / 8)
 #define SHA512_AUTH_KEY_LENGTH_IN_BYTES                (512 / 8)
 #define MD5_AUTH_KEY_LENGTH_IN_BYTES           (128 / 8)
+#define KASUMI_AUTH_KEY_LENGTH_IN_BYTES                (128 / 8)
 
 /* HASH DIGEST LENGHTS */
 #define AES_XCBC_DIGEST_LENGTH_IN_BYTES                (128 / 8)
@@ -98,6 +99,7 @@
 #define SHA256_DIGEST_LENGTH_IN_BYTES          (256 / 8)
 #define SHA384_DIGEST_LENGTH_IN_BYTES          (384 / 8)
 #define SHA512_DIGEST_LENGTH_IN_BYTES          (512 / 8)
+#define KASUMI_DIGEST_LENGTH_IN_BYTES          (32 / 8)
 
 #define IV_LENGTH_16_BYTES     (16)
 #define IV_LENGTH_8_BYTES      (8)
@@ -422,6 +424,12 @@ initCySymSession(const int pkt_cipher_alg,
                sessionSetupData.cipherSetupData.cipherKeyLenInBytes =
                                KEY_SIZE_128_IN_BYTES;
                break;
+       case CIPHER_KASUMI_F8:
+               sessionSetupData.cipherSetupData.cipherAlgorithm =
+                               CPA_CY_SYM_CIPHER_KASUMI_F8;
+               sessionSetupData.cipherSetupData.cipherKeyLenInBytes =
+                               KEY_SIZE_128_IN_BYTES;
+               break;
        default:
                printf("Crypto: Undefined Cipher specified\n");
                break;
@@ -484,6 +492,11 @@ initCySymSession(const int pkt_cipher_alg,
                sessionSetupData.hashSetupData.digestResultLenInBytes =
                                SHA512_DIGEST_LENGTH_IN_BYTES;
                break;
+       case HASH_KASUMI_F9:
+               sessionSetupData.hashSetupData.hashAlgorithm = CPA_CY_SYM_HASH_KASUMI_F9;
+               sessionSetupData.hashSetupData.digestResultLenInBytes =
+                               KASUMI_DIGEST_LENGTH_IN_BYTES;
+               break;
        default:
                printf("Crypto: Undefined Hash specified\n");
                break;
@@ -527,6 +540,10 @@ initCySymSession(const int pkt_cipher_alg,
                                sessionSetupData.hashSetupData.authModeSetupData.authKeyLenInBytes =
                                                SHA512_AUTH_KEY_LENGTH_IN_BYTES;
                                break;
+                       case HASH_KASUMI_F9:
+                               sessionSetupData.hashSetupData.authModeSetupData.authKeyLenInBytes =
+                                               KASUMI_AUTH_KEY_LENGTH_IN_BYTES;
+                               break;
                        default:
                                printf("Crypto: Undefined Hash specified\n");
                                return CPA_STATUS_FAIL;
@@ -590,6 +607,9 @@ initSessionDataTables(struct qa_core_conf *qaCoreConf,uint32_t lcore_id)
        CpaStatus status = CPA_STATUS_FAIL;
        for (i = 0; i < NUM_CRYPTO; i++) {
                for (j = 0; j < NUM_HMAC; j++) {
+                       if (((i == CIPHER_KASUMI_F8) && (j != NO_HASH) && (j != HASH_KASUMI_F9)) ||
+                               ((i != NO_CIPHER) && (i != CIPHER_KASUMI_F8) && (j == HASH_KASUMI_F9)))
+                               continue;
                        status = initCySymSession(i, j, CPA_CY_SYM_HASH_MODE_AUTH,
                                        CPA_CY_SYM_CIPHER_DIRECTION_ENCRYPT,
                                        &qaCoreConf->encryptSessionHandleTbl[i][j],
index 725bc9a..327b904 100644 (file)
@@ -44,6 +44,7 @@ enum cipher_alg {
        CIPHER_DES3_CBC,
        CIPHER_AES,
        CIPHER_AES_CBC_128,
+       CIPHER_KASUMI_F8,
        NUM_CRYPTO,
 };
 
@@ -59,6 +60,7 @@ enum hash_alg {
        HASH_SHA512,
        HASH_AES_XCBC,
        HASH_AES_XCBC_96,
+       HASH_KASUMI_F9,
        NUM_HMAC,
 };