[dpdk-dev] [PATCH] sched: fix useless call

Dumitrescu, Cristian cristian.dumitrescu at intel.com
Fri May 13 13:04:44 CEST 2016



> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Friday, May 13, 2016 11:12 AM
> To: Dumitrescu, Cristian <cristian.dumitrescu at intel.com>
> Cc: dev at dpdk.org; Yigit, Ferruh <ferruh.yigit at intel.com>; Mrzyglod, DanielX
> T <danielx.t.mrzyglod at intel.com>
> Subject: Re: [dpdk-dev] [PATCH] sched: fix useless call
> 
> 2016-05-11 10:46, Ferruh Yigit:
> > On 5/10/2016 6:18 PM, Dumitrescu, Cristian wrote:
> > > As previously discussed on this email list, the rte_bitmap_free() is an API
> function that works as a placeholder for any resource freeing that needs to
> be done for the bitmap. The API function should not be removed and also
> the call to this function from the rte_sched_port_free() should not be
> removed either.
> > >
> >
> > Right now it isn't required and doesn't do anything.
> > Why not add this function when it is required?
> 
> I don't understand why we keep a function which does nothing.

Every data type/class/object should have a constructor/create and destructor/free function. This is standard programming practice, right?

This API function is the free function for the bitmap object. Right now there are no internally allocated resources to be freed, but as code evolves, some other internal memory could be allocated by the bitmap, which needs to be freed in the bitmap free function.

This function should be kept in order to have a stable API. We should not go back and forth with adding / removing API functions as code evolves. It does not make any sense to go through the ABI change process to remove this API function now just to come back later on and go again through ABI change to add back this API function later.

I think each DPDK object should have its create and free functions clearly identified in the API.



More information about the dev mailing list