]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
cxgb3 - Recovery from HW starvation of response queue entries.
authorDivy Le Ray <divy@chelsio.com>
Sun, 25 Feb 2007 00:44:12 +0000 (16:44 -0800)
committerJeff Garzik <jeff@garzik.org>
Tue, 27 Feb 2007 09:27:12 +0000 (04:27 -0500)
Improve the traffic recovery after the HW ran out of response queue entries.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/cxgb3/adapter.h
drivers/net/cxgb3/sge.c

index 5c97a64451ce3fa187fb0f4edcf5b8a8d851be00..01b99b901434723207a91e2ed3163c9ce31209b5 100644 (file)
@@ -121,6 +121,8 @@ struct sge_rspq {           /* state for an SGE response queue */
        unsigned long empty;    /* # of times queue ran out of credits */
        unsigned long nomem;    /* # of responses deferred due to no mem */
        unsigned long unhandled_irqs;   /* # of spurious intrs */
+       unsigned long starved;
+       unsigned long restarted;
 };
 
 struct tx_desc;
index 822a598c0db10eadf00e9924ce7daf367031bc8f..4ff0ab60c6c7746cde0ba9dbe031967270efb336 100644 (file)
@@ -2376,13 +2376,26 @@ static void sge_timer_cb(unsigned long data)
                spin_unlock(&qs->txq[TXQ_OFLD].lock);
        }
        lock = (adap->flags & USING_MSIX) ? &qs->rspq.lock :
-           &adap->sge.qs[0].rspq.lock;
+                                           &adap->sge.qs[0].rspq.lock;
        if (spin_trylock_irq(lock)) {
                if (!napi_is_scheduled(qs->netdev)) {
+                       u32 status = t3_read_reg(adap, A_SG_RSPQ_FL_STATUS);
+
                        if (qs->fl[0].credits < qs->fl[0].size)
                                __refill_fl(adap, &qs->fl[0]);
                        if (qs->fl[1].credits < qs->fl[1].size)
                                __refill_fl(adap, &qs->fl[1]);
+
+                       if (status & (1 << qs->rspq.cntxt_id)) {
+                               qs->rspq.starved++;
+                               if (qs->rspq.credits) {
+                                       refill_rspq(adap, &qs->rspq, 1);
+                                       qs->rspq.credits--;
+                                       qs->rspq.restarted++;
+                                       t3_write_reg(adap, A_SG_RSPQ_FL_STATUS, 
+                                                    1 << qs->rspq.cntxt_id);
+                               }
+                       }
                }
                spin_unlock_irq(lock);
        }