Rename PMD_DRV_LOG to the more appropriate name QAT_LOG.
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
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;
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
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;
}
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);
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)
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,
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);
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;
}
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;
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;
}
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;
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,
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;
}
}
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;
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 */
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);
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);
}
}
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;
}
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;
}
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;
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;
}
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;
}
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,
*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;
}
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;
}
#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;
}
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;
}
(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;
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;
&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;
}
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;
}
return 0;
cipher_encrypt_err:
- PMD_DRV_LOG(ERR, "libcrypto ECB cipher encrypt failed");
+ QAT_LOG(ERR, "libcrypto ECB cipher encrypt failed");
return -EINVAL;
}
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;
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;
{
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]
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;
}
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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 */
/* 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;
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;
}
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;
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;
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;
}
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;
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;
}
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;
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;
/* 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;
/* 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;
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;
}
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;
}
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;
}
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);
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;
}
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;
}
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;
}
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;
}
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);
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;
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;
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;
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;
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;
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;
}
/*
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;
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;
}