Skip to content

Commit f639634

Browse files
esbendavem330
authored andcommitted
net: ll_temac: Avoid ndo_start_xmit returning NETDEV_TX_BUSY
As documented in Documentation/networking/driver.rst, the ndo_start_xmit method must not return NETDEV_TX_BUSY under any normal circumstances, and as recommended, we simply stop the tx queue in advance, when there is a risk that the next xmit would cause a NETDEV_TX_BUSY return. Signed-off-by: Esben Haabendal <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c364df2 commit f639634

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/net/ethernet/xilinx/ll_temac_main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,11 @@ temac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
942942
wmb();
943943
lp->dma_out(lp, TX_TAILDESC_PTR, tail_p); /* DMA start */
944944

945+
if (temac_check_tx_bd_space(lp, MAX_SKB_FRAGS + 1)) {
946+
netdev_info(ndev, "%s -> netif_stop_queue\n", __func__);
947+
netif_stop_queue(ndev);
948+
}
949+
945950
return NETDEV_TX_OK;
946951
}
947952

0 commit comments

Comments
 (0)