diff options
author | Rasesh Mody <rmody@brocade.com> | 2010-12-23 16:45:05 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-25 22:16:01 -0500 |
commit | f7c0fa4cd5dcf58dd95b216d2c33444a3b4a44e0 (patch) | |
tree | 5836683f415a5806ffccfbb16bac2ede9980587d /drivers/net | |
parent | 886f7fedb0cee56acca7620d89186669273d3d56 (diff) |
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')
-rw-r--r-- | drivers/net/bna/bnad.c | 20 | ||||
-rw-r--r-- | drivers/net/bna/bnad.h | 7 | ||||
-rw-r--r-- | drivers/net/bna/bnad_ethtool.c | 4 |
3 files changed, 25 insertions, 6 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 | |||
109 | bnad_free_all_txbufs(struct bnad *bnad, | 109 | bnad_free_all_txbufs(struct bnad *bnad, |
110 | struct bna_tcb *tcb) | 110 | struct bna_tcb *tcb) |
111 | { | 111 | { |
112 | u16 unmap_cons; | 112 | u32 unmap_cons; |
113 | struct bnad_unmap_q *unmap_q = tcb->unmap_q; | 113 | struct bnad_unmap_q *unmap_q = tcb->unmap_q; |
114 | struct bnad_skb_unmap *unmap_array; | 114 | struct bnad_skb_unmap *unmap_array; |
115 | struct sk_buff *skb = NULL; | 115 | struct sk_buff *skb = NULL; |
@@ -244,7 +244,7 @@ bnad_tx_free_tasklet(unsigned long bnad_ptr) | |||
244 | { | 244 | { |
245 | struct bnad *bnad = (struct bnad *)bnad_ptr; | 245 | struct bnad *bnad = (struct bnad *)bnad_ptr; |
246 | struct bna_tcb *tcb; | 246 | struct bna_tcb *tcb; |
247 | u32 acked; | 247 | u32 acked = 0; |
248 | int i, j; | 248 | int i, j; |
249 | 249 | ||
250 | for (i = 0; i < bnad->num_tx; i++) { | 250 | for (i = 0; i < bnad->num_tx; i++) { |
@@ -263,6 +263,20 @@ bnad_tx_free_tasklet(unsigned long bnad_ptr) | |||
263 | smp_mb__before_clear_bit(); | 263 | smp_mb__before_clear_bit(); |
264 | clear_bit(BNAD_TXQ_FREE_SENT, &tcb->flags); | 264 | clear_bit(BNAD_TXQ_FREE_SENT, &tcb->flags); |
265 | } | 265 | } |
266 | if (unlikely(!test_bit(BNAD_TXQ_TX_STARTED, | ||
267 | &tcb->flags))) | ||
268 | continue; | ||
269 | if (netif_queue_stopped(bnad->netdev)) { | ||
270 | if (acked && netif_carrier_ok(bnad->netdev) && | ||
271 | BNA_QE_FREE_CNT(tcb, tcb->q_depth) >= | ||
272 | BNAD_NETIF_WAKE_THRESHOLD) { | ||
273 | netif_wake_queue(bnad->netdev); | ||
274 | /* TODO */ | ||
275 | /* Counters for individual TxQs? */ | ||
276 | BNAD_UPDATE_CTR(bnad, | ||
277 | netif_queue_wakeup); | ||
278 | } | ||
279 | } | ||
266 | } | 280 | } |
267 | } | 281 | } |
268 | } | 282 | } |
@@ -334,8 +348,6 @@ bnad_free_all_rxbufs(struct bnad *bnad, struct bna_rcb *rcb) | |||
334 | skb = unmap_q->unmap_array[unmap_cons].skb; | 348 | skb = unmap_q->unmap_array[unmap_cons].skb; |
335 | if (!skb) | 349 | if (!skb) |
336 | continue; | 350 | continue; |
337 | BUG_ON(!(pci_unmap_addr( | ||
338 | &unmap_q->unmap_array[unmap_cons], dma_addr))); | ||
339 | unmap_q->unmap_array[unmap_cons].skb = NULL; | 351 | unmap_q->unmap_array[unmap_cons].skb = NULL; |
340 | pci_unmap_single(bnad->pcidev, pci_unmap_addr(&unmap_q-> | 352 | pci_unmap_single(bnad->pcidev, pci_unmap_addr(&unmap_q-> |
341 | unmap_array[unmap_cons], | 353 | unmap_array[unmap_cons], |
diff --git a/drivers/net/bna/bnad.h b/drivers/net/bna/bnad.h index f59685a5543d..1954dea4cbf2 100644 --- a/drivers/net/bna/bnad.h +++ b/drivers/net/bna/bnad.h | |||
@@ -126,6 +126,7 @@ struct bnad_completion { | |||
126 | struct bnad_drv_stats { | 126 | struct bnad_drv_stats { |
127 | u64 netif_queue_stop; | 127 | u64 netif_queue_stop; |
128 | u64 netif_queue_wakeup; | 128 | u64 netif_queue_wakeup; |
129 | u64 netif_queue_stopped; | ||
129 | u64 tso4; | 130 | u64 tso4; |
130 | u64 tso6; | 131 | u64 tso6; |
131 | u64 tso_err; | 132 | u64 tso_err; |
@@ -308,8 +309,10 @@ extern void bnad_cleanup_rx(struct bnad *bnad, uint rx_id); | |||
308 | extern void bnad_dim_timer_start(struct bnad *bnad); | 309 | extern void bnad_dim_timer_start(struct bnad *bnad); |
309 | 310 | ||
310 | /* Statistics */ | 311 | /* Statistics */ |
311 | extern void bnad_netdev_qstats_fill(struct bnad *bnad, struct rtnl_link_stats64 *stats); | 312 | extern void bnad_netdev_qstats_fill(struct bnad *bnad, |
312 | extern void bnad_netdev_hwstats_fill(struct bnad *bnad, struct rtnl_link_stats64 *stats); | 313 | struct rtnl_link_stats64 *stats); |
314 | extern void bnad_netdev_hwstats_fill(struct bnad *bnad, | ||
315 | struct rtnl_link_stats64 *stats); | ||
313 | 316 | ||
314 | /** | 317 | /** |
315 | * MACROS | 318 | * MACROS |
diff --git a/drivers/net/bna/bnad_ethtool.c b/drivers/net/bna/bnad_ethtool.c index 3011110c2023..99be5ae91991 100644 --- a/drivers/net/bna/bnad_ethtool.c +++ b/drivers/net/bna/bnad_ethtool.c | |||
@@ -68,6 +68,7 @@ static char *bnad_net_stats_strings[BNAD_ETHTOOL_STATS_NUM] = { | |||
68 | 68 | ||
69 | "netif_queue_stop", | 69 | "netif_queue_stop", |
70 | "netif_queue_wakeup", | 70 | "netif_queue_wakeup", |
71 | "netif_queue_stopped", | ||
71 | "tso4", | 72 | "tso4", |
72 | "tso6", | 73 | "tso6", |
73 | "tso_err", | 74 | "tso_err", |
@@ -1180,6 +1181,9 @@ bnad_get_ethtool_stats(struct net_device *netdev, struct ethtool_stats *stats, | |||
1180 | 1181 | ||
1181 | bi = sizeof(*net_stats64) / sizeof(u64); | 1182 | bi = sizeof(*net_stats64) / sizeof(u64); |
1182 | 1183 | ||
1184 | /* Get netif_queue_stopped from stack */ | ||
1185 | bnad->stats.drv_stats.netif_queue_stopped = netif_queue_stopped(netdev); | ||
1186 | |||
1183 | /* Fill driver stats into ethtool buffers */ | 1187 | /* Fill driver stats into ethtool buffers */ |
1184 | stats64 = (u64 *)&bnad->stats.drv_stats; | 1188 | stats64 = (u64 *)&bnad->stats.drv_stats; |
1185 | for (i = 0; i < sizeof(struct bnad_drv_stats) / sizeof(u64); i++) | 1189 | for (i = 0; i < sizeof(struct bnad_drv_stats) / sizeof(u64); i++) |