From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Luo bin <luobin9@huawei.com>,
"David S. Miller" <davem@davemloft.net>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.8 061/124] hinic: add log in exception handling processes
Date: Mon, 12 Oct 2020 15:31:05 +0200 [thread overview]
Message-ID: <20201012133149.813147139@linuxfoundation.org> (raw)
In-Reply-To: <20201012133146.834528783@linuxfoundation.org>
From: Luo bin <luobin9@huawei.com>
[ Upstream commit 90f86b8a36c065286b743eed29661fc5cd00d342 ]
improve the error message when functions return failure and dump
relevant registers in some exception handling processes
Signed-off-by: Luo bin <luobin9@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../ethernet/huawei/hinic/hinic_hw_api_cmd.c | 27 +++++++-
.../ethernet/huawei/hinic/hinic_hw_api_cmd.h | 4 ++
.../net/ethernet/huawei/hinic/hinic_hw_cmdq.c | 2 +
.../net/ethernet/huawei/hinic/hinic_hw_cmdq.h | 2 +
.../net/ethernet/huawei/hinic/hinic_hw_dev.c | 12 ++--
.../net/ethernet/huawei/hinic/hinic_hw_eqs.c | 39 ++++++++++++
.../net/ethernet/huawei/hinic/hinic_hw_eqs.h | 6 +-
.../net/ethernet/huawei/hinic/hinic_hw_if.c | 23 +++++++
.../net/ethernet/huawei/hinic/hinic_hw_if.h | 10 ++-
.../net/ethernet/huawei/hinic/hinic_hw_mbox.c | 2 +
.../net/ethernet/huawei/hinic/hinic_hw_mgmt.c | 1 +
.../net/ethernet/huawei/hinic/hinic_port.c | 62 +++++++++----------
.../net/ethernet/huawei/hinic/hinic_sriov.c | 6 +-
13 files changed, 151 insertions(+), 45 deletions(-)
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.c
index 583fd24c29cf6..29e88e25a4a4f 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.c
@@ -112,6 +112,26 @@ static u32 get_hw_cons_idx(struct hinic_api_cmd_chain *chain)
return HINIC_API_CMD_STATUS_GET(val, CONS_IDX);
}
+static void dump_api_chain_reg(struct hinic_api_cmd_chain *chain)
+{
+ u32 addr, val;
+
+ addr = HINIC_CSR_API_CMD_STATUS_ADDR(chain->chain_type);
+ val = hinic_hwif_read_reg(chain->hwif, addr);
+
+ dev_err(&chain->hwif->pdev->dev, "Chain type: 0x%x, cpld error: 0x%x, check error: 0x%x, current fsm: 0x%x\n",
+ chain->chain_type, HINIC_API_CMD_STATUS_GET(val, CPLD_ERR),
+ HINIC_API_CMD_STATUS_GET(val, CHKSUM_ERR),
+ HINIC_API_CMD_STATUS_GET(val, FSM));
+
+ dev_err(&chain->hwif->pdev->dev, "Chain hw current ci: 0x%x\n",
+ HINIC_API_CMD_STATUS_GET(val, CONS_IDX));
+
+ addr = HINIC_CSR_API_CMD_CHAIN_PI_ADDR(chain->chain_type);
+ val = hinic_hwif_read_reg(chain->hwif, addr);
+ dev_err(&chain->hwif->pdev->dev, "Chain hw current pi: 0x%x\n", val);
+}
+
/**
* chain_busy - check if the chain is still processing last requests
* @chain: chain to check
@@ -131,8 +151,10 @@ static int chain_busy(struct hinic_api_cmd_chain *chain)
/* check for a space for a new command */
if (chain->cons_idx == MASKED_IDX(chain, prod_idx + 1)) {
- dev_err(&pdev->dev, "API CMD chain %d is busy\n",
- chain->chain_type);
+ dev_err(&pdev->dev, "API CMD chain %d is busy, cons_idx: %d, prod_idx: %d\n",
+ chain->chain_type, chain->cons_idx,
+ chain->prod_idx);
+ dump_api_chain_reg(chain);
return -EBUSY;
}
break;
@@ -332,6 +354,7 @@ static int wait_for_api_cmd_completion(struct hinic_api_cmd_chain *chain)
err = wait_for_status_poll(chain);
if (err) {
dev_err(&pdev->dev, "API CMD Poll status timeout\n");
+ dump_api_chain_reg(chain);
break;
}
break;
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.h b/drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.h
index 0ba00fd828dfc..6d1654b050ad5 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.h
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.h
@@ -103,10 +103,14 @@
HINIC_API_CMD_STATUS_HEADER_##member##_MASK)
#define HINIC_API_CMD_STATUS_CONS_IDX_SHIFT 0
+#define HINIC_API_CMD_STATUS_FSM_SHIFT 24
#define HINIC_API_CMD_STATUS_CHKSUM_ERR_SHIFT 28
+#define HINIC_API_CMD_STATUS_CPLD_ERR_SHIFT 30
#define HINIC_API_CMD_STATUS_CONS_IDX_MASK 0xFFFFFF
+#define HINIC_API_CMD_STATUS_FSM_MASK 0xFU
#define HINIC_API_CMD_STATUS_CHKSUM_ERR_MASK 0x3
+#define HINIC_API_CMD_STATUS_CPLD_ERR_MASK 0x1U
#define HINIC_API_CMD_STATUS_GET(val, member) \
(((val) >> HINIC_API_CMD_STATUS_##member##_SHIFT) & \
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c
index cb5b6e5f787f2..e0eb294779ec1 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c
@@ -401,6 +401,7 @@ static int cmdq_sync_cmd_direct_resp(struct hinic_cmdq *cmdq,
spin_unlock_bh(&cmdq->cmdq_lock);
+ hinic_dump_ceq_info(cmdq->hwdev);
return -ETIMEDOUT;
}
@@ -807,6 +808,7 @@ static int init_cmdqs_ctxt(struct hinic_hwdev *hwdev,
cmdq_type = HINIC_CMDQ_SYNC;
for (; cmdq_type < HINIC_MAX_CMDQ_TYPES; cmdq_type++) {
+ cmdqs->cmdq[cmdq_type].hwdev = hwdev;
err = init_cmdq(&cmdqs->cmdq[cmdq_type],
&cmdqs->saved_wqs[cmdq_type], cmdq_type,
db_area[cmdq_type]);
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.h b/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.h
index 3e4b0aef9fe6c..f40c31e1879f1 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.h
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.h
@@ -130,6 +130,8 @@ struct hinic_cmdq_ctxt {
};
struct hinic_cmdq {
+ struct hinic_hwdev *hwdev;
+
struct hinic_wq *wq;
enum hinic_cmdq_type cmdq_type;
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c
index b735bc537508f..298ceb930cc62 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c
@@ -253,9 +253,9 @@ static int init_fw_ctxt(struct hinic_hwdev *hwdev)
&fw_ctxt, sizeof(fw_ctxt),
&fw_ctxt, &out_size);
if (err || (out_size != sizeof(fw_ctxt)) || fw_ctxt.status) {
- dev_err(&pdev->dev, "Failed to init FW ctxt, ret = %d\n",
- fw_ctxt.status);
- return -EFAULT;
+ dev_err(&pdev->dev, "Failed to init FW ctxt, err: %d, status: 0x%x, out size: 0x%x\n",
+ err, fw_ctxt.status, out_size);
+ return -EIO;
}
return 0;
@@ -420,9 +420,9 @@ static int get_base_qpn(struct hinic_hwdev *hwdev, u16 *base_qpn)
&cmd_base_qpn, sizeof(cmd_base_qpn),
&cmd_base_qpn, &out_size);
if (err || (out_size != sizeof(cmd_base_qpn)) || cmd_base_qpn.status) {
- dev_err(&pdev->dev, "Failed to get base qpn, status = %d\n",
- cmd_base_qpn.status);
- return -EFAULT;
+ dev_err(&pdev->dev, "Failed to get base qpn, err: %d, status: 0x%x, out size: 0x%x\n",
+ err, cmd_base_qpn.status, out_size);
+ return -EIO;
}
*base_qpn = cmd_base_qpn.qpn;
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_eqs.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_eqs.c
index 397936cac304c..ca8cb68a8d206 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_eqs.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_eqs.c
@@ -953,3 +953,42 @@ void hinic_ceqs_free(struct hinic_ceqs *ceqs)
for (q_id = 0; q_id < ceqs->num_ceqs; q_id++)
remove_eq(&ceqs->ceq[q_id]);
}
+
+void hinic_dump_ceq_info(struct hinic_hwdev *hwdev)
+{
+ struct hinic_eq *eq = NULL;
+ u32 addr, ci, pi;
+ int q_id;
+
+ for (q_id = 0; q_id < hwdev->func_to_io.ceqs.num_ceqs; q_id++) {
+ eq = &hwdev->func_to_io.ceqs.ceq[q_id];
+ addr = EQ_CONS_IDX_REG_ADDR(eq);
+ ci = hinic_hwif_read_reg(hwdev->hwif, addr);
+ addr = EQ_PROD_IDX_REG_ADDR(eq);
+ pi = hinic_hwif_read_reg(hwdev->hwif, addr);
+ dev_err(&hwdev->hwif->pdev->dev, "Ceq id: %d, ci: 0x%08x, sw_ci: 0x%08x, pi: 0x%x, tasklet_state: 0x%lx, wrap: %d, ceqe: 0x%x\n",
+ q_id, ci, eq->cons_idx, pi,
+ eq->ceq_tasklet.state,
+ eq->wrapped, be32_to_cpu(*(__be32 *)(GET_CURR_CEQ_ELEM(eq))));
+ }
+}
+
+void hinic_dump_aeq_info(struct hinic_hwdev *hwdev)
+{
+ struct hinic_aeq_elem *aeqe_pos = NULL;
+ struct hinic_eq *eq = NULL;
+ u32 addr, ci, pi;
+ int q_id;
+
+ for (q_id = 0; q_id < hwdev->aeqs.num_aeqs; q_id++) {
+ eq = &hwdev->aeqs.aeq[q_id];
+ addr = EQ_CONS_IDX_REG_ADDR(eq);
+ ci = hinic_hwif_read_reg(hwdev->hwif, addr);
+ addr = EQ_PROD_IDX_REG_ADDR(eq);
+ pi = hinic_hwif_read_reg(hwdev->hwif, addr);
+ aeqe_pos = GET_CURR_AEQ_ELEM(eq);
+ dev_err(&hwdev->hwif->pdev->dev, "Aeq id: %d, ci: 0x%08x, pi: 0x%x, work_state: 0x%x, wrap: %d, desc: 0x%x\n",
+ q_id, ci, pi, work_busy(&eq->aeq_work.work),
+ eq->wrapped, be32_to_cpu(aeqe_pos->desc));
+ }
+}
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_eqs.h b/drivers/net/ethernet/huawei/hinic/hinic_hw_eqs.h
index 74b9ff90640c2..43065fc708693 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_eqs.h
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_eqs.h
@@ -162,7 +162,7 @@ enum hinic_eqe_state {
struct hinic_aeq_elem {
u8 data[HINIC_AEQE_DATA_SIZE];
- u32 desc;
+ __be32 desc;
};
struct hinic_eq_work {
@@ -254,4 +254,8 @@ int hinic_ceqs_init(struct hinic_ceqs *ceqs, struct hinic_hwif *hwif,
void hinic_ceqs_free(struct hinic_ceqs *ceqs);
+void hinic_dump_ceq_info(struct hinic_hwdev *hwdev);
+
+void hinic_dump_aeq_info(struct hinic_hwdev *hwdev);
+
#endif
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_if.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_if.c
index cf127d896ba69..bc8925c0c982c 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_if.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_if.c
@@ -21,6 +21,8 @@
#define WAIT_HWIF_READY_TIMEOUT 10000
+#define HINIC_SELFTEST_RESULT 0x883C
+
/**
* hinic_msix_attr_set - set message attribute for msix entry
* @hwif: the HW interface of a pci function device
@@ -369,6 +371,26 @@ u16 hinic_pf_id_of_vf_hw(struct hinic_hwif *hwif)
return HINIC_FA0_GET(attr0, PF_IDX);
}
+static void __print_selftest_reg(struct hinic_hwif *hwif)
+{
+ u32 addr, attr0, attr1;
+
+ addr = HINIC_CSR_FUNC_ATTR1_ADDR;
+ attr1 = hinic_hwif_read_reg(hwif, addr);
+
+ if (attr1 == HINIC_PCIE_LINK_DOWN) {
+ dev_err(&hwif->pdev->dev, "PCIE is link down\n");
+ return;
+ }
+
+ addr = HINIC_CSR_FUNC_ATTR0_ADDR;
+ attr0 = hinic_hwif_read_reg(hwif, addr);
+ if (HINIC_FA0_GET(attr0, FUNC_TYPE) != HINIC_VF &&
+ !HINIC_FA0_GET(attr0, PCI_INTF_IDX))
+ dev_err(&hwif->pdev->dev, "Selftest reg: 0x%08x\n",
+ hinic_hwif_read_reg(hwif, HINIC_SELFTEST_RESULT));
+}
+
/**
* hinic_init_hwif - initialize the hw interface
* @hwif: the HW interface of a pci function device
@@ -398,6 +420,7 @@ int hinic_init_hwif(struct hinic_hwif *hwif, struct pci_dev *pdev)
err = wait_hwif_ready(hwif);
if (err) {
dev_err(&pdev->dev, "HW interface is not ready\n");
+ __print_selftest_reg(hwif);
goto err_hwif_ready;
}
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_if.h b/drivers/net/ethernet/huawei/hinic/hinic_hw_if.h
index 0872e035faa11..c06f2253151e2 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_if.h
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_if.h
@@ -12,6 +12,8 @@
#include <linux/types.h>
#include <asm/byteorder.h>
+#define HINIC_PCIE_LINK_DOWN 0xFFFFFFFF
+
#define HINIC_DMA_ATTR_ST_SHIFT 0
#define HINIC_DMA_ATTR_AT_SHIFT 8
#define HINIC_DMA_ATTR_PH_SHIFT 10
@@ -249,13 +251,17 @@ struct hinic_hwif {
static inline u32 hinic_hwif_read_reg(struct hinic_hwif *hwif, u32 reg)
{
- return be32_to_cpu(readl(hwif->cfg_regs_bar + reg));
+ u32 out = readl(hwif->cfg_regs_bar + reg);
+
+ return be32_to_cpu(*(__be32 *)&out);
}
static inline void hinic_hwif_write_reg(struct hinic_hwif *hwif, u32 reg,
u32 val)
{
- writel(cpu_to_be32(val), hwif->cfg_regs_bar + reg);
+ __be32 in = cpu_to_be32(val);
+
+ writel(*(u32 *)&in, hwif->cfg_regs_bar + reg);
}
int hinic_msix_attr_set(struct hinic_hwif *hwif, u16 msix_index,
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c
index bc2f87e6cb5d7..47c93f946b94d 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c
@@ -650,6 +650,7 @@ wait_for_mbox_seg_completion(struct hinic_mbox_func_to_func *func_to_func,
if (!wait_for_completion_timeout(done, jif)) {
dev_err(&hwdev->hwif->pdev->dev, "Send mailbox segment timeout\n");
dump_mox_reg(hwdev);
+ hinic_dump_aeq_info(hwdev);
return -ETIMEDOUT;
}
@@ -897,6 +898,7 @@ int hinic_mbox_to_func(struct hinic_mbox_func_to_func *func_to_func,
set_mbox_to_func_event(func_to_func, EVENT_TIMEOUT);
dev_err(&func_to_func->hwif->pdev->dev,
"Send mbox msg timeout, msg_id: %d\n", msg_info.msg_id);
+ hinic_dump_aeq_info(func_to_func->hwdev);
err = -ETIMEDOUT;
goto err_send_mbox;
}
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c
index 7fe39a155b329..070288c8b4f37 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c
@@ -276,6 +276,7 @@ static int msg_to_mgmt_sync(struct hinic_pf_to_mgmt *pf_to_mgmt,
if (!wait_for_completion_timeout(recv_done, timeo)) {
dev_err(&pdev->dev, "MGMT timeout, MSG id = %d\n", msg_id);
+ hinic_dump_aeq_info(pf_to_mgmt->hwdev);
err = -ETIMEDOUT;
goto unlock_sync_msg;
}
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_port.c b/drivers/net/ethernet/huawei/hinic/hinic_port.c
index 175c0ee000384..82d5c50630e64 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_port.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_port.c
@@ -61,8 +61,8 @@ static int change_mac(struct hinic_dev *nic_dev, const u8 *addr,
(port_mac_cmd.status &&
port_mac_cmd.status != HINIC_PF_SET_VF_ALREADY &&
port_mac_cmd.status != HINIC_MGMT_STATUS_EXIST)) {
- dev_err(&pdev->dev, "Failed to change MAC, ret = %d\n",
- port_mac_cmd.status);
+ dev_err(&pdev->dev, "Failed to change MAC, err: %d, status: 0x%x, out size: 0x%x\n",
+ err, port_mac_cmd.status, out_size);
return -EFAULT;
}
@@ -129,8 +129,8 @@ int hinic_port_get_mac(struct hinic_dev *nic_dev, u8 *addr)
&port_mac_cmd, sizeof(port_mac_cmd),
&port_mac_cmd, &out_size);
if (err || (out_size != sizeof(port_mac_cmd)) || port_mac_cmd.status) {
- dev_err(&pdev->dev, "Failed to get mac, ret = %d\n",
- port_mac_cmd.status);
+ dev_err(&pdev->dev, "Failed to get mac, err: %d, status: 0x%x, out size: 0x%x\n",
+ err, port_mac_cmd.status, out_size);
return -EFAULT;
}
@@ -172,9 +172,9 @@ int hinic_port_set_mtu(struct hinic_dev *nic_dev, int new_mtu)
err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_CHANGE_MTU,
&port_mtu_cmd, sizeof(port_mtu_cmd),
&port_mtu_cmd, &out_size);
- if (err || (out_size != sizeof(port_mtu_cmd)) || port_mtu_cmd.status) {
- dev_err(&pdev->dev, "Failed to set mtu, ret = %d\n",
- port_mtu_cmd.status);
+ if (err || out_size != sizeof(port_mtu_cmd) || port_mtu_cmd.status) {
+ dev_err(&pdev->dev, "Failed to set mtu, err: %d, status: 0x%x, out size: 0x%x\n",
+ err, port_mtu_cmd.status, out_size);
return -EFAULT;
}
@@ -264,8 +264,8 @@ int hinic_port_link_state(struct hinic_dev *nic_dev,
&link_cmd, sizeof(link_cmd),
&link_cmd, &out_size);
if (err || (out_size != sizeof(link_cmd)) || link_cmd.status) {
- dev_err(&pdev->dev, "Failed to get link state, ret = %d\n",
- link_cmd.status);
+ dev_err(&pdev->dev, "Failed to get link state, err: %d, status: 0x%x, out size: 0x%x\n",
+ err, link_cmd.status, out_size);
return -EINVAL;
}
@@ -298,8 +298,8 @@ int hinic_port_set_state(struct hinic_dev *nic_dev, enum hinic_port_state state)
&port_state, sizeof(port_state),
&port_state, &out_size);
if (err || (out_size != sizeof(port_state)) || port_state.status) {
- dev_err(&pdev->dev, "Failed to set port state, ret = %d\n",
- port_state.status);
+ dev_err(&pdev->dev, "Failed to set port state, err: %d, status: 0x%x, out size: 0x%x\n",
+ err, port_state.status, out_size);
return -EFAULT;
}
@@ -330,8 +330,8 @@ int hinic_port_set_func_state(struct hinic_dev *nic_dev,
&func_state, sizeof(func_state),
&func_state, &out_size);
if (err || (out_size != sizeof(func_state)) || func_state.status) {
- dev_err(&pdev->dev, "Failed to set port func state, ret = %d\n",
- func_state.status);
+ dev_err(&pdev->dev, "Failed to set port func state, err: %d, status: 0x%x, out size: 0x%x\n",
+ err, func_state.status, out_size);
return -EFAULT;
}
@@ -361,9 +361,9 @@ int hinic_port_get_cap(struct hinic_dev *nic_dev,
port_cap, &out_size);
if (err || (out_size != sizeof(*port_cap)) || port_cap->status) {
dev_err(&pdev->dev,
- "Failed to get port capabilities, ret = %d\n",
- port_cap->status);
- return -EINVAL;
+ "Failed to get port capabilities, err: %d, status: 0x%x, out size: 0x%x\n",
+ err, port_cap->status, out_size);
+ return -EIO;
}
return 0;
@@ -393,9 +393,9 @@ int hinic_port_set_tso(struct hinic_dev *nic_dev, enum hinic_tso_state state)
&tso_cfg, &out_size);
if (err || out_size != sizeof(tso_cfg) || tso_cfg.status) {
dev_err(&pdev->dev,
- "Failed to set port tso, ret = %d\n",
- tso_cfg.status);
- return -EINVAL;
+ "Failed to set port tso, err: %d, status: 0x%x, out size: 0x%x\n",
+ err, tso_cfg.status, out_size);
+ return -EIO;
}
return 0;
@@ -423,9 +423,9 @@ int hinic_set_rx_csum_offload(struct hinic_dev *nic_dev, u32 en)
&rx_csum_cfg, &out_size);
if (err || !out_size || rx_csum_cfg.status) {
dev_err(&pdev->dev,
- "Failed to set rx csum offload, ret = %d\n",
- rx_csum_cfg.status);
- return -EINVAL;
+ "Failed to set rx csum offload, err: %d, status: 0x%x, out size: 0x%x\n",
+ err, rx_csum_cfg.status, out_size);
+ return -EIO;
}
return 0;
@@ -480,9 +480,9 @@ int hinic_set_max_qnum(struct hinic_dev *nic_dev, u8 num_rqs)
&rq_num, &out_size);
if (err || !out_size || rq_num.status) {
dev_err(&pdev->dev,
- "Failed to rxq number, ret = %d\n",
- rq_num.status);
- return -EINVAL;
+ "Failed to set rxq number, err: %d, status: 0x%x, out size: 0x%x\n",
+ err, rq_num.status, out_size);
+ return -EIO;
}
return 0;
@@ -508,9 +508,9 @@ static int hinic_set_rx_lro(struct hinic_dev *nic_dev, u8 ipv4_en, u8 ipv6_en,
&lro_cfg, &out_size);
if (err || !out_size || lro_cfg.status) {
dev_err(&pdev->dev,
- "Failed to set lro offload, ret = %d\n",
- lro_cfg.status);
- return -EINVAL;
+ "Failed to set lro offload, err: %d, status: 0x%x, out size: 0x%x\n",
+ err, lro_cfg.status, out_size);
+ return -EIO;
}
return 0;
@@ -542,10 +542,10 @@ static int hinic_set_rx_lro_timer(struct hinic_dev *nic_dev, u32 timer_value)
if (err || !out_size || lro_timer.status) {
dev_err(&pdev->dev,
- "Failed to set lro timer, ret = %d\n",
- lro_timer.status);
+ "Failed to set lro timer, err: %d, status: 0x%x, out size: 0x%x\n",
+ err, lro_timer.status, out_size);
- return -EINVAL;
+ return -EIO;
}
return 0;
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_sriov.c b/drivers/net/ethernet/huawei/hinic/hinic_sriov.c
index efab2dd2c889b..1043389754df0 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_sriov.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_sriov.c
@@ -40,9 +40,9 @@ static int hinic_set_mac(struct hinic_hwdev *hwdev, const u8 *mac_addr,
if (err || out_size != sizeof(mac_info) ||
(mac_info.status && mac_info.status != HINIC_PF_SET_VF_ALREADY &&
mac_info.status != HINIC_MGMT_STATUS_EXIST)) {
- dev_err(&hwdev->func_to_io.hwif->pdev->dev, "Failed to change MAC, ret = %d\n",
- mac_info.status);
- return -EFAULT;
+ dev_err(&hwdev->func_to_io.hwif->pdev->dev, "Failed to set MAC, err: %d, status: 0x%x, out size: 0x%x\n",
+ err, mac_info.status, out_size);
+ return -EIO;
}
return 0;
--
2.25.1
next prev parent reply other threads:[~2020-10-12 13:47 UTC|newest]
Thread overview: 136+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-12 13:30 [PATCH 5.8 000/124] 5.8.15-rc1 review Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 001/124] fbdev, newport_con: Move FONT_EXTRA_WORDS macros into linux/font.h Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 002/124] Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 003/124] fbcon: Fix global-out-of-bounds read in fbcon_get_font() Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 004/124] Revert "ravb: Fixed to be able to unload modules" Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 005/124] bpf: Fix scalar32_min_max_or bounds tracking Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 006/124] crypto: arm64: Use x16 with indirect branch to bti_c Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 007/124] exfat: fix use of uninitialized spinlock on error path Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 008/124] net: wireless: nl80211: fix out-of-bounds access in nl80211_del_key() Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 009/124] drm/nouveau/device: return error for unknown chipsets Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 010/124] drm/nouveau/mem: guard against NULL pointer access in mem_del Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 011/124] partitions/ibm: fix non-DASD devices Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 012/124] block/scsi-ioctl: Fix kernel-infoleak in scsi_put_cdrom_generic_arg() Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 013/124] vhost: Dont call access_ok() when using IOTLB Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 014/124] vhost: Use vhost_get_used_size() in vhost_vring_set_addr() Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 015/124] usermodehelper: reset umask to default before executing user process Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 016/124] splice: teach splice pipe reading about empty pipe buffers Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 017/124] Platform: OLPC: Fix memleak in olpc_ec_probe Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 018/124] platform/x86: intel-vbtn: Fix SW_TABLET_MODE always reporting 1 on the HP Pavilion 11 x360 Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 019/124] platform/x86: thinkpad_acpi: initialize tp_nvram_state variable Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 020/124] platform/x86: asus-wmi: Fix SW_TABLET_MODE always reporting 1 on many different models Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 021/124] bpf: Fix sysfs export of empty BTF section Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 022/124] bpf: Prevent .BTF section elimination Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 023/124] r8169: consider that PHY reset may still be in progress after applying firmware Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 024/124] platform/x86: intel-vbtn: Switch to an allow-list for SW_TABLET_MODE reporting Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 025/124] platform/x86: thinkpad_acpi: re-initialize ACPI buffer size when reuse Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 026/124] nvme-core: put ctrl ref when module ref get fail Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 027/124] macsec: avoid use-after-free in macsec_handle_frame() Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 028/124] RISC-V: Make sure memblock reserves the memory containing DT Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 029/124] gpiolib: Disable compat ->read() code in UML case Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 030/124] mm/khugepaged: fix filemap page_to_pgoff(page) != offset Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 031/124] net: introduce helper sendpage_ok() in include/linux/net.h Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 032/124] tcp: use sendpage_ok() to detect misused .sendpage Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 033/124] nvme-tcp: check page by sendpage_ok() before calling kernel_sendpage() Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 034/124] xfrmi: drop ignore_df check before updating pmtu Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 035/124] espintcp: restore IP CB before handing the packet to xfrm Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 036/124] cifs: Fix incomplete memory allocation on setxattr path Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 037/124] i2c: meson: fix clock setting overwrite Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 038/124] i2c: meson: keep peripheral clock enabled Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 039/124] i2c: meson: fixup rate calculation with filter delay Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 040/124] i2c: owl: Clear NACK and BUS error bits Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 041/124] sctp: fix sctp_auth_init_hmacs() error path Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 042/124] team: set dev->needed_headroom in team_setup_by_port() Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 043/124] net: team: fix memory leak in __team_options_register Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 044/124] openvswitch: handle DNAT tuple collision Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 045/124] drm/amdgpu: prevent double kfree ttm->sg Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 046/124] btrfs: move btrfs_scratch_superblocks into btrfs_dev_replace_finishing Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 047/124] io_uring: fix potential ABBA deadlock in ->show_fdinfo() Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 048/124] drm/amd/pm: Removed fixed clock in auto mode DPM Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 049/124] drm/amd/display: fix return value check for hdcp_work Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 050/124] drm/vmwgfx: Fix error handling in get_node Greg Kroah-Hartman
2020-10-13 15:55 ` Roland Scheidegger
2020-10-14 6:55 ` Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 051/124] btrfs: move btrfs_rm_dev_replace_free_srcdev outside of all locks Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 052/124] iommu/vt-d: Fix lockdep splat in iommu_flush_dev_iotlb() Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 053/124] xfrm: clone XFRMA_SET_MARK in xfrm_do_migrate Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 054/124] xfrm: clone XFRMA_REPLAY_ESN_VAL " Greg Kroah-Hartman
2020-10-12 13:30 ` [PATCH 5.8 055/124] xfrm: clone XFRMA_SEC_CTX " Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 056/124] xfrm: clone whole liftime_cur structure " Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 057/124] xsk: Do not discard packet when NETDEV_TX_BUSY Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 058/124] net: stmmac: removed enabling eee in EEE set callback Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 059/124] platform/x86: fix kconfig dependency warning for LG_LAPTOP Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 060/124] platform/x86: fix kconfig dependency warning for FUJITSU_LAPTOP Greg Kroah-Hartman
2020-10-12 13:31 ` Greg Kroah-Hartman [this message]
2020-10-12 13:31 ` [PATCH 5.8 062/124] hinic: fix wrong return value of mac-set cmd Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 063/124] net: dsa: felix: convert TAS link speed based on phylink speed Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 064/124] xfrm: Use correct address family in xfrm_state_find Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 065/124] iavf: use generic power management Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 066/124] iavf: Fix incorrect adapter get in iavf_resume Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 067/124] ice: fix memory leak if register_netdev_fails Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 068/124] ice: fix memory leak in ice_vsi_setup Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 069/124] vmxnet3: fix cksum offload issues for non-udp tunnels Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 070/124] net: stmmac: Fix clock handling on remove path Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 071/124] net: ethernet: cavium: octeon_mgmt: use phy_start and phy_stop Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 072/124] bonding: set dev->needed_headroom in bond_setup_by_slave() Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 073/124] mdio: fix mdio-thunder.c dependency & build error Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 074/124] mlxsw: spectrum_acl: Fix mlxsw_sp_acl_tcam_group_add()s error path Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 075/124] r8169: fix RTL8168f/RTL8411 EPHY config Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 076/124] net: usb: ax88179_178a: fix missing stop entry in driver_info Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 077/124] virtio-net: dont disable guest csum when disable LRO Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 078/124] net: phy: realtek: fix rtl8211e rx/tx delay config Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 079/124] octeontx2-af: Fix enable/disable of default NPC entries Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 080/124] octeontx2-pf: Fix TCP/UDP checksum offload for IPv6 frames Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 081/124] octeontx2-pf: Fix the device state on error Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 082/124] octeontx2-pf: Fix synchnorization issue in mbox Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 083/124] pipe: Fix memory leaks in create_pipe_files() Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 084/124] net/mlx5: Fix a race when moving command interface to polling mode Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 085/124] net/mlx5: Avoid possible free of command entry while timeout comp handler Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 086/124] net/mlx5: poll cmd EQ in case of command timeout Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 087/124] net/mlx5: Add retry mechanism to the command entry index allocation Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 088/124] net/mlx5: Fix request_irqs error flow Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 089/124] net/mlx5e: Add resiliency in Striding RQ mode for packets larger than MTU Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 090/124] net/mlx5e: Fix return status when setting unsupported FEC mode Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 091/124] net/mlx5e: Fix VLAN cleanup flow Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 092/124] net/mlx5e: Fix VLAN create flow Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 093/124] net/mlx5e: Fix race condition on nhe->n pointer in neigh update Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 094/124] net: stmmac: Modify configuration method of EEE timers Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 095/124] net: hinic: fix DEVLINK build errors Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 096/124] vhost-vdpa: fix vhost_vdpa_map() on error condition Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 097/124] vhost-vdpa: fix page pinning leakage in error path Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 098/124] net: mvneta: fix double free of txq->buf Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 099/124] rxrpc: Fix rxkad token xdr encoding Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 100/124] rxrpc: Downgrade the BUG() for unsupported token type in rxrpc_read() Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 101/124] rxrpc: Fix some missing _bh annotations on locking conn->state_lock Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 102/124] rxrpc: The server keyring isnt network-namespaced Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 103/124] rxrpc: Fix server keyring leak Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 104/124] net: mscc: ocelot: rename ocelot_board.c to ocelot_vsc7514.c Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 105/124] net: mscc: ocelot: split writes to pause frame enable bit and to thresholds Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 106/124] net: mscc: ocelot: extend watermark encoding function Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 107/124] net: mscc: ocelot: divide watermark value by 60 when writing to SYS_ATOP Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 108/124] afs: Fix deadlock between writeback and truncate Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 109/124] perf: Fix task_function_call() error handling Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 110/124] mmc: core: dont set limits.discard_granularity as 0 Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 111/124] mm: validate inode in mapping_set_error() Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 112/124] mm: khugepaged: recalculate min_free_kbytes after memory hotplug as expected by khugepaged Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 113/124] tcp: fix receive window update in tcp_add_backlog() Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 114/124] netlink: fix policy dump leak Greg Kroah-Hartman
2020-10-12 13:31 ` [PATCH 5.8 115/124] net/core: check length before updating Ethertype in skb_mpls_{push,pop} Greg Kroah-Hartman
2020-10-12 13:32 ` [PATCH 5.8 116/124] net: bridge: fdb: dont flush ext_learn entries Greg Kroah-Hartman
2020-10-12 13:32 ` [PATCH 5.8 117/124] net/tls: race causes kernel panic Greg Kroah-Hartman
2020-10-12 13:32 ` [PATCH 5.8 118/124] net/mlx5e: Fix drivers declaration to support GRE offload Greg Kroah-Hartman
2020-10-12 13:32 ` [PATCH 5.8 119/124] tty/vt: Do not warn when huge selection requested Greg Kroah-Hartman
2020-10-12 13:32 ` [PATCH 5.8 120/124] Input: ati_remote2 - add missing newlines when printing module parameters Greg Kroah-Hartman
2020-10-12 13:32 ` [PATCH 5.8 121/124] net: usb: rtl8150: set random MAC address when set_ethernet_addr() fails Greg Kroah-Hartman
2020-10-12 13:32 ` [PATCH 5.8 122/124] net: qrtr: ns: Protect radix_tree_deref_slot() using rcu read locks Greg Kroah-Hartman
2020-10-12 13:32 ` [PATCH 5.8 123/124] net_sched: defer tcf_idr_insert() in tcf_action_init_1() Greg Kroah-Hartman
2020-10-12 13:32 ` [PATCH 5.8 124/124] net_sched: commit action insertions together Greg Kroah-Hartman
2020-10-12 17:30 ` [PATCH 5.8 000/124] 5.8.15-rc1 review Jeffrin Jose T
2020-10-14 9:56 ` Greg Kroah-Hartman
2020-10-14 18:31 ` Jeffrin Jose T
2020-10-13 5:44 ` Naresh Kamboju
2020-10-14 9:57 ` Greg Kroah-Hartman
2020-10-13 16:41 ` Guenter Roeck
2020-10-14 9:57 ` Greg Kroah-Hartman
2020-10-14 1:21 ` Shuah Khan
2020-10-14 9:57 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201012133149.813147139@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=luobin9@huawei.com \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).