cxgbe(4): Fix an off by one error when looking for the BAR2 doorbell

address of an egress queue.

MFC after:	2 weeks
This commit is contained in:
Navdeep Parhar 2014-08-02 01:48:25 +00:00
parent b2daa9a9cd
commit f10405b396
2 changed files with 2 additions and 2 deletions

View File

@ -390,7 +390,7 @@ alloc_nm_txq_hwq(struct port_info *pi, struct sge_nm_txq *nm_txq)
udb = sc->udbs_base + UDBS_DB_OFFSET;
udb += (nm_txq->cntxt_id >> s_qpp) << PAGE_SHIFT;
nm_txq->udb_qid = nm_txq->cntxt_id & mask;
if (nm_txq->udb_qid > PAGE_SIZE / UDBS_SEG_SIZE)
if (nm_txq->udb_qid >= PAGE_SIZE / UDBS_SEG_SIZE)
clrbit(&nm_txq->doorbells, DOORBELL_WCWR);
else {
udb += nm_txq->udb_qid << UDBS_SEG_SHIFT;

View File

@ -2985,7 +2985,7 @@ alloc_eq(struct adapter *sc, struct port_info *pi, struct sge_eq *eq)
udb = sc->udbs_base + UDBS_DB_OFFSET;
udb += (eq->cntxt_id >> s_qpp) << PAGE_SHIFT; /* pg offset */
eq->udb_qid = eq->cntxt_id & mask; /* id in page */
if (eq->udb_qid > PAGE_SIZE / UDBS_SEG_SIZE)
if (eq->udb_qid >= PAGE_SIZE / UDBS_SEG_SIZE)
clrbit(&eq->doorbells, DOORBELL_WCWR);
else {
udb += eq->udb_qid << UDBS_SEG_SHIFT; /* seg offset */