From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH] ethdev: remove useless parameter in callback process Date: Thu, 21 Dec 2017 19:08:12 -0800 Message-ID: <53c8669c-79b9-2f6d-4008-7679aa2cf377@intel.com> References: <20171128220951.15317-1-thomas@monjalon.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: bernard.iremonger@intel.com To: Thomas Monjalon , dev@dpdk.org Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id A0AC61B27F for ; Fri, 22 Dec 2017 04:08:13 +0100 (CET) In-Reply-To: <20171128220951.15317-1-thomas@monjalon.net> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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