From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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: , X-List-Received-Date: Mon, 22 Apr 2019 14:49:55 -0000 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); -- 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 47EEBA05D3 for ; Mon, 22 Apr 2019 16:49:56 +0200 (CEST) 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" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190422143942.0Hr31a95DctD5oI8Ce-2DNI2dOwCO4wyWg29j-cu9WQ@z> 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); -- 2.17.1