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 6A670A00E6 for ; Thu, 21 Mar 2019 16:25:57 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1DF631B503; Thu, 21 Mar 2019 16:25:57 +0100 (CET) Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by dpdk.org (Postfix) with ESMTP id 8A6481B4F4 for ; Thu, 21 Mar 2019 16:25:55 +0100 (CET) Received: by mail-pf1-f195.google.com with SMTP id 9so4265130pfj.13 for ; Thu, 21 Mar 2019 08:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HKvb30oqkm5Yn5QsjPHEWHoci2zJoUfe+gne7I6eWf8=; b=ZCy04fpjrcFpyIXP1AXyDZ1Gd68OR3CTuuS1E+C0HMWDK3QdT5RerSaRNKOZk43xq7 6zeCg1P0hhPEEOPIW6RZN5C6B4Ztemt/rXKFaj73VQJzc4weEPBm9cXX5AuoozODbZjA mGCuX0bm8h00aIz9WEVwUNMI/VecOPyfHDcbB+Dj02xWmUBPYv2eSv+mljvpTS+Ahh0+ 4bjnC2QJa3GKN2Ruf8qD59lSi3WLI4Ubqlo2Q/sSyI+nCvm+eNfKSl6hGQOhZdbOaRjK QQ8g81It4L6KzxG3Hq8ifvNXWH45Mph8TC5Vg0GRIoHBK2cDVZ8ptc+CV2zw1wVes7nv MZ6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HKvb30oqkm5Yn5QsjPHEWHoci2zJoUfe+gne7I6eWf8=; b=tVtM3RytrGpobQQlGX5Zq5BAgsaVkdTdr2RVidoRwDPp978ateIQhWzzNwzCLSg44K jhWYNJe9JyqyUoN5rqNEj1QEA4fxPNwvz9p+22A3qtTjfXrN6KwyGbduMr5ywMLTWxRb X9GgVdpT4Ommt6nieRPDMy/vPBPtqCE1nXYJ2wKbKLcGabRBXP31ZhqM8IP/tw6d2v4e TPz8+OhJf4mAS59O2w8rI8ccAD3lzHz83h/GSPvdwd51LT8+9iU1iqrHVBUbBgp0eCiP KcVp0HWE/TsTCpef5KOfWmcJk22u/JwA8COkOZsDbRWx1f9GQtJyfRmdgwBR+hc/g6Yw 8bng== X-Gm-Message-State: APjAAAVRenl1hUrglcm2lqWxL3pdKUvz16jliFpdkgga6wZ3zBd9Xh/f +/eVqXgCqOrL3AkHYtVL+5PXgA== X-Google-Smtp-Source: APXvYqz8Cl/kf7w6QkredpgahIP23BqTx4/Oc7OryAdLKYrorZ5y18qGEmBYK76laJa1YxHd8QpRdA== X-Received: by 2002:a62:1f86:: with SMTP id l6mr3618455pfj.138.1553181954669; Thu, 21 Mar 2019 08:25:54 -0700 (PDT) Received: from shemminger-XPS-13-9360 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id f125sm9638457pfc.91.2019.03.21.08.25.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Mar 2019 08:25:54 -0700 (PDT) Date: Thu, 21 Mar 2019 08:25:51 -0700 From: Stephen Hemminger To: Xiaolong Ye Cc: dev@dpdk.org, Qi Zhang , Karlsson Magnus , Topel Bjorn Message-ID: <20190321082551.56907fa9@shemminger-XPS-13-9360> In-Reply-To: <20190321091845.78495-2-xiaolong.ye@intel.com> References: <20190301080947.91086-1-xiaolong.ye@intel.com> <20190321091845.78495-1-xiaolong.ye@intel.com> <20190321091845.78495-2-xiaolong.ye@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit 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: <20190321152551.LSGSVjY1EVW61S66Y113N6koed2qj0dr6Mm7t0g2Omo@z> 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.