From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 822B6A04FA; Wed, 8 Jan 2020 02:38:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9E1421D63B; Wed, 8 Jan 2020 02:38:14 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 7FAE21D5D4 for ; Wed, 8 Jan 2020 02:38:12 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jan 2020 17:38:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,408,1571727600"; d="scan'208";a="223404972" Received: from dpdk-xiao1.sh.intel.com ([10.67.110.150]) by orsmga003.jf.intel.com with ESMTP; 07 Jan 2020 17:38:09 -0800 From: Xiao Wang To: xiaolong.ye@intel.com, qi.z.zhang@intel.com Cc: dev@dpdk.org, Xiao Wang Date: Wed, 8 Jan 2020 08:37:08 -0500 Message-Id: <20200108133708.51909-1-xiao.w.wang@intel.com> X-Mailer: git-send-email 2.15.1 Subject: [dpdk-dev] [PATCH] net/af_xdp: use single-prod-and-cons ring 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" The ring is used only by af_xdp pmd itself, so no need to support multi-producer and multi-consumer mode. This patch changes the ring to single-producer and single-consumer mode, which could yield better performance for addr enqueue and dequeue. Signed-off-by: Xiao Wang --- drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c index d903e6c28..683e2a559 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c @@ -809,7 +809,7 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals, umem->buf_ring = rte_ring_create(ring_name, ETH_AF_XDP_NUM_BUFFERS, rte_socket_id(), - 0x0); + RING_F_SP_ENQ | RING_F_SC_DEQ); if (umem->buf_ring == NULL) { AF_XDP_LOG(ERR, "Failed to create rte_ring\n"); goto err; -- 2.15.1