mac80211: debounce queue stop/wake
authorJohannes Berg <johannes.berg@intel.com>
Wed, 28 Mar 2012 09:04:27 +0000 (11:04 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 10 Apr 2012 18:54:11 +0000 (14:54 -0400)
When the queue status changes we need to do a fair
bit of work, so ignore no-op changes early.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/util.c

index 2b62307825d4333c909d726afac8e2985d0ee051..ef725cabb09950d5163156a6d93f18803e89bb90 100644 (file)
@@ -276,6 +276,9 @@ static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue,
        if (WARN_ON(queue >= hw->queues))
                return;
 
+       if (!test_bit(reason, &local->queue_stop_reasons[queue]))
+               return;
+
        __clear_bit(reason, &local->queue_stop_reasons[queue]);
 
        if (local->queue_stop_reasons[queue] != 0)
@@ -323,6 +326,9 @@ static void __ieee80211_stop_queue(struct ieee80211_hw *hw, int queue,
        if (WARN_ON(queue >= hw->queues))
                return;
 
+       if (test_bit(reason, &local->queue_stop_reasons[queue]))
+               return;
+
        __set_bit(reason, &local->queue_stop_reasons[queue]);
 
        rcu_read_lock();