crypto/qat: do not use cryptodev driver
[dpdk.git] / drivers / crypto / qat / qat_crypto.c
index b851926..8b7b2fa 100644 (file)
@@ -60,6 +60,7 @@
 #include <rte_spinlock.h>
 #include <rte_hexdump.h>
 #include <rte_crypto_sym.h>
+#include <rte_cryptodev_pci.h>
 #include <openssl/evp.h>
 
 #include "qat_logs.h"
 
 #define BYTE_LENGTH    8
 
-static const struct rte_cryptodev_capabilities qat_pmd_capabilities[] = {
-       {       /* SHA1 HMAC */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       {.auth = {
-                               .algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
-                               .block_size = 64,
-                               .key_size = {
-                                       .min = 64,
-                                       .max = 64,
-                                       .increment = 0
-                               },
-                               .digest_size = {
-                                       .min = 20,
-                                       .max = 20,
-                                       .increment = 0
-                               },
-                               .aad_size = { 0 }
-                       }, }
-               }, }
-       },
-       {       /* SHA224 HMAC */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       {.auth = {
-                               .algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
-                               .block_size = 64,
-                                       .key_size = {
-                                       .min = 64,
-                                       .max = 64,
-                                       .increment = 0
-                               },
-                               .digest_size = {
-                                       .min = 28,
-                                       .max = 28,
-                                       .increment = 0
-                               },
-                               .aad_size = { 0 }
-                       }, }
-               }, }
-       },
-       {       /* SHA256 HMAC */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       {.auth = {
-                               .algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
-                               .block_size = 64,
-                               .key_size = {
-                                       .min = 64,
-                                       .max = 64,
-                                       .increment = 0
-                               },
-                               .digest_size = {
-                                       .min = 32,
-                                       .max = 32,
-                                       .increment = 0
-                               },
-                               .aad_size = { 0 }
-                       }, }
-               }, }
-       },
-       {       /* SHA384 HMAC */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       {.auth = {
-                               .algo = RTE_CRYPTO_AUTH_SHA384_HMAC,
-                               .block_size = 64,
-                               .key_size = {
-                                       .min = 128,
-                                       .max = 128,
-                                       .increment = 0
-                               },
-                               .digest_size = {
-                                       .min = 48,
-                                       .max = 48,
-                                       .increment = 0
-                                       },
-                               .aad_size = { 0 }
-                       }, }
-               }, }
-       },
-       {       /* SHA512 HMAC */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       {.auth = {
-                               .algo = RTE_CRYPTO_AUTH_SHA512_HMAC,
-                               .block_size = 128,
-                               .key_size = {
-                                       .min = 128,
-                                       .max = 128,
-                                       .increment = 0
-                               },
-                               .digest_size = {
-                                       .min = 64,
-                                       .max = 64,
-                                       .increment = 0
-                               },
-                               .aad_size = { 0 }
-                       }, }
-               }, }
-       },
-       {       /* MD5 HMAC */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       {.auth = {
-                               .algo = RTE_CRYPTO_AUTH_MD5_HMAC,
-                               .block_size = 64,
-                               .key_size = {
-                                       .min = 8,
-                                       .max = 64,
-                                       .increment = 8
-                               },
-                               .digest_size = {
-                                       .min = 16,
-                                       .max = 16,
-                                       .increment = 0
-                               },
-                               .aad_size = { 0 }
-                       }, }
-               }, }
-       },
-       {       /* AES XCBC MAC */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       {.auth = {
-                               .algo = RTE_CRYPTO_AUTH_AES_XCBC_MAC,
-                               .block_size = 16,
-                               .key_size = {
-                                       .min = 16,
-                                       .max = 16,
-                                       .increment = 0
-                               },
-                               .digest_size = {
-                                       .min = 16,
-                                       .max = 16,
-                                       .increment = 0
-                               },
-                               .aad_size = { 0 }
-                       }, }
-               }, }
-       },
-       {       /* AES GCM (AUTH) */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       {.auth = {
-                               .algo = RTE_CRYPTO_AUTH_AES_GCM,
-                               .block_size = 16,
-                               .key_size = {
-                                       .min = 16,
-                                       .max = 32,
-                                       .increment = 8
-                               },
-                               .digest_size = {
-                                       .min = 8,
-                                       .max = 16,
-                                       .increment = 4
-                               },
-                               .aad_size = {
-                                       .min = 8,
-                                       .max = 12,
-                                       .increment = 4
-                               }
-                       }, }
-               }, }
-       },
-       {       /* AES GMAC (AUTH) */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       {.auth = {
-                               .algo = RTE_CRYPTO_AUTH_AES_GMAC,
-                               .block_size = 16,
-                               .key_size = {
-                                       .min = 16,
-                                       .max = 32,
-                                       .increment = 8
-                               },
-                               .digest_size = {
-                                       .min = 8,
-                                       .max = 16,
-                                       .increment = 4
-                               },
-                               .aad_size = {
-                                       .min = 1,
-                                       .max = 65535,
-                                       .increment = 1
-                               }
-                       }, }
-               }, }
-       },
-       {       /* SNOW 3G (UIA2) */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       {.auth = {
-                               .algo = RTE_CRYPTO_AUTH_SNOW3G_UIA2,
-                               .block_size = 16,
-                               .key_size = {
-                                       .min = 16,
-                                       .max = 16,
-                                       .increment = 0
-                               },
-                               .digest_size = {
-                                       .min = 4,
-                                       .max = 4,
-                                       .increment = 0
-                               },
-                               .aad_size = {
-                                       .min = 16,
-                                       .max = 16,
-                                       .increment = 0
-                               }
-                       }, }
-               }, }
-       },
-       {       /* AES GCM (CIPHER) */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
-                       {.cipher = {
-                               .algo = RTE_CRYPTO_CIPHER_AES_GCM,
-                               .block_size = 16,
-                               .key_size = {
-                                       .min = 16,
-                                       .max = 32,
-                                       .increment = 8
-                               },
-                               .iv_size = {
-                                       .min = 12,
-                                       .max = 12,
-                                       .increment = 0
-                               }
-                       }, }
-               }, }
-       },
-       {       /* AES CBC */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
-                       {.cipher = {
-                               .algo = RTE_CRYPTO_CIPHER_AES_CBC,
-                               .block_size = 16,
-                               .key_size = {
-                                       .min = 16,
-                                       .max = 32,
-                                       .increment = 8
-                               },
-                               .iv_size = {
-                                       .min = 16,
-                                       .max = 16,
-                                       .increment = 0
-                               }
-                       }, }
-               }, }
-       },
-       {       /* AES DOCSISBPI */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
-                       {.cipher = {
-                               .algo = RTE_CRYPTO_CIPHER_AES_DOCSISBPI,
-                               .block_size = 16,
-                               .key_size = {
-                                       .min = 16,
-                                       .max = 16,
-                                       .increment = 0
-                               },
-                               .iv_size = {
-                                       .min = 16,
-                                       .max = 16,
-                                       .increment = 0
-                               }
-                       }, }
-               }, }
-       },
-       {       /* SNOW 3G (UEA2) */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
-                       {.cipher = {
-                               .algo = RTE_CRYPTO_CIPHER_SNOW3G_UEA2,
-                               .block_size = 16,
-                               .key_size = {
-                                       .min = 16,
-                                       .max = 16,
-                                       .increment = 0
-                               },
-                               .iv_size = {
-                                       .min = 16,
-                                       .max = 16,
-                                       .increment = 0
-                               }
-                       }, }
-               }, }
-       },
-       {       /* AES CTR */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
-                       {.cipher = {
-                               .algo = RTE_CRYPTO_CIPHER_AES_CTR,
-                               .block_size = 16,
-                               .key_size = {
-                                       .min = 16,
-                                       .max = 32,
-                                       .increment = 8
-                               },
-                               .iv_size = {
-                                       .min = 16,
-                                       .max = 16,
-                                       .increment = 0
-                               }
-                       }, }
-               }, }
-       },
-       {       /* NULL (AUTH) */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       {.auth = {
-                               .algo = RTE_CRYPTO_AUTH_NULL,
-                               .block_size = 1,
-                               .key_size = {
-                                       .min = 0,
-                                       .max = 0,
-                                       .increment = 0
-                               },
-                               .digest_size = {
-                                       .min = 0,
-                                       .max = 0,
-                                       .increment = 0
-                               },
-                               .aad_size = { 0 }
-                       }, },
-               }, },
-       },
-       {       /* NULL (CIPHER) */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
-                       {.cipher = {
-                               .algo = RTE_CRYPTO_CIPHER_NULL,
-                               .block_size = 1,
-                               .key_size = {
-                                       .min = 0,
-                                       .max = 0,
-                                       .increment = 0
-                               },
-                               .iv_size = {
-                                       .min = 0,
-                                       .max = 0,
-                                       .increment = 0
-                               }
-                       }, },
-               }, }
-       },
-       {       /* KASUMI (F8) */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
-                       {.cipher = {
-                               .algo = RTE_CRYPTO_CIPHER_KASUMI_F8,
-                               .block_size = 8,
-                               .key_size = {
-                                       .min = 16,
-                                       .max = 16,
-                                       .increment = 0
-                               },
-                               .iv_size = {
-                                       .min = 8,
-                                       .max = 8,
-                                       .increment = 0
-                               }
-                       }, }
-               }, }
-       },
-       {       /* KASUMI (F9) */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       {.auth = {
-                               .algo = RTE_CRYPTO_AUTH_KASUMI_F9,
-                               .block_size = 8,
-                               .key_size = {
-                                       .min = 16,
-                                       .max = 16,
-                                       .increment = 0
-                               },
-                               .digest_size = {
-                                       .min = 4,
-                                       .max = 4,
-                                       .increment = 0
-                               },
-                               .aad_size = {
-                                       .min = 8,
-                                       .max = 8,
-                                       .increment = 0
-                               }
-                       }, }
-               }, }
-       },
-       {       /* 3DES CBC */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
-                       {.cipher = {
-                               .algo = RTE_CRYPTO_CIPHER_3DES_CBC,
-                               .block_size = 8,
-                               .key_size = {
-                                       .min = 16,
-                                       .max = 24,
-                                       .increment = 8
-                               },
-                               .iv_size = {
-                                       .min = 8,
-                                       .max = 8,
-                                       .increment = 0
-                               }
-                       }, }
-               }, }
-       },
-       {       /* 3DES CTR */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
-                       {.cipher = {
-                               .algo = RTE_CRYPTO_CIPHER_3DES_CTR,
-                               .block_size = 8,
-                               .key_size = {
-                                       .min = 16,
-                                       .max = 24,
-                                       .increment = 8
-                               },
-                               .iv_size = {
-                                       .min = 8,
-                                       .max = 8,
-                                       .increment = 0
-                               }
-                       }, }
-               }, }
-       },
-       {       /* DES CBC */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
-                       {.cipher = {
-                               .algo = RTE_CRYPTO_CIPHER_DES_CBC,
-                               .block_size = 8,
-                               .key_size = {
-                                       .min = 8,
-                                       .max = 8,
-                                       .increment = 0
-                               },
-                               .iv_size = {
-                                       .min = 8,
-                                       .max = 8,
-                                       .increment = 0
-                               }
-                       }, }
-               }, }
-       },
-       {       /* DES DOCSISBPI */
-               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               {.sym = {
-                       .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
-                       {.cipher = {
-                               .algo = RTE_CRYPTO_CIPHER_DES_DOCSISBPI,
-                               .block_size = 8,
-                               .key_size = {
-                                       .min = 8,
-                                       .max = 8,
-                                       .increment = 0
-                               },
-                               .iv_size = {
-                                       .min = 8,
-                                       .max = 8,
-                                       .increment = 0
-                               }
-                       }, }
-               }, }
-       },
-       RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
-};
+static int
+qat_is_cipher_alg_supported(enum rte_crypto_cipher_algorithm algo,
+               struct qat_pmd_private *internals) {
+       int i = 0;
+       const struct rte_cryptodev_capabilities *capability;
+
+       while ((capability = &(internals->qat_dev_capabilities[i++]))->op !=
+                       RTE_CRYPTO_OP_TYPE_UNDEFINED) {
+               if (capability->op != RTE_CRYPTO_OP_TYPE_SYMMETRIC)
+                       continue;
+
+               if (capability->sym.xform_type != RTE_CRYPTO_SYM_XFORM_CIPHER)
+                       continue;
+
+               if (capability->sym.cipher.algo == algo)
+                       return 1;
+       }
+       return 0;
+}
+
+static int
+qat_is_auth_alg_supported(enum rte_crypto_auth_algorithm algo,
+               struct qat_pmd_private *internals) {
+       int i = 0;
+       const struct rte_cryptodev_capabilities *capability;
+
+       while ((capability = &(internals->qat_dev_capabilities[i++]))->op !=
+                       RTE_CRYPTO_OP_TYPE_UNDEFINED) {
+               if (capability->op != RTE_CRYPTO_OP_TYPE_SYMMETRIC)
+                       continue;
+
+               if (capability->sym.xform_type != RTE_CRYPTO_SYM_XFORM_AUTH)
+                       continue;
+
+               if (capability->sym.auth.algo == algo)
+                       return 1;
+       }
+       return 0;
+}
 
 /** Encrypt a single partial block
  *  Depends on openssl libcrypto
@@ -742,10 +291,8 @@ void *
 qat_crypto_sym_configure_session_cipher(struct rte_cryptodev *dev,
                struct rte_crypto_sym_xform *xform, void *session_private)
 {
-       struct qat_pmd_private *internals = dev->data->dev_private;
-
        struct qat_session *session = session_private;
-
+       struct qat_pmd_private *internals = dev->data->dev_private;
        struct rte_crypto_cipher_xform *cipher_xform = NULL;
 
        /* Get cipher xform from crypto xform chain */
