Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 13776
b: refs/heads/master
c: 64044bc
h: refs/heads/master
v: v3
  • Loading branch information
Roland Dreier committed Nov 10, 2005
1 parent 3b01f40 commit e4f05cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 62abb8416f1923f4cef50ce9ce841b919275e3fb
refs/heads/master: 64044bcf75063cb5a6d42712886a712449df2ce3
16 changes: 6 additions & 10 deletions trunk/drivers/infiniband/hw/mthca/mthca_cq.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ void mthca_cq_clean(struct mthca_dev *dev, u32 cqn, u32 qpn,
{
struct mthca_cq *cq;
struct mthca_cqe *cqe;
int prod_index;
u32 prod_index;
int nfreed = 0;

spin_lock_irq(&dev->cq_table.lock);
Expand Down Expand Up @@ -293,19 +293,15 @@ void mthca_cq_clean(struct mthca_dev *dev, u32 cqn, u32 qpn,
* Now sweep backwards through the CQ, removing CQ entries
* that match our QP by copying older entries on top of them.
*/
while (prod_index > cq->cons_index) {
cqe = get_cqe(cq, (prod_index - 1) & cq->ibcq.cqe);
while ((int) --prod_index - (int) cq->cons_index >= 0) {
cqe = get_cqe(cq, prod_index & cq->ibcq.cqe);
if (cqe->my_qpn == cpu_to_be32(qpn)) {
if (srq)
mthca_free_srq_wqe(srq, be32_to_cpu(cqe->wqe));
++nfreed;
}
else if (nfreed)
memcpy(get_cqe(cq, (prod_index - 1 + nfreed) &
cq->ibcq.cqe),
cqe,
MTHCA_CQ_ENTRY_SIZE);
--prod_index;
} else if (nfreed)
memcpy(get_cqe(cq, (prod_index + nfreed) & cq->ibcq.cqe),
cqe, MTHCA_CQ_ENTRY_SIZE);
}

if (nfreed) {
Expand Down

0 comments on commit e4f05cf

Please sign in to comment.