From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] ethdev: remove useless parameter in callback process Date: Thu, 28 Dec 2017 22:54:07 +0100 Message-ID: <1953628.EychQmWvfA@xps> References: <20171128220951.15317-1-thomas@monjalon.net> <53c8669c-79b9-2f6d-4008-7679aa2cf377@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: Ferruh Yigit , bernard.iremonger@intel.com To: dev@dpdk.org Return-path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id C8DFC1B53 for ; Thu, 28 Dec 2017 22:54:21 +0100 (CET) In-Reply-To: <53c8669c-79b9-2f6d-4008-7679aa2cf377@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 > > Reviewed-by: Ferruh Yigit Applied