providers/erdma: Initialize CQ doorbell record
[ Upstream commit 1f9f73c28b006bcb4b37bfc594f12c173156c385 ]
Initialize the CQ doorbell record after CQ creation succeeds so the CQ
starts from the initial state expected by hardware.
Fixes: 235333a1d072 ("providers/erdma: Add userspace verbs implementation")
Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com>
Signed-off-by: Nicolas Morey <nmorey@suse.com>
diff --git a/providers/erdma/erdma_verbs.c b/providers/erdma/erdma_verbs.c
index 3557ef3..d4503d2 100644
--- a/providers/erdma/erdma_verbs.c
+++ b/providers/erdma/erdma_verbs.c
@@ -219,6 +219,10 @@
cq->db += cq->db_offset;
cq->comp_vector = comp_vector;
+ *(__le64 *)cq->db_record =
+ htole64(FIELD_PREP(ERDMA_CQDB_IDX_MASK, 0xFF) |
+ FIELD_PREP(ERDMA_CQDB_CQN_MASK, cq->id) |
+ FIELD_PREP(ERDMA_CQDB_CMDSN_MASK, 0x3));
return &cq->base_cq;