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

Message ID 1508439184-17893-1-git-send-email-aviadye@dev.mellanox.co.il (mailing list archive)
State Superseded, 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. 19, 2017, 6:52 p.m. UTC
  From: Aviad Yehezkel <aviadye@mellanox.com>

Fixes: 501e9c226adf ("examples/ipsec-secgw: add AEAD parameters")
Cc: pablo.de.lara.guarch@intel.com

Issue: None
Signed-off-by: Aviad Yehezkel <aviadye@mellanox.com>
--
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

De Lara Guarch, Pablo Oct. 20, 2017, 9:50 a.m. UTC | #1
> -----Original Message-----
> From: aviadye@dev.mellanox.co.il [mailto:aviadye@dev.mellanox.co.il]
> Sent: Thursday, October 19, 2017 7:53 PM
> To: 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; Nicolau, Radu <radu.nicolau@intel.com>;
> Doherty, Declan <declan.doherty@intel.com>; aviadye@dev.mellanox.co.il;
> liranl@mellanox.com; nelio.laranjeiro@6wind.com; thomas@monjalon.net
> Subject: [dpdk-dev][PATCH v2 1/6] examples/ipsec-secgw: fix initialization
> of aead crypto devices
> 
> From: Aviad Yehezkel <aviadye@mellanox.com>
> 
> Fixes: 501e9c226adf ("examples/ipsec-secgw: add AEAD parameters")
> Cc: pablo.de.lara.guarch@intel.com

You should CC stable here.
> 
> Issue: None

What does this mean? This is a fix to an existing issue,
so this doesn't make sense.

Apart from this:

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
  
Aviad Yehezkel Oct. 22, 2017, 7:21 a.m. UTC | #2
On 10/20/2017 12:50 PM, De Lara Guarch, Pablo wrote:
>
>> -----Original Message-----
>> From: aviadye@dev.mellanox.co.il [mailto:aviadye@dev.mellanox.co.il]
>> Sent: Thursday, October 19, 2017 7:53 PM
>> To: 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; Nicolau, Radu <radu.nicolau@intel.com>;
>> Doherty, Declan <declan.doherty@intel.com>; aviadye@dev.mellanox.co.il;
>> liranl@mellanox.com; nelio.laranjeiro@6wind.com; thomas@monjalon.net
>> Subject: [dpdk-dev][PATCH v2 1/6] examples/ipsec-secgw: fix initialization
>> of aead crypto devices
>>
>> From: Aviad Yehezkel <aviadye@mellanox.com>
>>
>> Fixes: 501e9c226adf ("examples/ipsec-secgw: add AEAD parameters")
>> Cc: pablo.de.lara.guarch@intel.com
> You should CC stable here.
You referred me to http://dpdk.org/doc/guides/contributing/patches.html
I followed the documentation:
"
When fixing a regression, it is required to reference the id of the 
commit which introduced the bug, and put the original author of that 
commit on CC. Yiu can generate the required lines using the following 
git alias, which print the commit SHA and the author of the original code:
git config alias.fixline "log -1 --abbrev=12 --format='Fixes: %h 
(\"%s\")%nCc: %ae'"
"
Please explain when to use above alias and when to put stable or 
something else.

Thanks!
>> Issue: None
> What does this mean? This is a fix to an existing issue,
> so this doesn't make sense.
This is leftovers from my internal git continuous integration system. It 
refers to internal bug in my local bugzilla.
Will remove that and automate next patches not to include it.

Thanks!
>
> Apart from this:
>
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
  
Thomas Monjalon Oct. 22, 2017, 11 a.m. UTC | #3
22/10/2017 09:21, Aviad Yehezkel:
> On 10/20/2017 12:50 PM, De Lara Guarch, Pablo wrote:
> > From: aviadye@dev.mellanox.co.il
> >> From: Aviad Yehezkel <aviadye@mellanox.com>
> >>
> >> Fixes: 501e9c226adf ("examples/ipsec-secgw: add AEAD parameters")
> >> Cc: pablo.de.lara.guarch@intel.com
> > 
> > You should CC stable here.
> 
> You referred me to http://dpdk.org/doc/guides/contributing/patches.html
> I followed the documentation:
> "
> When fixing a regression, it is required to reference the id of the 
> commit which introduced the bug, and put the original author of that 
> commit on CC. Yiu can generate the required lines using the following 
> git alias, which print the commit SHA and the author of the original code:
> git config alias.fixline "log -1 --abbrev=12 --format='Fixes: %h 
> (\"%s\")%nCc: %ae'"
> "
> Please explain when to use above alias and when to put stable or 
> something else.

It seems it is not described in the chapter 5.
It is mentioned only in chapter 6:
	http://dpdk.org/doc/guides/contributing/stable.html#the-stable-mailing-list

But when running devtools/check-git-log.sh as described in chapter 5:
	http://dpdk.org/doc/guides/contributing/patches.html#checking-the-patches
You should see this:
	Is it candidate for Cc: stable@dpdk.org backport?
It is using devtools/git-log-fixes.sh to get patches which are fixing
older releases.

Short answer:
You must add "Cc: stable@dpdk.org" just below "Fixes:" if the bug
was introduced in an older release.
It will trigger the patch to be backported in maintenance releases.

It is the responsibility of the tree maintainer to check this tag,
and add or remove it, if he thinks the backport requirement was not
properly considered.
  

Patch

diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index d451b3d..1a5e9c0 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -1115,7 +1115,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;
@@ -1126,6 +1127,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)
@@ -1194,6 +1197,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;
 
@@ -1206,7 +1215,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 {