[dpdk-dev,v3,1/4] examples/ipsec-secgw: fix initialization of aead crypto devices

Message ID 1508849340-23758-1-git-send-email-aviadye@dev.mellanox.co.il (mailing list archive)
State Accepted, archived
Delegated to: Pablo de Lara Guarch
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Aviad Yehezkel Oct. 24, 2017, 12:48 p.m. UTC
  From: Aviad Yehezkel <aviadye@mellanox.com>

Fixes: 501e9c226adf ("examples/ipsec-secgw: add AEAD parameters")
Cc: stable@dpdk.org

Signed-off-by: Aviad Yehezkel <aviadye@mellanox.com>
--
v3:
* Address feedbacks.
v2:
* Fix commit message.
* Address feedbacks.
---
 examples/ipsec-secgw/ipsec-secgw.c | 13 +++++++++++--
 examples/ipsec-secgw/ipsec.h       |  1 +
 2 files changed, 12 insertions(+), 2 deletions(-)
  

Comments

Radu Nicolau Oct. 24, 2017, 2:06 p.m. UTC | #1
On 10/24/2017 1:48 PM, aviadye@dev.mellanox.co.il wrote:
> From: Aviad Yehezkel <aviadye@mellanox.com>
>
> Fixes: 501e9c226adf ("examples/ipsec-secgw: add AEAD parameters")
> Cc: stable@dpdk.org
>
> Signed-off-by: Aviad Yehezkel <aviadye@mellanox.com>
> --
> v3:
> * Address feedbacks.
> v2:
> * Fix commit message.
> * Address feedbacks.
> ---
>
Series-acked-by: Radu Nicolau <radu.nicolau@intel.com>
  
De Lara Guarch, Pablo Oct. 24, 2017, 2:20 p.m. UTC | #2
> From: Nicolau, Radu

> Sent: Tuesday, October 24, 2017 3:06 PM

> To: aviadye@dev.mellanox.co.il; dev@dpdk.org; Gonzalez Monroy, Sergio

> <sergio.gonzalez.monroy@intel.com>; De Lara Guarch, Pablo

> <pablo.de.lara.guarch@intel.com>; aviadye@mellanox.com

> Cc: borisp@mellanox.com; akhil.goyal@nxp.com;

> hemant.agrawal@nxp.com; Doherty, Declan <declan.doherty@intel.com>;

> liranl@mellanox.com; nelio.laranjeiro@6wind.com; thomas@monjalon.net

> Subject: Re: [dpdk-dev][PATCH v3 1/4] examples/ipsec-secgw: fix

> initialization of aead crypto devices

> 

> 

> On 10/24/2017 1:48 PM, aviadye@dev.mellanox.co.il wrote:

> From: Aviad Yehezkel <aviadye@mellanox.com>

> 

> Fixes: 501e9c226adf ("examples/ipsec-secgw: add AEAD parameters")

> Cc: stable@dpdk.org

> 

> Signed-off-by: Aviad Yehezkel <aviadye@mellanox.com>

> --

> v3:

> * Address feedbacks.

> v2:

> * Fix commit message.

> * Address feedbacks.

> ---

> 

> Series-acked-by: Radu Nicolau <radu.nicolau@intel.com


Series applied to dpdk-next-crypto.
Thanks,

Pablo
  

Patch

diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 39f81cb..6abf852 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -1132,7 +1132,8 @@  add_mapping(struct rte_hash *map, const char *str, uint16_t cdev_id,
 		uint16_t qp, struct lcore_params *params,
 		struct ipsec_ctx *ipsec_ctx,
 		const struct rte_cryptodev_capabilities *cipher,
-		const struct rte_cryptodev_capabilities *auth)
+		const struct rte_cryptodev_capabilities *auth,
+		const struct rte_cryptodev_capabilities *aead)
 {
 	int32_t ret = 0;
 	unsigned long i;
@@ -1143,6 +1144,8 @@  add_mapping(struct rte_hash *map, const char *str, uint16_t cdev_id,
 		key.cipher_algo = cipher->sym.cipher.algo;
 	if (auth)
 		key.auth_algo = auth->sym.auth.algo;
+	if (aead)
+		key.aead_algo = aead->sym.aead.algo;
 
 	ret = rte_hash_lookup(map, &key);
 	if (ret != -ENOENT)
@@ -1211,6 +1214,12 @@  add_cdev_mapping(struct rte_cryptodev_info *dev_info, uint16_t cdev_id,
 		if (i->op != RTE_CRYPTO_OP_TYPE_SYMMETRIC)
 			continue;
 
+		if (i->sym.xform_type == RTE_CRYPTO_SYM_XFORM_AEAD) {
+			ret |= add_mapping(map, str, cdev_id, qp, params,
+					ipsec_ctx, NULL, NULL, i);
+			continue;
+		}
+
 		if (i->sym.xform_type != RTE_CRYPTO_SYM_XFORM_CIPHER)
 			continue;
 
@@ -1223,7 +1232,7 @@  add_cdev_mapping(struct rte_cryptodev_info *dev_info, uint16_t cdev_id,
 				continue;
 
 			ret |= add_mapping(map, str, cdev_id, qp, params,
-					ipsec_ctx, i, j);
+						ipsec_ctx, i, j, NULL);
 		}
 	}
 
diff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h
index da1fb1b..7d057ae 100644
--- a/examples/ipsec-secgw/ipsec.h
+++ b/examples/ipsec-secgw/ipsec.h
@@ -150,6 +150,7 @@  struct cdev_key {
 	uint16_t lcore_id;
 	uint8_t cipher_algo;
 	uint8_t auth_algo;
+	uint8_t aead_algo;
 };
 
 struct socket_ctx {