cxgbe(4): The T5 allows for a different freelist starvation threshold

for queues with buffer packing.  Use the correct value to calculate a
freelist's low water mark.

MFC after:	1 week
This commit is contained in:
Navdeep Parhar 2014-02-06 03:21:43 +00:00
parent 3b8ad66ea9
commit 7293a15f54
2 changed files with 8 additions and 1 deletions

View File

@ -517,6 +517,7 @@ struct sge {
int timer_val[SGE_NTIMERS];
int counter_val[SGE_NCOUNTERS];
int fl_starve_threshold;
int fl_starve_threshold2;
int eq_s_qpp;
int iq_s_qpp;

View File

@ -569,6 +569,10 @@ t4_read_chip_settings(struct adapter *sc)
r = t4_read_reg(sc, A_SGE_CONM_CTRL);
s->fl_starve_threshold = G_EGRTHRESHOLD(r) * 2 + 1;
if (is_t4(sc))
s->fl_starve_threshold2 = s->fl_starve_threshold;
else
s->fl_starve_threshold2 = G_EGRTHRESHOLDPACKING(r) * 2 + 1;
/* egress queues: log2 of # of doorbells per BAR2 page */
r = t4_read_reg(sc, A_SGE_EGRESS_QUEUES_PER_PAGE_PF);
@ -2233,7 +2237,9 @@ alloc_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl,
return (rc);
}
fl->needed = fl->cap;
fl->lowat = roundup2(sc->sge.fl_starve_threshold, 8);
fl->lowat = fl->flags & FL_BUF_PACKING ?
roundup2(sc->sge.fl_starve_threshold2, 8) :
roundup2(sc->sge.fl_starve_threshold, 8);
c.iqns_to_fl0congen |=
htobe32(V_FW_IQ_CMD_FL0HOSTFCMODE(X_HOSTFCMODE_NONE) |