[dpdk-dev] [PATCH v4 1/9] rawdev: allow devices to skip extra memory allocation

Bruce Richardson bruce.richardson at intel.com
Tue Jul 2 14:41:38 CEST 2019


On Tue, Jul 02, 2019 at 11:43:58AM +0000, Shreyansh Jain wrote:
> > -----Original Message-----
> > From: Bruce Richardson <bruce.richardson at intel.com>
> > Sent: Monday, July 1, 2019 9:26 PM
> > To: dev at dpdk.org
> > Cc: thomas at monjalon.net; jerinj at marvell.com; jiayu.hu at intel.com; Bruce
> > Richardson <bruce.richardson at intel.com>; Shreyansh Jain
> > <shreyansh.jain at nxp.com>; Hemant Agrawal <hemant.agrawal at nxp.com>
> > Subject: [PATCH v4 1/9] rawdev: allow devices to skip extra memory
> > allocation
> > 
> > Some device drivers want to allocate their own private memory, and
> > should
> > be allowed to do so. Therefore skip memory allocation and associated
> > error
> > checks if zero-length private memory is requested.
> 
> Agree with this - rawdev was intended for flexibility and this (allowing them their own memory) is definitely better way ahead. Thanks for proposing.
> But, I think the kind of caveat should also be added to the header declaring this function:
> 
> Probably something like this:
> 
> --->8--- lib/librte_rawdev/rte_rawdev_pmd.h ---
> /**
>  * Allocates a new rawdev slot for an raw device and returns the pointer 
>  * to that slot for the driver to use.        
>  *
>  * @param name 
>  *   Unique identifier name for each device 
>  * @param dev_private_size 
>  *   Private data allocated within rte_rawdev object.
>  *   <b>Set to 0 to disable internal allocation and allow for self-allocation</b>
>  * @param socket_id 
>  *   Socket to allocate resources on. 
>  * @return 
>  *   - Slot in the rte_dev_devices array for a new device; 
>  */
> struct rte_rawdev *
> rte_rawdev_pmd_allocate(const char *name, size_t dev_private_size, 
>                         int socket_id);
> --->8---
> 
> > 
> > While adjusting the code for new indent level, fix incorrect error
> > message.
> > 
> > Cc: Shreyansh Jain <shreyansh.jain at nxp.com>
> > Cc: Hemant Agrawal <hemant.agrawal at nxp.com>
> > Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> > ---
> 
> If you can update the header, please use my ACK in next version.
> 
> Acked-by: Shreyansh Jain <shreyansh.jain at nxp.com>
> 
Thanks Shreyansh, will do.

/Bruce


More information about the dev mailing list