diff options
author | Amerigo Wang <amwang@redhat.com> | 2012-08-09 21:24:41 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-14 17:33:31 -0400 |
commit | 91fe4a4b9e490a24f6702dd8afe72d8afab6fcdb (patch) | |
tree | ded789b4e378c4e657ea425f0e05ea72be395747 | |
parent | 57c5d46191e75312934c00eba65b13a31ca95120 (diff) |
netpoll: use netpoll_rx_on() in netpoll_rx()
The logic of the code is same, just call netpoll_rx_on().
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/netpoll.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 5d881c388273..2d178baa49df 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
@@ -63,6 +63,13 @@ static inline void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) | |||
63 | 63 | ||
64 | 64 | ||
65 | #ifdef CONFIG_NETPOLL | 65 | #ifdef CONFIG_NETPOLL |
66 | static inline int netpoll_rx_on(struct sk_buff *skb) | ||
67 | { | ||
68 | struct netpoll_info *npinfo = rcu_dereference_bh(skb->dev->npinfo); | ||
69 | |||
70 | return npinfo && (!list_empty(&npinfo->rx_np) || npinfo->rx_flags); | ||
71 | } | ||
72 | |||
66 | static inline bool netpoll_rx(struct sk_buff *skb) | 73 | static inline bool netpoll_rx(struct sk_buff *skb) |
67 | { | 74 | { |
68 | struct netpoll_info *npinfo; | 75 | struct netpoll_info *npinfo; |
@@ -70,11 +77,11 @@ static inline bool netpoll_rx(struct sk_buff *skb) | |||
70 | bool ret = false; | 77 | bool ret = false; |
71 | 78 | ||
72 | local_irq_save(flags); | 79 | local_irq_save(flags); |
73 | npinfo = rcu_dereference_bh(skb->dev->npinfo); | ||
74 | 80 | ||
75 | if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags)) | 81 | if (!netpoll_rx_on(skb)) |
76 | goto out; | 82 | goto out; |
77 | 83 | ||
84 | npinfo = rcu_dereference_bh(skb->dev->npinfo); | ||
78 | spin_lock(&npinfo->rx_lock); | 85 | spin_lock(&npinfo->rx_lock); |
79 | /* check rx_flags again with the lock held */ | 86 | /* check rx_flags again with the lock held */ |
80 | if (npinfo->rx_flags && __netpoll_rx(skb, npinfo)) | 87 | if (npinfo->rx_flags && __netpoll_rx(skb, npinfo)) |
@@ -86,13 +93,6 @@ out: | |||
86 | return ret; | 93 | return ret; |
87 | } | 94 | } |
88 | 95 | ||
89 | static inline int netpoll_rx_on(struct sk_buff *skb) | ||
90 | { | ||
91 | struct netpoll_info *npinfo = rcu_dereference_bh(skb->dev->npinfo); | ||
92 | |||
93 | return npinfo && (!list_empty(&npinfo->rx_np) || npinfo->rx_flags); | ||
94 | } | ||
95 | |||
96 | static inline int netpoll_receive_skb(struct sk_buff *skb) | 96 | static inline int netpoll_receive_skb(struct sk_buff *skb) |
97 | { | 97 | { |
98 | if (!list_empty(&skb->dev->napi_list)) | 98 | if (!list_empty(&skb->dev->napi_list)) |