Skip to content

Commit

Permalink
cxgb4/cxgb4vf: Use fl capacity to check if fl needs to be replenished
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hariprasad Shenai authored and David S. Miller committed Mar 2, 2016
1 parent d93e409 commit da08e42
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/chelsio/cxgb4/sge.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/chelsio/cxgb4vf/sge.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit da08e42

Please sign in to comment.