examples/ipsec-secgw: extend inline session to non AES-GCM
diff mbox series

Message ID 1581662298-12565-1-git-send-email-adwivedi@marvell.com
State Accepted, archived
Delegated to: akhil goyal
Headers show
Series
  • examples/ipsec-secgw: extend inline session to non AES-GCM
Related show

Checks

Context Check Description
ci/Intel-compilation fail apply issues
ci/travis-robot success Travis build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/checkpatch success coding style OK

Commit Message

Ankur Dwivedi Feb. 14, 2020, 6:38 a.m. UTC
This patch extends creation of inline session to all the algorithms.
Previously the inline session was enabled only for AES-GCM cipher.

Fixes: 3a690d5a65e2 ("examples/ipsec-secgw: fix first packet with inline crypto")

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
---
 examples/ipsec-secgw/sa.c | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

Comments

Anoob Joseph Feb. 15, 2020, 7:36 a.m. UTC | #1
> This patch extends creation of inline session to all the algorithms.
> Previously the inline session was enabled only for AES-GCM cipher.
> 
> Fixes: 3a690d5a65e2 ("examples/ipsec-secgw: fix first packet with inline
> crypto")
> 
> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> ---
>  examples/ipsec-secgw/sa.c | 26 ++++++++++++--------------
>  1 file changed, 12 insertions(+), 14 deletions(-)

Acked-by: Anoob Joseph <anoobj@marvell.com>
Akhil Goyal Feb. 20, 2020, 10:11 a.m. UTC | #2
> -----Original Message-----
> From: Anoob Joseph <anoobj@marvell.com>
> Sent: Saturday, February 15, 2020 1:06 PM
> To: Akhil Goyal <akhil.goyal@nxp.com>; Konstantin Ananyev
> <konstantin.ananyev@intel.com>
> Cc: Ankur Dwivedi <adwivedi@marvell.com>; Narayana Prasad Raju Athreya
> <pathreya@marvell.com>; dev@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH] examples/ipsec-secgw: extend inline session to
> non AES-GCM
> 
> > This patch extends creation of inline session to all the algorithms.
> > Previously the inline session was enabled only for AES-GCM cipher.
> >
> > Fixes: 3a690d5a65e2 ("examples/ipsec-secgw: fix first packet with inline
> > crypto")
> >
> > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> > ---
> >  examples/ipsec-secgw/sa.c | 26 ++++++++++++--------------
> >  1 file changed, 12 insertions(+), 14 deletions(-)
> 
> Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>

Hi Konstantin,

I am about to merge this patch. Do you have any issues on this.

Regards,
Akhil
Ananyev, Konstantin Feb. 20, 2020, 10:41 a.m. UTC | #3
Hi Akhil,

> > > This patch extends creation of inline session to all the algorithms.
> > > Previously the inline session was enabled only for AES-GCM cipher.
> > >
> > > Fixes: 3a690d5a65e2 ("examples/ipsec-secgw: fix first packet with inline
> > > crypto")
> > >
> > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> > > ---
> > >  examples/ipsec-secgw/sa.c | 26 ++++++++++++--------------
> > >  1 file changed, 12 insertions(+), 14 deletions(-)
> >
> > Acked-by: Anoob Joseph <anoobj@marvell.com>
> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
> 
> Hi Konstantin,
> 
> I am about to merge this patch. Do you have any issues on this.

No objections, LGTM.
Konstantin
Akhil Goyal Feb. 20, 2020, 10:42 a.m. UTC | #4
> 
> Hi Akhil,
> 
> > > > This patch extends creation of inline session to all the algorithms.
> > > > Previously the inline session was enabled only for AES-GCM cipher.
> > > >
> > > > Fixes: 3a690d5a65e2 ("examples/ipsec-secgw: fix first packet with inline
> > > > crypto")
> > > >
> > > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> > > > ---
> > > >  examples/ipsec-secgw/sa.c | 26 ++++++++++++--------------
> > > >  1 file changed, 12 insertions(+), 14 deletions(-)
> > >
> > > Acked-by: Anoob Joseph <anoobj@marvell.com>
> > Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
> >
> > Hi Konstantin,
> >
> > I am about to merge this patch. Do you have any issues on this.
> 
> No objections, LGTM.
> Konstantin
> 
Applied to dpdk-next-crypto

Thanks.

Patch
diff mbox series

diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c
index e75b687..4822d6b 100644
--- a/examples/ipsec-secgw/sa.c
+++ b/examples/ipsec-secgw/sa.c
@@ -1057,7 +1057,6 @@  struct sa_ctx {
 		}
 
 		if (sa->aead_algo == RTE_CRYPTO_AEAD_AES_GCM) {
-			struct rte_ipsec_session *ips;
 			iv_length = 12;
 
 			sa_ctx->xf[idx].a.type = RTE_CRYPTO_SYM_XFORM_AEAD;
@@ -1077,19 +1076,6 @@  struct sa_ctx {
 				sa->digest_len;
 
 			sa->xforms = &sa_ctx->xf[idx].a;
-
-			ips = ipsec_get_primary_session(sa);
-			if (ips->type ==
-				RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL ||
-				ips->type ==
-				RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO) {
-				rc = create_inline_session(skt_ctx, sa, ips);
-				if (rc != 0) {
-					RTE_LOG(ERR, IPSEC_ESP,
-						"create_inline_session() failed\n");
-					return -EINVAL;
-				}
-			}
 		} else {
 			switch (sa->cipher_algo) {
 			case RTE_CRYPTO_CIPHER_NULL:
@@ -1156,6 +1142,18 @@  struct sa_ctx {
 			sa->xforms = &sa_ctx->xf[idx].a;
 		}
 
+		if (ips->type ==
+			RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL ||
+			ips->type ==
+			RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO) {
+			rc = create_inline_session(skt_ctx, sa, ips);
+			if (rc != 0) {
+				RTE_LOG(ERR, IPSEC_ESP,
+					"create_inline_session() failed\n");
+				return -EINVAL;
+			}
+		}
+
 		print_one_sa_rule(sa, inbound);
 	}