From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id 920B02C6E for ; Fri, 26 Feb 2016 10:18:23 +0100 (CET) Received: from was59-1-82-226-113-214.fbx.proxad.net ([82.226.113.214] helo=[192.168.0.10]) by mail.droids-corp.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1aZEYu-00082M-IB; Fri, 26 Feb 2016 10:19:48 +0100 To: "Xie, Huawei" , Panu Matilainen , "dev@dpdk.org" References: <1450049754-33635-1-git-send-email-huawei.xie@intel.com> <1453827815-56384-1-git-send-email-huawei.xie@intel.com> <1453827815-56384-2-git-send-email-huawei.xie@intel.com> <56A8CCA3.7060302@redhat.com> <56B237AD.1040209@6wind.com> <56D012EF.9090507@6wind.com> From: Olivier MATZ X-Enigmail-Draft-Status: N1110 Message-ID: <56D01857.1060808@6wind.com> Date: Fri, 26 Feb 2016 10:18:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: "dprovan@bivio.net" Subject: Re: [dpdk-dev] [PATCH v6 1/2] 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: Fri, 26 Feb 2016 09:18:23 -0000 Hi Huawei, On 02/26/2016 10:07 AM, Xie, Huawei wrote: > On 2/26/2016 4:56 PM, Olivier MATZ wrote: >> test_one_pktmbuf(struct rte_mbuf *m) >> { >> /* same as before without the allocation/free */ >> } >> >> test_pkt_mbuf(void) >> { >> m = rte_pktmbuf_alloc(pool); >> test_one_pktmbuf(m); >> rte_pktmbuf_free(m); >> >> ret = rte_pktmbuf_alloc_bulk(pool, mtab, BULK_CNT) >> for (i = 0; i < BULK_CNT; i++) { >> m = mtab[i]; >> test_one_pktmbuf(m); >> rte_pktmbuf_free(m); >> } >> } > > This is to test the functionality. > Let us also have the case like the following? > cycles_start = rte_get_timer_cycles(); > while(rounds--) { > > ret = rte_pktmbuf_alloc_bulk(pool, mtab, BULK_CNT) > for (i = 0; i < BULK_CNT; i++) { > m = mtab[i]; > /* some work if needed */ > rte_pktmbuf_free(m); > } > } > cycles_end = rte_get_timer_cycles(); > > to compare with > cycles_start = rte_get_timer_cycles(); > while(rounds--) { > for (i = 0; i < BULK_CNT; i++) > mtab[i] = rte_pktmbuf_alloc(...); > > ret = rte_pktmbuf_alloc_bulk(pool, mtab, BULK_CNT) > for (i = 0; i < BULK_CNT; i++) { > m = mtab[i]; > /* some work if needed */ > rte_pktmbuf_free(m); > } > } > cycles_end = rte_get_timer_cycles(); In my opinion, it's already quite obvious that the bulk allocation will be faster than the non-bulk (and we already have some mempool benchmarks showing it). So I would say that functional testing is enough. On the other hand, it would be good to see if some examples applications could be updated to take advantage of the new API (as you did for the librte_vhost). What do you think?