From 61911051eec0f984537c2762208b8ecbc875d5d3 Mon Sep 17 00:00:00 2001 From: Wenpeng Liang Date: Fri, 26 Nov 2021 16:53:18 +0800 Subject: libhns: Fix the size setting error when copying CQE in clean cq() The size of CQE is different for different versions of hardware, so the driver needs to specify the size of CQE explicitly. Fixes: 3546e6b69ac8 ("libhns: Add support for CQE in size of 64 Bytes") Signed-off-by: Wenpeng Liang --- providers/hns/hns_roce_u_hw_v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c index 1b4e91b..b13b6dc 100644 --- a/providers/hns/hns_roce_u_hw_v2.c +++ b/providers/hns/hns_roce_u_hw_v2.c @@ -1426,7 +1426,7 @@ static void __hns_roce_v2_cq_clean(struct hns_roce_cq *cq, uint32_t qpn, (prod_index + nfreed) & cq->ibv_cq.cqe); owner_bit = roce_get_bit(dest->byte_4, CQE_BYTE_4_OWNER_S); - memcpy(dest, cqe, sizeof(*cqe)); + memcpy(dest, cqe, cq->cqe_size); roce_set_bit(dest->byte_4, CQE_BYTE_4_OWNER_S, owner_bit); } -- 2.27.0