From fc50769b446a5418767058cd2a5b5e7a9724a391 Mon Sep 17 00:00:00 2001
From: Luoyouming <luoyouming@huawei.com>
Date: Mon, 29 Jan 2024 16:12:55 +0800
Subject: [PATCH 2/4] libhns: Support returning the final value of SL
 configuration
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Returns the real SL used in HW to user, which can be used in variety of scenarios.
E.g. The STARS mode.

Signed-off-by: Luoyouming <luoyouming@huawei.com>
---
 providers/hns/hns_roce_u_hw_v2.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c
index 42b4f32..af25e6e 100644
--- a/providers/hns/hns_roce_u_hw_v2.c
+++ b/providers/hns/hns_roce_u_hw_v2.c
@@ -1967,6 +1967,9 @@ static int hns_roce_u_v2_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
 
 	record_qp_attr(qp, attr, attr_mask);
 
+	// Update the SL value and return it to the user.
+	attr->ah_attr.sl = hr_qp->sl;
+
 	return ret;
 }
 
-- 
2.33.0

