!113 [sync] PR-111: Fix missing DB when compiler does not support SVE
From: @openeuler-sync-bot Reviewed-by: @li-yangyang20 Signed-off-by: @li-yangyang20
This commit is contained in:
commit
254fe16d77
@ -0,0 +1,83 @@
|
||||
From cad30f3d98525d14796094b2905de222c894464f Mon Sep 17 00:00:00 2001
|
||||
From: Chengchang Tang <tangchengchang@huawei.com>
|
||||
Date: Fri, 8 Dec 2023 09:49:42 +0800
|
||||
Subject: [PATCH] libhns: Fix missing DB when compiler does not support SVE
|
||||
|
||||
driver inclusion
|
||||
category: bugfix
|
||||
bugzilla: https://gitee.com/openeuler/kernel/issues/I8MPTX
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Currently, if compiler does not support SVE, hns_roce_sve_write512() will
|
||||
be a empty function, which means that this doorbell will be missed when
|
||||
HNS_ROCE_QP_CAP_SVE_DIRECT_WQE is set in qp flag.
|
||||
|
||||
This patch ensures that driver will at least generate the DB regardless
|
||||
of whether SVE DWQE is supported or not.
|
||||
|
||||
Fixes: 7b1f5c5654c2 ("libhns: Add support for SVE Direct WQE function")
|
||||
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
|
||||
Signed-off-by: Ran Zhou <zhouran10@h-partners.com>
|
||||
---
|
||||
providers/hns/hns_roce_u_hw_v2.c | 33 +++++++++++++-------------------
|
||||
1 file changed, 13 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c
|
||||
index acbc854..be4c9f3 100644
|
||||
--- a/providers/hns/hns_roce_u_hw_v2.c
|
||||
+++ b/providers/hns/hns_roce_u_hw_v2.c
|
||||
@@ -318,26 +318,22 @@ static void hns_roce_update_sq_db(struct hns_roce_context *ctx,
|
||||
hns_roce_write64(ctx, qp->sq.db_reg, (__le32 *)&sq_db);
|
||||
}
|
||||
|
||||
-static void hns_roce_write512(uint64_t *dest, uint64_t *val)
|
||||
+static void hns_roce_qp_write512(struct hns_roce_qp *qp, uint64_t *val)
|
||||
{
|
||||
- mmio_memcpy_x64(dest, val, sizeof(struct hns_roce_rc_sq_wqe));
|
||||
-}
|
||||
+ uint64_t *dest = qp->sq.db_reg;
|
||||
|
||||
#if defined(HNS_SVE)
|
||||
-static void hns_roce_sve_write512(uint64_t *dest, uint64_t *val)
|
||||
-{
|
||||
- asm volatile(
|
||||
- "ldr z0, [%0]\n"
|
||||
- "str z0, [%1]\n"
|
||||
- ::"r" (val), "r"(dest):"cc", "memory"
|
||||
- );
|
||||
-}
|
||||
-#else
|
||||
-static void hns_roce_sve_write512(uint64_t *dest, uint64_t *val)
|
||||
-{
|
||||
- return;
|
||||
-}
|
||||
+ if (qp->flags & HNS_ROCE_QP_CAP_SVE_DIRECT_WQE) {
|
||||
+ asm volatile(
|
||||
+ "ldr z0, [%0]\n"
|
||||
+ "str z0, [%1]\n"
|
||||
+ ::"r" (val), "r"(dest):"cc", "memory"
|
||||
+ );
|
||||
+ return;
|
||||
+ }
|
||||
#endif
|
||||
+ mmio_memcpy_x64(dest, val, sizeof(struct hns_roce_rc_sq_wqe));
|
||||
+}
|
||||
|
||||
static void hns_roce_write_dwqe(struct hns_roce_qp *qp, void *wqe)
|
||||
{
|
||||
@@ -355,10 +351,7 @@ static void hns_roce_write_dwqe(struct hns_roce_qp *qp, void *wqe)
|
||||
hr_reg_write(rc_sq_wqe, RCWQE_DB_SL_H, qp->sl >> HNS_ROCE_SL_SHIFT);
|
||||
hr_reg_write(rc_sq_wqe, RCWQE_WQE_IDX, qp->sq.head);
|
||||
|
||||
- if (qp->flags & HNS_ROCE_QP_CAP_SVE_DIRECT_WQE)
|
||||
- hns_roce_sve_write512(qp->sq.db_reg, wqe);
|
||||
- else
|
||||
- hns_roce_write512(qp->sq.db_reg, wqe);
|
||||
+ hns_roce_qp_write512(qp, wqe);
|
||||
}
|
||||
|
||||
static void update_cq_db(struct hns_roce_context *ctx, struct hns_roce_cq *cq)
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Name: rdma-core
|
||||
Version: 41.0
|
||||
Release: 23
|
||||
Release: 24
|
||||
Summary: RDMA core userspace libraries and daemons
|
||||
License: GPLv2 or BSD
|
||||
Url: https://github.com/linux-rdma/rdma-core
|
||||
@ -86,6 +86,7 @@ patch77: 0077-libhns-Fix-parent-domain-unsupported-comp-mask.patch
|
||||
patch78: 0078-libhns-Add-pthread_spin_destroy-pthread_mutex_destro.patch
|
||||
patch79: 0079-libhns-Removes-a-repeated-initialization-of-a-spinlo.patch
|
||||
patch80: 0080-libhns-Fix-owner-bit-when-SQ-wraps-around-in-new-IO.patch
|
||||
patch81: 0081-libhns-Fix-missing-DB-when-compiler-does-not-support.patch
|
||||
|
||||
BuildRequires: binutils cmake >= 2.8.11 gcc libudev-devel pkgconfig pkgconfig(libnl-3.0)
|
||||
BuildRequires: pkgconfig(libnl-route-3.0) valgrind-devel systemd systemd-devel
|
||||
@ -333,6 +334,12 @@ fi
|
||||
%{_mandir}/*
|
||||
|
||||
%changelog
|
||||
* Fri Dec 8 2023 Ran Zhou <zhouran10@h-partners.com> - 41.0-24
|
||||
- Type: bugfix
|
||||
- ID: NA
|
||||
- SUG: NA
|
||||
- DESC: Fix missing DB when compiler does not support SVE
|
||||
|
||||
* Thu Dec 7 2023 Ran Zhou <zhouran10@h-partners.com> - 41.0-23
|
||||
- Type: bugfix
|
||||
- ID: NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user