1 Star 0 Fork 45

Lostway/rdma-core

forked from src-openEuler/rdma-core 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0051-libhns-Remove-unnecessary-QP-checks.patch 2.19 KB
一键复制 编辑 原始数据 按行查看 历史
From 14e8bd8f4e30abdaabbe7ffc3a19e4381b4130fe Mon Sep 17 00:00:00 2001
From: Chengchang Tang <tangchengchang@huawei.com>
Date: Wed, 24 May 2023 10:34:07 +0800
Subject: [PATCH 1/2] libhns: Remove unnecessary QP checks
mainline inclusion
from mainline-v47.0
commit 4ea9a4f77ac8c174d1ae4cf551a2e5abea13516f
category: cleanup
bugzilla: https://gitee.com/src-openeuler/rdma-core/issues/I7NT3M
CVE: NA
Reference: https://github.com/linux-rdma/rdma-core/commit/4ea9a4f77ac8c174d1ae4cf551a2e5abea13516f
----------------------------------------------------------------------
It is not necessary to check the type of the queue on post_send and
post_recv since the QP type that cannot be supported will be rejected
when it is created.
Check for srq in post_recv has also been removed, because the RQ of
QP bound to srq is empty and will return immediate error in post_recv.
Besides, remove the unused parameter ctx.
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Signed-off-by: Juan Zhou <zhoujuan51@h-partners.com>
---
providers/hns/hns_roce_u_hw_v2.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c
index ee2fffe..688eff8 100644
--- a/providers/hns/hns_roce_u_hw_v2.c
+++ b/providers/hns/hns_roce_u_hw_v2.c
@@ -908,11 +908,6 @@ static int check_qp_send(struct hns_roce_qp *qp, struct hns_roce_context *ctx)
struct ibv_qp *ibvqp = &qp->verbs_qp.qp;
int ret = 0;
- if (unlikely(ibvqp->qp_type != IBV_QPT_RC &&
- ibvqp->qp_type != IBV_QPT_UD) &&
- ibvqp->qp_type != IBV_QPT_XRC_SEND)
- return -EINVAL;
-
if (unlikely(ibvqp->state == IBV_QPS_RESET ||
ibvqp->state == IBV_QPS_INIT ||
ibvqp->state == IBV_QPS_RTR))
@@ -1516,11 +1511,7 @@ static int check_qp_recv(struct hns_roce_qp *qp, struct hns_roce_context *ctx)
struct ibv_qp *ibvqp = &qp->verbs_qp.qp;
int ret = 0;
- if (unlikely(ibvqp->qp_type != IBV_QPT_RC &&
- ibvqp->qp_type != IBV_QPT_UD))
- return -EINVAL;
-
- if (ibvqp->state == IBV_QPS_RESET || ibvqp->srq)
+ if (ibvqp->state == IBV_QPS_RESET)
return -EINVAL;
if (check_dca_attach_enable(qp)) {
--
2.25.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Lostwayzxc/rdma-core.git
git@gitee.com:Lostwayzxc/rdma-core.git
Lostwayzxc
rdma-core
rdma-core
master

搜索帮助