Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 119884
b: refs/heads/master
c: 7b363e4
h: refs/heads/master
v: v3
  • Loading branch information
Neil Horman authored and David S. Miller committed Dec 10, 2008
1 parent 0e2a816 commit b1bced0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 24fc7b86dc0470616803be2f921c8cd5c459175d
refs/heads/master: 7b363e440021a1cf9ed76944b2685f48dacefb3e
7 changes: 7 additions & 0 deletions trunk/include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ enum
{
NAPI_STATE_SCHED, /* Poll is scheduled */
NAPI_STATE_DISABLE, /* Disable pending */
NAPI_STATE_NPSVC, /* Netpoll - don't dequeue from poll_list */
};

extern void __napi_schedule(struct napi_struct *n);
Expand Down Expand Up @@ -1497,6 +1498,12 @@ static inline void netif_rx_complete(struct net_device *dev,
{
unsigned long flags;

/*
* don't let napi dequeue from the cpu poll list
* just in case its running on a different cpu
*/
if (unlikely(test_bit(NAPI_STATE_NPSVC, &napi->state)))
return;
local_irq_save(flags);
__netif_rx_complete(dev, napi);
local_irq_restore(flags);
Expand Down
2 changes: 2 additions & 0 deletions trunk/net/core/netpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,11 @@ static int poll_one_napi(struct netpoll_info *npinfo,

npinfo->rx_flags |= NETPOLL_RX_DROP;
atomic_inc(&trapped);
set_bit(NAPI_STATE_NPSVC, &napi->state);

work = napi->poll(napi, budget);

clear_bit(NAPI_STATE_NPSVC, &napi->state);
atomic_dec(&trapped);
npinfo->rx_flags &= ~NETPOLL_RX_DROP;

Expand Down

0 comments on commit b1bced0

Please sign in to comment.