diff options
author | Rasesh Mody <rmody@brocade.com> | 2010-12-23 21:45:05 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-25 19:16:01 -0800 |
commit | f7c0fa4cd5dcf58dd95b216d2c33444a3b4a44e0 (patch) | |
tree | 5836683f415a5806ffccfbb16bac2ede9980587d /drivers/net/bna/bnad.c | |
parent | 886f7fedb0cee56acca7620d89186669273d3d56 (diff) | |
download | lwn-f7c0fa4cd5dcf58dd95b216d2c33444a3b4a44e0.tar.gz lwn-f7c0fa4cd5dcf58dd95b216d2c33444a3b4a44e0.zip |
bna: Fix for TX queue
Change Details:
- Call netif_wake_queue() if we have freed up sufficient elements
at the end of completion processing
- Add netif_queue_stopped counter back to bnad_drv_stats {}
- Get netif_queue_stopped value from stack
- Remove BUG_ON() on value returned by pci_unmap_addr()
Signed-off-by: Debashis Dutt <ddutt@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bna/bnad.c')
-rw-r--r-- | drivers/net/bna/bnad.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/net/bna/bnad.c b/drivers/net/bna/bnad.c index 5e7a0307f853..f77593638c57 100644 --- a/drivers/net/bna/bnad.c +++ b/drivers/net/bna/bnad.c @@ -109,7 +109,7 @@ static void bnad_free_all_txbufs(struct bnad *bnad, struct bna_tcb *tcb) { - u16 unmap_cons; + u32 unmap_cons; struct bnad_unmap_q *unmap_q = tcb->unmap_q; struct bnad_skb_unmap *unmap_array; struct sk_buff *skb = NULL; @@ -244,7 +244,7 @@ bnad_tx_free_tasklet(unsigned long bnad_ptr) { struct bnad *bnad = (struct bnad *)bnad_ptr; struct bna_tcb *tcb; - u32 acked; + u32 acked = 0; int i, j; for (i = 0; i < bnad->num_tx; i++) { @@ -263,6 +263,20 @@ bnad_tx_free_tasklet(unsigned long bnad_ptr) smp_mb__before_clear_bit(); clear_bit(BNAD_TXQ_FREE_SENT, &tcb->flags); } + if (unlikely(!test_bit(BNAD_TXQ_TX_STARTED, + &tcb->flags))) + continue; + if (netif_queue_stopped(bnad->netdev)) { + if (acked && netif_carrier_ok(bnad->netdev) && + BNA_QE_FREE_CNT(tcb, tcb->q_depth) >= + BNAD_NETIF_WAKE_THRESHOLD) { + netif_wake_queue(bnad->netdev); + /* TODO */ + /* Counters for individual TxQs? */ + BNAD_UPDATE_CTR(bnad, + netif_queue_wakeup); + } + } } } } @@ -334,8 +348,6 @@ bnad_free_all_rxbufs(struct bnad *bnad, struct bna_rcb *rcb) skb = unmap_q->unmap_array[unmap_cons].skb; if (!skb) continue; - BUG_ON(!(pci_unmap_addr( - &unmap_q->unmap_array[unmap_cons], dma_addr))); unmap_q->unmap_array[unmap_cons].skb = NULL; pci_unmap_single(bnad->pcidev, pci_unmap_addr(&unmap_q-> unmap_array[unmap_cons], |