From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 32BBC1B108 for ; Wed, 21 Nov 2018 17:06:51 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8D6809981B; Wed, 21 Nov 2018 16:06:50 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.36.118.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 511AB2C8DC; Wed, 21 Nov 2018 16:06:49 +0000 (UTC) From: Kevin Traynor To: Anoob Joseph Cc: Archana Muniganti , Akhil Goyal , dpdk stable Date: Wed, 21 Nov 2018 16:04:32 +0000 Message-Id: <20181121160440.9014-42-ktraynor@redhat.com> In-Reply-To: <20181121160440.9014-1-ktraynor@redhat.com> References: <20181121160440.9014-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 21 Nov 2018 16:06:50 +0000 (UTC) Subject: [dpdk-stable] patch 'examples/ipsec-secgw: fix wrong session size' has been queued to stable release 18.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 16:06:51 -0000 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 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 Signed-off-by: Archana Muniganti Acked-by: Akhil Goyal --- 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 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@dpdk.org Signed-off-by: Anoob Joseph Signed-off-by: Archana Muniganti @@ -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;