From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2019 19:09:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,255,1549958400"; d="scan'208";a="154029347" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.110.206]) by fmsmga002.fm.intel.com with ESMTP; 21 Mar 2019 19:09:09 -0700 Date: Fri, 22 Mar 2019 10:05:05 +0800 From: Ye Xiaolong To: Stephen Hemminger Cc: dev@dpdk.org, Qi Zhang , Karlsson Magnus , Topel Bjorn 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 Content-Disposition: inline In-Reply-To: <20190321082551.56907fa9@shemminger-XPS-13-9360> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v3 1/5] net/af_xdp: introduce AF XDP PMD driver X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Mar 2019 02:09:11 -0000 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. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id C901FA00E6 for ; Fri, 22 Mar 2019 03:09:13 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 751FE1B562; Fri, 22 Mar 2019 03:09:13 +0100 (CET) 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) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2019 19:09:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,255,1549958400"; d="scan'208";a="154029347" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.110.206]) by fmsmga002.fm.intel.com with ESMTP; 21 Mar 2019 19:09:09 -0700 Date: Fri, 22 Mar 2019 10:05:05 +0800 From: Ye Xiaolong To: Stephen Hemminger Cc: dev@dpdk.org, Qi Zhang , Karlsson Magnus , Topel Bjorn 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="UTF-8" Content-Disposition: inline In-Reply-To: <20190321082551.56907fa9@shemminger-XPS-13-9360> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v3 1/5] net/af_xdp: introduce AF XDP PMD driver X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190322020505.JlyPyXy3Jy4XiXqTZgxI_o59jc09vvH0iG81UO8mPrs@z> 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.