代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/rdma-core 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 8b922418b18fefe2a60e122374b3bc8096672661 Mon Sep 17 00:00:00 2001
From: Chengchang Tang <tangchengchang@huawei.com>
Date: Tue, 26 Sep 2023 19:19:10 +0800
Subject: [PATCH 17/18] libhns: Fix missing reset notification.
driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I98HQV
--------------------------------------------------------------------------
Currently, userspace driver get the reset notification by reading a
a shared variable which would be set to non-zero during reset. However,
if the user does not call driver's IO interface during reset, the reset
notification will be ignored. because this variable will be clear after
completes the reset.
This patch use a new reset flag to get whether the driver has been reset
at any time. A non-zero value will be assigned to this new reset
flag by default, which will permanently become 0 once a reset occurs.
During reset, the kernel space driver will assign 0 to this variable.
After reset, this variable will be remapped to a page of all zeros. The
userspace driver can judge whether the driver has been reset by whether
this variable is 0.
Fixes: 34f2ad8085c2 ("libhns: Add reset stop flow mechanism")
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
---
providers/hns/hns_roce_u.c | 4 ++++
providers/hns/hns_roce_u.h | 2 ++
providers/hns/hns_roce_u_hw_v2.c | 3 +++
3 files changed, 9 insertions(+)
diff --git a/providers/hns/hns_roce_u.c b/providers/hns/hns_roce_u.c
index 0e4f4c1..810b650 100644
--- a/providers/hns/hns_roce_u.c
+++ b/providers/hns/hns_roce_u.c
@@ -105,6 +105,7 @@ static int init_reset_context(struct hns_roce_context *ctx, int cmd_fd,
int page_size)
{
uint64_t reset_mmap_key = resp->reset_mmap_key;
+ struct hns_roce_v2_reset_state *state;
/* The reset mmap key is 0, which means it is not supported. */
if (reset_mmap_key == 0)
@@ -115,6 +116,9 @@ static int init_reset_context(struct hns_roce_context *ctx, int cmd_fd,
if (ctx->reset_state == MAP_FAILED)
return -ENOMEM;
+ state = ctx->reset_state;
+ ctx->use_new_reset_flag = state->hw_ready;
+
return 0;
}
diff --git a/providers/hns/hns_roce_u.h b/providers/hns/hns_roce_u.h
index 5adf6bd..024932a 100644
--- a/providers/hns/hns_roce_u.h
+++ b/providers/hns/hns_roce_u.h
@@ -203,6 +203,7 @@ struct hns_roce_spinlock {
struct hns_roce_v2_reset_state {
uint32_t is_reset;
+ uint32_t hw_ready;
};
struct hns_roce_context {
@@ -239,6 +240,7 @@ struct hns_roce_context {
uint32_t config;
unsigned int max_inline_data;
+ bool use_new_reset_flag;
bool reseted;
};
diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c
index fe22b43..a0dce1c 100644
--- a/providers/hns/hns_roce_u_hw_v2.c
+++ b/providers/hns/hns_roce_u_hw_v2.c
@@ -891,6 +891,9 @@ static bool hns_roce_reseted(struct hns_roce_context *ctx)
{
struct hns_roce_v2_reset_state *state = ctx->reset_state;
+ if (ctx->use_new_reset_flag)
+ return !state->hw_ready;
+
if (state && state->is_reset)
ctx->reseted = true;
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。