During resize_cq, when copying over unpolled CQEs from the old CQE buffer to
the new buffer, the ownership bit must be set appropriately for the new buffer,
or the ownership bit in the new buffer gets corrupted.

Signed-off-by: Jack Morgenstein <[email protected]>

Index: libmlx4/src/cq.c
===================================================================
--- libmlx4.orig/src/cq.c       2008-11-20 11:46:58.000000000 +0200
+++ libmlx4/src/cq.c    2008-12-14 18:10:41.000000000 +0200
@@ -455,6 +455,8 @@ void mlx4_cq_resize_copy_cqes(struct mlx
        cqe = get_cqe(cq, (i & old_cqe));
 
        while ((cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) != 
MLX4_CQE_OPCODE_RESIZE) {
+               cqe->owner_sr_opcode = (cqe->owner_sr_opcode & 
~MLX4_CQE_OWNER_MASK) |
+                       (((i + 1) & (cq->ibv_cq.cqe + 1)) ? MLX4_CQE_OWNER_MASK 
: 0);
                memcpy(buf + ((i + 1) & cq->ibv_cq.cqe) * MLX4_CQ_ENTRY_SIZE,
                       cqe, MLX4_CQ_ENTRY_SIZE);
                ++i;
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to