From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier MATZ Subject: Re: [PATCH v6 1/2] mbuf: provide rte_pktmbuf_alloc_bulk API Date: Fri, 26 Feb 2016 10:18:15 +0100 Message-ID: <56D01857.1060808@6wind.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: "dprovan@bivio.net" To: "Xie, Huawei" , Panu Matilainen , "dev@dpdk.org" 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) In-Reply-To: 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" 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?