From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ye Xiaolong Subject: Re: [PATCH v3 1/5] net/af_xdp: introduce AF XDP PMD driver Date: Fri, 22 Mar 2019 10:05:05 +0800 Message-ID: <20190322020505.GF84243@intel.com> References: <20190301080947.91086-1-xiaolong.ye@intel.com> <20190321091845.78495-1-xiaolong.ye@intel.com> <20190321091845.78495-2-xiaolong.ye@intel.com> <20190321082551.56907fa9@shemminger-XPS-13-9360> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, Qi Zhang , Karlsson Magnus , Topel Bjorn To: Stephen Hemminger Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 54D931B4F3 for ; Fri, 22 Mar 2019 03:09:11 +0100 (CET) Content-Disposition: inline In-Reply-To: <20190321082551.56907fa9@shemminger-XPS-13-9360> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 03/21, Stephen Hemminger wrote: >On Thu, 21 Mar 2019 17:18:41 +0800 >Xiaolong Ye wrote: > >> + for (i = 0; i < rcvd; i++) { >> + const struct xdp_desc *desc; >> + uint64_t addr; >> + uint32_t len; >> + void *pkt; >> + >> + desc = xsk_ring_cons__rx_desc(rx, idx_rx++); >> + addr = desc->addr; >> + len = desc->len; >> + pkt = xsk_umem__get_data(rxq->umem->buffer, addr); >> + >> + mbuf = rte_pktmbuf_alloc(rxq->mb_pool); > >You could use rte_pktmbuf_alloc_bulk to get the mbufs in one call >before doing this. It saves rcvd-1 atomic operations. Got it, will do.