netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: fec: avoid tx queue timeout when XDP is enabled
@ 2023-07-21  8:35 Wei Fang
  2023-07-25  0:00 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Fang @ 2023-07-21  8:35 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, shenwei.wang, xiaoning.wang,
	netdev
  Cc: linux-imx, linux-kernel

According to the implementation of XDP of FEC driver, the XDP path
shares the transmit queues with the kernel network stack, so it is
possible to lead to a tx timeout event when XDP uses the tx queue
pretty much exclusively. And this event will cause the reset of the
FEC hardware.
To avoid timeout in this case, we use the txq_trans_cond_update()
interface to update txq->trans_start to jiffies so that watchdog
won't generate a transmit timeout warning.

Fixes: 6d6b39f180b8 ("net: fec: add initial XDP support")
Signed-off-by: Wei Fang <wei.fang@nxp.com>
---
 drivers/net/ethernet/freescale/fec_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index ec9e4bdb0c06..073d61619336 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -3916,6 +3916,8 @@ static int fec_enet_xdp_xmit(struct net_device *dev,
 
 	__netif_tx_lock(nq, cpu);
 
+	/* Avoid tx timeout as XDP shares the queue with kernel stack */
+	txq_trans_cond_update(nq);
 	for (i = 0; i < num_frames; i++) {
 		if (fec_enet_txq_xmit_frame(fep, txq, frames[i]) < 0)
 			break;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net: fec: avoid tx queue timeout when XDP is enabled
  2023-07-21  8:35 [PATCH net] net: fec: avoid tx queue timeout when XDP is enabled Wei Fang
@ 2023-07-25  0:00 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-07-25  0:00 UTC (permalink / raw)
  To: Wei Fang
  Cc: davem, edumazet, kuba, pabeni, shenwei.wang, xiaoning.wang,
	netdev, linux-imx, linux-kernel

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 21 Jul 2023 16:35:59 +0800 you wrote:
> According to the implementation of XDP of FEC driver, the XDP path
> shares the transmit queues with the kernel network stack, so it is
> possible to lead to a tx timeout event when XDP uses the tx queue
> pretty much exclusively. And this event will cause the reset of the
> FEC hardware.
> To avoid timeout in this case, we use the txq_trans_cond_update()
> interface to update txq->trans_start to jiffies so that watchdog
> won't generate a transmit timeout warning.
> 
> [...]

Here is the summary with links:
  - [net] net: fec: avoid tx queue timeout when XDP is enabled
    https://git.kernel.org/netdev/net/c/bb7a0156365d

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-25  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-21  8:35 [PATCH net] net: fec: avoid tx queue timeout when XDP is enabled Wei Fang
2023-07-25  0:00 ` patchwork-bot+netdevbpf

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).