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 09:55:11 +0100 Message-ID: <56D012EF.9090507@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> 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 DD73E2C4D for ; Fri, 26 Feb 2016 09:55:18 +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" On 02/23/2016 06:35 AM, Xie, Huawei wrote: >>> Also, it would be nice to have a simple test function in >>> app/test/test_mbuf.c. For instance, you could update >>> test_one_pktmbuf() to take a mbuf pointer as a parameter and remove >>> the mbuf allocation from the function. Then it could be called with >>> a mbuf allocated with rte_pktmbuf_alloc() (like before) and with >>> all the mbufs of rte_pktmbuf_alloc_bulk(). > > Don't quite get you. Is it that we write two cases, one case allocate > mbuf through rte_pktmbuf_alloc_bulk and one use rte_pktmbuf_alloc? It is > good to have. Yes, something like: 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); } } > I could do this after this patch. Yes, please. Thanks, Olivier