summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEsben Haabendal <esben@geanix.com>2021-06-18 12:52:38 +0200
committerSasha Levin <sashal@kernel.org>2021-06-30 08:49:38 -0400
commitd527ab8b45cbeb686da3cd75b282f5ce6144350d (patch)
treee8d4be57992b2e9a3d3bdbec209f01fbaad79894
parentda5b3a5d48ec2c2f63b7526fc989ce8736dd63b3 (diff)
net: ll_temac: Avoid ndo_start_xmit returning NETDEV_TX_BUSY
[ Upstream commit f6396341194234e9b01cd7538bc2c6ac4501ab14 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/net/ethernet/xilinx/ll_temac_main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index ed6a88cf3281..98a1c712b62a 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -735,6 +735,11 @@ temac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
/* Kick off the transfer */
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;
}