From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=BTGiqGc2vLxkUcrp2aL7554GgPGHu0UGhbLXWn16jqM=; b=ZeVINpN6vsc+tbgZGay4+bttSeXLOUZlI2+3hvZ2kk7ceP1Ywg/bWHx7EqMTrDeMvW UqBElPj4xgBlsz1MP8x90AzUxMSnjuqse6iOpejK3TobUDckPruXqZexHKVqCpjG7pIP strPzEr1rgU2XYesvHTmCPx4xlnZY1tiE3oLUiSrLxPoeNgjWZDi1RC86DnpBmFPyhIi /DA0Iq9reAjwtvoE+lxZFBGbgdoQ3Hv/z/Kra4AV3OCNvUq7a2Hb5uKgBYT0CCJOa6lW rEzWHn353N20DVJnQ4YXzT7/USLkXkTE1+0rOiTpg9oSLMx0DwdYRF592Vgcg4WxMyJB MKNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding; bh=BTGiqGc2vLxkUcrp2aL7554GgPGHu0UGhbLXWn16jqM=; b=i1VNxq7YjNKfita64mYs501dFqzUg4AlaCpi3afcSDN81iizANIys4KjgTTD+dOXrO qinJIjagGefOvjewEtGzU1IoQgM+xhlYTgPdmyRJuBO+1lu2alIDB/nRcPrLr8+uh2jl vOG+mCAITWPDHkM+jUCVFnU5ZxGwmWJfoprKXw/2gpwlaaOuoDPLs7DDwdCr1R85z1lc rcN3jecxtRxVHN/LUIpWhLfTjUYJ+pC0NlpCblKsoLECnYxzq/9vY4S81kCqMLB5gV30 AEDf4jPHALuHdNLeNvXE/dxzDtVAsvd5Ef5vLi8OyvgEEAhE9qAexhZCpBr31sb/1CF6 Me+A== X-Gm-Message-State: AD7BkJJ6Hjie2MnuHx9p48ESxe2PywighQl5/LTa4vBUBs1d+se3MZrRShzC34sjVvJ544kH X-Received: by 10.28.173.143 with SMTP id w137mr13585580wme.101.1456763361600; Mon, 29 Feb 2016 08:29:21 -0800 (PST) Received: from xps13.localnet (171.36.101.84.rev.sfr.net. [84.101.36.171]) by smtp.gmail.com with ESMTPSA id r62sm17175450wmd.15.2016.02.29.08.29.20 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Feb 2016 08:29:20 -0800 (PST) From: Thomas Monjalon To: Huawei Xie Date: Mon, 29 Feb 2016 17:27:47 +0100 Message-ID: <17789053.QlRipHDoo3@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1456663496-32704-1-git-send-email-huawei.xie@intel.com> 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-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org, dprovan@bivio.net Subject: Re: [dpdk-dev] [PATCH v7] mbuf: provide rte_pktmbuf_alloc_bulk API 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: Mon, 29 Feb 2016 16:29:22 -0000 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