Blob Blame History Raw
From e99103602f477c84f31b79779f7544d6e1704593 Mon Sep 17 00:00:00 2001
From: Michael Guralnik <michaelgur@nvidia.com>
Date: Mon, 19 Oct 2020 09:00:56 +0300
Subject: [PATCH] mlx5: Fix wqe size parameter in wqe signature calculation

[ Upstream commit 8cde184624d192f7cd61247eec92a3a9b4ba7c7f ]

WQE signature calculation requires passing the size of the WQE as a
parameter.

Current code passes the qpn_ds field as the WQE size which is wrong.
Fixing to extract from the qpn_ds the WQE size in bytes and use it for
the signature calculations.

Fixes: 8c4791ae2395 ("libmlx5: First version of libmlx5")
Signed-off-by: Michael Guralnik <michaelgur@nvidia.com>
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
---
 providers/mlx5/qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/providers/mlx5/qp.c b/providers/mlx5/qp.c
index 077346d63137..13d7bcccc39d 100644
--- a/providers/mlx5/qp.c
+++ b/providers/mlx5/qp.c
@@ -368,7 +368,7 @@ static int set_data_inl_seg(struct mlx5_qp *qp, struct ibv_send_wr *wr,
 
 static uint8_t wq_sig(struct mlx5_wqe_ctrl_seg *ctrl)
 {
-	return calc_sig(ctrl, be32toh(ctrl->qpn_ds));
+	return calc_sig(ctrl, (be32toh(ctrl->qpn_ds) & 0x3f) << 4);
 }
 
 #ifdef MLX5_DEBUG
-- 
2.25.4