From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 780E02BAC for ; Tue, 18 Dec 2018 17:25:23 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Dec 2018 08:25:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,368,1539673200"; d="scan'208";a="304829562" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga005.fm.intel.com with ESMTP; 18 Dec 2018 08:25:21 -0800 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.237]) by IRSMSX103.ger.corp.intel.com ([169.254.3.157]) with mapi id 14.03.0415.000; Tue, 18 Dec 2018 16:25:20 +0000 From: "Zhang, Roy Fan" To: "Trahe, Fiona" , "dev@dpdk.org" CC: "akhil.goyal@nxp.com" , "Ananyev, Konstantin" Thread-Topic: [dpdk-dev] [PATCH v2 2/2] cryptodev: change symmetric session structure Thread-Index: AQHUkT02z+uoRC4QuU637ZPOzTUBNKWDbAuAgAFEXAA= Date: Tue, 18 Dec 2018 16:25:19 +0000 Message-ID: <9F7182E3F746AB4EA17801C148F3C6043351D265@IRSMSX101.ger.corp.intel.com> References: <20181115172427.67607-1-roy.fan.zhang@intel.com> <20181211103402.81914-1-roy.fan.zhang@intel.com> <20181211103402.81914-3-roy.fan.zhang@intel.com> <348A99DA5F5B7549AA880327E580B435896A4029@IRSMSX101.ger.corp.intel.com> In-Reply-To: <348A99DA5F5B7549AA880327E580B435896A4029@IRSMSX101.ger.corp.intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWMyYzFiZTMtZTczOS00Y2IxLTkxN2QtOGUzOGExNzQzY2JmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZWtFXC9Ta2dDdm5SbWdic0tGditCR3BLb0ppdVNiZXczNExOZW1WUlYrUk9uSUJiOGNWTForOVVMSDljRDUrV3oifQ== dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 2/2] cryptodev: change symmetric session structure 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, 18 Dec 2018 16:25:24 -0000 Hi Fiona, Thanks for the review. Comments inline. > -----Original Message----- > From: Trahe, Fiona > Sent: Monday, December 17, 2018 8:30 PM > To: Zhang, Roy Fan ; dev@dpdk.org > Cc: akhil.goyal@nxp.com; Ananyev, Konstantin > ; Trahe, Fiona > Subject: RE: [dpdk-dev] [PATCH v2 2/2] cryptodev: change symmetric sessio= n > structure >=20 > Hi Fan, >=20 > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Fan Zhang > > Sent: Tuesday, December 11, 2018 3:34 AM > > To: dev@dpdk.org > > Cc: akhil.goyal@nxp.com; Ananyev, Konstantin > > > > Subject: [dpdk-dev] [PATCH v2 2/2] cryptodev: change symmetric session > > structure > > > > This patch changes the symmetric session structure of cryptodev. > > The symmetric session now contains extra information for secure access > > purposes. The patch also includes the updates to the PMDs, test > > applications, and examples to fit the change. > > > > Signed-off-by: Fan Zhang > > --- >=20 >=20 > > > //snip//// > > int > > rte_cryptodev_sym_session_init(uint8_t dev_id, > > struct rte_cryptodev_sym_session *sess, @@ -1160,12 > +1206,15 @@ > > rte_cryptodev_sym_session_init(uint8_t dev_id, > > return -EINVAL; > > > > index =3D dev->driver_id; > > + if (index > sess->nb_drivers) > > + return -EINVAL; > [Fiona] This should be <=3D [Fan] I assume it is >=3D right? >=20 >=20 > > - > > unsigned int > > rte_cryptodev_sym_get_header_session_size(void) > > { > > /* > > - * Header contains pointers to the private data > > + * Header contains all dpointers to the private data > [Fiona] typo. And comment should be updated as it also now contains more > than just a flag [Fan] Will change. Thanks for the catch. >=20 >=20 > > * of all registered drivers, and a flag which > > * indicates presence of user data > > */ > > - return ((sizeof(void *) * nb_drivers) + sizeof(uint8_t)); > > + struct rte_cryptodev_sym_session s =3D {0}; > > + s.nb_drivers =3D nb_drivers; > > + s.user_data_sz =3D 0; > [Fiona] Why is a get_header_session_size fn initialising fields in the se= ssion? > Doesn't seem right? [Fan] Header session includes the rte_cryptodev_sym_session structure plus = the extended area to store session's driver specific private data. This fun= ction is used to obtain a "safe" session size (structure itself and the ses= sion private data pointers) with existing nb_drivers up-to-date exclude the= user data size. A temporary sym session variable here is used to pass into= rte_cryptodev_sym_session_data_size() function call so the data area size = can be obtained.