Bugfix for hns SRQ and SGE. And also added all related cleanups and refactorings. Signed-off-by: zhengfeng luo <luozhengfeng@h-partners.com> Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
34 lines
1.3 KiB
Diff
34 lines
1.3 KiB
Diff
From a18b0ee409d3382aa556b8f06a6cd6bfbef3f5c8 Mon Sep 17 00:00:00 2001
|
|
From: Wenpeng Liang <liangwenpeng@huawei.com>
|
|
Date: Tue, 11 May 2021 19:06:38 +0800
|
|
Subject: libhns: Set srqlimit to 0 when creating SRQ
|
|
|
|
According to the IB specification, the srq_limt parameter should not be
|
|
configured when creating srq. But the libhns does not set attr.srq_limit
|
|
to 0 currently. As a result, when attr.srq_limit provided by the user is
|
|
not 0, the value of attr.srq_limit returned to the user will be different
|
|
from that obtained by ibv_query_srq(). Therefore, the driver should set
|
|
attr.srq_limit to 0 when creating SRQ.
|
|
|
|
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
|
|
Signed-off-by: Weihang Li <liweihang@huawei.com>
|
|
---
|
|
providers/hns/hns_roce_u_verbs.c | 1 +
|
|
1 file changed, 1 insertion(+)
|
|
|
|
diff --git a/providers/hns/hns_roce_u_verbs.c b/providers/hns/hns_roce_u_verbs.c
|
|
index 2d1a6de3..107da753 100644
|
|
--- a/providers/hns/hns_roce_u_verbs.c
|
|
+++ b/providers/hns/hns_roce_u_verbs.c
|
|
@@ -580,6 +580,7 @@ static struct ibv_srq *create_srq(struct ibv_context *context,
|
|
srq->wqe_cnt = roundup_pow_of_two(attr->max_wr + 1);
|
|
srq->max_gs = roundup_pow_of_two(attr->max_sge + srq->rsv_sge);
|
|
attr->max_sge = srq->max_gs;
|
|
+ attr->srq_limit = 0;
|
|
|
|
ret = hns_roce_create_idx_que(srq);
|
|
if (ret)
|
|
--
|
|
2.30.0
|
|
|