diff options
Diffstat (limited to 'drivers/net/cxgb4/sge.c')
-rw-r--r-- | drivers/net/cxgb4/sge.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/cxgb4/sge.c b/drivers/net/cxgb4/sge.c index bf38cfc5756..44c2e6c9f07 100644 --- a/drivers/net/cxgb4/sge.c +++ b/drivers/net/cxgb4/sge.c | |||
@@ -557,7 +557,8 @@ out: cred = q->avail - cred; | |||
557 | 557 | ||
558 | if (unlikely(fl_starving(q))) { | 558 | if (unlikely(fl_starving(q))) { |
559 | smp_wmb(); | 559 | smp_wmb(); |
560 | set_bit(q->cntxt_id, adap->sge.starving_fl); | 560 | set_bit(q->cntxt_id - adap->sge.egr_start, |
561 | adap->sge.starving_fl); | ||
561 | } | 562 | } |
562 | 563 | ||
563 | return cred; | 564 | return cred; |
@@ -1213,7 +1214,8 @@ static void txq_stop_maperr(struct sge_ofld_txq *q) | |||
1213 | { | 1214 | { |
1214 | q->mapping_err++; | 1215 | q->mapping_err++; |
1215 | q->q.stops++; | 1216 | q->q.stops++; |
1216 | set_bit(q->q.cntxt_id, q->adap->sge.txq_maperr); | 1217 | set_bit(q->q.cntxt_id - q->adap->sge.egr_start, |
1218 | q->adap->sge.txq_maperr); | ||
1217 | } | 1219 | } |
1218 | 1220 | ||
1219 | /** | 1221 | /** |
@@ -1835,6 +1837,7 @@ static unsigned int process_intrq(struct adapter *adap) | |||
1835 | if (RSPD_TYPE(rc->type_gen) == RSP_TYPE_INTR) { | 1837 | if (RSPD_TYPE(rc->type_gen) == RSP_TYPE_INTR) { |
1836 | unsigned int qid = ntohl(rc->pldbuflen_qid); | 1838 | unsigned int qid = ntohl(rc->pldbuflen_qid); |
1837 | 1839 | ||
1840 | qid -= adap->sge.ingr_start; | ||
1838 | napi_schedule(&adap->sge.ingr_map[qid]->napi); | 1841 | napi_schedule(&adap->sge.ingr_map[qid]->napi); |
1839 | } | 1842 | } |
1840 | 1843 | ||
@@ -2050,14 +2053,14 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq, | |||
2050 | /* set offset to -1 to distinguish ingress queues without FL */ | 2053 | /* set offset to -1 to distinguish ingress queues without FL */ |
2051 | iq->offset = fl ? 0 : -1; | 2054 | iq->offset = fl ? 0 : -1; |
2052 | 2055 | ||
2053 | adap->sge.ingr_map[iq->cntxt_id] = iq; | 2056 | adap->sge.ingr_map[iq->cntxt_id - adap->sge.ingr_start] = iq; |
2054 | 2057 | ||
2055 | if (fl) { | 2058 | if (fl) { |
2056 | fl->cntxt_id = ntohs(c.fl0id); | 2059 | fl->cntxt_id = ntohs(c.fl0id); |
2057 | fl->avail = fl->pend_cred = 0; | 2060 | fl->avail = fl->pend_cred = 0; |
2058 | fl->pidx = fl->cidx = 0; | 2061 | fl->pidx = fl->cidx = 0; |
2059 | fl->alloc_failed = fl->large_alloc_failed = fl->starving = 0; | 2062 | fl->alloc_failed = fl->large_alloc_failed = fl->starving = 0; |
2060 | adap->sge.egr_map[fl->cntxt_id] = fl; | 2063 | adap->sge.egr_map[fl->cntxt_id - adap->sge.egr_start] = fl; |
2061 | refill_fl(adap, fl, fl_cap(fl), GFP_KERNEL); | 2064 | refill_fl(adap, fl, fl_cap(fl), GFP_KERNEL); |
2062 | } | 2065 | } |
2063 | return 0; | 2066 | return 0; |
@@ -2087,7 +2090,7 @@ static void init_txq(struct adapter *adap, struct sge_txq *q, unsigned int id) | |||
2087 | q->stops = q->restarts = 0; | 2090 | q->stops = q->restarts = 0; |
2088 | q->stat = (void *)&q->desc[q->size]; | 2091 | q->stat = (void *)&q->desc[q->size]; |
2089 | q->cntxt_id = id; | 2092 | q->cntxt_id = id; |
2090 | adap->sge.egr_map[id] = q; | 2093 | adap->sge.egr_map[id - adap->sge.egr_start] = q; |
2091 | } | 2094 | } |
2092 | 2095 | ||
2093 | int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq, | 2096 | int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq, |
@@ -2259,7 +2262,7 @@ static void free_rspq_fl(struct adapter *adap, struct sge_rspq *rq, | |||
2259 | { | 2262 | { |
2260 | unsigned int fl_id = fl ? fl->cntxt_id : 0xffff; | 2263 | unsigned int fl_id = fl ? fl->cntxt_id : 0xffff; |
2261 | 2264 | ||
2262 | adap->sge.ingr_map[rq->cntxt_id] = NULL; | 2265 | adap->sge.ingr_map[rq->cntxt_id - adap->sge.ingr_start] = NULL; |
2263 | t4_iq_free(adap, adap->fn, adap->fn, 0, FW_IQ_TYPE_FL_INT_CAP, | 2266 | t4_iq_free(adap, adap->fn, adap->fn, 0, FW_IQ_TYPE_FL_INT_CAP, |
2264 | rq->cntxt_id, fl_id, 0xffff); | 2267 | rq->cntxt_id, fl_id, 0xffff); |
2265 | dma_free_coherent(adap->pdev_dev, (rq->size + 1) * rq->iqe_len, | 2268 | dma_free_coherent(adap->pdev_dev, (rq->size + 1) * rq->iqe_len, |