[dpdk-dev] [PATCH v2 2/2] cryptodev: change symmetric session structure
Zhang, Roy Fan
roy.fan.zhang at intel.com
Tue Dec 18 17:25:19 CET 2018
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 <roy.fan.zhang at intel.com>; dev at dpdk.org
> Cc: akhil.goyal at nxp.com; Ananyev, Konstantin
> <konstantin.ananyev at intel.com>; Trahe, Fiona <fiona.trahe at intel.com>
> Subject: RE: [dpdk-dev] [PATCH v2 2/2] cryptodev: change symmetric session
> structure
>
> Hi Fan,
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Fan Zhang
> > Sent: Tuesday, December 11, 2018 3:34 AM
> > To: dev at dpdk.org
> > Cc: akhil.goyal at nxp.com; Ananyev, Konstantin
> > <konstantin.ananyev at intel.com>
> > 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 <roy.fan.zhang at intel.com>
> > ---
>
>
> >
> //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 = dev->driver_id;
> > + if (index > sess->nb_drivers)
> > + return -EINVAL;
> [Fiona] This should be <=
[Fan] I assume it is >= right?
>
>
> > -
> > 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.
>
>
> > * 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 = {0};
> > + s.nb_drivers = nb_drivers;
> > + s.user_data_sz = 0;
> [Fiona] Why is a get_header_session_size fn initialising fields in the session?
> 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 function is used to obtain a "safe" session size (structure itself and the session 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.
More information about the dev
mailing list