[ofa-general] [PATCH] libmlx4: Adjust ownership bit properly in resize_cq when copying over CQEs
Jack Morgenstein
jackm at dev.mellanox.co.il
Sun Dec 14 08:14:20 PST 2008
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 <jackm at dev.mellanox.co.il>
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;
More information about the general
mailing list