DPDK patches and discussions
 help / color / Atom feed
* [dpdk-dev] [PATCH] examples/ipsec-secgw: extend inline session to non AES-GCM
@ 2020-02-14  6:38 Ankur Dwivedi
  2020-02-15  7:36 ` Anoob Joseph
  0 siblings, 1 reply; 2+ messages in thread
From: Ankur Dwivedi @ 2020-02-14  6:38 UTC (permalink / raw)
  To: dev; +Cc: Ankur Dwivedi

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(-)

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);
 	}
 
-- 
1.9.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] examples/ipsec-secgw: extend inline session to non AES-GCM
  2020-02-14  6:38 [dpdk-dev] [PATCH] examples/ipsec-secgw: extend inline session to non AES-GCM Ankur Dwivedi
@ 2020-02-15  7:36 ` Anoob Joseph
  0 siblings, 0 replies; 2+ messages in thread
From: Anoob Joseph @ 2020-02-15  7:36 UTC (permalink / raw)
  To: Akhil Goyal, Konstantin Ananyev
  Cc: Ankur Dwivedi, Narayana Prasad Raju Athreya, dev

> 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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-14  6:38 [dpdk-dev] [PATCH] examples/ipsec-secgw: extend inline session to non AES-GCM Ankur Dwivedi
2020-02-15  7:36 ` Anoob Joseph

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox