diff mbox series

[1/3] crypto/aesni_mb: add NULL/NULL support

Message ID 20210907090715.460856-1-radu.nicolau@intel.com (mailing list archive)
State Deferred
Delegated to: akhil goyal
Headers show
Series [1/3] crypto/aesni_mb: add NULL/NULL support | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Radu Nicolau Sept. 7, 2021, 9:07 a.m. UTC
Add support for NULL/NULL xform.

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c    |  3 ++
 .../crypto/aesni_mb/rte_aesni_mb_pmd_ops.c    | 38 +++++++++++++++++++
 2 files changed, 41 insertions(+)

Comments

Akhil Goyal Oct. 8, 2021, 12:21 p.m. UTC | #1
> Add support for NULL/NULL xform.
> 
> Signed-off-by: Declan Doherty <declan.doherty@intel.com>
> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> ---
Release notes missing.
Updates in doc/guides/cryptodevs/features/aesni_gcm.ini and
doc/guides/cryptodevs/features/aesni_mb.ini missing.
Fan Zhang Oct. 8, 2021, 12:49 p.m. UTC | #2
Hi Radu and Akhil

We can add  this change as a patch into http://patchwork.dpdk.org/project/dpdk/cover/20210929163035.608387-1-ciara.power@intel.com/ v4 it is ok.
The doc can be updated accordingly.

Regards,
Fan

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Akhil Goyal
> Sent: Friday, October 8, 2021 1:21 PM
> To: Nicolau, Radu <radu.nicolau@intel.com>; Doherty, Declan
> <declan.doherty@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [EXT] [PATCH 1/3] crypto/aesni_mb: add NULL/NULL
> support
> 
> > Add support for NULL/NULL xform.
> >
> > Signed-off-by: Declan Doherty <declan.doherty@intel.com>
> > Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> > ---
> Release notes missing.
> Updates in doc/guides/cryptodevs/features/aesni_gcm.ini and
> doc/guides/cryptodevs/features/aesni_mb.ini missing.
Akhil Goyal Oct. 8, 2021, 6:18 p.m. UTC | #3
> 
> Hi Radu and Akhil
> 
> We can add  this change as a patch into
> http://patchwork.dpdk.org/project/dpdk/cover/20210929163035.608387-1-ciara.power@intel.com/  v4 it is ok.
> The doc can be updated accordingly.
> 
No issues from my side.
Radu Nicolau Oct. 11, 2021, 8:47 a.m. UTC | #4
On 10/8/2021 7:18 PM, Akhil Goyal wrote:
>> Hi Radu and Akhil
>>
>> We can add  this change as a patch into
>> http://patchwork.dpdk.org/project/dpdk/cover/20210929163035.608387-1-ciara.power@intel.com/  v4 it is ok.
>> The doc can be updated accordingly.
>>
> No issues from my side.
Same for my side, no issues, thanks!
diff mbox series

Patch

diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
index a01c826a3c..b8ab84e215 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
@@ -462,6 +462,9 @@  aesni_mb_set_session_cipher_parameters(const MB_MGR *mb_mgr,
 
 	/* Select cipher mode */
 	switch (xform->cipher.algo) {
+	case RTE_CRYPTO_CIPHER_NULL:
+		sess->cipher.mode = NULL_CIPHER;
+		return 0;
 	case RTE_CRYPTO_CIPHER_AES_CBC:
 		sess->cipher.mode = CBC;
 		is_aes = 1;
diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
index fc7fdfec8e..ebf75198ae 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
@@ -502,6 +502,44 @@  static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 			}, }
 		}, }
 	},
+	{       /* NULL (AUTH) */
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+		{.sym = {
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
+			{.auth = {
+				.algo = RTE_CRYPTO_AUTH_NULL,
+				.block_size = 1,
+				.key_size = {
+					.min = 0,
+					.max = 0,
+					.increment = 0
+				},
+				.digest_size = {
+				.min = 0,
+					.max = 0,
+				.increment = 0
+				},
+				.iv_size = { 0 }
+			}, },
+		}, },
+	},
+	{       /* NULL (CIPHER) */
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+		{.sym = {
+			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
+			{.cipher = {
+				.algo = RTE_CRYPTO_CIPHER_NULL,
+				.block_size = 1,
+				.key_size = {
+					.min = 0,
+					.max = 0,
+					.increment = 0
+				},
+				.iv_size = { 0 }
+			}, },
+		}, }
+	},
+
 #if IMB_VERSION(0, 53, 0) <= IMB_VERSION_NUM
 	{	/* AES ECB */
 		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,