Skip to content

Commit

Permalink
net: ll_temac: Avoid ndo_start_xmit returning NETDEV_TX_BUSY
Browse files Browse the repository at this point in the history
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 <esben@geanix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
esben authored and davem330 committed Jun 18, 2021
1 parent c364df2 commit f639634
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/ethernet/xilinx/ll_temac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,11 @@ temac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
wmb();
lp->dma_out(lp, TX_TAILDESC_PTR, tail_p); /* DMA start */

if (temac_check_tx_bd_space(lp, MAX_SKB_FRAGS + 1)) {
netdev_info(ndev, "%s -> netif_stop_queue\n", __func__);
netif_stop_queue(ndev);
}

return NETDEV_TX_OK;
}

Expand Down

0 comments on commit f639634

Please sign in to comment.