16 Star 3 Fork 50

src-openEuler/rdma-core

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0043-libhns-Fix-missing-fields-for-SRQ-WC.patch 2.82 KB
一键复制 编辑 原始数据 按行查看 历史
Xinghai Cen 提交于 2025-01-17 16:43 +08:00 . libhns: Fix missing fields for SRQ WC
From b52618371517527ce8ea4b8f5bd2571c7f69a2ba Mon Sep 17 00:00:00 2001
From: wenglianfa <wenglianfa@huawei.com>
Date: Wed, 15 Jan 2025 15:55:29 +0800
Subject: [PATCH] libhns: Fix missing fields for SRQ WC
mainline inclusion
from mainline-master
commit 65a7ce99cf4bfd6748346206f546e51c0a82c993
category: bugfix
bugzilla: https://gitee.com/src-openeuler/rdma-core/issues/IBIEA4
CVE: NA
Reference: https://github.com/linux-rdma/rdma-core/pull/1543/commits/65a7ce99cf4bfd6748346206f546e51c0a82c993
----------------------------------------------------------------------
The sl and src_qpn fields in recv-WC are not filled when the QP is UD
and has an SRQ. Here fix it.
In addition, UD QP does not support RQ INLINE and CQE INLINE features.
Reorder the related if-else statements to reduce the number of
conditional checks in IO path.
Fixes: 061f7e1757ca ("libhns: Refactor the poll one interface")
Signed-off-by: wenglianfa <wenglianfa@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Signed-off-by: Xinghai Cen <cenxinghai@h-partners.com>
---
providers/hns/hns_roce_u_hw_v2.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c
index 0628646..aadea7a 100644
--- a/providers/hns/hns_roce_u_hw_v2.c
+++ b/providers/hns/hns_roce_u_hw_v2.c
@@ -519,7 +519,8 @@ static void parse_for_ud_qp(struct hns_roce_v2_cqe *cqe, struct ibv_wc *wc)
}
static void parse_cqe_for_srq(struct hns_roce_v2_cqe *cqe, struct ibv_wc *wc,
- struct hns_roce_srq *srq)
+ struct hns_roce_srq *srq,
+ struct hns_roce_qp *hr_qp)
{
uint32_t wqe_idx;
@@ -529,6 +530,8 @@ static void parse_cqe_for_srq(struct hns_roce_v2_cqe *cqe, struct ibv_wc *wc,
if (hr_reg_read(cqe, CQE_CQE_INLINE))
handle_recv_cqe_inl_from_srq(cqe, srq);
+ else if (hr_qp->verbs_qp.qp.qp_type == IBV_QPT_UD)
+ parse_for_ud_qp(cqe, wc);
}
static void parse_cqe_for_resp(struct hns_roce_v2_cqe *cqe, struct ibv_wc *wc,
@@ -540,13 +543,13 @@ static void parse_cqe_for_resp(struct hns_roce_v2_cqe *cqe, struct ibv_wc *wc,
wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)];
++wq->tail;
- if (hr_qp->verbs_qp.qp.qp_type == IBV_QPT_UD)
- parse_for_ud_qp(cqe, wc);
-
if (hr_reg_read(cqe, CQE_CQE_INLINE))
handle_recv_cqe_inl_from_rq(cqe, hr_qp);
else if (hr_reg_read(cqe, CQE_RQ_INLINE))
handle_recv_rq_inl(cqe, hr_qp);
+ else if (hr_qp->verbs_qp.qp.qp_type == IBV_QPT_UD)
+ parse_for_ud_qp(cqe, wc);
+
}
static void parse_cqe_for_req(struct hns_roce_v2_cqe *cqe, struct ibv_wc *wc,
@@ -753,7 +756,7 @@ static int parse_cqe_for_cq(struct hns_roce_context *ctx, struct hns_roce_cq *cq
return V2_CQ_POLL_ERR;
if (srq)
- parse_cqe_for_srq(cqe, wc, srq);
+ parse_cqe_for_srq(cqe, wc, srq, cur_qp);
else
parse_cqe_for_resp(cqe, wc, cur_qp);
}
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/rdma-core.git
git@gitee.com:src-openeuler/rdma-core.git
src-openeuler
rdma-core
rdma-core
master

搜索帮助