From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 3766011F5 for ; Mon, 29 Sep 2014 00:17:13 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 28 Sep 2014 15:23:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,616,1406617200"; d="scan'208";a="598032254" Received: from jzito-mobl1.amr.corp.intel.com (HELO [10.254.118.119]) ([10.254.118.119]) by fmsmga001.fm.intel.com with ESMTP; 28 Sep 2014 15:23:44 -0700 Message-ID: <54288A70.9020902@intel.com> Date: Sun, 28 Sep 2014 15:23:44 -0700 From: "Venkatesan, Venky" User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: dev@dpdk.org References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] Bulk dequeue of packets and the returned values, question 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: Sun, 28 Sep 2014 22:17:13 -0000 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 fixed 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 zero in the variable case, correct? > > If these are true then why not have the routines return < 0 on error and >= 0 on success. Which means a dequeue from a fixed ring would return only ’requested size n’ or < 0 if you error off the 0 case. The 0 case could be OK, if you allow zero to be return on a empty ring for the fixed ring case. > > Does this make sense to anyone? It won't make sense unless you're aware of the history behind these functions. The original functions that were implemented for the ring were only the bulk functions (i.e. FIXED). They would return exactly the number of items requested for dequeue (0 if success, negative if error), and not return any if the required number were not available. The burst (i.e. VARIABLE) functions came in much later (think it was r1.3 where we introduced them), and by that time, there were already quite a number of deployments of DPDK in the field using the legacy ring functions. Therefore we made the decision to keep the legacy behavior intact & not impacting deployed code - and merging the burst functions into the code. Given that there was no "versioning" of the API/ABI in those releases :). Hope that helps. -Venky > > Thanks > ++Keith > > Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-213-5533 >