aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Morgenstein <jackm@dev.mellanox.co.il>2008-12-14 18:14:20 +0200
committerRoland Dreier <rolandd@cisco.com>2008-12-24 20:34:02 -0800
commit7cad1a1d412ea0e7566f27ce83e224c29c7dbdbe (patch)
tree7cf471e9550af60da9fc79bb32eb2d50748fbcd9
parentcbe93dcaf11f6c73d68a90067e83d145bb93f94b (diff)
downloadlibmlx4-7cad1a1d412ea0e7566f27ce83e224c29c7dbdbe.tar.gz
Set ownership bit correctly when copying over CQEs during CQ resize
When resizing a 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@dev.mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--src/cq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cq.c b/src/cq.c
index 68e16e9..8226b6b 100644
--- a/src/cq.c
+++ b/src/cq.c
@@ -455,6 +455,8 @@ void mlx4_cq_resize_copy_cqes(struct mlx4_cq *cq, void *buf, int old_cqe)
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;