From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: [PATCH 7/7] ethdev: use opaque user callback object Date: Fri, 1 Dec 2017 13:17:02 +0000 Message-ID: <20171201131702.GA2552@bricha3-MOBL3.ger.corp.intel.com> References: <20171201022957.64329-1-ferruh.yigit@intel.com> <20171201022957.64329-7-ferruh.yigit@intel.com> <20171201103308.GB10384@bricha3-MOBL3.ger.corp.intel.com> <2601191342CEEE43887BDE71AB9772585FAC3718@irsmsx105.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Yigit, Ferruh" , Thomas Monjalon , "dev@dpdk.org" , "vladz@cloudius-systems.com" To: "Ananyev, Konstantin" Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 4C1342A58 for ; Fri, 1 Dec 2017 14:17:06 +0100 (CET) Content-Disposition: inline In-Reply-To: <2601191342CEEE43887BDE71AB9772585FAC3718@irsmsx105.ger.corp.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" On Fri, Dec 01, 2017 at 11:22:12AM +0000, Ananyev, Konstantin wrote: > > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson > > Sent: Friday, December 1, 2017 10:33 AM > > To: Yigit, Ferruh > > Cc: Thomas Monjalon ; dev@dpdk.org; vladz@cloudius-systems.com > > Subject: Re: [dpdk-dev] [PATCH 7/7] ethdev: use opaque user callback object > > > > On Fri, Dec 01, 2017 at 02:29:57AM +0000, Ferruh Yigit wrote: > > > "struct rte_eth_rxtx_callback" is defined as internal data structure but > > > used in public APIs. > > > > > > Checking the API documentation shows that intention was using this > > > object as opaque object. Data structure only used in delete APIs which > > > doesn't require to know the internals of the data structure. > > > > > > Converting callback parameter in API to void pointer should not require > > > any modification in user application because this data structure was > > > already marked as internal and only should be used as pointer in > > > application. > > > > > > Signed-off-by: Ferruh Yigit > > > --- > > > > I disagree on this patch. The structure itself is not exposed, only the > > name, since it is only passed around as a pointer, so there is no need > > to change the parameters to void pointer. It's a named opaque type. > > Personally I think it would be better to do visa-versa: > make rte_eth_add_(rx|tx)_callback() to return struct rte_eth_rxtx_callback * > instead of void *. > Konstantin > I didn't realise that it did, so definite +1 to that suggestion.