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 DD73E2C4D for ; Fri, 26 Feb 2016 09:55:18 +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 1aZECa-00081T-62; Fri, 26 Feb 2016 09:56:44 +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> From: Olivier MATZ X-Enigmail-Draft-Status: N1110 Message-ID: <56D012EF.9090507@6wind.com> Date: Fri, 26 Feb 2016 09:55:11 +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 08:55:19 -0000 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