crypto/qat: rename log macro for non-dp logs
authorFiona Trahe <fiona.trahe@intel.com>
Thu, 14 Jun 2018 11:03:04 +0000 (13:03 +0200)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Wed, 27 Jun 2018 23:25:33 +0000 (01:25 +0200)
Rename PMD_DRV_LOG to the more appropriate name QAT_LOG.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
drivers/crypto/qat/qat_common.c
drivers/crypto/qat/qat_device.c
drivers/crypto/qat/qat_logs.h
drivers/crypto/qat/qat_qp.c
drivers/crypto/qat/qat_sym.c
drivers/crypto/qat/qat_sym.h
drivers/crypto/qat/qat_sym_pmd.c
drivers/crypto/qat/qat_sym_session.c

index c10c142..c206d3b 100644 (file)
@@ -28,7 +28,7 @@ qat_sgl_fill_array(struct rte_mbuf *buf, uint64_t buf_start,
        buf = buf->next;
        while (buf) {
                if (unlikely(nr == QAT_SGL_MAX_NUMBER)) {
-                       PMD_DRV_LOG(ERR,
+                       QAT_LOG(ERR,
                                "QAT PMD exceeded size of QAT SGL entry(%u)",
                                        QAT_SGL_MAX_NUMBER);
                        return -EINVAL;
@@ -61,7 +61,7 @@ void qat_stats_get(struct qat_pci_device *dev,
        struct qat_qp **qp;
 
        if (stats == NULL || dev == NULL || service >= QAT_SERVICE_INVALID) {
-               PMD_DRV_LOG(ERR, "invalid param: stats %p, dev %p, service %d",
+               QAT_LOG(ERR, "invalid param: stats %p, dev %p, service %d",
                                stats, dev, service);
                return;
        }
@@ -69,7 +69,7 @@ void qat_stats_get(struct qat_pci_device *dev,
        qp = dev->qps_in_use[service];
        for (i = 0; i < ADF_MAX_QPS_ON_ANY_SERVICE; i++) {
                if (qp[i] == NULL) {
-                       PMD_DRV_LOG(DEBUG, "Service %d Uninitialised qp %d",
+                       QAT_LOG(DEBUG, "Service %d Uninitialised qp %d",
                                        service, i);
                        continue;
                }
@@ -88,7 +88,7 @@ void qat_stats_reset(struct qat_pci_device *dev,
        struct qat_qp **qp;
 
        if (dev == NULL || service >= QAT_SERVICE_INVALID) {
-               PMD_DRV_LOG(ERR, "invalid param: dev %p, service %d",
+               QAT_LOG(ERR, "invalid param: dev %p, service %d",
                                dev, service);
                return;
        }
@@ -96,12 +96,12 @@ void qat_stats_reset(struct qat_pci_device *dev,
        qp = dev->qps_in_use[service];
        for (i = 0; i < ADF_MAX_QPS_ON_ANY_SERVICE; i++) {
                if (qp[i] == NULL) {
-                       PMD_DRV_LOG(DEBUG, "Service %d Uninitialised qp %d",
+                       QAT_LOG(DEBUG, "Service %d Uninitialised qp %d",
                                        service, i);
                        continue;
                }
                memset(&(qp[i]->stats), 0, sizeof(qp[i]->stats));
        }
 
-       PMD_DRV_LOG(DEBUG, "QAT: %d stats cleared", service);
+       QAT_LOG(DEBUG, "QAT: %d stats cleared", service);
 }
index 0cab2e9..4b97c84 100644 (file)
@@ -105,14 +105,14 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev)
        rte_pci_device_name(&pci_dev->addr, name, sizeof(name));
        snprintf(name+strlen(name), QAT_DEV_NAME_MAX_LEN-strlen(name), "_qat");
        if (qat_pci_get_named_dev(name) != NULL) {
-               PMD_DRV_LOG(ERR, "QAT device with name %s already allocated!",
+               QAT_LOG(ERR, "QAT device with name %s already allocated!",
                                name);
                return NULL;
        }
 
        qat_dev_id = qat_pci_find_free_device_index();
        if (qat_dev_id == RTE_PMD_QAT_MAX_PCI_DEVICES) {
-               PMD_DRV_LOG(ERR, "Reached maximum number of QAT devices");
+               QAT_LOG(ERR, "Reached maximum number of QAT devices");
                return NULL;
        }
 
@@ -131,7 +131,7 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev)
                qat_dev->qat_dev_gen = QAT_GEN2;
                break;
        default:
-               PMD_DRV_LOG(ERR, "Invalid dev_id, can't determine generation");
+               QAT_LOG(ERR, "Invalid dev_id, can't determine generation");
                return NULL;
        }
 
@@ -141,7 +141,7 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev)
 
        qat_nb_pci_devices++;
 
-       PMD_DRV_LOG(DEBUG, "QAT device %d allocated, name %s, total QATs %d",
+       QAT_LOG(DEBUG, "QAT device %d allocated, name %s, total QATs %d",
                        qat_dev->qat_dev_id, qat_dev->name, qat_nb_pci_devices);
 
        return qat_dev;
@@ -168,7 +168,7 @@ qat_pci_device_release(struct rte_pci_device *pci_dev)
                qat_dev->attached = QAT_DETACHED;
                qat_nb_pci_devices--;
        }
-       PMD_DRV_LOG(DEBUG, "QAT device %s released, total QATs %d",
+       QAT_LOG(DEBUG, "QAT device %s released, total QATs %d",
                                name, qat_nb_pci_devices);
        return 0;
 }
@@ -189,7 +189,7 @@ static int qat_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
        int ret = 0;
        struct qat_pci_device *qat_pci_dev;
 
-       PMD_DRV_LOG(DEBUG, "Found QAT device at %02x:%02x.%x",
+       QAT_LOG(DEBUG, "Found QAT device at %02x:%02x.%x",
                        pci_dev->addr.bus,
                        pci_dev->addr.devid,
                        pci_dev->addr.function);
index b00a06b..b12f754 100644 (file)
@@ -7,7 +7,7 @@
 
 extern int qat_gen_logtype;
 
-#define PMD_DRV_LOG(level, fmt, args...)                       \
+#define QAT_LOG(level, fmt, args...)                   \
        rte_log(RTE_LOG_ ## level, qat_gen_logtype,             \
                        "%s(): " fmt "\n", __func__, ## args)
 
index 531752b..32c1759 100644 (file)
@@ -125,12 +125,12 @@ queue_dma_zone_reserve(const char *queue_name, uint32_t queue_size,
                if (((size_t)queue_size <= mz->len) &&
                                ((socket_id == SOCKET_ID_ANY) ||
                                        (socket_id == mz->socket_id))) {
-                       PMD_DRV_LOG(DEBUG, "re-use memzone already "
+                       QAT_LOG(DEBUG, "re-use memzone already "
                                        "allocated for %s", queue_name);
                        return mz;
                }
 
-               PMD_DRV_LOG(ERR, "Incompatible memzone already "
+               QAT_LOG(ERR, "Incompatible memzone already "
                                "allocated %s, size %u, socket %d. "
                                "Requested size %u, socket %u",
                                queue_name, (uint32_t)mz->len,
@@ -138,7 +138,7 @@ queue_dma_zone_reserve(const char *queue_name, uint32_t queue_size,
                return NULL;
        }
 
-       PMD_DRV_LOG(DEBUG, "Allocate memzone for %s, size %u on socket %u",
+       QAT_LOG(DEBUG, "Allocate memzone for %s, size %u on socket %u",
                                        queue_name, queue_size, socket_id);
        return rte_memzone_reserve_aligned(queue_name, queue_size,
                socket_id, RTE_MEMZONE_IOVA_CONTIG, queue_size);
@@ -155,18 +155,18 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
        char op_cookie_pool_name[RTE_RING_NAMESIZE];
        uint32_t i;
 
-       PMD_DRV_LOG(DEBUG, "Setup qp %u on qat pci device %d gen %d",
+       QAT_LOG(DEBUG, "Setup qp %u on qat pci device %d gen %d",
                queue_pair_id, qat_dev->qat_dev_id, qat_dev->qat_dev_gen);
 
        if ((qat_qp_conf->nb_descriptors > ADF_MAX_DESC) ||
                (qat_qp_conf->nb_descriptors < ADF_MIN_DESC)) {
-               PMD_DRV_LOG(ERR, "Can't create qp for %u descriptors",
+               QAT_LOG(ERR, "Can't create qp for %u descriptors",
                                qat_qp_conf->nb_descriptors);
                return -EINVAL;
        }
 
        if (pci_dev->mem_resource[0].addr == NULL) {
-               PMD_DRV_LOG(ERR, "Could not find VF config space "
+               QAT_LOG(ERR, "Could not find VF config space "
                                "(UIO driver attached?).");
                return -EINVAL;
        }
@@ -175,7 +175,7 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
        qp = rte_zmalloc("qat PMD qp metadata",
                        sizeof(*qp), RTE_CACHE_LINE_SIZE);
        if (qp == NULL) {
-               PMD_DRV_LOG(ERR, "Failed to alloc mem for qp struct");
+               QAT_LOG(ERR, "Failed to alloc mem for qp struct");
                return -ENOMEM;
        }
        qp->nb_descriptors = qat_qp_conf->nb_descriptors;
@@ -183,7 +183,7 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
                        qat_qp_conf->nb_descriptors * sizeof(*qp->op_cookies),
                        RTE_CACHE_LINE_SIZE);
        if (qp->op_cookies == NULL) {
-               PMD_DRV_LOG(ERR, "Failed to alloc mem for cookie");
+               QAT_LOG(ERR, "Failed to alloc mem for cookie");
                rte_free(qp);
                return -ENOMEM;
        }
@@ -193,14 +193,14 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 
        if (qat_queue_create(qat_dev, &(qp->tx_q), qat_qp_conf,
                                        ADF_RING_DIR_TX) != 0) {
-               PMD_DRV_LOG(ERR, "Tx queue create failed "
+               QAT_LOG(ERR, "Tx queue create failed "
                                "queue_pair_id=%u", queue_pair_id);
                goto create_err;
        }
 
        if (qat_queue_create(qat_dev, &(qp->rx_q), qat_qp_conf,
                                        ADF_RING_DIR_RX) != 0) {
-               PMD_DRV_LOG(ERR, "Rx queue create failed "
+               QAT_LOG(ERR, "Rx queue create failed "
                                "queue_pair_id=%hu", queue_pair_id);
                qat_queue_delete(&(qp->tx_q));
                goto create_err;
@@ -215,7 +215,7 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
                pci_dev->driver->driver.name, qat_dev->qat_dev_id,
                qat_qp_conf->service_str, queue_pair_id);
 
-       PMD_DRV_LOG(DEBUG, "cookiepool: %s", op_cookie_pool_name);
+       QAT_LOG(DEBUG, "cookiepool: %s", op_cookie_pool_name);
        qp->op_cookie_pool = rte_mempool_lookup(op_cookie_pool_name);
        if (qp->op_cookie_pool == NULL)
                qp->op_cookie_pool = rte_mempool_create(op_cookie_pool_name,
@@ -224,14 +224,14 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
                                NULL, NULL, NULL, NULL, qat_qp_conf->socket_id,
                                0);
        if (!qp->op_cookie_pool) {
-               PMD_DRV_LOG(ERR, "QAT PMD Cannot create"
+               QAT_LOG(ERR, "QAT PMD Cannot create"
                                " op mempool");
                goto create_err;
        }
 
        for (i = 0; i < qp->nb_descriptors; i++) {
                if (rte_mempool_get(qp->op_cookie_pool, &qp->op_cookies[i])) {
-                       PMD_DRV_LOG(ERR, "QAT PMD Cannot get op_cookie");
+                       QAT_LOG(ERR, "QAT PMD Cannot get op_cookie");
                        goto create_err;
                }
        }
@@ -241,7 +241,7 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
        qp->service_type = qat_qp_conf->hw->service_type;
        qp->qat_dev = qat_dev;
 
-       PMD_DRV_LOG(DEBUG, "QP setup complete: id: %d, cookiepool: %s",
+       QAT_LOG(DEBUG, "QP setup complete: id: %d, cookiepool: %s",
                        queue_pair_id, op_cookie_pool_name);
 
        *qp_addr = qp;
@@ -261,11 +261,11 @@ int qat_qp_release(struct qat_qp **qp_addr)
        uint32_t i;
 
        if (qp == NULL) {
-               PMD_DRV_LOG(DEBUG, "qp already freed");
+               QAT_LOG(DEBUG, "qp already freed");
                return 0;
        }
 
-       PMD_DRV_LOG(DEBUG, "Free qp on qat_pci device %d",
+       QAT_LOG(DEBUG, "Free qp on qat_pci device %d",
                                qp->qat_dev->qat_dev_id);
 
        /* Don't free memory if there are still responses to be processed */
@@ -298,10 +298,10 @@ static void qat_queue_delete(struct qat_queue *queue)
        int status = 0;
 
        if (queue == NULL) {
-               PMD_DRV_LOG(DEBUG, "Invalid queue");
+               QAT_LOG(DEBUG, "Invalid queue");
                return;
        }
-       PMD_DRV_LOG(DEBUG, "Free ring %d, memzone: %s",
+       QAT_LOG(DEBUG, "Free ring %d, memzone: %s",
                        queue->hw_queue_number, queue->memz_name);
 
        mz = rte_memzone_lookup(queue->memz_name);
@@ -310,10 +310,10 @@ static void qat_queue_delete(struct qat_queue *queue)
                memset(queue->base_addr, 0x7F, queue->queue_size);
                status = rte_memzone_free(mz);
                if (status != 0)
-                       PMD_DRV_LOG(ERR, "Error %d on freeing queue %s",
+                       QAT_LOG(ERR, "Error %d on freeing queue %s",
                                        status, queue->memz_name);
        } else {
-               PMD_DRV_LOG(DEBUG, "queue %s doesn't exist",
+               QAT_LOG(DEBUG, "queue %s doesn't exist",
                                queue->memz_name);
        }
 }
@@ -336,7 +336,7 @@ qat_queue_create(struct qat_pci_device *qat_dev, struct qat_queue *queue,
                        qp_conf->hw->tx_ring_num : qp_conf->hw->rx_ring_num);
 
        if (desc_size > ADF_MSG_SIZE_TO_BYTES(ADF_MAX_MSG_SIZE)) {
-               PMD_DRV_LOG(ERR, "Invalid descriptor size %d", desc_size);
+               QAT_LOG(ERR, "Invalid descriptor size %d", desc_size);
                return -EINVAL;
        }
 
@@ -351,7 +351,7 @@ qat_queue_create(struct qat_pci_device *qat_dev, struct qat_queue *queue,
        qp_mz = queue_dma_zone_reserve(queue->memz_name, queue_size_bytes,
                        qp_conf->socket_id);
        if (qp_mz == NULL) {
-               PMD_DRV_LOG(ERR, "Failed to allocate ring memzone");
+               QAT_LOG(ERR, "Failed to allocate ring memzone");
                return -ENOMEM;
        }
 
@@ -359,7 +359,7 @@ qat_queue_create(struct qat_pci_device *qat_dev, struct qat_queue *queue,
        queue->base_phys_addr = qp_mz->iova;
        if (qat_qp_check_queue_alignment(queue->base_phys_addr,
                        queue_size_bytes)) {
-               PMD_DRV_LOG(ERR, "Invalid alignment on queue create "
+               QAT_LOG(ERR, "Invalid alignment on queue create "
                                        " 0x%"PRIx64"\n",
                                        queue->base_phys_addr);
                ret = -EFAULT;
@@ -368,7 +368,7 @@ qat_queue_create(struct qat_pci_device *qat_dev, struct qat_queue *queue,
 
        if (adf_verify_queue_size(desc_size, qp_conf->nb_descriptors,
                        &(queue->queue_size)) != 0) {
-               PMD_DRV_LOG(ERR, "Invalid num inflights");
+               QAT_LOG(ERR, "Invalid num inflights");
                ret = -EINVAL;
                goto queue_create_err;
        }
@@ -378,7 +378,7 @@ qat_queue_create(struct qat_pci_device *qat_dev, struct qat_queue *queue,
        queue->modulo_mask = (1 << ADF_RING_SIZE_MODULO(queue->queue_size)) - 1;
 
        if (queue->max_inflights < 2) {
-               PMD_DRV_LOG(ERR, "Invalid num inflights");
+               QAT_LOG(ERR, "Invalid num inflights");
                ret = -EINVAL;
                goto queue_create_err;
        }
@@ -399,7 +399,7 @@ qat_queue_create(struct qat_pci_device *qat_dev, struct qat_queue *queue,
        WRITE_CSR_RING_BASE(io_addr, queue->hw_bundle_number,
                        queue->hw_queue_number, queue_base);
 
-       PMD_DRV_LOG(DEBUG, "RING: Name:%s, size in CSR: %u, in bytes %u,"
+       QAT_LOG(DEBUG, "RING: Name:%s, size in CSR: %u, in bytes %u,"
                " nb msgs %u, msg_size %u, max_inflights %u modulo mask %u",
                        queue->memz_name,
                        queue->queue_size, queue_size_bytes,
@@ -432,7 +432,7 @@ static int adf_verify_queue_size(uint32_t msg_size, uint32_t msg_num,
                        *p_queue_size_for_csr = i;
                        return 0;
                }
-       PMD_DRV_LOG(ERR, "Invalid ring size %d", msg_size * msg_num);
+       QAT_LOG(ERR, "Invalid ring size %d", msg_size * msg_num);
        return -EINVAL;
 }
 
index 887d4eb..7bedad3 100644 (file)
@@ -39,7 +39,7 @@ bpi_cipher_decrypt(uint8_t *src, uint8_t *dst,
        return 0;
 
 cipher_decrypt_err:
-       PMD_DRV_LOG(ERR, "libcrypto ECB cipher decrypt for BPI IV failed");
+       QAT_LOG(ERR, "libcrypto ECB cipher decrypt for BPI IV failed");
        return -EINVAL;
 }
 
@@ -165,14 +165,14 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
 
 #ifdef RTE_LIBRTE_PMD_QAT_DEBUG_TX
        if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
-               PMD_DRV_LOG(ERR, "QAT PMD only supports symmetric crypto "
+               QAT_LOG(ERR, "QAT PMD only supports symmetric crypto "
                                "operation requests, op (%p) is not a "
                                "symmetric operation.", op);
                return -EINVAL;
        }
 #endif
        if (unlikely(op->sess_type == RTE_CRYPTO_OP_SESSIONLESS)) {
-               PMD_DRV_LOG(ERR, "QAT PMD only supports session oriented"
+               QAT_LOG(ERR, "QAT PMD only supports session oriented"
                                " requests, op (%p) is sessionless.", op);
                return -EINVAL;
        }
@@ -181,12 +181,12 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
                        op->sym->session, cryptodev_qat_driver_id);
 
        if (unlikely(ctx == NULL)) {
-               PMD_DRV_LOG(ERR, "Session was not created for this device");
+               QAT_LOG(ERR, "Session was not created for this device");
                return -EINVAL;
        }
 
        if (unlikely(ctx->min_qat_dev_gen > qat_dev_gen)) {
-               PMD_DRV_LOG(ERR, "Session alg not supported on this device gen");
+               QAT_LOG(ERR, "Session alg not supported on this device gen");
                op->status = RTE_CRYPTO_OP_STATUS_INVALID_SESSION;
                return -EINVAL;
        }
@@ -231,7 +231,7 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
                                (cipher_param->cipher_length % BYTE_LENGTH != 0)
                                 || (cipher_param->cipher_offset
                                                        % BYTE_LENGTH != 0))) {
-                               PMD_DRV_LOG(ERR,
+                               QAT_LOG(ERR,
                  "SNOW3G/KASUMI/ZUC in QAT PMD only supports byte aligned values");
                                op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
                                return -EINVAL;
@@ -265,7 +265,7 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
                                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,
+                               QAT_LOG(ERR,
                "For SNOW3G/KASUMI/ZUC, QAT PMD only supports byte aligned values");
                                op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
                                return -EINVAL;
@@ -501,7 +501,7 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
                                &cookie->qat_sgl_src,
                                qat_req->comn_mid.src_length);
                if (ret) {
-                       PMD_DRV_LOG(ERR, "QAT PMD Cannot fill sgl array");
+                       QAT_LOG(ERR, "QAT PMD Cannot fill sgl array");
                        return ret;
                }
 
@@ -516,7 +516,7 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
                                                qat_req->comn_mid.dst_length);
 
                        if (ret) {
-                               PMD_DRV_LOG(ERR, "QAT PMD Cannot "
+                               QAT_LOG(ERR, "QAT PMD Cannot "
                                                "fill sgl array");
                                return ret;
                        }
index ddd0f47..b693a4d 100644 (file)
@@ -59,7 +59,7 @@ bpi_cipher_encrypt(uint8_t *src, uint8_t *dst,
        return 0;
 
 cipher_encrypt_err:
-       PMD_DRV_LOG(ERR, "libcrypto ECB cipher encrypt failed");
+       QAT_LOG(ERR, "libcrypto ECB cipher encrypt failed");
        return -EINVAL;
 }
 
index 8797c0e..1156390 100644 (file)
@@ -85,7 +85,7 @@ static void qat_sym_stats_get(struct rte_cryptodev *dev,
        struct qat_sym_dev_private *qat_priv;
 
        if (stats == NULL || dev == NULL) {
-               PMD_DRV_LOG(ERR, "invalid ptr: stats %p, dev %p", stats, dev);
+               QAT_LOG(ERR, "invalid ptr: stats %p, dev %p", stats, dev);
                return;
        }
        qat_priv = dev->data->dev_private;
@@ -102,7 +102,7 @@ static void qat_sym_stats_reset(struct rte_cryptodev *dev)
        struct qat_sym_dev_private *qat_priv;
 
        if (dev == NULL) {
-               PMD_DRV_LOG(ERR, "invalid cryptodev ptr %p", dev);
+               QAT_LOG(ERR, "invalid cryptodev ptr %p", dev);
                return;
        }
        qat_priv = dev->data->dev_private;
@@ -115,7 +115,7 @@ static int qat_sym_qp_release(struct rte_cryptodev *dev, uint16_t queue_pair_id)
 {
        struct qat_sym_dev_private *qat_private = dev->data->dev_private;
 
-       PMD_DRV_LOG(DEBUG, "Release sym qp %u on device %d",
+       QAT_LOG(DEBUG, "Release sym qp %u on device %d",
                                queue_pair_id, dev->data->dev_id);
 
        qat_private->qat_dev->qps_in_use[QAT_SERVICE_SYMMETRIC][queue_pair_id]
@@ -149,7 +149,7 @@ static int qat_sym_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
                        return ret;
        }
        if (qp_id >= qat_qps_per_service(sym_hw_qps, QAT_SERVICE_SYMMETRIC)) {
-               PMD_DRV_LOG(ERR, "qp_id %u invalid for this device", qp_id);
+               QAT_LOG(ERR, "qp_id %u invalid for this device", qp_id);
                return -EINVAL;
        }
 
@@ -253,7 +253,7 @@ qat_sym_dev_create(struct qat_pci_device *qat_pci_dev)
 
        snprintf(name, RTE_CRYPTODEV_NAME_MAX_LEN, "%s_%s",
                        qat_pci_dev->name, "sym");
-       PMD_DRV_LOG(DEBUG, "Creating QAT SYM device %s", name);
+       QAT_LOG(DEBUG, "Creating QAT SYM device %s", name);
 
        /* Populate subset device to use in cryptodev device creation */
        qat_pci_dev->sym_rte_dev.driver = &cryptodev_qat_sym_driver;
@@ -293,13 +293,13 @@ qat_sym_dev_create(struct qat_pci_device *qat_pci_dev)
                break;
        default:
                internals->qat_dev_capabilities = qat_gen2_sym_capabilities;
-               PMD_DRV_LOG(DEBUG,
+               QAT_LOG(DEBUG,
                        "QAT gen %d capabilities unknown, default to GEN2",
                                        qat_pci_dev->qat_dev_gen);
                break;
        }
 
-       PMD_DRV_LOG(DEBUG, "Created QAT SYM device %s as cryptodev instance %d",
+       QAT_LOG(DEBUG, "Created QAT SYM device %s as cryptodev instance %d",
                        cryptodev->data->name, internals->sym_dev_id);
        return 0;
 }
index 83d0fb1..dc1c200 100644 (file)
@@ -217,7 +217,7 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
        case RTE_CRYPTO_CIPHER_AES_CBC:
                if (qat_sym_validate_aes_key(cipher_xform->key.length,
                                &session->qat_cipher_alg) != 0) {
-                       PMD_DRV_LOG(ERR, "Invalid AES cipher key size");
+                       QAT_LOG(ERR, "Invalid AES cipher key size");
                        ret = -EINVAL;
                        goto error_out;
                }
@@ -226,7 +226,7 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
        case RTE_CRYPTO_CIPHER_AES_CTR:
                if (qat_sym_validate_aes_key(cipher_xform->key.length,
                                &session->qat_cipher_alg) != 0) {
-                       PMD_DRV_LOG(ERR, "Invalid AES cipher key size");
+                       QAT_LOG(ERR, "Invalid AES cipher key size");
                        ret = -EINVAL;
                        goto error_out;
                }
@@ -235,7 +235,7 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
        case RTE_CRYPTO_CIPHER_SNOW3G_UEA2:
                if (qat_sym_validate_snow3g_key(cipher_xform->key.length,
                                        &session->qat_cipher_alg) != 0) {
-                       PMD_DRV_LOG(ERR, "Invalid SNOW 3G cipher key size");
+                       QAT_LOG(ERR, "Invalid SNOW 3G cipher key size");
                        ret = -EINVAL;
                        goto error_out;
                }
@@ -247,7 +247,7 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
        case RTE_CRYPTO_CIPHER_KASUMI_F8:
                if (qat_sym_validate_kasumi_key(cipher_xform->key.length,
                                        &session->qat_cipher_alg) != 0) {
-                       PMD_DRV_LOG(ERR, "Invalid KASUMI cipher key size");
+                       QAT_LOG(ERR, "Invalid KASUMI cipher key size");
                        ret = -EINVAL;
                        goto error_out;
                }
@@ -256,7 +256,7 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
        case RTE_CRYPTO_CIPHER_3DES_CBC:
                if (qat_sym_validate_3des_key(cipher_xform->key.length,
                                &session->qat_cipher_alg) != 0) {
-                       PMD_DRV_LOG(ERR, "Invalid 3DES cipher key size");
+                       QAT_LOG(ERR, "Invalid 3DES cipher key size");
                        ret = -EINVAL;
                        goto error_out;
                }
@@ -265,7 +265,7 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
        case RTE_CRYPTO_CIPHER_DES_CBC:
                if (qat_sym_validate_des_key(cipher_xform->key.length,
                                &session->qat_cipher_alg) != 0) {
-                       PMD_DRV_LOG(ERR, "Invalid DES cipher key size");
+                       QAT_LOG(ERR, "Invalid DES cipher key size");
                        ret = -EINVAL;
                        goto error_out;
                }
@@ -274,7 +274,7 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
        case RTE_CRYPTO_CIPHER_3DES_CTR:
                if (qat_sym_validate_3des_key(cipher_xform->key.length,
                                &session->qat_cipher_alg) != 0) {
-                       PMD_DRV_LOG(ERR, "Invalid 3DES cipher key size");
+                       QAT_LOG(ERR, "Invalid 3DES cipher key size");
                        ret = -EINVAL;
                        goto error_out;
                }
@@ -287,12 +287,12 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
                                        cipher_xform->key.data,
                                        &session->bpi_ctx);
                if (ret != 0) {
-                       PMD_DRV_LOG(ERR, "failed to create DES BPI ctx");
+                       QAT_LOG(ERR, "failed to create DES BPI ctx");
                        goto error_out;
                }
                if (qat_sym_validate_des_key(cipher_xform->key.length,
                                &session->qat_cipher_alg) != 0) {
-                       PMD_DRV_LOG(ERR, "Invalid DES cipher key size");
+                       QAT_LOG(ERR, "Invalid DES cipher key size");
                        ret = -EINVAL;
                        goto error_out;
                }
@@ -305,12 +305,12 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
                                        cipher_xform->key.data,
                                        &session->bpi_ctx);
                if (ret != 0) {
-                       PMD_DRV_LOG(ERR, "failed to create AES BPI ctx");
+                       QAT_LOG(ERR, "failed to create AES BPI ctx");
                        goto error_out;
                }
                if (qat_sym_validate_aes_docsisbpi_key(cipher_xform->key.length,
                                &session->qat_cipher_alg) != 0) {
-                       PMD_DRV_LOG(ERR, "Invalid AES DOCSISBPI key size");
+                       QAT_LOG(ERR, "Invalid AES DOCSISBPI key size");
                        ret = -EINVAL;
                        goto error_out;
                }
@@ -319,7 +319,7 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
        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",
+                       QAT_LOG(ERR, "%s not supported on this device",
                                rte_crypto_cipher_algorithm_strings
                                        [cipher_xform->algo]);
                        ret = -ENOTSUP;
@@ -327,7 +327,7 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
                }
                if (qat_sym_validate_zuc_key(cipher_xform->key.length,
                                &session->qat_cipher_alg) != 0) {
-                       PMD_DRV_LOG(ERR, "Invalid ZUC cipher key size");
+                       QAT_LOG(ERR, "Invalid ZUC cipher key size");
                        ret = -EINVAL;
                        goto error_out;
                }
@@ -338,12 +338,12 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
        case RTE_CRYPTO_CIPHER_AES_F8:
        case RTE_CRYPTO_CIPHER_AES_XTS:
        case RTE_CRYPTO_CIPHER_ARC4:
-               PMD_DRV_LOG(ERR, "Crypto QAT PMD: Unsupported Cipher alg %u",
+               QAT_LOG(ERR, "Crypto QAT PMD: Unsupported Cipher alg %u",
                                cipher_xform->algo);
                ret = -ENOTSUP;
                goto error_out;
        default:
-               PMD_DRV_LOG(ERR, "Crypto: Undefined Cipher specified %u\n",
+               QAT_LOG(ERR, "Crypto: Undefined Cipher specified %u\n",
                                cipher_xform->algo);
                ret = -EINVAL;
                goto error_out;
@@ -388,7 +388,7 @@ qat_sym_session_configure(struct rte_cryptodev *dev,
 
        ret = qat_sym_session_set_parameters(dev, xform, sess_private_data);
        if (ret != 0) {
-               PMD_DRV_LOG(ERR,
+               QAT_LOG(ERR,
                    "Crypto QAT PMD: failed to configure session parameters");
 
                /* Return session to mempool */
@@ -419,7 +419,7 @@ qat_sym_session_set_parameters(struct rte_cryptodev *dev,
        /* Get requested QAT command id */
        qat_cmd_id = qat_get_cmd_id(xform);
        if (qat_cmd_id < 0 || qat_cmd_id >= ICP_QAT_FW_LA_CMD_DELIMITER) {
-               PMD_DRV_LOG(ERR, "Unsupported xform chain requested");
+               QAT_LOG(ERR, "Unsupported xform chain requested");
                return -ENOTSUP;
        }
        session->qat_cmd = (enum icp_qat_fw_la_cmd_id)qat_cmd_id;
@@ -477,11 +477,11 @@ qat_sym_session_set_parameters(struct rte_cryptodev *dev,
        case ICP_QAT_FW_LA_CMD_AUTH_PRE_COMP:
        case ICP_QAT_FW_LA_CMD_CIPHER_PRE_COMP:
        case ICP_QAT_FW_LA_CMD_DELIMITER:
-       PMD_DRV_LOG(ERR, "Unsupported Service %u",
+       QAT_LOG(ERR, "Unsupported Service %u",
                session->qat_cmd);
                return -ENOTSUP;
        default:
-       PMD_DRV_LOG(ERR, "Unsupported Service %u",
+       QAT_LOG(ERR, "Unsupported Service %u",
                session->qat_cmd);
                return -ENOTSUP;
        }
@@ -521,7 +521,7 @@ qat_sym_session_configure_auth(struct rte_cryptodev *dev,
        case RTE_CRYPTO_AUTH_AES_GMAC:
                if (qat_sym_validate_aes_key(auth_xform->key.length,
                                &session->qat_cipher_alg) != 0) {
-                       PMD_DRV_LOG(ERR, "Invalid AES key size");
+                       QAT_LOG(ERR, "Invalid AES key size");
                        return -EINVAL;
                }
                session->qat_mode = ICP_QAT_HW_CIPHER_CTR_MODE;
@@ -542,7 +542,7 @@ qat_sym_session_configure_auth(struct rte_cryptodev *dev,
                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",
+                       QAT_LOG(ERR, "%s not supported on this device",
                                rte_crypto_auth_algorithm_strings
                                [auth_xform->algo]);
                        return -ENOTSUP;
@@ -557,11 +557,11 @@ qat_sym_session_configure_auth(struct rte_cryptodev *dev,
        case RTE_CRYPTO_AUTH_MD5:
        case RTE_CRYPTO_AUTH_AES_CMAC:
        case RTE_CRYPTO_AUTH_AES_CBC_MAC:
-               PMD_DRV_LOG(ERR, "Crypto: Unsupported hash alg %u",
+               QAT_LOG(ERR, "Crypto: Unsupported hash alg %u",
                                auth_xform->algo);
                return -ENOTSUP;
        default:
-               PMD_DRV_LOG(ERR, "Crypto: Undefined Hash algo %u specified",
+               QAT_LOG(ERR, "Crypto: Undefined Hash algo %u specified",
                                auth_xform->algo);
                return -EINVAL;
        }
@@ -645,7 +645,7 @@ qat_sym_session_configure_aead(struct rte_crypto_sym_xform *xform,
        case RTE_CRYPTO_AEAD_AES_GCM:
                if (qat_sym_validate_aes_key(aead_xform->key.length,
                                &session->qat_cipher_alg) != 0) {
-                       PMD_DRV_LOG(ERR, "Invalid AES key size");
+                       QAT_LOG(ERR, "Invalid AES key size");
                        return -EINVAL;
                }
                session->qat_mode = ICP_QAT_HW_CIPHER_CTR_MODE;
@@ -654,14 +654,14 @@ qat_sym_session_configure_aead(struct rte_crypto_sym_xform *xform,
        case RTE_CRYPTO_AEAD_AES_CCM:
                if (qat_sym_validate_aes_key(aead_xform->key.length,
                                &session->qat_cipher_alg) != 0) {
-                       PMD_DRV_LOG(ERR, "Invalid AES key size");
+                       QAT_LOG(ERR, "Invalid AES key size");
                        return -EINVAL;
                }
                session->qat_mode = ICP_QAT_HW_CIPHER_CTR_MODE;
                session->qat_hash_alg = ICP_QAT_HW_AUTH_ALGO_AES_CBC_MAC;
                break;
        default:
-               PMD_DRV_LOG(ERR, "Crypto: Undefined AEAD specified %u\n",
+               QAT_LOG(ERR, "Crypto: Undefined AEAD specified %u\n",
                                aead_xform->algo);
                return -EINVAL;
        }
@@ -737,7 +737,7 @@ int qat_cipher_get_block_size(enum icp_qat_hw_cipher_algo qat_cipher_alg)
        case ICP_QAT_HW_CIPHER_ALGO_AES256:
                return ICP_QAT_HW_AES_BLK_SZ;
        default:
-               PMD_DRV_LOG(ERR, "invalid block cipher alg %u", qat_cipher_alg);
+               QAT_LOG(ERR, "invalid block cipher alg %u", qat_cipher_alg);
                return -EFAULT;
        };
        return -EFAULT;
@@ -795,7 +795,7 @@ static int qat_hash_get_state1_size(enum icp_qat_hw_auth_algo qat_hash_alg)
                return QAT_HW_ROUND_UP(ICP_QAT_HW_SHA512_STATE1_SZ,
                                                QAT_HW_DEFAULT_ALIGNMENT);
        default:
-               PMD_DRV_LOG(ERR, "invalid hash alg %u", qat_hash_alg);
+               QAT_LOG(ERR, "invalid hash alg %u", qat_hash_alg);
                return -EFAULT;
        };
        return -EFAULT;
@@ -821,7 +821,7 @@ static int qat_hash_get_digest_size(enum icp_qat_hw_auth_algo qat_hash_alg)
                /* return maximum digest size in this case */
                return ICP_QAT_HW_SHA512_STATE1_SZ;
        default:
-               PMD_DRV_LOG(ERR, "invalid hash alg %u", qat_hash_alg);
+               QAT_LOG(ERR, "invalid hash alg %u", qat_hash_alg);
                return -EFAULT;
        };
        return -EFAULT;
@@ -849,7 +849,7 @@ static int qat_hash_get_block_size(enum icp_qat_hw_auth_algo qat_hash_alg)
                /* return maximum block size in this case */
                return SHA512_CBLOCK;
        default:
-               PMD_DRV_LOG(ERR, "invalid hash alg %u", qat_hash_alg);
+               QAT_LOG(ERR, "invalid hash alg %u", qat_hash_alg);
                return -EFAULT;
        };
        return -EFAULT;
@@ -981,7 +981,7 @@ static int partial_hash_compute(enum icp_qat_hw_auth_algo hash_alg,
                        return -EFAULT;
                break;
        default:
-               PMD_DRV_LOG(ERR, "invalid hash alg %u", hash_alg);
+               QAT_LOG(ERR, "invalid hash alg %u", hash_alg);
                return -EFAULT;
        }
 
@@ -1021,7 +1021,7 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg,
                in = rte_zmalloc("working mem for key",
                                ICP_QAT_HW_AES_XCBC_MAC_STATE2_SZ, 16);
                if (in == NULL) {
-                       PMD_DRV_LOG(ERR, "Failed to alloc memory");
+                       QAT_LOG(ERR, "Failed to alloc memory");
                        return -ENOMEM;
                }
 
@@ -1056,7 +1056,7 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg,
                in = rte_zmalloc("working mem for key",
                                ICP_QAT_HW_GALOIS_H_SZ, 16);
                if (in == NULL) {
-                       PMD_DRV_LOG(ERR, "Failed to alloc memory");
+                       QAT_LOG(ERR, "Failed to alloc memory");
                        return -ENOMEM;
                }
 
@@ -1081,7 +1081,7 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg,
        memset(opad, 0, block_size);
 
        if (auth_keylen > (unsigned int)block_size) {
-               PMD_DRV_LOG(ERR, "invalid keylen %u", auth_keylen);
+               QAT_LOG(ERR, "invalid keylen %u", auth_keylen);
                return -EFAULT;
        }
        rte_memcpy(ipad, auth_key, auth_keylen);
@@ -1098,7 +1098,7 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg,
        if (partial_hash_compute(hash_alg, ipad, p_state_buf)) {
                memset(ipad, 0, block_size);
                memset(opad, 0, block_size);
-               PMD_DRV_LOG(ERR, "ipad precompute failed");
+               QAT_LOG(ERR, "ipad precompute failed");
                return -EFAULT;
        }
 
@@ -1110,7 +1110,7 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg,
        if (partial_hash_compute(hash_alg, opad, p_state_buf + *p_state_len)) {
                memset(ipad, 0, block_size);
                memset(opad, 0, block_size);
-               PMD_DRV_LOG(ERR, "opad precompute failed");
+               QAT_LOG(ERR, "opad precompute failed");
                return -EFAULT;
        }
 
@@ -1230,7 +1230,7 @@ int qat_sym_session_aead_create_cd_cipher(struct qat_sym_session *cdesc,
                                        ICP_QAT_FW_SLICE_DRAM_WR);
                cdesc->cd_cur_ptr = (uint8_t *)&cdesc->cd;
        } else if (cdesc->qat_cmd != ICP_QAT_FW_LA_CMD_HASH_CIPHER) {
-               PMD_DRV_LOG(ERR, "Invalid param, must be a cipher command.");
+               QAT_LOG(ERR, "Invalid param, must be a cipher command.");
                return -EFAULT;
        }
 
@@ -1379,7 +1379,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
                                ICP_QAT_FW_SLICE_DRAM_WR);
                cdesc->cd_cur_ptr = (uint8_t *)&cdesc->cd;
        } else if (cdesc->qat_cmd != ICP_QAT_FW_LA_CMD_CIPHER_HASH) {
-               PMD_DRV_LOG(ERR, "Invalid param, must be a hash command.");
+               QAT_LOG(ERR, "Invalid param, must be a hash command.");
                return -EFAULT;
        }
 
@@ -1424,7 +1424,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
        case ICP_QAT_HW_AUTH_ALGO_SHA1:
                if (qat_sym_do_precomputes(ICP_QAT_HW_AUTH_ALGO_SHA1,
                        authkey, authkeylen, cdesc->cd_cur_ptr, &state1_size)) {
-                       PMD_DRV_LOG(ERR, "(SHA)precompute failed");
+                       QAT_LOG(ERR, "(SHA)precompute failed");
                        return -EFAULT;
                }
                state2_size = RTE_ALIGN_CEIL(ICP_QAT_HW_SHA1_STATE2_SZ, 8);
@@ -1432,7 +1432,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
        case ICP_QAT_HW_AUTH_ALGO_SHA224:
                if (qat_sym_do_precomputes(ICP_QAT_HW_AUTH_ALGO_SHA224,
                        authkey, authkeylen, cdesc->cd_cur_ptr, &state1_size)) {
-                       PMD_DRV_LOG(ERR, "(SHA)precompute failed");
+                       QAT_LOG(ERR, "(SHA)precompute failed");
                        return -EFAULT;
                }
                state2_size = ICP_QAT_HW_SHA224_STATE2_SZ;
@@ -1440,7 +1440,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
        case ICP_QAT_HW_AUTH_ALGO_SHA256:
                if (qat_sym_do_precomputes(ICP_QAT_HW_AUTH_ALGO_SHA256,
                        authkey, authkeylen, cdesc->cd_cur_ptr, &state1_size)) {
-                       PMD_DRV_LOG(ERR, "(SHA)precompute failed");
+                       QAT_LOG(ERR, "(SHA)precompute failed");
                        return -EFAULT;
                }
                state2_size = ICP_QAT_HW_SHA256_STATE2_SZ;
@@ -1448,7 +1448,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
        case ICP_QAT_HW_AUTH_ALGO_SHA384:
                if (qat_sym_do_precomputes(ICP_QAT_HW_AUTH_ALGO_SHA384,
                        authkey, authkeylen, cdesc->cd_cur_ptr, &state1_size)) {
-                       PMD_DRV_LOG(ERR, "(SHA)precompute failed");
+                       QAT_LOG(ERR, "(SHA)precompute failed");
                        return -EFAULT;
                }
                state2_size = ICP_QAT_HW_SHA384_STATE2_SZ;
@@ -1456,7 +1456,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
        case ICP_QAT_HW_AUTH_ALGO_SHA512:
                if (qat_sym_do_precomputes(ICP_QAT_HW_AUTH_ALGO_SHA512,
                        authkey, authkeylen, cdesc->cd_cur_ptr, &state1_size)) {
-                       PMD_DRV_LOG(ERR, "(SHA)precompute failed");
+                       QAT_LOG(ERR, "(SHA)precompute failed");
                        return -EFAULT;
                }
                state2_size = ICP_QAT_HW_SHA512_STATE2_SZ;
@@ -1466,7 +1466,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
                if (qat_sym_do_precomputes(ICP_QAT_HW_AUTH_ALGO_AES_XCBC_MAC,
                        authkey, authkeylen, cdesc->cd_cur_ptr + state1_size,
                        &state2_size)) {
-                       PMD_DRV_LOG(ERR, "(XCBC)precompute failed");
+                       QAT_LOG(ERR, "(XCBC)precompute failed");
                        return -EFAULT;
                }
                break;
@@ -1477,7 +1477,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
                if (qat_sym_do_precomputes(cdesc->qat_hash_alg,
                        authkey, authkeylen, cdesc->cd_cur_ptr + state1_size,
                        &state2_size)) {
-                       PMD_DRV_LOG(ERR, "(GCM)precompute failed");
+                       QAT_LOG(ERR, "(GCM)precompute failed");
                        return -EFAULT;
                }
                /*
@@ -1537,7 +1537,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
                if (qat_sym_do_precomputes(ICP_QAT_HW_AUTH_ALGO_MD5,
                        authkey, authkeylen, cdesc->cd_cur_ptr,
                        &state1_size)) {
-                       PMD_DRV_LOG(ERR, "(MD5)precompute failed");
+                       QAT_LOG(ERR, "(MD5)precompute failed");
                        return -EFAULT;
                }
                state2_size = ICP_QAT_HW_MD5_STATE2_SZ;
@@ -1592,7 +1592,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
                        pTempKey[wordIndex] ^= KASUMI_F9_KEY_MODIFIER_4_BYTES;
                break;
        default:
-               PMD_DRV_LOG(ERR, "Invalid HASH alg %u", cdesc->qat_hash_alg);
+               QAT_LOG(ERR, "Invalid HASH alg %u", cdesc->qat_hash_alg);
                return -EFAULT;
        }