17 Star 12 Fork 75

src-openEuler/dpdk

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0048-net-hns3-verify-reset-type-from-firmware.patch 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
huangdengdui 提交于 2024-11-11 18:33 . sync some patchs from upstreaming
From e089c8f6266a0c65600be8b32c14ffc014c2b506 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Sat, 12 Oct 2024 17:14:57 +0800
Subject: [PATCH] net/hns3: verify reset type from firmware
[ upstream commit 3db846003734d38d59950ebe024ad6d61afe08f0 ]
Verify reset-type which get from firmware.
Fixes: 1c1eb759e9d7 ("net/hns3: support RAS process in Kunpeng 930")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Jie Hai <haijie1@huawei.com>
---
drivers/net/hns3/hns3_intr.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/hns3/hns3_intr.c b/drivers/net/hns3/hns3_intr.c
index 916bf30..d37c7eb 100644
--- a/drivers/net/hns3/hns3_intr.c
+++ b/drivers/net/hns3/hns3_intr.c
@@ -2252,6 +2252,12 @@ hns3_handle_module_error_data(struct hns3_hw *hw, uint32_t *buf,
sum_err_info = (struct hns3_sum_err_info *)&buf[offset++];
mod_num = sum_err_info->mod_num;
reset_type = sum_err_info->reset_type;
+
+ if (reset_type >= HNS3_MAX_RESET) {
+ hns3_err(hw, "invalid reset type = %u", reset_type);
+ return;
+ }
+
if (reset_type && reset_type != HNS3_NONE_RESET)
hns3_atomic_set_bit(reset_type, &hw->reset.request);
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/dpdk.git
git@gitee.com:src-openeuler/dpdk.git
src-openeuler
dpdk
dpdk
master

搜索帮助