The logic of the code is same, just call netpoll_rx_on().
Showing the changes to include/linux (1 of 1 file). Show all
Unified · Split
| @@ -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 | 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 | 73 | static inline bool netpoll_rx(struct sk_buff *skb) |
| 67 | 74 | { |
| 68 | 75 | struct netpoll_info *npinfo; |
| @@ -70,11 +77,11 @@ static inline bool netpoll_rx(struct sk_buff *skb) · 1 unmodified line | ||
| 70 | 77 | bool ret = false; |
| 71 | 78 | |
| 72 | 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 | 82 | goto out; |
| 77 | 83 | |
| 84 | + npinfo = rcu_dereference_bh(skb->dev->npinfo); | |
| 78 | 85 | spin_lock(&npinfo->rx_lock); |
| 79 | 86 | /* check rx_flags again with the lock held */ |
| 80 | 87 | if (npinfo->rx_flags && __netpoll_rx(skb, npinfo)) |
| @@ -86,13 +93,6 @@ out: · 5 unmodified lines | ||
| 86 | 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 | 96 | static inline int netpoll_receive_skb(struct sk_buff *skb) |
| 97 | 97 | { |
| 98 | 98 | if (!list_empty(&skb->dev->napi_list)) |