p54: call p54_wake_free_queues on every p54_free_skb and p54_rx_frame_sent

Currently queues are stopped when their length reaches their length limit,
but are restarted only when the size of freed range of packet buffer is
not less than the size of the largest possible packet.

This causes permanent queue stop on radio visibility loss in the middle
of ping series: there is plenty of room in the packet buffer, but it is
never freed more than 3 (size of 'best effort' queue) * 288 (ping packet
plus headers) bytes at once.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Max Filippov 2009-05-06 01:47:02 +04:00 committed by John W. Linville
parent aec6795210
commit 7c5a189dc6

View File

@ -822,7 +822,6 @@ void p54_free_skb(struct ieee80211_hw *dev, struct sk_buff *skb)
struct ieee80211_tx_info *info; struct ieee80211_tx_info *info;
struct p54_tx_info *range; struct p54_tx_info *range;
unsigned long flags; unsigned long flags;
u32 freed = 0, last_addr = priv->rx_start;
if (unlikely(!skb || !dev || !skb_queue_len(&priv->tx_queue))) if (unlikely(!skb || !dev || !skb_queue_len(&priv->tx_queue)))
return; return;
@ -842,7 +841,6 @@ void p54_free_skb(struct ieee80211_hw *dev, struct sk_buff *skb)
ni = IEEE80211_SKB_CB(skb->prev); ni = IEEE80211_SKB_CB(skb->prev);
mr = (struct p54_tx_info *)ni->rate_driver_data; mr = (struct p54_tx_info *)ni->rate_driver_data;
last_addr = mr->end_addr;
} }
if (skb->next != (struct sk_buff *)&priv->tx_queue) { if (skb->next != (struct sk_buff *)&priv->tx_queue) {
struct ieee80211_tx_info *ni; struct ieee80211_tx_info *ni;
@ -850,16 +848,11 @@ void p54_free_skb(struct ieee80211_hw *dev, struct sk_buff *skb)
ni = IEEE80211_SKB_CB(skb->next); ni = IEEE80211_SKB_CB(skb->next);
mr = (struct p54_tx_info *)ni->rate_driver_data; mr = (struct p54_tx_info *)ni->rate_driver_data;
freed = mr->start_addr - last_addr; }
} else
freed = priv->rx_end - last_addr;
__skb_unlink(skb, &priv->tx_queue); __skb_unlink(skb, &priv->tx_queue);
spin_unlock_irqrestore(&priv->tx_queue.lock, flags); spin_unlock_irqrestore(&priv->tx_queue.lock, flags);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
p54_wake_free_queues(dev);
if (freed >= priv->headroom + sizeof(struct p54_hdr) + 48 +
IEEE80211_MAX_RTS_THRESHOLD + priv->tailroom)
p54_wake_free_queues(dev);
} }
EXPORT_SYMBOL_GPL(p54_free_skb); EXPORT_SYMBOL_GPL(p54_free_skb);
@ -893,8 +886,6 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb)
struct sk_buff *entry; struct sk_buff *entry;
u32 addr = le32_to_cpu(hdr->req_id) - priv->headroom; u32 addr = le32_to_cpu(hdr->req_id) - priv->headroom;
struct p54_tx_info *range = NULL; struct p54_tx_info *range = NULL;
u32 freed = 0;
u32 last_addr = priv->rx_start;
unsigned long flags; unsigned long flags;
int count, idx; int count, idx;
@ -908,7 +899,6 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb)
range = (void *)info->rate_driver_data; range = (void *)info->rate_driver_data;
if (range->start_addr != addr) { if (range->start_addr != addr) {
last_addr = range->end_addr;
entry = entry->next; entry = entry->next;
continue; continue;
} }
@ -919,11 +909,8 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb)
ni = IEEE80211_SKB_CB(entry->next); ni = IEEE80211_SKB_CB(entry->next);
mr = (struct p54_tx_info *)ni->rate_driver_data; mr = (struct p54_tx_info *)ni->rate_driver_data;
freed = mr->start_addr - last_addr; }
} else
freed = priv->rx_end - last_addr;
last_addr = range->end_addr;
__skb_unlink(entry, &priv->tx_queue); __skb_unlink(entry, &priv->tx_queue);
spin_unlock_irqrestore(&priv->tx_queue.lock, flags); spin_unlock_irqrestore(&priv->tx_queue.lock, flags);
@ -1010,9 +997,7 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb)
spin_unlock_irqrestore(&priv->tx_queue.lock, flags); spin_unlock_irqrestore(&priv->tx_queue.lock, flags);
out: out:
if (freed >= priv->headroom + sizeof(struct p54_hdr) + 48 + p54_wake_free_queues(dev);
IEEE80211_MAX_RTS_THRESHOLD + priv->tailroom)
p54_wake_free_queues(dev);
} }
static void p54_rx_eeprom_readback(struct ieee80211_hw *dev, static void p54_rx_eeprom_readback(struct ieee80211_hw *dev,