[1/1] net/cnxk: enable 3des-cbc capability

Message ID 20220430045955.1875892-1-vattunuru@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series [1/1] net/cnxk: enable 3des-cbc capability |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Vamsi Krishna Attunuru April 30, 2022, 4:59 a.m. UTC
  Patch enables 3DES-CBC capability of inline crypto device.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
---
 drivers/common/cnxk/cnxk_security.c |  3 +++
 drivers/net/cnxk/cn10k_ethdev_sec.c | 20 ++++++++++++++++++++
 2 files changed, 23 insertions(+)
  

Comments

Jerin Jacob May 7, 2022, 11:09 a.m. UTC | #1
On Sat, Apr 30, 2022 at 10:30 AM Vamsi Attunuru <vattunuru@marvell.com> wrote:
>
> Patch enables 3DES-CBC capability of inline crypto device.
>
> Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Applied to dpdk-next-net-mrvl/for-next-net. Thanks

> ---
>  drivers/common/cnxk/cnxk_security.c |  3 +++
>  drivers/net/cnxk/cn10k_ethdev_sec.c | 20 ++++++++++++++++++++
>  2 files changed, 23 insertions(+)
>
> diff --git a/drivers/common/cnxk/cnxk_security.c b/drivers/common/cnxk/cnxk_security.c
> index ec808c0033..8ea0aea7c2 100644
> --- a/drivers/common/cnxk/cnxk_security.c
> +++ b/drivers/common/cnxk/cnxk_security.c
> @@ -129,6 +129,9 @@ ot_ipsec_sa_common_param_fill(union roc_ot_ipsec_sa_word2 *w2,
>                 case RTE_CRYPTO_CIPHER_AES_CTR:
>                         w2->s.enc_type = ROC_IE_OT_SA_ENC_AES_CTR;
>                         break;
> +               case RTE_CRYPTO_CIPHER_3DES_CBC:
> +                       w2->s.enc_type = ROC_IE_OT_SA_ENC_3DES_CBC;
> +                       break;
>                 default:
>                         return -ENOTSUP;
>                 }
> diff --git a/drivers/net/cnxk/cn10k_ethdev_sec.c b/drivers/net/cnxk/cn10k_ethdev_sec.c
> index 87bb691ab4..d0463b3622 100644
> --- a/drivers/net/cnxk/cn10k_ethdev_sec.c
> +++ b/drivers/net/cnxk/cn10k_ethdev_sec.c
> @@ -62,6 +62,26 @@ static struct rte_cryptodev_capabilities cn10k_eth_sec_crypto_caps[] = {
>                         }, }
>                 }, }
>         },
> +       {       /* 3DES CBC */
> +               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
> +               {.sym = {
> +                       .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
> +                       {.cipher = {
> +                               .algo = RTE_CRYPTO_CIPHER_3DES_CBC,
> +                               .block_size = 8,
> +                               .key_size = {
> +                                       .min = 24,
> +                                       .max = 24,
> +                                       .increment = 0
> +                               },
> +                               .iv_size = {
> +                                       .min = 8,
> +                                       .max = 16,
> +                                       .increment = 8
> +                               }
> +                       }, }
> +               }, }
> +       },
>         {       /* SHA1 HMAC */
>                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
>                 {.sym = {
> --
> 2.25.1
>
  

Patch

diff --git a/drivers/common/cnxk/cnxk_security.c b/drivers/common/cnxk/cnxk_security.c
index ec808c0033..8ea0aea7c2 100644
--- a/drivers/common/cnxk/cnxk_security.c
+++ b/drivers/common/cnxk/cnxk_security.c
@@ -129,6 +129,9 @@  ot_ipsec_sa_common_param_fill(union roc_ot_ipsec_sa_word2 *w2,
 		case RTE_CRYPTO_CIPHER_AES_CTR:
 			w2->s.enc_type = ROC_IE_OT_SA_ENC_AES_CTR;
 			break;
+		case RTE_CRYPTO_CIPHER_3DES_CBC:
+			w2->s.enc_type = ROC_IE_OT_SA_ENC_3DES_CBC;
+			break;
 		default:
 			return -ENOTSUP;
 		}
diff --git a/drivers/net/cnxk/cn10k_ethdev_sec.c b/drivers/net/cnxk/cn10k_ethdev_sec.c
index 87bb691ab4..d0463b3622 100644
--- a/drivers/net/cnxk/cn10k_ethdev_sec.c
+++ b/drivers/net/cnxk/cn10k_ethdev_sec.c
@@ -62,6 +62,26 @@  static struct rte_cryptodev_capabilities cn10k_eth_sec_crypto_caps[] = {
 			}, }
 		}, }
 	},
+	{	/* 3DES CBC */
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+		{.sym = {
+			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
+			{.cipher = {
+				.algo = RTE_CRYPTO_CIPHER_3DES_CBC,
+				.block_size = 8,
+				.key_size = {
+					.min = 24,
+					.max = 24,
+					.increment = 0
+				},
+				.iv_size = {
+					.min = 8,
+					.max = 16,
+					.increment = 8
+				}
+			}, }
+		}, }
+	},
 	{	/* SHA1 HMAC */
 		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
 		{.sym = {