* [PATCH net] net: fec: fix improper use of NETDEV_TX_BUSY
@ 2022-10-28 2:09 Zhang Changzhong
2022-10-31 9:30 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Zhang Changzhong @ 2022-10-28 2:09 UTC (permalink / raw)
To: Joakim Zhang, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Nimrod Andy
Cc: Zhang Changzhong, netdev, linux-kernel
The ndo_start_xmit() method must not free skb when returning
NETDEV_TX_BUSY, since caller is going to requeue freed skb.
Fix it by returning NETDEV_TX_OK in case of dma_map_single() fails.
Fixes: 79f339125ea3 ("net: fec: Add software TSO support")
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
---
drivers/net/ethernet/freescale/fec_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 28ef4d3..f623c12 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -713,7 +713,7 @@ fec_enet_txq_put_data_tso(struct fec_enet_priv_tx_q *txq, struct sk_buff *skb,
dev_kfree_skb_any(skb);
if (net_ratelimit())
netdev_err(ndev, "Tx DMA memory map failed\n");
- return NETDEV_TX_BUSY;
+ return NETDEV_TX_OK;
}
bdp->cbd_datlen = cpu_to_fec16(size);
@@ -775,7 +775,7 @@ fec_enet_txq_put_hdr_tso(struct fec_enet_priv_tx_q *txq,
dev_kfree_skb_any(skb);
if (net_ratelimit())
netdev_err(ndev, "Tx DMA memory map failed\n");
- return NETDEV_TX_BUSY;
+ return NETDEV_TX_OK;
}
}
--
2.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: fec: fix improper use of NETDEV_TX_BUSY
2022-10-28 2:09 [PATCH net] net: fec: fix improper use of NETDEV_TX_BUSY Zhang Changzhong
@ 2022-10-31 9:30 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-10-31 9:30 UTC (permalink / raw)
To: Zhang Changzhong
Cc: qiangqing.zhang, davem, edumazet, kuba, pabeni, B38611, netdev,
linux-kernel
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Fri, 28 Oct 2022 10:09:11 +0800 you wrote:
> The ndo_start_xmit() method must not free skb when returning
> NETDEV_TX_BUSY, since caller is going to requeue freed skb.
>
> Fix it by returning NETDEV_TX_OK in case of dma_map_single() fails.
>
> Fixes: 79f339125ea3 ("net: fec: Add software TSO support")
> Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
>
> [...]
Here is the summary with links:
- [net] net: fec: fix improper use of NETDEV_TX_BUSY
https://git.kernel.org/netdev/net/c/06a4df5863f7
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:[~2022-10-31 9:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-28 2:09 [PATCH net] net: fec: fix improper use of NETDEV_TX_BUSY Zhang Changzhong
2022-10-31 9:30 ` 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).