!29 代码同步:修复PICe和serdes、roh模块问题

From: @veega2022 
Reviewed-by: @chenjunxin1992, @kongzizaixian 
Signed-off-by: @chenjunxin1992
This commit is contained in:
openeuler-ci-bot 2023-06-01 02:59:26 +00:00 committed by Gitee
commit 9395fb04d6
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
12 changed files with 642 additions and 1 deletions

View File

@ -0,0 +1,44 @@
From 436ab65e026ae1260b7e7cab905a23096bf7e1e5 Mon Sep 17 00:00:00 2001
From: veega2022 <zhuweijia@huawei.com>
Date: Wed, 10 May 2023 17:39:59 +0800
Subject: [PATCH 01/18] fix hikptool rciep rsp filed error problem
union hikp_space_rsp 0xF8h is reserved and 0xFCh is cpl_status
Signed-off-by: hesiyuan <hesiyuan4@huawei.com>
---
libhikptdev/src/rciep/hikpt_rciep.c | 2 +-
libhikptdev/src/rciep/hikpt_rciep.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libhikptdev/src/rciep/hikpt_rciep.c b/libhikptdev/src/rciep/hikpt_rciep.c
index 9b7a82a..5c7e82f 100644
--- a/libhikptdev/src/rciep/hikpt_rciep.c
+++ b/libhikptdev/src/rciep/hikpt_rciep.c
@@ -97,7 +97,7 @@ static uint32_t hikp_wait_for_cpl_status(void)
uint32_t status;
do {
- status = g_hikp_req->field.cpl_status;
+ status = g_hikp_rsp->field.cpl_status;
if (status != HIKP_INIT_STAT)
return status;
count--;
diff --git a/libhikptdev/src/rciep/hikpt_rciep.h b/libhikptdev/src/rciep/hikpt_rciep.h
index 093724a..8fbb3c0 100644
--- a/libhikptdev/src/rciep/hikpt_rciep.h
+++ b/libhikptdev/src/rciep/hikpt_rciep.h
@@ -75,8 +75,8 @@ union hikp_space_rsp {
uint32_t version; /* 000h */
uint32_t rsp_para_num; /* 004h */
uint32_t data[HIKP_RSP_DATA_MAX]; /* 008h */
- uint32_t cpl_status; /* 0F8h */
- uint32_t pid_record; /* 0FCh */
+ uint32_t rsv; /* 0F8h */
+ uint32_t cpl_status; /* 0FCh */
struct iep_doorbell sw_db; /* 100h. Fixed and unmodifiable */
} field;
--
2.25.1

View File

@ -0,0 +1,37 @@
From befc663ba761c1b334b50de138e57e2a00be4f32 Mon Sep 17 00:00:00 2001
From: veega2022 <zhuweijia@huawei.com>
Date: Wed, 10 May 2023 17:54:59 +0800
Subject: [PATCH 02/18] fix pcie_info cmd print display problem
The spelling of WITDH is incorrect. Change it to WIDTH.
Signed-off-by: hesiyuan <hesiyuan4@huawei.com>
---
pcie/func_lib/pcie_func/pcie_statistics.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pcie/func_lib/pcie_func/pcie_statistics.c b/pcie/func_lib/pcie_func/pcie_statistics.c
index f12660d..308a142 100644
--- a/pcie/func_lib/pcie_func/pcie_statistics.c
+++ b/pcie/func_lib/pcie_func/pcie_statistics.c
@@ -22,7 +22,7 @@
#include "pcie_statistics.h"
static const char *g_global_width_name[GLOBAL_WIDTH_TABLE_SIZE] = {
- "PCIE_WITDH_X1", "PCIE_WITDH_X2", "PCIE_WITDH_X4", "PCIE_WITDH_X8", "PCIE_WITDH_X16"
+ "PCIE_WIDTH_X1", "PCIE_WIDTH_X2", "PCIE_WIDTH_X4", "PCIE_WIDTH_X8", "PCIE_WIDTH_X16"
};
static int port_distribution_rsp_data_check(const struct hikp_cmd_ret *cmd_ret, uint32_t *port_num)
@@ -81,7 +81,7 @@ int pcie_port_distribution_get(uint32_t chip_id)
for (i = 0; i < pair_num; i++) {
if (port_info->info_pair[i].port_width >= HIKP_ARRAY_SIZE(g_global_width_name)) {
Info("PCIe Base", "port_id[%u] %s\n", port_info->info_pair[i].port_id,
- "UNKNOWN_WITDH");
+ "UNKNOWN_WIDTH");
continue;
}
Info("PCIe Base", "port_id[%u] %s\n", port_info->info_pair[i].port_id,
--
2.25.1

View File

@ -0,0 +1,123 @@
From e649f6245f73b99e5c2501f789a3b363c2a25554 Mon Sep 17 00:00:00 2001
From: veega2022 <zhuweijia@huawei.com>
Date: Wed, 10 May 2023 18:05:01 +0800
Subject: [PATCH 03/18] fix signal proc func api modified to be open to the
public
move sig_init api to op_logs public header file
Signed-off-by: wangkang <wangkang124@hisilicon.com>
---
hikp_init_main.c | 20 --------------------
libhikptdev/src/rciep/hikpt_rciep.h | 2 +-
tool_lib/op_logs.c | 23 ++++++++++++++++++++++-
tool_lib/op_logs.h | 3 ++-
4 files changed, 25 insertions(+), 23 deletions(-)
diff --git a/hikp_init_main.c b/hikp_init_main.c
index 4102c69..4629b40 100644
--- a/hikp_init_main.c
+++ b/hikp_init_main.c
@@ -19,26 +19,6 @@
/* hikptool command adapter */
struct cmd_adapter g_tool = { 0 };
-static void _sig_ign_handle(int arg)
-{
- signal_op_log_write(arg);
- hikp_unlock();
- _exit(1);
-}
-
-static void sig_init(void)
-{
- (void)signal(SIGINT, _sig_ign_handle); /* Quit process */
- (void)signal(SIGTERM, _sig_ign_handle);
- (void)signal(SIGQUIT, _sig_ign_handle);
- (void)signal(SIGHUP, _sig_ign_handle);
- (void)signal(SIGSEGV, _sig_ign_handle);
- (void)signal(SIGBUS, _sig_ign_handle);
- (void)signal(SIGFPE, _sig_ign_handle);
- (void)signal(SIGABRT, _sig_ign_handle);
- (void)signal(SIGTSTP, _sig_ign_handle); /* Stop process */
-}
-
static void show_tool_version(const struct cmd_adapter *adapter)
{
printf("%s version %s Huawei\n", adapter->name, adapter->version);
diff --git a/libhikptdev/src/rciep/hikpt_rciep.h b/libhikptdev/src/rciep/hikpt_rciep.h
index 8fbb3c0..dd08759 100644
--- a/libhikptdev/src/rciep/hikpt_rciep.h
+++ b/libhikptdev/src/rciep/hikpt_rciep.h
@@ -40,7 +40,7 @@
#define MAX_LOCK_COUNT 5
#define LOCK_CHECK_GAP_US 1000
#define CPL_CHECK_GAP_US 1000
-#define WAIT_CPL_MAX_MS 5000
+#define WAIT_CPL_MAX_MS 8000
enum {
HIKP_RESOURCE_DIR,
diff --git a/tool_lib/op_logs.c b/tool_lib/op_logs.c
index d6082a3..069428d 100644
--- a/tool_lib/op_logs.c
+++ b/tool_lib/op_logs.c
@@ -14,7 +14,9 @@
#include <syslog.h>
#include <unistd.h>
#include <sys/stat.h>
+#include <signal.h>
#include "tool_lib.h"
+#include "hikptdev_plug.h"
#include "op_logs.h"
static char g_op_log[OP_LOG_FILE_PATH_MAXLEN] = {0};
@@ -23,7 +25,6 @@ static bool g_record = true;
static bool g_log_info;
static char g_input_buf[OP_LOG_FILE_W_MAXSIZE + 1] = {0};
-
static void op_log_write(const char *log_data)
{
size_t w_size;
@@ -414,3 +415,23 @@ SIGNAL_LOG_OUT:
(void)close(fd);
(void)uda_unfcntl(&op_log_fd, UDA_FLOCK_BLOCK);
}
+
+static void signal_handle(int arg)
+{
+ signal_op_log_write(arg);
+ hikp_unlock();
+ _exit(1);
+}
+
+void sig_init(void)
+{
+ (void)signal(SIGINT, signal_handle); /* Quit process */
+ (void)signal(SIGTERM, signal_handle);
+ (void)signal(SIGQUIT, signal_handle);
+ (void)signal(SIGHUP, signal_handle);
+ (void)signal(SIGSEGV, signal_handle);
+ (void)signal(SIGBUS, signal_handle);
+ (void)signal(SIGFPE, signal_handle);
+ (void)signal(SIGABRT, signal_handle);
+ (void)signal(SIGTSTP, signal_handle); /* Stop process */
+}
diff --git a/tool_lib/op_logs.h b/tool_lib/op_logs.h
index 597f063..6b6e421 100644
--- a/tool_lib/op_logs.h
+++ b/tool_lib/op_logs.h
@@ -45,7 +45,8 @@ struct op_log_print_t {
char *str;
};
-void signal_op_log_write(int signal_code);
+void sig_init(void);
+
void op_log_on(void);
void op_log_off(void);
int op_log_initialise(const char *log_dir);
--
2.25.1

View File

@ -0,0 +1,28 @@
From b369c7bf28b576097b46470d509ac61116872958 Mon Sep 17 00:00:00 2001
From: veega2022 <zhuweijia@huawei.com>
Date: Wed, 10 May 2023 18:09:55 +0800
Subject: [PATCH 04/18] delete pcie AP_INT module for dump reg
the AP_INT module is abandoned, so deleted this module and do not dump
this module reg
Signed-off-by: hesiyuan <hesiyuan4@huawei.com>
---
pcie/func_lib/pcie_func/pcie_reg_read.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/pcie/func_lib/pcie_func/pcie_reg_read.c b/pcie/func_lib/pcie_func/pcie_reg_read.c
index 6ba4f07..b3d4643 100644
--- a/pcie/func_lib/pcie_func/pcie_reg_read.c
+++ b/pcie/func_lib/pcie_func/pcie_reg_read.c
@@ -30,7 +30,6 @@ static struct pcie_module_table g_module_table[] = {
{"PCIPC_REG", PCIPC_REG_ID},
{"AP_MCTP_REG", AP_MCTP_REG_ID},
{"AP_ENGINE_REG", AP_ENGINE_REG_ID},
- {"AP_INT_REG", AP_INT_REG_ID},
{"AP_DMA_REG", AP_DMA_REG_ID},
{"TOP_REG", TOP_REG_ID},
{"CORE_GLOBAL_REG", CORE_GLOBAL_REG_ID},
--
2.25.1

View File

@ -0,0 +1,28 @@
From 2b679f7b8023298c3942b424545a4eff8aebe683 Mon Sep 17 00:00:00 2001
From: veega2022 <zhuweijia@huawei.com>
Date: Wed, 10 May 2023 18:14:50 +0800
Subject: [PATCH 05/18] fix serdes module dump reg num is not enough problem
The number of new chip registers may increase. Therefore, increase the number of dump registers.
Signed-off-by: wangkang <wangkang124@hisilicon.com>
---
serdes/hikp_serdes.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/serdes/hikp_serdes.c b/serdes/hikp_serdes.c
index 89e66e1..dd9eee3 100644
--- a/serdes/hikp_serdes.c
+++ b/serdes/hikp_serdes.c
@@ -23,7 +23,7 @@
static struct cmd_serdes_param g_serdes_param = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-#define SERDES_OUTPUT_MAX_SIZE 2048
+#define SERDES_OUTPUT_MAX_SIZE 2560
static char g_serdes_data_out_buf[SERDES_OUTPUT_MAX_SIZE] = {0};
static int cmd_serdes_maininfo_help(struct major_cmd_ctrl *self, const char *argv)
--
2.25.1

View File

@ -0,0 +1,125 @@
From 104dce7743c31c73a54095844d704272fa14de69 Mon Sep 17 00:00:00 2001
From: veega2022 <zhuweijia@huawei.com>
Date: Wed, 10 May 2023 18:20:58 +0800
Subject: [PATCH 06/18] fix the number of PCS lane registers in the PCIe
dumpreg
Traverse the PCS registers of all lanes under the current core.
Signed-off-by: hesiyuan <hesiyuan4@huawei.com>
---
pcie/func_lib/pcie_func/pcie_reg_dump.c | 36 +++++++++++-------------
pcie/func_lib/pcie_func/pcie_reg_dump.h | 10 +++++++
pcie/usr_cmd/interface/pcie_common_api.h | 4 +++
3 files changed, 31 insertions(+), 19 deletions(-)
diff --git a/pcie/func_lib/pcie_func/pcie_reg_dump.c b/pcie/func_lib/pcie_func/pcie_reg_dump.c
index 7d91969..e10ff7e 100644
--- a/pcie/func_lib/pcie_func/pcie_reg_dump.c
+++ b/pcie/func_lib/pcie_func/pcie_reg_dump.c
@@ -108,13 +108,13 @@ struct pcie_dumpreg_info g_reg_table_mac[] = {
};
struct pcie_dumpreg_info g_reg_table_pcs[] = {
- {0, "SERDES_STATUS_RPT"},
- {0, "EBUF_STATUS"},
- {0, "GEN3_DEC_ENC_STATUS"},
- {0, "WAKE_STATUS"},
- {0, "RECV_DET_OR_PWR_CHAGE"},
- {0, "EQEVAL_STATUS"},
- {0, "LANE_INTR_STATUS"},
+ HIKP_PCIE_PCS_LANE_TBL_ENTRY(SERDES_STATUS_RPT),
+ HIKP_PCIE_PCS_LANE_TBL_ENTRY(EBUF_STATUS),
+ HIKP_PCIE_PCS_LANE_TBL_ENTRY(GEN3_DEC_ENC_STATUS),
+ HIKP_PCIE_PCS_LANE_TBL_ENTRY(WAKE_STATUS),
+ HIKP_PCIE_PCS_LANE_TBL_ENTRY(RECV_DET_OR_PWR_CHAGE),
+ HIKP_PCIE_PCS_LANE_TBL_ENTRY(EQEVAL_STATUS),
+ HIKP_PCIE_PCS_LANE_TBL_ENTRY(LANE_INTR_STATUS),
};
struct pcie_dumpreg_info g_reg_table_iob_tx[] = {
@@ -348,6 +348,13 @@ static void pcie_dumpreg_save_glb_analysis_log(const uint32_t *data, uint32_t da
pcie_dumpreg_write_value_to_file(g_reg_table_core_glb[item_i].name,
g_reg_table_core_glb[item_i].val);
}
+ /* PCS REG */
+ for (item_i = 0; item_i < HIKP_ARRAY_SIZE(g_reg_table_pcs) &&
+ data_i < data_num; item_i++, data_i++) {
+ g_reg_table_pcs[item_i].val = data[data_i];
+ pcie_dumpreg_write_value_to_file(g_reg_table_pcs[item_i].name,
+ g_reg_table_pcs[item_i].val);
+ }
}
static void pcie_dumpreg_save_port_analysis_log(uint32_t *data, uint32_t data_num)
@@ -376,13 +383,6 @@ static void pcie_dumpreg_save_port_analysis_log(uint32_t *data, uint32_t data_nu
pcie_dumpreg_write_value_to_file(g_reg_table_mac[item_i].name,
g_reg_table_mac[item_i].val);
}
- /* PCS REG */
- for (item_i = 0; item_i < HIKP_ARRAY_SIZE(g_reg_table_pcs) &&
- data_i < data_num; item_i++, data_i++) {
- g_reg_table_pcs[item_i].val = data[data_i];
- pcie_dumpreg_write_value_to_file(g_reg_table_pcs[item_i].name,
- g_reg_table_pcs[item_i].val);
- }
}
static int pcie_dumpreg_write_header_to_file(uint32_t version,
@@ -421,14 +421,12 @@ static int pcie_dumpreg_save_log(uint32_t *data, uint32_t data_num,
switch (req_data->level) {
case DUMP_GLOBAL_LEVEL:
expect_data_num = HIKP_ARRAY_SIZE(g_reg_table_iob_tx) +
- HIKP_ARRAY_SIZE(g_reg_table_iob_rx) + HIKP_ARRAY_SIZE(g_reg_table_ap_glb) +
- HIKP_ARRAY_SIZE(g_reg_table_core_glb);
+ HIKP_ARRAY_SIZE(g_reg_table_iob_rx) + HIKP_ARRAY_SIZE(g_reg_table_ap_glb) +
+ HIKP_ARRAY_SIZE(g_reg_table_core_glb) + HIKP_ARRAY_SIZE(g_reg_table_pcs);
break;
case DUMP_PORT_LEVEL:
expect_data_num = HIKP_ARRAY_SIZE(g_reg_table_tl) +
- HIKP_ARRAY_SIZE(g_reg_table_dl) +
- HIKP_ARRAY_SIZE(g_reg_table_mac) +
- HIKP_ARRAY_SIZE(g_reg_table_pcs);
+ HIKP_ARRAY_SIZE(g_reg_table_dl) + HIKP_ARRAY_SIZE(g_reg_table_mac);
break;
default:
Err("PCIe DUMPREG", "check dump level failed.\n");
diff --git a/pcie/func_lib/pcie_func/pcie_reg_dump.h b/pcie/func_lib/pcie_func/pcie_reg_dump.h
index 1993c1f..4ec1909 100644
--- a/pcie/func_lib/pcie_func/pcie_reg_dump.h
+++ b/pcie/func_lib/pcie_func/pcie_reg_dump.h
@@ -20,6 +20,16 @@
#define MAX_STR_LEN 80
#define PCIE_DUMPREG_LOGFILE_NAME "pcie_dumpreg"
+#define HIKP_PCIE_PCS_LANE_TBL_ENTRY(name) \
+ {0, STR(CONTACT(name, _00))}, {0, STR(CONTACT(name, _01))}, \
+ {0, STR(CONTACT(name, _02))}, {0, STR(CONTACT(name, _03))}, \
+ {0, STR(CONTACT(name, _04))}, {0, STR(CONTACT(name, _05))}, \
+ {0, STR(CONTACT(name, _06))}, {0, STR(CONTACT(name, _07))}, \
+ {0, STR(CONTACT(name, _08))}, {0, STR(CONTACT(name, _09))}, \
+ {0, STR(CONTACT(name, _10))}, {0, STR(CONTACT(name, _11))}, \
+ {0, STR(CONTACT(name, _12))}, {0, STR(CONTACT(name, _13))}, \
+ {0, STR(CONTACT(name, _14))}, {0, STR(CONTACT(name, _15))}
+
enum pcie_dump_level {
DUMP_GLOBAL_LEVEL = 1,
DUMP_PORT_LEVEL = 2,
diff --git a/pcie/usr_cmd/interface/pcie_common_api.h b/pcie/usr_cmd/interface/pcie_common_api.h
index f6541bd..9809575 100644
--- a/pcie/usr_cmd/interface/pcie_common_api.h
+++ b/pcie/usr_cmd/interface/pcie_common_api.h
@@ -17,6 +17,10 @@
#include <stdint.h>
#include <stdio.h>
+#define CONTACT(x, y) x##y
+#define STR_INTER(x) #x
+#define STR(x) STR_INTER(x)
+
struct print_info {
char *buff;
size_t buff_size;
--
2.25.1

View File

@ -0,0 +1,46 @@
From c0f8dd5ae8fe688825e77cf63ddb30d0cb27ecdf Mon Sep 17 00:00:00 2001
From: veega2022 <zhuweijia@huawei.com>
Date: Thu, 11 May 2023 08:54:09 +0800
Subject: [PATCH 08/18] optimize the nic_mac dump register
if reg dump block data num is 0, print not support dump and return.
hikptool version: 1.0.14
Signed-off-by: veega2022 <zhuweijia@huawei.com>
---
net/nic/nic_mac/hikp_nic_mac_dump.c | 5 +++++
tool_lib/tool_lib.h | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/net/nic/nic_mac/hikp_nic_mac_dump.c b/net/nic/nic_mac/hikp_nic_mac_dump.c
index 6e856a8..3e818cd 100644
--- a/net/nic/nic_mac/hikp_nic_mac_dump.c
+++ b/net/nic/nic_mac/hikp_nic_mac_dump.c
@@ -64,6 +64,11 @@ static int mac_cmd_dump_mod(struct major_cmd_ctrl *self, const char *name,
uint32_t i;
int ret;
+ if (blk_num == 0) {
+ printf("%s module is not support dump.\n", name);
+ return 0;
+ }
+
printf("============ %10s REG INFO ==============\n", name);
printf("\t %s :\t%10s\n", "offset", "value");
diff --git a/tool_lib/tool_lib.h b/tool_lib/tool_lib.h
index bf37465..9766a7e 100644
--- a/tool_lib/tool_lib.h
+++ b/tool_lib/tool_lib.h
@@ -18,7 +18,7 @@
#define TOOL_NAME "hikptool"
-#define TOOL_VER "1.0.13"
+#define TOOL_VER "1.0.14"
#define HI_GET_BITFIELD(value, start, mask) (((value) >> (start)) & (mask))
#define HI_SET_FIELD(origin, shift, val) ((origin) |= (val) << (shift))
--
2.25.1

View File

@ -0,0 +1,53 @@
From e51911b2c5daa7f9d650849aaa4f389291415255 Mon Sep 17 00:00:00 2001
From: veega2022 <zhuweijia@huawei.com>
Date: Thu, 11 May 2023 09:29:48 +0800
Subject: [PATCH 14/18] Fix a resource release bug in hikp_roh_get_cam_reg_num
Fix a resource release bug in hikp_roh_get_cam_reg_num
Signed-off-by: chenke chenke54@huawei.com
---
net/roh/hikp_roh_mac.c | 6 +++++-
net/roh/hikp_roh_show_bp.c | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/net/roh/hikp_roh_mac.c b/net/roh/hikp_roh_mac.c
index 90708b1..43f954c 100644
--- a/net/roh/hikp_roh_mac.c
+++ b/net/roh/hikp_roh_mac.c
@@ -141,6 +141,7 @@ static int hikp_roh_get_cam_reg_num(struct major_cmd_ctrl *self)
struct roh_mac_req_para req_data = { 0 };
struct hikp_cmd_header req_header = { 0 };
struct hikp_cmd_ret *cmd_ret = NULL;
+ uint32_t cam_reg_num;
req_data.bdf = g_roh_mac_param.target.bdf;
hikp_cmd_init(&req_header, ROH_MOD, HIKP_ROH_MAC, CMD_GET_CAM_REG_NUM);
@@ -153,7 +154,10 @@ static int hikp_roh_get_cam_reg_num(struct major_cmd_ctrl *self)
return -EIO;
}
mac_rsp = (struct roh_mac_cam_reg_num *)(cmd_ret->rsp_data);
- return mac_rsp->cam_reg_num;
+ cam_reg_num = mac_rsp->cam_reg_num;
+ free(cmd_ret);
+ cmd_ret = NULL;
+ return cam_reg_num;
}
static int hikp_roh_build_cam(struct major_cmd_ctrl *self, struct cam_table_entry_t *cam_table)
diff --git a/net/roh/hikp_roh_show_bp.c b/net/roh/hikp_roh_show_bp.c
index c89e98b..73a53d8 100644
--- a/net/roh/hikp_roh_show_bp.c
+++ b/net/roh/hikp_roh_show_bp.c
@@ -44,7 +44,7 @@ static int hikp_roh_show_bp(struct major_cmd_ctrl *self)
union bp_val res;
uint8_t flit_bp;
int mac_id;
- int ret;
+ int ret = 0;
struct hikp_cmd_ret *cmd_ret = NULL;
struct hikp_cmd_header req_header = { 0 };
--
2.25.1

View File

@ -0,0 +1,28 @@
From 28283e9ab010f418846eaa00511721745927088f Mon Sep 17 00:00:00 2001
From: veega2022 <zhuweijia@huawei.com>
Date: Thu, 11 May 2023 09:36:38 +0800
Subject: [PATCH 15/18] fix missing white space issue
Add a space on the left and right of the "="
Signed-off-by: veega2022 <zhuweijia@huawei.com>
---
socip/hikp_socip_dumpreg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/socip/hikp_socip_dumpreg.c b/socip/hikp_socip_dumpreg.c
index b74dac8..32325bb 100644
--- a/socip/hikp_socip_dumpreg.c
+++ b/socip/hikp_socip_dumpreg.c
@@ -142,7 +142,7 @@ static void hikp_socip_dumpreg_execute(struct major_cmd_ctrl *self)
hikp_cmd_init(&req_header, SOCIP_MOD, HIKP_SOCIP_CMD_DUMPREG, param[MODULE_ID_INDEX].val);
cmd_ret = hikp_cmd_alloc(&req_header, &req_data, sizeof(req_data));
if (!cmd_ret) {
- self->err_no=-EINVAL;
+ self->err_no = -EINVAL;
HIKP_ERROR_PRINT("hikp_cmd_alloc\n");
return;
}
--
2.25.1

View File

@ -0,0 +1,86 @@
From 90c8f3c14e4d5cf1ea5fd8181810f07d33af4e9b Mon Sep 17 00:00:00 2001
From: huangguanhua <huangguanhua3@huawei.com>
Date: Thu, 18 May 2023 16:29:28 +0800
Subject: [PATCH 17/18] hikptool-fix-maininfo-detail-info-print-error
Signed-off-by: huangguanhua <huangguanhua3@huawei.com>
---
serdes/hikp_serdes.c | 12 ++++++++----
serdes/hikp_serdes.h | 3 ++-
tool_lib/op_logs.c | 6 +++---
3 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/serdes/hikp_serdes.c b/serdes/hikp_serdes.c
index dd9eee3..527fd53 100644
--- a/serdes/hikp_serdes.c
+++ b/serdes/hikp_serdes.c
@@ -184,21 +184,22 @@ static void hikp_serdes_brief_info_print(struct major_cmd_ctrl *self,
"Tap16,Tap17,Tap18,Tap19,Tap20]\n" \
"FWFourEye: It only takes effect when the firmware is running and " \
"continuous adaptation is turned on\n" \
+ "Snr: [SNR_METRIC,SNR_METRIC_HIS_MIN,SNR_CYCLES,HEH,SNR_METRIC_SW]\n" \
"-----------------------------------------------------" \
"------------------------------------------------" \
"-----------------------------------------------------" \
"------------------------------------------------" \
- "-------------------\n" \
+ "--------------------------------\n" \
" [ FFE ]" \
"[ CTLE ]" \
"[ " \
"DFE ]" \
- "[ FWFourEye ][ snr ]\n" \
+ "[ FWFourEye ][ Snr ]\n" \
"-----------------------------------------------------" \
"-------------------------------------------------" \
"-----------------------------------------------------" \
"-------------------------------------------------" \
- "------------------\n")
+ "--------------------------------\n")
static void hikp_serdes_detail_info_print(struct major_cmd_ctrl *self,
const struct hilink_detail_info *data,
@@ -233,7 +234,10 @@ static void hikp_serdes_detail_info_print(struct major_cmd_ctrl *self,
printf("][%4d,%4d,%4d,%4d]",
data[ds_id].eye_diagram.top, data[ds_id].eye_diagram.bottom,
data[ds_id].eye_diagram.left, data[ds_id].eye_diagram.right);
- printf("[%7d]\n", data[ds_id].snr);
+ /* 0: SNR_METRIC, 1:SNR_METRIC_HIS_MIN */
+ printf("[%3d,%3d,%3d,%3d,%3d]\n", data[ds_id].snr_para[0], data[ds_id].snr_para[1],
+ /* 2:SNR_CYCLES, 3:HEH, 4:SNR_METRIC_SW */
+ data[ds_id].snr_para[2], data[ds_id].snr_para[3], data[ds_id].snr_para[4]);
}
}
diff --git a/serdes/hikp_serdes.h b/serdes/hikp_serdes.h
index 99b9b15..83c28b8 100644
--- a/serdes/hikp_serdes.h
+++ b/serdes/hikp_serdes.h
@@ -192,7 +192,8 @@ struct hilink_detail_info {
struct hilink_rx_param rx_ctle_cfg;
struct hilink_serdes_rx_tap rx_tap_cfg;
struct hilink_4p_eye_result eye_diagram;
- uint32_t snr;
+ /* 5: (0: SNR_METRIC, 1:SNR_METRIC_HIS_MIN, 2:SNR_CYCLES, 3:HEH, 4:SNR_METRIC_SW) */
+ int32_t snr_para[5];
};
struct hilink_brief_info {
diff --git a/tool_lib/op_logs.c b/tool_lib/op_logs.c
index 069428d..d91ddb0 100644
--- a/tool_lib/op_logs.c
+++ b/tool_lib/op_logs.c
@@ -431,7 +431,7 @@ void sig_init(void)
(void)signal(SIGHUP, signal_handle);
(void)signal(SIGSEGV, signal_handle);
(void)signal(SIGBUS, signal_handle);
- (void)signal(SIGFPE, signal_handle);
- (void)signal(SIGABRT, signal_handle);
- (void)signal(SIGTSTP, signal_handle); /* Stop process */
+ (void)signal(SIGFPE, signal_handle);
+ (void)signal(SIGABRT, signal_handle);
+ (void)signal(SIGTSTP, signal_handle); /* Stop process */
}
--
2.25.1

View File

@ -0,0 +1,29 @@
From dc15df882b56ec2abff2a5bba45238309a02f5e9 Mon Sep 17 00:00:00 2001
From: FuJia Ni <nifujia1@hisilicon.com>
Date: Thu, 25 May 2023 09:36:39 +0800
Subject: [PATCH 18/18] hikptool: fix print sas_dqe info error problem
the volatile modifier is added because the O2 compilation optimization is enbaled.
As a result, the pointer data is not updated.
Signed-off-by: FuJia Ni <nifujia1@hisilicon.com>
---
sas/sas_func/sas_read_dqe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sas/sas_func/sas_read_dqe.c b/sas/sas_func/sas_read_dqe.c
index fc04682..2f653df 100644
--- a/sas/sas_func/sas_read_dqe.c
+++ b/sas/sas_func/sas_read_dqe.c
@@ -47,7 +47,7 @@ static int sas_get_dqe(const struct tool_sas_cmd *cmd, uint32_t *reg_save, uint3
static void print_dqe_info(const void *reg_save, uint32_t reg_num)
{
- struct hisi_sas_dq_info *dqe = (struct hisi_sas_dq_info *)(reg_save);
+ volatile struct hisi_sas_dq_info *dqe = (volatile struct hisi_sas_dq_info *)(reg_save);
printf("The dqe dw0 information as below:\n");
printf("abort_flag: %u\n", dqe->dw0.abort_flag);
--
2.25.1

View File

@ -1,7 +1,7 @@
Name: hikptool
Summary: A userspace tool for Linux providing problem location on Kunpeng chips
Version: 1.0.0
Release: 9
Release: 10
License: MulanPSL2
Source: %{name}-%{version}.tar.gz
ExclusiveOS: linux
@ -18,6 +18,17 @@ Patch0001: 0001-socip-Return-EINVAL-when-the-parameter-check-fails.patch
Patch0002: 0002-fix-compiler-security-option-problem.patch
Patch0003: 0003-fix-the-security-compilation-PIE-issue.patch
Patch0004: 0004-hikptool-fix-print-sas_dev-info-error-problem.patch
Patch0005: 0005-fix-hikptool-rciep-rsp-filed-error-problem.patch
Patch0006: 0006-fix-pcie_info-cmd-print-display-problem.patch
Patch0007: 0007-fix-signal-proc-func-api-modified-to-be-open-to-the-.patch
Patch0008: 0008-delete-pcie-AP_INT-module-for-dump-reg.patch
Patch0009: 0009-fix-serdes-module-dump-reg-num-is-not-enough-problem.patch
Patch0010: 0010-fix-the-number-of-PCS-lane-registers-in-the-PCIe-dum.patch
Patch0011: 0011-optimize-the-nic_mac-dump-register.patch
Patch0012: 0012-Fix-a-resource-release-bug-in-hikp_roh_get_cam_reg_n.patch
Patch0013: 0013-fix-missing-white-space-issue.patch
Patch0014: 0014-hikptool-fix-maininfo-detail-info-print-error.patch
Patch0015: 0015-hikptool-fix-print-sas_dqe-info-error-problem.patch
%description
This package contains the hikptool
@ -70,6 +81,9 @@ fi
/sbin/ldconfig
%changelog
* Tue May 30 2023 veega2022 <zhuweijia@huawei.com> 1.0.0-10
- sync code: fix PCIe and serdes, roh module problem
* Thu Apr 06 2023 veega2022 <zhuweijia@huawei.com> 1.0.0-9
- fix sas device info print error bug