[dpdk-dev] [PATCH] ethdev: remove useless parameter in callback process

Thomas Monjalon thomas at monjalon.net
Thu Dec 28 22:56:35 CET 2017


28/12/2017 22:54, Thomas Monjalon:
> 22/12/2017 04:08, Ferruh Yigit:
> > On 11/28/2017 2:09 PM, Thomas Monjalon wrote:
> > > The pointer to the user parameter of the callback registration is
> > > automatically pass to the callback function.
> > > There is no point to allow changing this user parameter by a caller.
> > > That's why this parameter is always set to NULL by PMDs and set only
> > > in ethdev layer before calling the callback function.
> > 
> > It can be helpful to mention a little from history:
> > 
> > user cb_arg overwrite introduced by [1], to enable driver pass a pointer to user
> > callback function and carry some information back from app to driver.
> > 
> > Later to prevent usage of cb_arg as both input and output, an explicit output
> > (ret_param) added [2] to _rte_eth_dev_callback_process() but previous cb_arg
> > overwriting kept without any user.
> > 
> > [1]: c1ceaf3ad056 ("ethdev: add an argument to internal callback function")
> > 
> > [2]: d6af1a13d7a1 ("ethdev: add return values to callback process API")
> > 
> > > 
> > > The NULL parameter in the internal callback processing function
> > > is now removed. It makes clear that the callback parameter is user
> > > managed and opaque from a DPDK point of view.
> > > 
> > > Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
> > 
> > Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
> 
> Applied

Sorry, not applied (should be applied on next-net).

I will send a v2 with a more detailed explanation.



More information about the dev mailing list