cxgb4/cxgb4vf: Use fl capacity to check if fl needs to be replenished
authorHariprasad Shenai <hariprasad@chelsio.com>
Tue, 1 Mar 2016 11:49:32 +0000 (17:19 +0530)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Mar 2016 19:46:29 +0000 (14:46 -0500)
Use freelist capacity instead of freelist size while checking, if
freelist needs to be refilled

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/sge.c
drivers/net/ethernet/chelsio/cxgb4vf/sge.c

index b4eb4680a27cc368d90f8716bfde16b85231d03b..22d972030927503e7e333d793f4aa88519ce2532 100644 (file)
@@ -2226,7 +2226,7 @@ static int process_responses(struct sge_rspq *q, int budget)
                budget_left--;
        }
 
-       if (q->offset >= 0 && rxq->fl.size - rxq->fl.avail >= 16)
+       if (q->offset >= 0 && fl_cap(&rxq->fl) - rxq->fl.avail >= 16)
                __refill_fl(q->adap, &rxq->fl);
        return budget - budget_left;
 }
index 6528231d8a59d0e7d8a2551b6e8312442ffd9d36..9772aad22bca2dcdd1aa711441b4a6482304ad7f 100644 (file)
@@ -1864,7 +1864,7 @@ static int process_responses(struct sge_rspq *rspq, int budget)
         * for new buffer pointers, refill the Free List.
         */
        if (rspq->offset >= 0 &&
-           rxq->fl.size - rxq->fl.avail >= 2*FL_PER_EQ_UNIT)
+           fl_cap(&rxq->fl) - rxq->fl.avail >= 2*FL_PER_EQ_UNIT)
                __refill_fl(rspq->adapter, &rxq->fl);
        return budget - budget_left;
 }