summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornp <np@FreeBSD.org>2013-08-02 17:44:19 +0000
committernp <np@FreeBSD.org>2013-08-02 17:44:19 +0000
commitaa66c86ef963107a374b9c27214de729234a03d8 (patch)
tree190c0455db300a15083fbac042be39f33c6818bc
parent2d3c928904a804c62206b6bec50d0030becd77f3 (diff)
downloadFreeBSD-src-aa66c86ef963107a374b9c27214de729234a03d8.zip
FreeBSD-src-aa66c86ef963107a374b9c27214de729234a03d8.tar.gz
Fix previous commit (r253873). "cong" has one bit per channel but the
congestion channel map has 1 nibble per channel. So bits wxyz need to be blown up into 000w000x000y000z.
-rw-r--r--sys/dev/cxgbe/t4_sge.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c
index ebc6497..5064d70 100644
--- a/sys/dev/cxgbe/t4_sge.c
+++ b/sys/dev/cxgbe/t4_sge.c
@@ -1878,7 +1878,16 @@ alloc_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl,
param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) |
V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_CONM_CTXT) |
V_FW_PARAMS_PARAM_YZ(iq->cntxt_id);
- val = cong ? cong | 2 << 19 : 1 << 19;
+ if (cong == 0)
+ val = 1 << 19;
+ else {
+ val = 2 << 19;
+ for (i = 0; i < 4; i++) {
+ if (cong & (1 << i))
+ val |= 1 << (i << 2);
+ }
+ }
+
rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, &param, &val);
if (rc != 0) {
/* report error but carry on */
OpenPOWER on IntegriCloud