@@ -851,13 +398,27 @@ qat_crypto_sym_configure_session_cipher(struct rte_cryptodev *dev,
                }
                session->qat_mode = ICP_QAT_HW_CIPHER_CBC_MODE;
                break;
+       case RTE_CRYPTO_CIPHER_ZUC_EEA3:
+               if (!qat_is_cipher_alg_supported(
+                       cipher_xform->algo, internals)) {
+                       PMD_DRV_LOG(ERR, "%s not supported on this device",
+                               rte_crypto_cipher_algorithm_strings
+                                       [cipher_xform->algo]);
+                       goto error_out;
+               }
+               if (qat_alg_validate_zuc_key(cipher_xform->key.length,
+                               &session->qat_cipher_alg) != 0) {
+                       PMD_DRV_LOG(ERR, "Invalid ZUC cipher key size");
+                       goto error_out;
+               }
+               session->qat_mode = ICP_QAT_HW_CIPHER_ECB_MODE;
+               break;
        case RTE_CRYPTO_CIPHER_3DES_ECB:
        case RTE_CRYPTO_CIPHER_AES_ECB:
        case RTE_CRYPTO_CIPHER_AES_CCM:
        case RTE_CRYPTO_CIPHER_AES_F8:
        case RTE_CRYPTO_CIPHER_AES_XTS:
        case RTE_CRYPTO_CIPHER_ARC4:
