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 658AEA328D for ; Tue, 22 Oct 2019 07:35:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 283D24C74; Tue, 22 Oct 2019 07:35:19 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 38E05271 for ; Tue, 22 Oct 2019 07:35:17 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Oct 2019 22:35:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,326,1566889200"; d="scan'208";a="191350298" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.117.17]) by orsmga008.jf.intel.com with ESMTP; 21 Oct 2019 22:35:14 -0700 Date: Tue, 22 Oct 2019 13:32:10 +0800 From: Ye Xiaolong To: Ciara Loftus Cc: dev@dpdk.org, kevin.laatz@intel.com, bruce.richardson@intel.com Message-ID: <20191022053210.GA51382@intel.com> References: <20190930164205.19419-1-ciara.loftus@intel.com> <20190930164205.19419-2-ciara.loftus@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190930164205.19419-2-ciara.loftus@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v2 1/3] net/af_xdp: fix Tx halt when no recv packets 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" Hi, As this is indeed a kernel driver issue, and Magnus is working on the workaound/fix in i40e kernel driver, as long as the workaound/fix can be merged in v5.4, this patch can be dropped. Thanks, Xiaolong On 09/30, Ciara Loftus wrote: >From: Xiaolong Ye > >The kernel only consumes Tx packets if we have some Rx traffic on specified >queue or we have called send(). So we need to issue a send() even when the >allocation fails so that kernel will start to consume packets again. > >Commit 45bba02c95b0 ("net/af_xdp: support need wakeup feature") breaks >above rule by adding some condition to send, this patch fixes it while >still keeps the need_wakeup feature for Tx. > >Fixes: 45bba02c95b0 ("net/af_xdp: support need wakeup feature") >Cc: stable@dpdk.org > >Signed-off-by: Xiaolong Ye >Tested-by: Ciara Loftus >--- > drivers/net/af_xdp/rte_eth_af_xdp.c | 28 ++++++++++++++-------------- > 1 file changed, 14 insertions(+), 14 deletions(-) > >diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c >index 41ed5b2af..e496e9aaa 100644 >--- a/drivers/net/af_xdp/rte_eth_af_xdp.c >+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c >@@ -286,19 +286,16 @@ kick_tx(struct pkt_tx_queue *txq) > { > struct xsk_umem_info *umem = txq->pair->umem; > >-#if defined(XDP_USE_NEED_WAKEUP) >- if (xsk_ring_prod__needs_wakeup(&txq->tx)) >-#endif >- while (send(xsk_socket__fd(txq->pair->xsk), NULL, >- 0, MSG_DONTWAIT) < 0) { >- /* some thing unexpected */ >- if (errno != EBUSY && errno != EAGAIN && errno != EINTR) >- break; >- >- /* pull from completion queue to leave more space */ >- if (errno == EAGAIN) >- pull_umem_cq(umem, ETH_AF_XDP_TX_BATCH_SIZE); >- } >+ while (send(xsk_socket__fd(txq->pair->xsk), NULL, >+ 0, MSG_DONTWAIT) < 0) { >+ /* some thing unexpected */ >+ if (errno != EBUSY && errno != EAGAIN && errno != EINTR) >+ break; >+ >+ /* pull from completion queue to leave more space */ >+ if (errno == EAGAIN) >+ pull_umem_cq(umem, ETH_AF_XDP_TX_BATCH_SIZE); >+ } > pull_umem_cq(umem, ETH_AF_XDP_TX_BATCH_SIZE); > } > >@@ -367,7 +364,10 @@ eth_af_xdp_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) > > xsk_ring_prod__submit(&txq->tx, nb_pkts); > >- kick_tx(txq); >+#if defined(XDP_USE_NEED_WAKEUP) >+ if (xsk_ring_prod__needs_wakeup(&txq->tx)) >+#endif >+ kick_tx(txq); > > txq->stats.tx_pkts += nb_pkts; > txq->stats.tx_bytes += tx_bytes; >-- >2.17.1 >