From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 9014B58FA; Tue, 23 Apr 2019 14:37:57 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Apr 2019 05:37:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,385,1549958400"; d="scan'208";a="153177133" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by orsmga002.jf.intel.com with ESMTP; 23 Apr 2019 05:32:55 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.31]) by IRSMSX152.ger.corp.intel.com ([169.254.6.225]) with mapi id 14.03.0415.000; Tue, 23 Apr 2019 13:32:54 +0100 From: "Ananyev, Konstantin" To: Akhil Goyal , "dev@dpdk.org" CC: "Nicolau, Radu" , "Zhang, Roy Fan" , "stable@dpdk.org" Thread-Topic: [PATCH v2] examples/ipsec-secgw: fix pool usage for security session Thread-Index: AQHU+dBSiF6sit9dmka5RK+7V2uSg6ZJrYIA Date: Tue, 23 Apr 2019 12:32:53 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772580148A9B08F@irsmsx105.ger.corp.intel.com> References: <20190422143942.26956-1-akhil.goyal@nxp.com> <20190423121959.23751-1-akhil.goyal@nxp.com> In-Reply-To: <20190423121959.23751-1-akhil.goyal@nxp.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMGRjZWNmMDctMWMxNi00ZDk0LTg4ODgtNzQ1ZGRlNDUwOGNjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiWTM5UGpHQWxSbXh2akkxXC9rYk56V0tCNWkzVUlUakdjcVY1M3I3VmQwRDdTeXQ0TEdkMXMxUkFTN3I2YkpjN2gifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] 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: Tue, 23 Apr 2019 12:37:58 -0000 > -----Original Message----- > From: Akhil Goyal [mailto:akhil.goyal@nxp.com] > Sent: Tuesday, April 23, 2019 1:20 PM > To: dev@dpdk.org > Cc: Nicolau, Radu ; Ananyev, Konstantin ; Akhil Goyal ; > Zhang, Roy Fan ; stable@dpdk.org > Subject: [PATCH v2] examples/ipsec-secgw: fix pool usage for security ses= sion >=20 > 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. >=20 > Fixes: 261bbff75e34 ("examples: use separate crypto session mempools") > Cc: roy.fan.zhang@intel.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Akhil Goyal > --- > v2: incorporated Konstantin's comments. >=20 >=20 > examples/ipsec-secgw/ipsec-secgw.c | 5 +++-- > examples/ipsec-secgw/ipsec.c | 4 ++-- > 2 files changed, 5 insertions(+), 4 deletions(-) >=20 > diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ip= sec-secgw.c > index 2e203393d..478dd80c2 100644 > --- a/examples/ipsec-secgw/ipsec-secgw.c > +++ b/examples/ipsec-secgw/ipsec-secgw.c > @@ -1791,7 +1791,7 @@ cryptodevs_init(void) > rte_eth_dev_get_sec_ctx(port_id)) { > int socket_id =3D rte_eth_dev_socket_id(port_id); >=20 > - if (!socket_ctx[socket_id].session_pool) { > + if (!socket_ctx[socket_id].session_priv_pool) { > char mp_name[RTE_MEMPOOL_NAMESIZE]; > struct rte_mempool *sess_mp; >=20 > @@ -1811,7 +1811,8 @@ cryptodevs_init(void) > else > printf("Allocated session pool " > "on socket %d\n", socket_id); > - socket_ctx[socket_id].session_pool =3D sess_mp; > + socket_ctx[socket_id].session_priv_pool =3D > + sess_mp; > } > } > } > 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 ip= sec_sa *sa) > set_ipsec_conf(sa, &(sess_conf.ipsec)); >=20 > sa->sec_session =3D rte_security_session_create(ctx, > - &sess_conf, ipsec_ctx->session_pool); > + &sess_conf, ipsec_ctx->session_priv_pool); > if (sa->sec_session =3D=3D 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 ip= sec_sa *sa) > int ret =3D 0; >=20 > sa->sec_session =3D rte_security_session_create(ctx, > - &sess_conf, ipsec_ctx->session_pool); > + &sess_conf, ipsec_ctx->session_priv_pool); > if (sa->sec_session =3D=3D NULL) { > RTE_LOG(ERR, IPSEC, > "SEC Session init failed: err: %d\n", ret); Acked-by: Konstantin Ananyev > -- > 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 85C52A05D3 for ; Tue, 23 Apr 2019 14:38:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E8E6A1B277; Tue, 23 Apr 2019 14:37:59 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 9014B58FA; Tue, 23 Apr 2019 14:37:57 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Apr 2019 05:37:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,385,1549958400"; d="scan'208";a="153177133" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by orsmga002.jf.intel.com with ESMTP; 23 Apr 2019 05:32:55 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.31]) by IRSMSX152.ger.corp.intel.com ([169.254.6.225]) with mapi id 14.03.0415.000; Tue, 23 Apr 2019 13:32:54 +0100 From: "Ananyev, Konstantin" To: Akhil Goyal , "dev@dpdk.org" CC: "Nicolau, Radu" , "Zhang, Roy Fan" , "stable@dpdk.org" Thread-Topic: [PATCH v2] examples/ipsec-secgw: fix pool usage for security session Thread-Index: AQHU+dBSiF6sit9dmka5RK+7V2uSg6ZJrYIA Date: Tue, 23 Apr 2019 12:32:53 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772580148A9B08F@irsmsx105.ger.corp.intel.com> References: <20190422143942.26956-1-akhil.goyal@nxp.com> <20190423121959.23751-1-akhil.goyal@nxp.com> In-Reply-To: <20190423121959.23751-1-akhil.goyal@nxp.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMGRjZWNmMDctMWMxNi00ZDk0LTg4ODgtNzQ1ZGRlNDUwOGNjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiWTM5UGpHQWxSbXh2akkxXC9rYk56V0tCNWkzVUlUakdjcVY1M3I3VmQwRDdTeXQ0TEdkMXMxUkFTN3I2YkpjN2gifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] 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" Message-ID: <20190423123253.bGlcyq4cV5EEvVQqfdLCOi9Nws8YDBwV6DxqOwHI8C8@z> > -----Original Message----- > From: Akhil Goyal [mailto:akhil.goyal@nxp.com] > Sent: Tuesday, April 23, 2019 1:20 PM > To: dev@dpdk.org > Cc: Nicolau, Radu ; Ananyev, Konstantin ; Akhil Goyal ; > Zhang, Roy Fan ; stable@dpdk.org > Subject: [PATCH v2] examples/ipsec-secgw: fix pool usage for security ses= sion >=20 > 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. >=20 > Fixes: 261bbff75e34 ("examples: use separate crypto session mempools") > Cc: roy.fan.zhang@intel.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Akhil Goyal > --- > v2: incorporated Konstantin's comments. >=20 >=20 > examples/ipsec-secgw/ipsec-secgw.c | 5 +++-- > examples/ipsec-secgw/ipsec.c | 4 ++-- > 2 files changed, 5 insertions(+), 4 deletions(-) >=20 > diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ip= sec-secgw.c > index 2e203393d..478dd80c2 100644 > --- a/examples/ipsec-secgw/ipsec-secgw.c > +++ b/examples/ipsec-secgw/ipsec-secgw.c > @@ -1791,7 +1791,7 @@ cryptodevs_init(void) > rte_eth_dev_get_sec_ctx(port_id)) { > int socket_id =3D rte_eth_dev_socket_id(port_id); >=20 > - if (!socket_ctx[socket_id].session_pool) { > + if (!socket_ctx[socket_id].session_priv_pool) { > char mp_name[RTE_MEMPOOL_NAMESIZE]; > struct rte_mempool *sess_mp; >=20 > @@ -1811,7 +1811,8 @@ cryptodevs_init(void) > else > printf("Allocated session pool " > "on socket %d\n", socket_id); > - socket_ctx[socket_id].session_pool =3D sess_mp; > + socket_ctx[socket_id].session_priv_pool =3D > + sess_mp; > } > } > } > 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 ip= sec_sa *sa) > set_ipsec_conf(sa, &(sess_conf.ipsec)); >=20 > sa->sec_session =3D rte_security_session_create(ctx, > - &sess_conf, ipsec_ctx->session_pool); > + &sess_conf, ipsec_ctx->session_priv_pool); > if (sa->sec_session =3D=3D 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 ip= sec_sa *sa) > int ret =3D 0; >=20 > sa->sec_session =3D rte_security_session_create(ctx, > - &sess_conf, ipsec_ctx->session_pool); > + &sess_conf, ipsec_ctx->session_priv_pool); > if (sa->sec_session =3D=3D NULL) { > RTE_LOG(ERR, IPSEC, > "SEC Session init failed: err: %d\n", ret); Acked-by: Konstantin Ananyev > -- > 2.17.1