From patchwork Thu Feb 18 09:23:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Loftus, Ciara" X-Patchwork-Id: 87971 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0D526A054D; Thu, 18 Feb 2021 10:54:00 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F0F8F16074A; Thu, 18 Feb 2021 10:53:48 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id DD44516073D for ; Thu, 18 Feb 2021 10:53:46 +0100 (CET) IronPort-SDR: eLFMuYao/AiQfqd/J65hazuceSNZnXlkLruMpBllUxxK6H0KgjT+xOGum+YEQ/eKvku1FH0anf YegjA9CldjIg== X-IronPort-AV: E=McAfee;i="6000,8403,9898"; a="179938827" X-IronPort-AV: E=Sophos;i="5.81,186,1610438400"; d="scan'208";a="179938827" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Feb 2021 01:53:46 -0800 IronPort-SDR: XGM3nuUQKqSALlctKbWT18w++tjgNT0MN7MOx/TeDcbNvZcfZiR15IhzMwpEfgCtL4qdY6bmNW x4s3k5PRPNgg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,186,1610438400"; d="scan'208";a="427090219" Received: from silpixa00399839.ir.intel.com (HELO localhost.localdomain) ([10.237.222.142]) by FMSMGA003.fm.intel.com with ESMTP; 18 Feb 2021 01:53:45 -0800 From: Ciara Loftus To: dev@dpdk.org Date: Thu, 18 Feb 2021 09:23:06 +0000 Message-Id: <20210218092307.29575-3-ciara.loftus@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210218092307.29575-1-ciara.loftus@intel.com> References: <20210218092307.29575-1-ciara.loftus@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH RFC 2/3] net/af_xdp: Use recvfrom() instead of poll() X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" poll() is more expensive and requires more tuning when used with the upcoming busy polling functionality. Signed-off-by: Ciara Loftus --- drivers/net/af_xdp/rte_eth_af_xdp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c index b51db90204..34b15aa3d0 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c @@ -263,9 +263,9 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) if (nb_pkts == 0) { #if defined(XDP_USE_NEED_WAKEUP) if (xsk_ring_prod__needs_wakeup(fq)) - (void)poll(rxq->fds, 1, 1000); + recvfrom(xsk_socket__fd(rxq->xsk), NULL, 0, + MSG_DONTWAIT, NULL, NULL); #endif - return 0; } @@ -336,7 +336,8 @@ af_xdp_rx_cp(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) if (nb_pkts == 0) { #if defined(XDP_USE_NEED_WAKEUP) if (xsk_ring_prod__needs_wakeup(fq)) - (void)poll(rxq->fds, 1, 1000); + recvfrom(xsk_socket__fd(rxq->xsk), NULL, 0, + MSG_DONTWAIT, NULL, NULL); #endif return 0; }