* [NET] napi: Call __netif_rx_complete in netif_rx_complete
@ 2007-05-20 10:39 Herbert Xu
2007-05-23 17:50 ` Ingo Oeser
0 siblings, 1 reply; 2+ messages in thread
From: Herbert Xu @ 2007-05-20 10:39 UTC (permalink / raw)
To: David S. Miller, netdev
Hi Dave:
[NET] napi: Call __netif_rx_complete in netif_rx_complete
This patch kills a little bit of code duplication between the two
variants of netif_rx_complete.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index f671cd2..3a70f55 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -910,6 +910,17 @@ static inline int netif_rx_reschedule(struct net_device *dev, int undo)
return 0;
}
+/* same as netif_rx_complete, except that local_irq_save(flags)
+ * has already been issued
+ */
+static inline void __netif_rx_complete(struct net_device *dev)
+{
+ BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state));
+ list_del(&dev->poll_list);
+ smp_mb__before_clear_bit();
+ clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
+}
+
/* Remove interface from poll list: it must be in the poll list
* on current cpu. This primitive is called by dev->poll(), when
* it completes the work. The device cannot be out of poll list at this
@@ -920,10 +931,7 @@ static inline void netif_rx_complete(struct net_device *dev)
unsigned long flags;
local_irq_save(flags);
- BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state));
- list_del(&dev->poll_list);
- smp_mb__before_clear_bit();
- clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
+ __netif_rx_complete(dev);
local_irq_restore(flags);
}
@@ -940,17 +948,6 @@ static inline void netif_poll_enable(struct net_device *dev)
clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
}
-/* same as netif_rx_complete, except that local_irq_save(flags)
- * has already been issued
- */
-static inline void __netif_rx_complete(struct net_device *dev)
-{
- BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state));
- list_del(&dev->poll_list);
- smp_mb__before_clear_bit();
- clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
-}
-
static inline void netif_tx_lock(struct net_device *dev)
{
spin_lock(&dev->_xmit_lock);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [NET] napi: Call __netif_rx_complete in netif_rx_complete
2007-05-20 10:39 [NET] napi: Call __netif_rx_complete in netif_rx_complete Herbert Xu
@ 2007-05-23 17:50 ` Ingo Oeser
0 siblings, 0 replies; 2+ messages in thread
From: Ingo Oeser @ 2007-05-23 17:50 UTC (permalink / raw)
To: Herbert Xu; +Cc: David S. Miller, netdev
Hi Herbert,
Herbert Xu schrieb:
> [NET] napi: Call __netif_rx_complete in netif_rx_complete
>
> This patch kills a little bit of code duplication between the two
> variants of netif_rx_complete.
What about making it out of line?
There is nothing the compiler can optimize away here
and the code looks bigger than a function call with a single argument.
Maybe even make the callers out of line?
Best regards
Ingo Oeser
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-05-23 17:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-20 10:39 [NET] napi: Call __netif_rx_complete in netif_rx_complete Herbert Xu
2007-05-23 17:50 ` Ingo Oeser
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).