Skip to content

Commit bb7a015

Browse files
Wei Fangkuba-moo
authored andcommitted
net: fec: avoid tx queue timeout when XDP is enabled
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: 6d6b39f ("net: fec: add initial XDP support") Signed-off-by: Wei Fang <wei.fang@nxp.com> Link: https://lore.kernel.org/r/20230721083559.2857312-1-wei.fang@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 69172f0 commit bb7a015

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3916,6 +3916,8 @@ static int fec_enet_xdp_xmit(struct net_device *dev,
39163916

39173917
__netif_tx_lock(nq, cpu);
39183918

3919+
/* Avoid tx timeout as XDP shares the queue with kernel stack */
3920+
txq_trans_cond_update(nq);
39193921
for (i = 0; i < num_frames; i++) {
39203922
if (fec_enet_txq_xmit_frame(fep, txq, frames[i]) < 0)
39213923
break;

0 commit comments

Comments
 (0)