public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net v2] net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq()
@ 2022-12-07  1:53 Yang Yingliang
  2022-12-07 13:54 ` Jiri Pirko
  2022-12-08  4:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Yang Yingliang @ 2022-12-07  1:53 UTC (permalink / raw)
  To: netdev; +Cc: davem, edumazet, kuba, pabeni

It is not allowed to call kfree_skb() or consume_skb() from
hardware interrupt context or with interrupts being disabled.
So replace kfree_skb/dev_kfree_skb() with dev_kfree_skb_irq()
and dev_consume_skb_irq() under spin_lock_irq().

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
v1 -> v2:
  Add a fix tag.
---
 drivers/net/plip/plip.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/plip/plip.c b/drivers/net/plip/plip.c
index c8791e9b451d..40ce8abe6999 100644
--- a/drivers/net/plip/plip.c
+++ b/drivers/net/plip/plip.c
@@ -450,12 +450,12 @@ plip_bh_timeout_error(struct net_device *dev, struct net_local *nl,
 	}
 	rcv->state = PLIP_PK_DONE;
 	if (rcv->skb) {
-		kfree_skb(rcv->skb);
+		dev_kfree_skb_irq(rcv->skb);
 		rcv->skb = NULL;
 	}
 	snd->state = PLIP_PK_DONE;
 	if (snd->skb) {
-		dev_kfree_skb(snd->skb);
+		dev_consume_skb_irq(snd->skb);
 		snd->skb = NULL;
 	}
 	spin_unlock_irq(&nl->lock);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net v2] net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq()
  2022-12-07  1:53 [PATCH net v2] net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq() Yang Yingliang
@ 2022-12-07 13:54 ` Jiri Pirko
  2022-12-08  4:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Pirko @ 2022-12-07 13:54 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: netdev, davem, edumazet, kuba, pabeni

Wed, Dec 07, 2022 at 02:53:10AM CET, yangyingliang@huawei.com wrote:
>It is not allowed to call kfree_skb() or consume_skb() from
>hardware interrupt context or with interrupts being disabled.
>So replace kfree_skb/dev_kfree_skb() with dev_kfree_skb_irq()
>and dev_consume_skb_irq() under spin_lock_irq().
>
>Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
>Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>

Reviewed-by: Jiri Pirko <jiri@nvidia.com>

I wonder if anyone is actually using PLIP these days :)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net v2] net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq()
  2022-12-07  1:53 [PATCH net v2] net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq() Yang Yingliang
  2022-12-07 13:54 ` Jiri Pirko
@ 2022-12-08  4:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-12-08  4:20 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: netdev, davem, edumazet, kuba, pabeni

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 7 Dec 2022 09:53:10 +0800 you wrote:
> It is not allowed to call kfree_skb() or consume_skb() from
> hardware interrupt context or with interrupts being disabled.
> So replace kfree_skb/dev_kfree_skb() with dev_kfree_skb_irq()
> and dev_consume_skb_irq() under spin_lock_irq().
> 
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> 
> [...]

Here is the summary with links:
  - [net,v2] net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq()
    https://git.kernel.org/netdev/net/c/7d8c19bfc8ff

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] 3+ messages in thread

end of thread, other threads:[~2022-12-08  4:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-07  1:53 [PATCH net v2] net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq() Yang Yingliang
2022-12-07 13:54 ` Jiri Pirko
2022-12-08  4:20 ` 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