From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v7] mbuf: provide rte_pktmbuf_alloc_bulk API Date: Mon, 29 Feb 2016 17:27:47 +0100 Message-ID: <17789053.QlRipHDoo3@xps13> References: <1450049754-33635-1-git-send-email-huawei.xie@intel.com> <1456663496-32704-1-git-send-email-huawei.xie@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, dprovan@bivio.net To: Huawei Xie Return-path: Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by dpdk.org (Postfix) with ESMTP id D15836CCF for ; Mon, 29 Feb 2016 17:29:21 +0100 (CET) Received: by mail-wm0-f43.google.com with SMTP id l68so70801731wml.0 for ; Mon, 29 Feb 2016 08:29:21 -0800 (PST) In-Reply-To: <1456663496-32704-1-git-send-email-huawei.xie@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2016-02-28 20:44, Huawei Xie: > v7 changes: > rte_pktmbuf_alloc_bulk isn't exported as API, so shouldn't be listed in > version map > > v6 changes: > reflect the changes in release notes and library version map file > revise our duff's code style a bit to make it more readable > > v5 changes: > add comment about duff's device and our variant implementation > > v3 changes: > move while after case 0 > add context about duff's device and why we use while loop in the commit > message > > v2 changes: > unroll the loop a bit to help the performance > > rte_pktmbuf_alloc_bulk allocates a bulk of packet mbufs. > > There is related thread about this bulk API. > http://dpdk.org/dev/patchwork/patch/4718/ > Thanks to Konstantin's loop unrolling. > > Attached the wiki page about duff's device. It explains the performance > optimization through loop unwinding, and also the most dramatic use of > case label fall-through. > https://en.wikipedia.org/wiki/Duff%27s_device > > In this implementation, while() loop is used because we could not assume > count is strictly positive. Using while() loop saves one line of check. > > Signed-off-by: Gerald Rogers > Signed-off-by: Huawei Xie > Acked-by: Konstantin Ananyev > Acked-by: Olivier Matz Applied, thanks