Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8779772c authored by David S. Miller's avatar David S. Miller
Browse files


Eric W. Biederman says:

====================
Using dev_kfree/consume_skb_any for functions called in multiple contexts

These changes are a result of walking through the network drivers
supporting netpoll and verifying the code paths that netpoll can cause
to be called in hard irq context use an appropriate flavor of
kfree_skb.  Either dev_kfree_skb_any or dev_consume_skb_any.

Since my last pass at this I have become aware of the small differences
between dev_kfree_skb_any and dev_consume_skb_any.
net/core/drop_monitor.c reports the dev_kfree_skb_any as a drop and
while being quite about the second.  With the weird twist that
dev_kfree_skb is unintuitively consume_skb.

As netpoll now calls the napi poll function with budget == 0, pieces of
a drivers the napi poll function that don't run when budget == 0 have
been ignored.

The most interesting change is to the atl1c which tried unsuccesfully to
tell one of it's functions which context it is called in so that it
could call dev_kfree_skb_irq or dev_kfree_skb as appropriate.  I have
just removed the extra parameter and called dev_consume_skb_any.

At 54 separate changes I will post each change as a separate patch (so
they can be reviewed) but for general sanity sake I have gathered them
all into a git branch for easy acces.
====================

Acked-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 35d499ee fb7c03df
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -240,7 +240,7 @@ static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)

	spin_unlock_irqrestore(&lp->lock, flags);

	dev_kfree_skb(skb);
	dev_consume_skb_any(skb);

	return NETDEV_TX_OK;
}
+1 −1
Original line number Diff line number Diff line
@@ -749,7 +749,7 @@ el3_start_xmit(struct sk_buff *skb, struct net_device *dev)

	spin_unlock_irqrestore(&lp->lock, flags);

	dev_kfree_skb (skb);
	dev_consume_skb_any (skb);

	/* Clear the Tx status stack. */
	{
+1 −1
Original line number Diff line number Diff line
@@ -2086,7 +2086,7 @@ vortex_start_xmit(struct sk_buff *skb, struct net_device *dev)
		/* ... and the packet rounded to a doubleword. */
		skb_tx_timestamp(skb);
		iowrite32_rep(ioaddr + TX_FIFO, skb->data, (skb->len + 3) >> 2);
		dev_kfree_skb (skb);
		dev_consume_skb_any (skb);
		if (ioread16(ioaddr + TxFree) > 1536) {
			netif_start_queue (dev);	/* AKPM: redundant? */
		} else {
+1 −1
Original line number Diff line number Diff line
@@ -404,7 +404,7 @@ static netdev_tx_t __ei_start_xmit(struct sk_buff *skb,
	spin_unlock(&ei_local->page_lock);
	enable_irq_lockdep_irqrestore(dev->irq, &flags);
	skb_tx_timestamp(skb);
	dev_kfree_skb(skb);
	dev_consume_skb_any(skb);
	dev->stats.tx_bytes += send_length;

	return NETDEV_TX_OK;
+1 −1
Original line number Diff line number Diff line
@@ -1087,7 +1087,7 @@ static inline void _tx_reclaim_skb(void)
		tx_list_head->desc_a.config &= ~DMAEN;
		tx_list_head->status.status_word = 0;
		if (tx_list_head->skb) {
			dev_kfree_skb(tx_list_head->skb);
			dev_consume_skb_any(tx_list_head->skb);
			tx_list_head->skb = NULL;
		}
		tx_list_head = tx_list_head->next;
Loading