[dpdk-dev] [PATCH 06/12] cryptodev: move vdev functions to a separate file

De Lara Guarch, Pablo pablo.de.lara.guarch at intel.com
Tue Jun 20 23:46:00 CEST 2017



> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Declan Doherty
> Sent: Tuesday, June 20, 2017 3:37 PM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch at intel.com>;
> thomas at monjalon.net
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 06/12] cryptodev: move vdev functions to a
> separate file
> 
> On 24/05/2017 4:27 PM, Pablo de Lara wrote:
> > Move all functions handling virtual devices to a separate header file
> > "rte_cryptodev_vdev.h", in order to leave only generic functions for
> > any device in the rest of the files.
> >
> > Signed-off-by: Pablo de Lara <pablo.de.lara.guarch at intel.com>
> > ---
> 
> ...
> 
> > +++ b/lib/librte_cryptodev/rte_cryptodev_vdev.h

...

> > +/**
> > + * @internal
> > + * Return number of sockets with memory reserved  */ static uint8_t
> > +number_of_sockets(void)
> > +{
> > +	int sockets = 0;
> > +	int i;
> > +	const struct rte_memseg *ms = rte_eal_get_physmem_layout();
> > +
> > +	for (i = 0; ((i < RTE_MAX_MEMSEG) && (ms[i].addr != NULL)); i++) {
> > +		if (sockets < ms[i].socket_id)
> > +			sockets = ms[i].socket_id;
> > +	}
> > +
> > +	/* Number of sockets = maximum socket_id + 1 */
> > +	return ++sockets;
> > +}
> > +
> If the above functions need to be public then they should have a naming prefix
> like outlined below.

They are used in the PMDs, for crypto vdevs, so I can include the prefix that you suggest,
except for the last one (number_of_sockets). I think this one should be substituted by a better function,
implemented in EAL, and used in this and other places.
I will send a separate patchset to address this.

> 
> > +#endif /* _RTE_CRYPTODEV_VDEV_H_ */
> > diff --git a/lib/librte_cryptodev/rte_cryptodev_version.map
> > b/lib/librte_cryptodev/rte_cryptodev_version.map
> > index 9ac510e..d519234 100644
> > --- a/lib/librte_cryptodev/rte_cryptodev_version.map
> 
> ...
> 
> >
> 
> Now that these APIs have been moved into a single header it would be good to
> have consistent naming, rte_cryptodev_vdev_

Will do this in v2.


More information about the dev mailing list