-       case RTE_CRYPTO_CIPHER_ZUC_EEA3:
                PMD_DRV_LOG(ERR, "Crypto QAT PMD: Unsupported Cipher alg %u",
                                cipher_xform->algo);
                goto error_out;
@@ -884,7 +445,6 @@ error_out:
                bpi_cipher_ctx_free(session->bpi_ctx);
                session->bpi_ctx = NULL;
        }
-       rte_mempool_put(internals->sess_mp, session);
        return NULL;
 }
 
@@ -893,8 +453,6 @@ void *
 qat_crypto_sym_configure_session(struct rte_cryptodev *dev,
                struct rte_crypto_sym_xform *xform, void *session_private)
 {
-       struct qat_pmd_private *internals = dev->data->dev_private;
-
        struct qat_session *session = session_private;
 
        int qat_cmd_id;
@@ -943,7 +501,6 @@ qat_crypto_sym_configure_session(struct rte_cryptodev *dev,
        return session;
 
 error_out:
-       rte_mempool_put(internals->sess_mp, session);
        return NULL;
 }
 
@@ -953,10 +510,10 @@ qat_crypto_sym_configure_session_auth(struct rte_cryptodev *dev,
                                struct qat_session *session_private)
 {
 
-       struct qat_pmd_private *internals = dev->data->dev_private;
        struct qat_session *session = session_private;
        struct rte_crypto_auth_xform *auth_xform = NULL;
        struct rte_crypto_cipher_xform *cipher_xform = NULL;
+       struct qat_pmd_private *internals = dev->data->dev_private;
        auth_xform = qat_get_auth_xform(xform);
 
        switch (auth_xform->algo) {
@@ -996,6 +553,15 @@ qat_crypto_sym_configure_session_auth(struct rte_cryptodev *dev,
        case RTE_CRYPTO_AUTH_KASUMI_F9:
                session->qat_hash_alg = ICP_QAT_HW_AUTH_ALGO_KASUMI_F9;
                break;
+       case RTE_CRYPTO_AUTH_ZUC_EIA3:
+               if (!qat_is_auth_alg_supported(auth_xform->algo, internals)) {
+                       PMD_DRV_LOG(ERR, "%s not supported on this device",
+                               rte_crypto_auth_algorithm_strings
+                               [auth_xform->algo]);
+                       goto error_out;
+               }
+               session->qat_hash_alg = ICP_QAT_HW_AUTH_ALGO_ZUC_3G_128_EIA3;
+               break;
        case RTE_CRYPTO_AUTH_SHA1:
        case RTE_CRYPTO_AUTH_SHA256:
        case RTE_CRYPTO_AUTH_SHA512:
@@ -1005,7 +571,6 @@ qat_crypto_sym_configure_session_auth(struct rte_cryptodev *dev,
        case RTE_CRYPTO_AUTH_AES_CCM:
        case RTE_CRYPTO_AUTH_AES_CMAC:
        case RTE_CRYPTO_AUTH_AES_CBC_MAC:
-       case RTE_CRYPTO_AUTH_ZUC_EIA3:
                PMD_DRV_LOG(ERR, "Crypto: Unsupported hash alg %u",
                                auth_xform->algo);
                goto error_out;
@@ -1038,8 +603,6 @@ qat_crypto_sym_configure_session_auth(struct rte_cryptodev *dev,
        return session;
 
 error_out:
-       if (internals->sess_mp != NULL)
-               rte_mempool_put(internals->sess_mp, session);
        return NULL;
 }
 
@@ -1195,7 +758,7 @@ qat_pmd_enqueue_op_burst(void *qp, struct rte_crypto_op **ops,
                        tmp_qp->stats.enqueue_err_count++;
                        /*
                         * This message cannot be enqueued,
-                        * decrease number of ops that wasnt sent
+                        * decrease number of ops that wasn't sent
                         */
                        rte_atomic16_sub(&tmp_qp->inflights16,
                                        nb_ops_possible - nb_ops_sent);
@@ -1238,6 +801,7 @@ qat_pmd_dequeue_op_burst(void *qp, struct rte_crypto_op **ops,
 #ifdef RTE_LIBRTE_PMD_QAT_DEBUG_RX
                rte_hexdump(stdout, "qat_response:", (uint8_t *)resp_msg,
                        sizeof(struct icp_qat_fw_comn_resp));
+
 #endif
                if (ICP_QAT_FW_COMN_STATUS_FLAG_OK !=
                                ICP_QAT_FW_COMN_RESP_CRYPTO_STAT_GET(
@@ -1378,14 +942,16 @@ qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg,
 
                if (ctx->qat_cipher_alg ==
                                         ICP_QAT_HW_CIPHER_ALGO_SNOW_3G_UEA2 ||
-                       ctx->qat_cipher_alg == ICP_QAT_HW_CIPHER_ALGO_KASUMI) {
+                       ctx->qat_cipher_alg == ICP_QAT_HW_CIPHER_ALGO_KASUMI ||
+                       ctx->qat_cipher_alg ==
+                               ICP_QAT_HW_CIPHER_ALGO_ZUC_3G_128_EEA3) {
 
                        if (unlikely(
                                (cipher_param->cipher_length % BYTE_LENGTH != 0)
                                 || (cipher_param->cipher_offset
                                                        % BYTE_LENGTH != 0))) {
                                PMD_DRV_LOG(ERR,
-                 "SNOW3G/KASUMI in QAT PMD only supports byte aligned values");
+                 "SNOW3G/KASUMI/ZUC in QAT PMD only supports byte aligned values");
                                op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
                                return -EINVAL;
                        }
@@ -1406,17 +972,24 @@ qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg,
                }
 
                /* copy IV into request if it fits */
-               if (op->sym->cipher.iv.length && (op->sym->cipher.iv.length <=
-                               sizeof(cipher_param->u.cipher_IV_array))) {
-                       rte_memcpy(cipher_param->u.cipher_IV_array,
-                                       op->sym->cipher.iv.data,
-                                       op->sym->cipher.iv.length);
-               } else {
-                       ICP_QAT_FW_LA_CIPH_IV_FLD_FLAG_SET(
-                                       qat_req->comn_hdr.serv_specif_flags,
-                                       ICP_QAT_FW_CIPH_IV_64BIT_PTR);
-                       cipher_param->u.s.cipher_IV_ptr =
-                                       op->sym->cipher.iv.phys_addr;
+               /*
+                * If IV length is zero do not copy anything but still
+                * use request descriptor embedded IV
+                *
+                */
+               if (op->sym->cipher.iv.length) {
+                       if (op->sym->cipher.iv.length <=
+                                       sizeof(cipher_param->u.cipher_IV_array)) {
+                               rte_memcpy(cipher_param->u.cipher_IV_array,
+                                               op->sym->cipher.iv.data,
+                                               op->sym->cipher.iv.length);
+                       } else {
+                               ICP_QAT_FW_LA_CIPH_IV_FLD_FLAG_SET(
+                                               qat_req->comn_hdr.serv_specif_flags,
+                                               ICP_QAT_FW_CIPH_IV_64BIT_PTR);
+                               cipher_param->u.s.cipher_IV_ptr =
+                                               op->sym->cipher.iv.phys_addr;
+                       }
                }
                min_ofs = cipher_ofs;
        }
@@ -1424,11 +997,13 @@ qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg,
        if (do_auth) {
 
                if (ctx->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_SNOW_3G_UIA2 ||
-                       ctx->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_KASUMI_F9) {
+                       ctx->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_KASUMI_F9 ||
+                       ctx->qat_hash_alg ==
+                               ICP_QAT_HW_AUTH_ALGO_ZUC_3G_128_EIA3) {
                        if (unlikely((auth_param->auth_off % BYTE_LENGTH != 0)
                                || (auth_param->auth_len % BYTE_LENGTH != 0))) {
                                PMD_DRV_LOG(ERR,
-               "For SNOW3G/KASUMI, QAT PMD only supports byte aligned values");
+               "For SNOW3G/KASUMI/ZUC, QAT PMD only supports byte aligned values");
                                op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
                                return -EINVAL;
                        }
@@ -1447,6 +1022,12 @@ qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg,
                                }
                        }
 
+               } else if (ctx->qat_hash_alg ==
+                                       ICP_QAT_HW_AUTH_ALGO_GALOIS_128 ||
+                               ctx->qat_hash_alg ==
+                                       ICP_QAT_HW_AUTH_ALGO_GALOIS_64) {
+                       auth_ofs = op->sym->cipher.data.offset;
+                       auth_len = op->sym->cipher.data.length;
                } else {
                        auth_ofs = op->sym->auth.data.offset;
                        auth_len = op->sym->auth.data.length;
@@ -1660,8 +1241,8 @@ int qat_dev_close(struct rte_cryptodev *dev)
        return 0;
 }
 
-void qat_dev_info_get(__rte_unused struct rte_cryptodev *dev,
-                               struct rte_cryptodev_info *info)
+void qat_dev_info_get(struct rte_cryptodev *dev,
+                       struct rte_cryptodev_info *info)
 {
        struct qat_pmd_private *internals = dev->data->dev_private;
 
@@ -1671,9 +1252,10 @@ void qat_dev_info_get(__rte_unused struct rte_cryptodev *dev,
                                ADF_NUM_SYM_QPS_PER_BUNDLE *
                                ADF_NUM_BUNDLES_PER_DEV;
                info->feature_flags = dev->feature_flags;
-               info->capabilities = qat_pmd_capabilities;
+               info->capabilities = internals->qat_dev_capabilities;
                info->sym.max_nb_sessions = internals->max_nb_sessions;
                info->dev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
+               info->pci_dev = RTE_DEV_TO_PCI(dev->device);
        }
 }
 
@@ -1695,9 +1277,9 @@ void qat_crypto_sym_stats_get(struct rte_cryptodev *dev,
                }
 
                stats->enqueued_count += qp[i]->stats.enqueued_count;
-               stats->dequeued_count += qp[i]->stats.enqueued_count;
+               stats->dequeued_count += qp[i]->stats.dequeued_count;
                stats->enqueue_err_count += qp[i]->stats.enqueue_err_count;
-               stats->dequeue_err_count += qp[i]->stats.enqueue_err_count;
+               stats->dequeue_err_count += qp[i]->stats.dequeue_err_count;
        }
 }