From patchwork Mon Apr 22 14:39:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akhil Goyal X-Patchwork-Id: 52981 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0E1091B416; Mon, 22 Apr 2019 16:49:56 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id E5E5D1B3EE; Mon, 22 Apr 2019 16:49:54 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 61AE8200120; Mon, 22 Apr 2019 16:49:54 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 3BE892000CE; Mon, 22 Apr 2019 16:49:51 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id E220E402A6; Mon, 22 Apr 2019 22:49:46 +0800 (SGT) From: Akhil Goyal To: dev@dpdk.org Cc: radu.nicolau@intel.com, konstantin.ananyev@intel.com, Akhil Goyal , roy.fan.zhang@intel.com, stable@dpdk.org Date: Mon, 22 Apr 2019 20:09:42 +0530 Message-Id: <20190422143942.26956-1-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH] examples/ipsec-secgw: fix pool usage for security session X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Currently, two separate mempools are being used for creating crypto sessions and its private data. crypto sessions are created and initialized separately, so a separate mempool is passed to each API, but in case of security sessions, where only one API create and initialize the private data as well. So if session mempool is passed to create a security session, the mempool element size is not sufficient enough to hold the private data as well. As a perfect solution, the security session create API should take 2 mempools for header and private data and initiatlize accordingly, but that would mean an API breakage, which will be done in the next release cycle. So introducing this patch as a workaround to resolve this issue. Fixes: 261bbff75e34 ("examples: use separate crypto session mempools") Cc: roy.fan.zhang@intel.com Cc: stable@dpdk.org Signed-off-by: Akhil Goyal --- examples/ipsec-secgw/ipsec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c index 4352cb842..7b8533077 100644 --- a/examples/ipsec-secgw/ipsec.c +++ b/examples/ipsec-secgw/ipsec.c @@ -102,7 +102,7 @@ create_session(struct ipsec_ctx *ipsec_ctx, struct ipsec_sa *sa) set_ipsec_conf(sa, &(sess_conf.ipsec)); sa->sec_session = rte_security_session_create(ctx, - &sess_conf, ipsec_ctx->session_pool); + &sess_conf, ipsec_ctx->session_priv_pool); if (sa->sec_session == NULL) { RTE_LOG(ERR, IPSEC, "SEC Session init failed: err: %d\n", ret); @@ -117,7 +117,7 @@ create_session(struct ipsec_ctx *ipsec_ctx, struct ipsec_sa *sa) int ret = 0; sa->sec_session = rte_security_session_create(ctx, - &sess_conf, ipsec_ctx->session_pool); + &sess_conf, ipsec_ctx->session_priv_pool); if (sa->sec_session == NULL) { RTE_LOG(ERR, IPSEC, "SEC Session init failed: err: %d\n", ret);