DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ye Xiaolong <xiaolong.ye@intel.com>
To: Ciara Loftus <ciara.loftus@intel.com>
Cc: dev@dpdk.org, kevin.laatz@intel.com, bruce.richardson@intel.com
Subject: Re: [dpdk-dev] [PATCH v2 1/3] net/af_xdp: fix Tx halt when no recv packets
Date: Tue, 22 Oct 2019 13:32:10 +0800	[thread overview]
Message-ID: <20191022053210.GA51382@intel.com> (raw)
In-Reply-To: <20190930164205.19419-2-ciara.loftus@intel.com>

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 <xiaolong.ye@intel.com>
>
>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 <xiaolong.ye@intel.com>
>Tested-by: Ciara Loftus <ciara.loftus@intel.com>
>---
> 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
>

  reply	other threads:[~2019-10-22  5:35 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-30 16:42 [dpdk-dev] [PATCH v2 0/3] AF_XDP tx halt fix, IRQ pinning and unaligned chunks Ciara Loftus
2019-09-30 16:42 ` [dpdk-dev] [PATCH v2 1/3] net/af_xdp: fix Tx halt when no recv packets Ciara Loftus
2019-10-22  5:32   ` Ye Xiaolong [this message]
2019-09-30 16:42 ` [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs Ciara Loftus
2019-09-30 17:11   ` Stephen Hemminger
2019-10-03 13:23     ` Loftus, Ciara
2019-10-14 14:43       ` Bruce Richardson
2019-10-21 15:24         ` Ferruh Yigit
2019-10-21 15:54           ` Bruce Richardson
2019-10-21 16:02             ` Ferruh Yigit
2019-10-21 16:14               ` Bruce Richardson
2019-10-15 11:14       ` Ray Kinsella
2019-10-21 10:04       ` Loftus, Ciara
2019-10-21 12:52         ` Varghese, Vipin
2019-10-21 13:04           ` Bruce Richardson
2019-10-21 13:11             ` Varghese, Vipin
2019-10-21 13:17               ` Bruce Richardson
2019-10-21 13:45                 ` Varghese, Vipin
2019-10-21 13:56                   ` Bruce Richardson
2019-10-21 14:06                     ` Varghese, Vipin
2019-10-18 23:49   ` Ye Xiaolong
2019-09-30 16:42 ` [dpdk-dev] [PATCH v2 3/3] net/af_xdp: enable support for unaligned umem chunks Ciara Loftus
2019-10-18 23:48   ` Ye Xiaolong
2019-10-22 14:28     ` Ferruh Yigit
2019-10-24 11:10   ` David Marchand
2019-10-24 12:18     ` David Marchand
2019-10-24 14:18       ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191022053210.GA51382@intel.com \
    --to=xiaolong.ye@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=ciara.loftus@intel.com \
    --cc=dev@dpdk.org \
    --cc=kevin.laatz@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).