]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
RDMA/cxgb3: Wrap the software send queue pointer as needed on flush
authorSteve Wise <swise@opengridcomputing.com>
Tue, 13 May 2008 18:52:55 +0000 (11:52 -0700)
committerRoland Dreier <rolandd@cisco.com>
Tue, 13 May 2008 18:52:55 +0000 (11:52 -0700)
cxio_flush_sq() was failing to wrap around the software send queue
causing garbage completion entries on a flush operation.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/cxgb3/cxio_hal.c

index ebf9d3043f80544dc32420b4483ef67111494ae9..3f441fc57c1719c6991d028dd5a0979760aa2d30 100644 (file)
@@ -405,11 +405,11 @@ int cxio_flush_sq(struct t3_wq *wq, struct t3_cq *cq, int count)
        struct t3_swsq *sqp = wq->sq + Q_PTR2IDX(wq->sq_rptr, wq->sq_size_log2);
 
        ptr = wq->sq_rptr + count;
-       sqp += count;
+       sqp = wq->sq + Q_PTR2IDX(ptr, wq->sq_size_log2);
        while (ptr != wq->sq_wptr) {
                insert_sq_cqe(wq, cq, sqp);
-               sqp++;
                ptr++;
+               sqp = wq->sq + Q_PTR2IDX(ptr, wq->sq_size_log2);
                flushed++;
        }
        return flushed;