2011/6/12 Michael BÃsch <m@xxxxxxx>: > On Sun, 12 Jun 2011 17:11:53 +0200 > RafaÅ MiÅecki <zajec5@xxxxxxxxx> wrote: > >> --- >> This prevents us from hitting "Packet after queue stopped", but still >> is not an optimal solution. We stop sending packets from queue to >> hardware if just a one ring is full. It may happen there are packets on >> the queue that want to be send to different ring (qos). >> --- >> Âdrivers/net/wireless/b43/b43.h Â| Â Â2 ++ >> Âdrivers/net/wireless/b43/dma.c Â| Â Â5 +++++ >> Âdrivers/net/wireless/b43/main.c | Â Â5 +++++ >> Â3 files changed, 12 insertions(+), 0 deletions(-) >> >> diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h >> index 1cb2dde..8d4bb28 100644 >> --- a/drivers/net/wireless/b43/b43.h >> +++ b/drivers/net/wireless/b43/b43.h >> @@ -582,6 +582,8 @@ struct b43_dma { >> Â Â Â struct b43_dmaring *rx_ring; >> >> Â Â Â u32 translation; /* Routing bits */ >> + >> + Â Â u8 stopped_rings; /* Amount of stopped rings */ >> Â}; >> >> Âstruct b43_pio_txqueue; >> diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c >> index d02cf83..a501992 100644 >> --- a/drivers/net/wireless/b43/dma.c >> +++ b/drivers/net/wireless/b43/dma.c >> @@ -1056,6 +1056,7 @@ int b43_dma_init(struct b43_wldev *dev) >> Â Â Â if (err) >> Â Â Â Â Â Â Â return err; >> Â Â Â dma->translation = ssb_dma_translation(dev->sdev); >> + Â Â dma->stopped_rings = 0; >> >> Â Â Â err = -ENOMEM; >> Â Â Â /* setup TX DMA channels. */ >> @@ -1374,6 +1375,8 @@ int b43_dma_tx(struct b43_wldev *dev, struct sk_buff *skb) >> Â Â Â Â Â Â Â /* This TX ring is full. */ >> Â Â Â Â Â Â Â ieee80211_stop_queue(dev->wl->hw, skb_get_queue_mapping(skb)); >> Â Â Â Â Â Â Â ring->stopped = 1; >> + Â Â Â Â Â Â dev->dma.stopped_rings++; >> + >> Â Â Â Â Â Â Â if (b43_debug(dev, B43_DBG_DMAVERBOSE)) { >> Â Â Â Â Â Â Â Â Â Â Â b43dbg(dev->wl, "Stopped TX ring %d\n", ring->index); >> Â Â Â Â Â Â Â } >> @@ -1493,9 +1496,11 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev, >> Â Â Â Â Â Â Â B43_WARN_ON(free_slots(ring) < TX_SLOTS_PER_FRAME); >> Â Â Â Â Â Â Â ieee80211_wake_queue(dev->wl->hw, ring->queue_prio); >> Â Â Â Â Â Â Â ring->stopped = 0; >> + Â Â Â Â Â Â dev->dma.stopped_rings--; >> Â Â Â Â Â Â Â if (b43_debug(dev, B43_DBG_DMAVERBOSE)) { >> Â Â Â Â Â Â Â Â Â Â Â b43dbg(dev->wl, "Woke up TX ring %d\n", ring->index); >> Â Â Â Â Â Â Â } >> + Â Â Â Â Â Â ieee80211_queue_work(dev->wl->hw, &dev->wl->tx_work); >> Â Â Â } >> Â} >> >> diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c >> index 1d8d983..2260b36 100644 >> --- a/drivers/net/wireless/b43/main.c >> +++ b/drivers/net/wireless/b43/main.c >> @@ -3219,6 +3219,11 @@ static void b43_tx_work(struct work_struct *work) >> Â Â Â } >> >> Â Â Â while (skb_queue_len(&wl->tx_queue)) { >> + Â Â Â Â Â Â if (!b43_using_pio_transfers(dev) && dev->dma.stopped_rings) { >> + Â Â Â Â Â Â Â Â Â Â mutex_unlock(&wl->mutex); >> + Â Â Â Â Â Â Â Â Â Â return; >> + Â Â Â Â Â Â } >> + >> Â Â Â Â Â Â Â skb = skb_dequeue(&wl->tx_queue); >> >> Â Â Â Â Â Â Â if (b43_using_pio_transfers(dev)) > > This can probably serve as a quick workaround, as long as a real fix is being developed. Yeah, that's what my summary/comment say :) > I'm not sure if multiple queues are needed for this to work. I think it could work > with a single queue as well. We just must not _unqueue_ it, if we are unable to transmit > it due to stopped ring. I don't know if there are skb_queue mechanisms that help > us achieve this. Well, as I said, we may be unable to transmit the first element of the queue, but 2nd/3rd/... may be for different ring (qos) (we can transmit). Looping through the whole queue every time, just to find packets we may transmit, sounds surely as a bad idea. The only idea I've right now, are separated TX skb queues, one for each qos. -- RafaÅ -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html