History

netpoll: use netpoll_rx_on() in netpoll_rx()

The logic of the code is same, just call netpoll_rx_on().

Amerigo Wang committed 14 years ago

Commit 91fe4a41 parent 57c5d461 file · +9 −9Browse files

Unified · Split

include/linux/netpoll.h+9−9
@@ -63,6 +63,13 @@ static inline void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) · 62 unmodified lines
63 63
64 64
65#ifdef CONFIG_NETPOLL65#ifdef CONFIG_NETPOLL
66static 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
66static inline bool netpoll_rx(struct sk_buff *skb)73static 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) · 1 unmodified line
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: · 5 unmodified lines
86 return ret;93 return ret;
87}94}
88 95
89static 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
96static inline int netpoll_receive_skb(struct sk_buff *skb)96static 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))

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t