Add null auth support with lookaside IPsec on cn10k crypto PMDs.
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
* Transport mode
* UDP Encapsulation
* AES-128/192/256-GCM
+* AES-128/192/256-CBC-NULL
* AES-128/192/256-CBC-SHA1-HMAC
* Added support for ZUC algorithm with 256-bit key length for CN10K.
* Added support for CN98xx dual block.
* Added inner checksum support in lookaside protocol (IPsec) for CN10K.
+ * Added AES-CBC NULL auth support in lookaside protocol (IPsec) for CN10K.
* **Added support for event crypto adapter on Marvell CN10K and CN9K.**
if (ret)
return ret;
- if (ctl->enc_type == ROC_IE_ON_SA_ENC_AES_GCM) {
+ if (ctl->enc_type == ROC_IE_ON_SA_ENC_AES_GCM ||
+ ctl->auth_type == ROC_IE_ON_SA_AUTH_NULL) {
template = &out_sa->aes_gcm.template;
ctx_len = offsetof(struct roc_ie_on_outb_sa, aes_gcm.template);
} else if (ctl->auth_type == ROC_IE_ON_SA_AUTH_SHA1) {
if (ret)
return ret;
- if (crypto_xform->type == RTE_CRYPTO_SYM_XFORM_AEAD) {
+ if (crypto_xform->type == RTE_CRYPTO_SYM_XFORM_AEAD ||
+ auth_xform->auth.algo == RTE_CRYPTO_AUTH_NULL) {
ctx_len = offsetof(struct roc_ie_on_inb_sa,
sha1_or_gcm.hmac_key[0]);
} else {
*cur_pos += nb_caps;
}
+static void
+cn10k_sec_crypto_caps_update(struct rte_cryptodev_capabilities cnxk_caps[],
+ int *cur_pos)
+{
+ const struct rte_cryptodev_capabilities *cap;
+ unsigned int i;
+
+ if ((CNXK_CPT_MAX_CAPS - *cur_pos) < 1)
+ return;
+
+ /* NULL auth */
+ for (i = 0; i < RTE_DIM(caps_null); i++) {
+ cap = &caps_null[i];
+ if (cap->sym.xform_type == RTE_CRYPTO_SYM_XFORM_AUTH &&
+ cap->sym.auth.algo == RTE_CRYPTO_AUTH_NULL) {
+ cnxk_caps[*cur_pos] = caps_null[i];
+ *cur_pos += 1;
+ }
+ }
+}
+
static void
sec_crypto_caps_populate(struct rte_cryptodev_capabilities cnxk_caps[],
union cpt_eng_caps *hw_caps)
SEC_CAPS_ADD(cnxk_caps, &cur_pos, hw_caps, aes);
SEC_CAPS_ADD(cnxk_caps, &cur_pos, hw_caps, sha1_sha2);
+ if (roc_model_is_cn10k())
+ cn10k_sec_crypto_caps_update(cnxk_caps, &cur_pos);
+
sec_caps_add(cnxk_caps, &cur_pos, caps_end, RTE_DIM(caps_end));
}
{
uint16_t keylen = crypto_xform->auth.key.length;
+ if (crypto_xform->auth.algo == RTE_CRYPTO_AUTH_NULL)
+ return 0;
+
if (crypto_xform->auth.algo == RTE_CRYPTO_AUTH_SHA1_HMAC) {
if (keylen >= 20 && keylen <= 64)
return 0;