Message ID | 20221207073215.3545460-3-yangyingliang@huawei.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: don't call dev_kfree_skb() under spin_lock_irqsave() | expand |
On Wed, Dec 7, 2022 at 8:35 AM Yang Yingliang <yangyingliang@huawei.com> wrote: > > It is not allowed to call consume_skb() from hardware interrupt context > or with interrupts being disabled. So replace dev_kfree_skb() with > dev_consume_skb_irq() under spin_lock_irqsave(). > > Fixes: 4796417417a6 ("dnet: Dave DNET ethernet controller driver (updated)") > Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> > --- > drivers/net/ethernet/dnet.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/dnet.c b/drivers/net/ethernet/dnet.c > index 08184f20f510..1da10c79fb97 100644 > --- a/drivers/net/ethernet/dnet.c > +++ b/drivers/net/ethernet/dnet.c > @@ -551,7 +551,7 @@ static netdev_tx_t dnet_start_xmit(struct sk_buff *skb, struct net_device *dev) > skb_tx_timestamp(skb); > > /* free the buffer */ > - dev_kfree_skb(skb); > + dev_consume_skb_irq(skb); > > spin_unlock_irqrestore(&bp->lock, flags); What about moving the dev_kfree_skb() after spin_unlock_irqrestore() ? > > -- > 2.25.1 >
diff --git a/drivers/net/ethernet/dnet.c b/drivers/net/ethernet/dnet.c index 08184f20f510..1da10c79fb97 100644 --- a/drivers/net/ethernet/dnet.c +++ b/drivers/net/ethernet/dnet.c @@ -551,7 +551,7 @@ static netdev_tx_t dnet_start_xmit(struct sk_buff *skb, struct net_device *dev) skb_tx_timestamp(skb); /* free the buffer */ - dev_kfree_skb(skb); + dev_consume_skb_irq(skb); spin_unlock_irqrestore(&bp->lock, flags);
It is not allowed to call consume_skb() from hardware interrupt context or with interrupts being disabled. So replace dev_kfree_skb() with dev_consume_skb_irq() under spin_lock_irqsave(). Fixes: 4796417417a6 ("dnet: Dave DNET ethernet controller driver (updated)") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> --- drivers/net/ethernet/dnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)