[dpdk-stable] patch 'examples/ipsec-secgw: fix wrong session size' has been queued to stable release 18.08.1

Kevin Traynor ktraynor at redhat.com
Wed Nov 21 17:04:32 CET 2018


Hi,

FYI, your patch has been queued to stable release 18.08.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/26/18. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the patch applied
to the branch. If the code is different (ie: not only metadata diffs), due for example to
a change in context or macro names, please double check it.

Thanks.

Kevin Traynor

---
>From 5dabd7159e90d7a66e19febc969d351de9a64999 Mon Sep 17 00:00:00 2001
From: Anoob Joseph <anoob.joseph at caviumnetworks.com>
Date: Fri, 7 Sep 2018 11:25:26 +0530
Subject: [PATCH] examples/ipsec-secgw: fix wrong session size

[ upstream commit 2e960c97c6b9311bea90b775e21a4b99ac1d50dc ]

Crypto devices, which support lookaside protocol, exposes security
session size in addition to the crypto private symmetric session data
size. For applications using the security capabilities, both these
sizes need to be considered.

Fixes: ec17993a145a ("examples/ipsec-secgw: support security offload")

Signed-off-by: Anoob Joseph <anoob.joseph at caviumnetworks.com>
Signed-off-by: Archana Muniganti <muniganti.archana at caviumnetworks.com>
Acked-by: Akhil Goyal <akhil.goyal at nxp.com>
---
 examples/ipsec-secgw/ipsec-secgw.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index b45b87bde..47ac26a97 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -1393,7 +1393,25 @@ cryptodevs_init(void)
 	uint32_t max_sess_sz = 0, sess_sz;
 	for (cdev_id = 0; cdev_id < rte_cryptodev_count(); cdev_id++) {
+		void *sec_ctx;
+
+		/* Get crypto priv session size */
 		sess_sz = rte_cryptodev_sym_get_private_session_size(cdev_id);
 		if (sess_sz > max_sess_sz)
 			max_sess_sz = sess_sz;
+
+		/*
+		 * If crypto device is security capable, need to check the
+		 * size of security session as well.
+		 */
+
+		/* Get security context of the crypto device */
+		sec_ctx = rte_cryptodev_get_sec_ctx(cdev_id);
+		if (sec_ctx == NULL)
+			continue;
+
+		/* Get size of security session */
+		sess_sz = rte_security_session_get_size(sec_ctx);
+		if (sess_sz > max_sess_sz)
+			max_sess_sz = sess_sz;
 	}
 	RTE_ETH_FOREACH_DEV(port_id) {
-- 
2.19.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2018-11-21 15:59:14.684023909 +0000
+++ 0042-examples-ipsec-secgw-fix-wrong-session-size.patch	2018-11-21 15:59:13.000000000 +0000
@@ -1,15 +1,16 @@
-From 2e960c97c6b9311bea90b775e21a4b99ac1d50dc Mon Sep 17 00:00:00 2001
+From 5dabd7159e90d7a66e19febc969d351de9a64999 Mon Sep 17 00:00:00 2001
 From: Anoob Joseph <anoob.joseph at caviumnetworks.com>
 Date: Fri, 7 Sep 2018 11:25:26 +0530
 Subject: [PATCH] examples/ipsec-secgw: fix wrong session size
 
+[ upstream commit 2e960c97c6b9311bea90b775e21a4b99ac1d50dc ]
+
 Crypto devices, which support lookaside protocol, exposes security
 session size in addition to the crypto private symmetric session data
 size. For applications using the security capabilities, both these
 sizes need to be considered.
 
 Fixes: ec17993a145a ("examples/ipsec-secgw: support security offload")
-Cc: stable at dpdk.org
 
 Signed-off-by: Anoob Joseph <anoob.joseph at caviumnetworks.com>
 Signed-off-by: Archana Muniganti <muniganti.archana at caviumnetworks.com>
@@ -19,10 +20,10 @@
  1 file changed, 18 insertions(+)
 
 diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
-index f9a90c620..1bc0b5b50 100644
+index b45b87bde..47ac26a97 100644
 --- a/examples/ipsec-secgw/ipsec-secgw.c
 +++ b/examples/ipsec-secgw/ipsec-secgw.c
-@@ -1392,7 +1392,25 @@ cryptodevs_init(void)
+@@ -1393,7 +1393,25 @@ cryptodevs_init(void)
  	uint32_t max_sess_sz = 0, sess_sz;
  	for (cdev_id = 0; cdev_id < rte_cryptodev_count(); cdev_id++) {
 +		void *sec_ctx;


More information about the stable mailing list