From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id E642B6942 for ; Sat, 14 Mar 2015 00:15:39 +0100 (CET) Received: from [2001:470:8:a08:215:ff:fecc:4872] (helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1YWYnk-0006kC-Ld; Fri, 13 Mar 2015 19:15:38 -0400 Date: Fri, 13 Mar 2015 19:15:26 -0400 From: Neil Horman To: "Mcnamara, John" Message-ID: <20150313231526.GA14641@neilslaptop.think-freely.org> References: <1426179268-22164-1-git-send-email-john.mcnamara@intel.com> <20150312191540.GB15260@hmsreliant.think-freely.org> <20150313094133.GA5056@bricha3-MOBL3> <20150313134514.GC28191@hmsreliant.think-freely.org> <20150313145002.GA11352@bricha3-MOBL3> <20150313150924.GF28191@hmsreliant.think-freely.org> <20150313173146.GJ28191@hmsreliant.think-freely.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Score: -2.9 (--) X-Spam-Status: No Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH] ethdev: additional parameter in RX callback X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 23:15:40 -0000 On Fri, Mar 13, 2015 at 06:28:31PM +0000, Mcnamara, John wrote: > > > > -----Original Message----- > > From: Neil Horman [mailto:nhorman@tuxdriver.com] > > Sent: Friday, March 13, 2015 5:32 PM > > To: Mcnamara, John > > Cc: Richardson, Bruce; dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH] ethdev: additional parameter in RX > > callback > > > > > Is encoding the information in the array really a better solution here? > > The cb->param already exists for passing in user defined information to > > the callback. The proposed patch merely transmits the parent function > > arguments to the enclosed callback. > > > > > The cb->param can't be used here, because its opaque to the internals of > > the DPDK. rte_eth_rx_burst doesn't (and can't) know where in the cb- > > >params pointer to store that information. Thats why you added an > > additional parameter in the first place, isn't it? > > Yes. That is correct. > Then why did you suggest doing so? > > My point is that using > > an array terminator keeps us out of this habbit of just adding parameters > > to communicate more information (as thats an ABI breaking method, and not > > particularly scalable if there is more information to be transmitted in > > the future). Using a context sensitive API set goes beyond even that, and > > allows to retrieve arbitrary information form callbacks as needed in an > > ABI safe manner > > Again I can agree with this in the general case, but it isn't necessary, in this case, to encode the information in the array since it is already local to and available in the function. It seems artificial, at this point, to implement an array terminator solution to protect an API that, effectively, hasn't been published yet. > You indicate that you agree an alternate solution is preferable in the general case, so as to provide an API that is extensible in a way that isn't subject to ABI breakage, correct? If so, why do assert that its not necessecary in this specific case? If you feel you need to add information so that callbacks can be more flexible (in this case specifying the size of a passed in array), why immediately shoehorn another parmeter in place, and break the consistency between rx and tx callbacks, when you don't have to? I don't care if you break ABI today (although to call it unpublished I think is disingenuous, as lots of testing and development has already taken place with the ABI as it currently stands). I care, as I noted above about not getting into the habbit of just assuming a change like this requires that you invaliate ABI somehow. You don't have to, you can create an API that is fairly invariant to it here if you like. The question in my mind is, why don't you? Neil > John > > > > >