default:
DPAA_SEC_ERR("Crypto: Undefined Cipher specified %u",
xform->cipher.algo);
- return -1;
+ return -ENOTSUP;
}
session->dir = (xform->cipher.op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) ?
DIR_ENC : DIR_DEC;
default:
DPAA_SEC_ERR("Crypto: Unsupported Auth specified %u",
xform->auth.algo);
- return -1;
+ return -ENOTSUP;
}
session->dir = (xform->auth.op == RTE_CRYPTO_AUTH_OP_GENERATE) ?
RTE_CACHE_LINE_SIZE);
if (session->cipher_key.data == NULL && cipher_xform->key.length > 0) {
DPAA_SEC_ERR("No Memory for cipher key");
- return -1;
+ return -ENOMEM;
}
session->cipher_key.length = cipher_xform->key.length;
session->auth_key.data = rte_zmalloc(NULL, auth_xform->key.length,
default:
DPAA_SEC_ERR("Crypto: Unsupported Auth specified %u",
auth_xform->algo);
- return -1;
+ return -ENOTSUP;
}
session->cipher_alg = cipher_xform->algo;
default:
DPAA_SEC_ERR("Crypto: Undefined Cipher specified %u",
cipher_xform->algo);
- return -1;
+ return -ENOTSUP;
}
session->dir = (cipher_xform->op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) ?
DIR_ENC : DIR_DEC;
break;
default:
DPAA_SEC_ERR("unsupported AEAD alg %d", session->aead_alg);
- return -ENOMEM;
+ return -ENOTSUP;
}
session->dir = (xform->aead.op == RTE_CRYPTO_AEAD_OP_ENCRYPT) ?
ret = dpaa_sec_prep_cdb(sess);
if (ret) {
DPAA_SEC_ERR("Unable to prepare sec cdb");
- return -1;
+ return ret;
}
if (unlikely(!RTE_PER_LCORE(dpaa_io))) {
ret = rte_dpaa_portal_init((void *)0);
ret = dpaa_sec_chain_init(dev, xform, session);
} else {
DPAA_SEC_ERR("Not supported: Auth then Cipher");
- return -EINVAL;
+ return -ENOTSUP;
}
/* Authenticate then Cipher */
} else if (xform->type == RTE_CRYPTO_SYM_XFORM_AUTH &&
ret = dpaa_sec_chain_init(dev, xform, session);
} else {
DPAA_SEC_ERR("Not supported: Auth then Cipher");
- return -EINVAL;
+ return -ENOTSUP;
}
/* AEAD operation for AES-GCM kind of Algorithms */
if (session->inq[i] == NULL) {
DPAA_SEC_ERR("unable to attach sec queue");
rte_spinlock_unlock(&internals->lock);
+ ret = -EBUSY;
goto err1;
}
}
err1:
free_session_data(session);
- return -EINVAL;
+ return ret;
}
static int
RTE_CACHE_LINE_SIZE);
if (session->aead_key.data == NULL && aead_xform->key.length > 0) {
DPAA_SEC_ERR("No Memory for aead key");
- return -1;
+ return -ENOMEM;
}
memcpy(session->aead_key.data, aead_xform->key.data,
aead_xform->key.length);
default:
DPAA_SEC_ERR("Crypto: Undefined GCM digest %d",
session->digest_length);
- return -1;
+ return -EINVAL;
}
if (session->dir == DIR_ENC) {
memcpy(session->encap_pdb.gcm.salt,
default:
DPAA_SEC_ERR("Crypto: Undefined AEAD specified %u",
aead_xform->algo);
- return -1;
+ return -ENOTSUP;
}
return 0;
}
case RTE_CRYPTO_AUTH_ZUC_EIA3:
DPAA_SEC_ERR("Crypto: Unsupported auth alg %u",
session->auth_alg);
- return -1;
+ return -ENOTSUP;
default:
DPAA_SEC_ERR("Crypto: Undefined Auth specified %u",
session->auth_alg);
- return -1;
+ return -ENOTSUP;
}
switch (session->cipher_alg) {
case RTE_CRYPTO_CIPHER_KASUMI_F8:
DPAA_SEC_ERR("Crypto: Unsupported Cipher alg %u",
session->cipher_alg);
- return -1;
+ return -ENOTSUP;
default:
DPAA_SEC_ERR("Crypto: Undefined Cipher specified %u",
session->cipher_alg);
- return -1;
+ return -ENOTSUP;
}
return 0;
dpaa_sec_session *session = (dpaa_sec_session *)sess;
struct dpaa_sec_dev_private *dev_priv = dev->data->dev_private;
uint32_t i;
+ int ret;
PMD_INIT_FUNC_TRACE();
default:
DPAA_SEC_ERR("Crypto: Undefined Cipher specified %u",
session->cipher_alg);
- return -1;
+ return -EINVAL;
}
session->cipher_key.data = rte_zmalloc(NULL,
pdcp_xform->sn_size != RTE_SECURITY_PDCP_SN_SIZE_12) {
DPAA_SEC_ERR(
"PDCP Seq Num size should be 5/12 bits for cmode");
+ ret = -EINVAL;
goto out;
}
}
DPAA_SEC_ERR("Crypto: Unsupported auth alg %u",
session->auth_alg);
rte_free(session->cipher_key.data);
- return -1;
+ return -EINVAL;
}
session->auth_key.data = rte_zmalloc(NULL,
auth_xform->key.length,
if (session->inq[i] == NULL) {
DPAA_SEC_ERR("unable to attach sec queue");
rte_spinlock_unlock(&dev_priv->lock);
+ ret = -EBUSY;
goto out;
}
}
rte_free(session->auth_key.data);
rte_free(session->cipher_key.data);
memset(session, 0, sizeof(dpaa_sec_session));
- return -1;
+ return ret;
}
static int
break;
case RTE_SCHED_TYPE_ORDERED:
DPAA_SEC_ERR("Ordered queue schedule type is not supported\n");
- return -1;
+ return -ENOTSUP;
default:
opts.fqd.fq_ctrl |= QM_FQCTRL_AVOIDBLOCK;
qp->outq.cb.dqrr_dpdk_cb = dpaa_sec_process_parallel_event;