diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2007-05-29 16:22:52 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-05-31 04:23:35 -0400 |
commit | b0ba66671a92f7d12fdbc42592d36e678f713efc (patch) | |
tree | 80aaa15272dca59160f5ffb6952941d01c084218 /include | |
parent | e4fd5da39f99d5921dda1fe3d93652fbd925fbfd (diff) |
[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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netdevice.h | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index f671cd2f133f..3a70f553b28f 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) | |||
910 | return 0; | 910 | return 0; |
911 | } | 911 | } |
912 | 912 | ||
913 | /* same as netif_rx_complete, except that local_irq_save(flags) | ||
914 | * has already been issued | ||
915 | */ | ||
916 | static inline void __netif_rx_complete(struct net_device *dev) | ||
917 | { | ||
918 | BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state)); | ||
919 | list_del(&dev->poll_list); | ||
920 | smp_mb__before_clear_bit(); | ||
921 | clear_bit(__LINK_STATE_RX_SCHED, &dev->state); | ||
922 | } | ||
923 | |||
913 | /* Remove interface from poll list: it must be in the poll list | 924 | /* Remove interface from poll list: it must be in the poll list |
914 | * on current cpu. This primitive is called by dev->poll(), when | 925 | * on current cpu. This primitive is called by dev->poll(), when |
915 | * it completes the work. The device cannot be out of poll list at this | 926 | * 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) | |||
920 | unsigned long flags; | 931 | unsigned long flags; |
921 | 932 | ||
922 | local_irq_save(flags); | 933 | local_irq_save(flags); |
923 | BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state)); | 934 | __netif_rx_complete(dev); |
924 | list_del(&dev->poll_list); | ||
925 | smp_mb__before_clear_bit(); | ||
926 | clear_bit(__LINK_STATE_RX_SCHED, &dev->state); | ||
927 | local_irq_restore(flags); | 935 | local_irq_restore(flags); |
928 | } | 936 | } |
929 | 937 | ||
@@ -940,17 +948,6 @@ static inline void netif_poll_enable(struct net_device *dev) | |||
940 | clear_bit(__LINK_STATE_RX_SCHED, &dev->state); | 948 | clear_bit(__LINK_STATE_RX_SCHED, &dev->state); |
941 | } | 949 | } |
942 | 950 | ||
943 | /* same as netif_rx_complete, except that local_irq_save(flags) | ||
944 | * has already been issued | ||
945 | */ | ||
946 | static inline void __netif_rx_complete(struct net_device *dev) | ||
947 | { | ||
948 | BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state)); | ||
949 | list_del(&dev->poll_list); | ||
950 | smp_mb__before_clear_bit(); | ||
951 | clear_bit(__LINK_STATE_RX_SCHED, &dev->state); | ||
952 | } | ||
953 | |||
954 | static inline void netif_tx_lock(struct net_device *dev) | 951 | static inline void netif_tx_lock(struct net_device *dev) |
955 | { | 952 | { |
956 | spin_lock(&dev->_xmit_lock); | 953 | spin_lock(&dev->_xmit_lock); |