From patchwork Wed Feb 24 11:18:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Loftus, Ciara" X-Patchwork-Id: 88134 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 AFA45A034F; Wed, 24 Feb 2021 12:49:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CAE53160800; Wed, 24 Feb 2021 12:49:08 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id C25A94069B for ; Wed, 24 Feb 2021 12:49:04 +0100 (CET) IronPort-SDR: bTMQ2xUJQ/lv85NNG/TgIJ/Y0Leo1C+DBjHFC6iV4ycPweV1cGqtkAKTDPxgfn6ed17DFMoEvy vtp2wAKkJj5w== X-IronPort-AV: E=McAfee;i="6000,8403,9904"; a="164359737" X-IronPort-AV: E=Sophos;i="5.81,202,1610438400"; d="scan'208";a="164359737" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2021 03:49:03 -0800 IronPort-SDR: vyjXXon2R9f/AMX4f9dkq9b9ttMHqCGha76KcO0dxqq6MIoven2qh4FNrmjRQPmUVwXIxk6PCr VXm48pdhZwTw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,202,1610438400"; d="scan'208";a="515592055" Received: from silpixa00399839.ir.intel.com (HELO localhost.localdomain) ([10.237.222.142]) by orsmga004.jf.intel.com with ESMTP; 24 Feb 2021 03:49:03 -0800 From: Ciara Loftus To: dev@dpdk.org Cc: Ciara Loftus Date: Wed, 24 Feb 2021 11:18:51 +0000 Message-Id: <20210224111852.11947-3-ciara.loftus@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210224111852.11947-1-ciara.loftus@intel.com> References: <20210218092307.29575-1-ciara.loftus@intel.com> <20210224111852.11947-1-ciara.loftus@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 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; }