net/cnxk: support crypto cipher DES-CBC

Add support for DES-CBC cipher for security offload in inline mode.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
This commit is contained in:
Vidya Sagar Velumuri 2022-09-12 18:44:21 +05:30 committed by Jerin Jacob
parent 61ee9dc8b6
commit e1a9ff6930
2 changed files with 25 additions and 0 deletions

View File

@ -817,6 +817,7 @@ cnxk_ipsec_ivlen_get(enum rte_crypto_cipher_algorithm c_algo,
case RTE_CRYPTO_CIPHER_AES_CTR:
ivlen = 8;
break;
case RTE_CRYPTO_CIPHER_DES_CBC:
case RTE_CRYPTO_CIPHER_3DES_CBC:
ivlen = ROC_CPT_DES_BLOCK_LENGTH;
break;
@ -898,6 +899,7 @@ cnxk_ipsec_outb_roundup_byte(enum rte_crypto_cipher_algorithm c_algo,
case RTE_CRYPTO_CIPHER_AES_CBC:
roundup_byte = 16;
break;
case RTE_CRYPTO_CIPHER_DES_CBC:
case RTE_CRYPTO_CIPHER_3DES_CBC:
roundup_byte = 8;
break;
@ -1033,6 +1035,9 @@ on_ipsec_sa_ctl_set(struct rte_security_ipsec_xform *ipsec,
case RTE_CRYPTO_CIPHER_NULL:
ctl->enc_type = ROC_IE_ON_SA_ENC_NULL;
break;
case RTE_CRYPTO_CIPHER_DES_CBC:
ctl->enc_type = ROC_IE_ON_SA_ENC_DES_CBC;
break;
case RTE_CRYPTO_CIPHER_3DES_CBC:
ctl->enc_type = ROC_IE_ON_SA_ENC_3DES_CBC;
break;

View File

@ -30,6 +30,26 @@ static struct rte_cryptodev_capabilities cn9k_eth_sec_crypto_caps[] = {
}, },
}, }
},
{ /* DES */
.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
}
}, },
}, }
},
{ /* 3DES CBC */
.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
{.sym = {