diff options
author | David S. Miller <davem@davemloft.net> | 2008-07-09 02:01:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-09 02:01:06 -0400 |
commit | 6fa9864b53f0680e432a2c431c2cf2055daa3a88 (patch) | |
tree | 77e6964f84775d5f2ee152c249ee26aa326df4ac /net | |
parent | 3e745dd6950d72d19e4cb30dc44307e8d6671864 (diff) |
net: Clean up explicit ->tx_queue references in link watch.
First, we add a qdisc_tx_changing() helper which returns true if the
qdisc attachment is in transition.
Second, we remove an assertion warning which is of limited value and
is hard to express precisely in a multiqueue environment.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/link_watch.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/net/core/link_watch.c b/net/core/link_watch.c index 50218218445b..bf8f7af699d7 100644 --- a/net/core/link_watch.c +++ b/net/core/link_watch.c | |||
@@ -77,12 +77,10 @@ static void rfc2863_policy(struct net_device *dev) | |||
77 | } | 77 | } |
78 | 78 | ||
79 | 79 | ||
80 | static int linkwatch_urgent_event(struct net_device *dev) | 80 | static bool linkwatch_urgent_event(struct net_device *dev) |
81 | { | 81 | { |
82 | struct netdev_queue *txq = &dev->tx_queue; | ||
83 | |||
84 | return netif_running(dev) && netif_carrier_ok(dev) && | 82 | return netif_running(dev) && netif_carrier_ok(dev) && |
85 | txq->qdisc != txq->qdisc_sleeping; | 83 | qdisc_tx_changing(dev); |
86 | } | 84 | } |
87 | 85 | ||
88 | 86 | ||
@@ -182,12 +180,9 @@ static void __linkwatch_run_queue(int urgent_only) | |||
182 | 180 | ||
183 | rfc2863_policy(dev); | 181 | rfc2863_policy(dev); |
184 | if (dev->flags & IFF_UP) { | 182 | if (dev->flags & IFF_UP) { |
185 | if (netif_carrier_ok(dev)) { | 183 | if (netif_carrier_ok(dev)) |
186 | struct netdev_queue *txq = &dev->tx_queue; | ||
187 | |||
188 | WARN_ON(txq->qdisc_sleeping == &noop_qdisc); | ||
189 | dev_activate(dev); | 184 | dev_activate(dev); |
190 | } else | 185 | else |
191 | dev_deactivate(dev); | 186 | dev_deactivate(dev); |
192 | 187 | ||
193 | netdev_state_change(dev); | 188 | netdev_state_change(dev); |
@@ -218,7 +213,7 @@ static void linkwatch_event(struct work_struct *dummy) | |||
218 | 213 | ||
219 | void linkwatch_fire_event(struct net_device *dev) | 214 | void linkwatch_fire_event(struct net_device *dev) |
220 | { | 215 | { |
221 | int urgent = linkwatch_urgent_event(dev); | 216 | bool urgent = linkwatch_urgent_event(dev); |
222 | 217 | ||
223 | if (!test_and_set_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state)) { | 218 | if (!test_and_set_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state)) { |
224 | dev_hold(dev); | 219 | dev_hold(dev); |