diff options
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/link_watch.c | 13 | ||||
-rw-r--r-- | net/core/netpoll.c | 11 |
2 files changed, 11 insertions, 13 deletions
diff --git a/net/core/link_watch.c b/net/core/link_watch.c index 4b36114744..549a2ce951 100644 --- a/net/core/link_watch.c +++ b/net/core/link_watch.c | |||
@@ -34,8 +34,8 @@ enum lw_bits { | |||
34 | static unsigned long linkwatch_flags; | 34 | static unsigned long linkwatch_flags; |
35 | static unsigned long linkwatch_nextevent; | 35 | static unsigned long linkwatch_nextevent; |
36 | 36 | ||
37 | static void linkwatch_event(void *dummy); | 37 | static void linkwatch_event(struct work_struct *dummy); |
38 | static DECLARE_WORK(linkwatch_work, linkwatch_event, NULL); | 38 | static DECLARE_DELAYED_WORK(linkwatch_work, linkwatch_event); |
39 | 39 | ||
40 | static LIST_HEAD(lweventlist); | 40 | static LIST_HEAD(lweventlist); |
41 | static DEFINE_SPINLOCK(lweventlist_lock); | 41 | static DEFINE_SPINLOCK(lweventlist_lock); |
@@ -127,7 +127,7 @@ void linkwatch_run_queue(void) | |||
127 | } | 127 | } |
128 | 128 | ||
129 | 129 | ||
130 | static void linkwatch_event(void *dummy) | 130 | static void linkwatch_event(struct work_struct *dummy) |
131 | { | 131 | { |
132 | /* Limit the number of linkwatch events to one | 132 | /* Limit the number of linkwatch events to one |
133 | * per second so that a runaway driver does not | 133 | * per second so that a runaway driver does not |
@@ -171,10 +171,9 @@ void linkwatch_fire_event(struct net_device *dev) | |||
171 | unsigned long delay = linkwatch_nextevent - jiffies; | 171 | unsigned long delay = linkwatch_nextevent - jiffies; |
172 | 172 | ||
173 | /* If we wrap around we'll delay it by at most HZ. */ | 173 | /* If we wrap around we'll delay it by at most HZ. */ |
174 | if (!delay || delay > HZ) | 174 | if (delay > HZ) |
175 | schedule_work(&linkwatch_work); | 175 | delay = 0; |
176 | else | 176 | schedule_delayed_work(&linkwatch_work, delay); |
177 | schedule_delayed_work(&linkwatch_work, delay); | ||
178 | } | 177 | } |
179 | } | 178 | } |
180 | } | 179 | } |
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 3c58846fca..b3c559b9ac 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -50,9 +50,10 @@ static atomic_t trapped; | |||
50 | static void zap_completion_queue(void); | 50 | static void zap_completion_queue(void); |
51 | static void arp_reply(struct sk_buff *skb); | 51 | static void arp_reply(struct sk_buff *skb); |
52 | 52 | ||
53 | static void queue_process(void *p) | 53 | static void queue_process(struct work_struct *work) |
54 | { | 54 | { |
55 | struct netpoll_info *npinfo = p; | 55 | struct netpoll_info *npinfo = |
56 | container_of(work, struct netpoll_info, tx_work.work); | ||
56 | struct sk_buff *skb; | 57 | struct sk_buff *skb; |
57 | 58 | ||
58 | while ((skb = skb_dequeue(&npinfo->txq))) { | 59 | while ((skb = skb_dequeue(&npinfo->txq))) { |
@@ -72,8 +73,6 @@ static void queue_process(void *p) | |||
72 | schedule_delayed_work(&npinfo->tx_work, HZ/10); | 73 | schedule_delayed_work(&npinfo->tx_work, HZ/10); |
73 | return; | 74 | return; |
74 | } | 75 | } |
75 | |||
76 | netif_tx_unlock_bh(dev); | ||
77 | } | 76 | } |
78 | } | 77 | } |
79 | 78 | ||
@@ -263,7 +262,7 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) | |||
263 | 262 | ||
264 | if (status != NETDEV_TX_OK) { | 263 | if (status != NETDEV_TX_OK) { |
265 | skb_queue_tail(&npinfo->txq, skb); | 264 | skb_queue_tail(&npinfo->txq, skb); |
266 | schedule_work(&npinfo->tx_work); | 265 | schedule_delayed_work(&npinfo->tx_work,0); |
267 | } | 266 | } |
268 | } | 267 | } |
269 | 268 | ||
@@ -628,7 +627,7 @@ int netpoll_setup(struct netpoll *np) | |||
628 | spin_lock_init(&npinfo->rx_lock); | 627 | spin_lock_init(&npinfo->rx_lock); |
629 | skb_queue_head_init(&npinfo->arp_tx); | 628 | skb_queue_head_init(&npinfo->arp_tx); |
630 | skb_queue_head_init(&npinfo->txq); | 629 | skb_queue_head_init(&npinfo->txq); |
631 | INIT_WORK(&npinfo->tx_work, queue_process, npinfo); | 630 | INIT_DELAYED_WORK(&npinfo->tx_work, queue_process); |
632 | 631 | ||
633 | atomic_set(&npinfo->refcnt, 1); | 632 | atomic_set(&npinfo->refcnt, 1); |
634 | } else { | 633 | } else { |