diff options
author | Christian Lamparter <chunkeey@googlemail.com> | 2009-11-28 18:52:51 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-12-21 18:39:00 -0500 |
commit | 53a76b58b66e77164c4a79c38da49b808d67477e (patch) | |
tree | 4fc6620497d45b492153826fafda0bf45dd2c29c /drivers | |
parent | 5e0ec316522e0372b633407c903b88f58859303f (diff) |
ar9170: improve network latency
AR9170 has the bad habit of choking when traffic builds up.
Tests have shown that this can partially be attributed to
a huge buildup of backlogged frames.
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ar9170/ar9170.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ar9170/main.c | 34 |
2 files changed, 18 insertions, 18 deletions
diff --git a/drivers/net/wireless/ath/ar9170/ar9170.h b/drivers/net/wireless/ath/ar9170/ar9170.h index d95a7d47af0..44c54b834a0 100644 --- a/drivers/net/wireless/ath/ar9170/ar9170.h +++ b/drivers/net/wireless/ath/ar9170/ar9170.h | |||
@@ -152,6 +152,8 @@ struct ar9170_sta_tid { | |||
152 | 152 | ||
153 | #define AR9170_NUM_TX_STATUS 128 | 153 | #define AR9170_NUM_TX_STATUS 128 |
154 | #define AR9170_NUM_TX_AGG_MAX 30 | 154 | #define AR9170_NUM_TX_AGG_MAX 30 |
155 | #define AR9170_NUM_TX_LIMIT_HARD AR9170_TXQ_DEPTH | ||
156 | #define AR9170_NUM_TX_LIMIT_SOFT (AR9170_TXQ_DEPTH - 10) | ||
155 | 157 | ||
156 | struct ar9170 { | 158 | struct ar9170 { |
157 | struct ieee80211_hw *hw; | 159 | struct ieee80211_hw *hw; |
diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c index cbf59b1590b..3cec2f16c65 100644 --- a/drivers/net/wireless/ath/ar9170/main.c +++ b/drivers/net/wireless/ath/ar9170/main.c | |||
@@ -430,7 +430,7 @@ void ar9170_tx_callback(struct ar9170 *ar, struct sk_buff *skb) | |||
430 | spin_lock_irqsave(&ar->tx_stats_lock, flags); | 430 | spin_lock_irqsave(&ar->tx_stats_lock, flags); |
431 | ar->tx_stats[queue].len--; | 431 | ar->tx_stats[queue].len--; |
432 | 432 | ||
433 | if (skb_queue_empty(&ar->tx_pending[queue])) { | 433 | if (ar->tx_stats[queue].len < AR9170_NUM_TX_LIMIT_SOFT) { |
434 | #ifdef AR9170_QUEUE_STOP_DEBUG | 434 | #ifdef AR9170_QUEUE_STOP_DEBUG |
435 | printk(KERN_DEBUG "%s: wake queue %d\n", | 435 | printk(KERN_DEBUG "%s: wake queue %d\n", |
436 | wiphy_name(ar->hw->wiphy), queue); | 436 | wiphy_name(ar->hw->wiphy), queue); |
@@ -1716,6 +1716,21 @@ static void ar9170_tx(struct ar9170 *ar) | |||
1716 | 1716 | ||
1717 | for (i = 0; i < __AR9170_NUM_TXQ; i++) { | 1717 | for (i = 0; i < __AR9170_NUM_TXQ; i++) { |
1718 | spin_lock_irqsave(&ar->tx_stats_lock, flags); | 1718 | spin_lock_irqsave(&ar->tx_stats_lock, flags); |
1719 | frames = min(ar->tx_stats[i].limit - ar->tx_stats[i].len, | ||
1720 | skb_queue_len(&ar->tx_pending[i])); | ||
1721 | |||
1722 | if (remaining_space < frames) { | ||
1723 | #ifdef AR9170_QUEUE_DEBUG | ||
1724 | printk(KERN_DEBUG "%s: tx quota reached queue:%d, " | ||
1725 | "remaining slots:%d, needed:%d\n", | ||
1726 | wiphy_name(ar->hw->wiphy), i, remaining_space, | ||
1727 | frames); | ||
1728 | #endif /* AR9170_QUEUE_DEBUG */ | ||
1729 | frames = remaining_space; | ||
1730 | } | ||
1731 | |||
1732 | ar->tx_stats[i].len += frames; | ||
1733 | ar->tx_stats[i].count += frames; | ||
1719 | if (ar->tx_stats[i].len >= ar->tx_stats[i].limit) { | 1734 | if (ar->tx_stats[i].len >= ar->tx_stats[i].limit) { |
1720 | #ifdef AR9170_QUEUE_DEBUG | 1735 | #ifdef AR9170_QUEUE_DEBUG |
1721 | printk(KERN_DEBUG "%s: queue %d full\n", | 1736 | printk(KERN_DEBUG "%s: queue %d full\n", |
@@ -1733,25 +1748,8 @@ static void ar9170_tx(struct ar9170 *ar) | |||
1733 | __ar9170_dump_txstats(ar); | 1748 | __ar9170_dump_txstats(ar); |
1734 | #endif /* AR9170_QUEUE_STOP_DEBUG */ | 1749 | #endif /* AR9170_QUEUE_STOP_DEBUG */ |
1735 | ieee80211_stop_queue(ar->hw, i); | 1750 | ieee80211_stop_queue(ar->hw, i); |
1736 | spin_unlock_irqrestore(&ar->tx_stats_lock, flags); | ||
1737 | continue; | ||
1738 | } | ||
1739 | |||
1740 | frames = min(ar->tx_stats[i].limit - ar->tx_stats[i].len, | ||
1741 | skb_queue_len(&ar->tx_pending[i])); | ||
1742 | |||
1743 | if (remaining_space < frames) { | ||
1744 | #ifdef AR9170_QUEUE_DEBUG | ||
1745 | printk(KERN_DEBUG "%s: tx quota reached queue:%d, " | ||
1746 | "remaining slots:%d, needed:%d\n", | ||
1747 | wiphy_name(ar->hw->wiphy), i, remaining_space, | ||
1748 | frames); | ||
1749 | #endif /* AR9170_QUEUE_DEBUG */ | ||
1750 | frames = remaining_space; | ||
1751 | } | 1751 | } |
1752 | 1752 | ||
1753 | ar->tx_stats[i].len += frames; | ||
1754 | ar->tx_stats[i].count += frames; | ||
1755 | spin_unlock_irqrestore(&ar->tx_stats_lock, flags); | 1753 | spin_unlock_irqrestore(&ar->tx_stats_lock, flags); |
1756 | 1754 | ||
1757 | if (!frames) | 1755 | if (!frames) |