Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321966
b: refs/heads/master
c: 91fe4a4
h: refs/heads/master
v: v3
  • Loading branch information
Amerigo Wang authored and David S. Miller committed Aug 14, 2012
1 parent 3881133 commit 51d6a7e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 57c5d46191e75312934c00eba65b13a31ca95120
refs/heads/master: 91fe4a4b9e490a24f6702dd8afe72d8afab6fcdb
18 changes: 9 additions & 9 deletions trunk/include/linux/netpoll.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,25 @@ static inline void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)


#ifdef CONFIG_NETPOLL
static inline int netpoll_rx_on(struct sk_buff *skb)
{
struct netpoll_info *npinfo = rcu_dereference_bh(skb->dev->npinfo);

return npinfo && (!list_empty(&npinfo->rx_np) || npinfo->rx_flags);
}

static inline bool netpoll_rx(struct sk_buff *skb)
{
struct netpoll_info *npinfo;
unsigned long flags;
bool ret = false;

local_irq_save(flags);
npinfo = rcu_dereference_bh(skb->dev->npinfo);

if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags))
if (!netpoll_rx_on(skb))
goto out;

npinfo = rcu_dereference_bh(skb->dev->npinfo);
spin_lock(&npinfo->rx_lock);
/* check rx_flags again with the lock held */
if (npinfo->rx_flags && __netpoll_rx(skb, npinfo))
Expand All @@ -86,13 +93,6 @@ static inline bool netpoll_rx(struct sk_buff *skb)
return ret;
}

static inline int netpoll_rx_on(struct sk_buff *skb)
{
struct netpoll_info *npinfo = rcu_dereference_bh(skb->dev->npinfo);

return npinfo && (!list_empty(&npinfo->rx_np) || npinfo->rx_flags);
}

static inline int netpoll_receive_skb(struct sk_buff *skb)
{
if (!list_empty(&skb->dev->napi_list))
Expand Down

0 comments on commit 51d6a7e

Please sign in to comment.