From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Venkatesan, Venky" Subject: Re: Bulk dequeue of packets and the returned values, question Date: Sun, 28 Sep 2014 15:23:44 -0700 Message-ID: <54288A70.9020902@intel.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable To: dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Keith, On 9/28/2014 11:04 AM, Wiles, Roger Keith wrote: > I am also looking at the bulk dequeue routines, which the ring can be f= ixed or variable. On fixed < 0 on error is returned and 0 if successful.= On a variable ring < 0 on error or n on success, but I think n can be ze= ro in the variable case, correct? > > If these are true then why not have the routines return < 0 on error a= nd >=3D 0 on success. Which means a dequeue from a fixed ring would retur= n only =92requested size n=92 or < 0 if you error off the 0 case. The 0 c= ase could be OK, if you allow zero to be return on a empty ring for the f= ixed ring case. > > Does this make sense to anyone? It won't make sense unless you're aware of the history behind these=20 functions. The original functions that were implemented for the ring=20 were only the bulk functions (i.e. FIXED). They would return exactly the=20 number of items requested for dequeue (0 if success, negative if error),=20 and not return any if the required number were not available. The burst (i.e. VARIABLE) functions came in much later (think it was=20 r1.3 where we introduced them), and by that time, there were already=20 quite a number of deployments of DPDK in the field using the legacy ring=20 functions. Therefore we made the decision to keep the legacy behavior=20 intact & not impacting deployed code - and merging the burst functions=20 into the code. Given that there was no "versioning" of the API/ABI in=20 those releases :). Hope that helps. -Venky > > Thanks > ++Keith > > Keith Wiles, Principal Technologist with CTO office, Wind River mobile = 972-213-5533 >