Commit 90f86b8a authored by Luo bin's avatar Luo bin Committed by David S. Miller

hinic: add log in exception handling processes

improve the error message when functions return failure and dump
relevant registers in some exception handling processes
Signed-off-by: default avatarLuo bin <luobin9@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c15850c7
...@@ -112,6 +112,26 @@ static u32 get_hw_cons_idx(struct hinic_api_cmd_chain *chain) ...@@ -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); 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_busy - check if the chain is still processing last requests
* @chain: chain to check * @chain: chain to check
...@@ -131,8 +151,10 @@ static int chain_busy(struct hinic_api_cmd_chain *chain) ...@@ -131,8 +151,10 @@ static int chain_busy(struct hinic_api_cmd_chain *chain)
/* check for a space for a new command */ /* check for a space for a new command */
if (chain->cons_idx == MASKED_IDX(chain, prod_idx + 1)) { if (chain->cons_idx == MASKED_IDX(chain, prod_idx + 1)) {
dev_err(&pdev->dev, "API CMD chain %d is busy\n", dev_err(&pdev->dev, "API CMD chain %d is busy, cons_idx: %d, prod_idx: %d\n",
chain->chain_type); chain->chain_type, chain->cons_idx,
chain->prod_idx);
dump_api_chain_reg(chain);
return -EBUSY; return -EBUSY;
} }
break; break;
...@@ -332,6 +354,7 @@ static int wait_for_api_cmd_completion(struct hinic_api_cmd_chain *chain) ...@@ -332,6 +354,7 @@ static int wait_for_api_cmd_completion(struct hinic_api_cmd_chain *chain)
err = wait_for_status_poll(chain); err = wait_for_status_poll(chain);
if (err) { if (err) {
dev_err(&pdev->dev, "API CMD Poll status timeout\n"); dev_err(&pdev->dev, "API CMD Poll status timeout\n");
dump_api_chain_reg(chain);
break; break;
} }
break; break;
......
...@@ -103,10 +103,14 @@ ...@@ -103,10 +103,14 @@
HINIC_API_CMD_STATUS_HEADER_##member##_MASK) HINIC_API_CMD_STATUS_HEADER_##member##_MASK)
#define HINIC_API_CMD_STATUS_CONS_IDX_SHIFT 0 #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_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_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_CHKSUM_ERR_MASK 0x3
#define HINIC_API_CMD_STATUS_CPLD_ERR_MASK 0x1U
#define HINIC_API_CMD_STATUS_GET(val, member) \ #define HINIC_API_CMD_STATUS_GET(val, member) \
(((val) >> HINIC_API_CMD_STATUS_##member##_SHIFT) & \ (((val) >> HINIC_API_CMD_STATUS_##member##_SHIFT) & \
......
...@@ -401,6 +401,7 @@ static int cmdq_sync_cmd_direct_resp(struct hinic_cmdq *cmdq, ...@@ -401,6 +401,7 @@ static int cmdq_sync_cmd_direct_resp(struct hinic_cmdq *cmdq,
spin_unlock_bh(&cmdq->cmdq_lock); spin_unlock_bh(&cmdq->cmdq_lock);
hinic_dump_ceq_info(cmdq->hwdev);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
...@@ -807,6 +808,7 @@ static int init_cmdqs_ctxt(struct hinic_hwdev *hwdev, ...@@ -807,6 +808,7 @@ static int init_cmdqs_ctxt(struct hinic_hwdev *hwdev,
cmdq_type = HINIC_CMDQ_SYNC; cmdq_type = HINIC_CMDQ_SYNC;
for (; cmdq_type < HINIC_MAX_CMDQ_TYPES; cmdq_type++) { for (; cmdq_type < HINIC_MAX_CMDQ_TYPES; cmdq_type++) {
cmdqs->cmdq[cmdq_type].hwdev = hwdev;
err = init_cmdq(&cmdqs->cmdq[cmdq_type], err = init_cmdq(&cmdqs->cmdq[cmdq_type],
&cmdqs->saved_wqs[cmdq_type], cmdq_type, &cmdqs->saved_wqs[cmdq_type], cmdq_type,
db_area[cmdq_type]); db_area[cmdq_type]);
......
...@@ -130,6 +130,8 @@ struct hinic_cmdq_ctxt { ...@@ -130,6 +130,8 @@ struct hinic_cmdq_ctxt {
}; };
struct hinic_cmdq { struct hinic_cmdq {
struct hinic_hwdev *hwdev;
struct hinic_wq *wq; struct hinic_wq *wq;
enum hinic_cmdq_type cmdq_type; enum hinic_cmdq_type cmdq_type;
......
...@@ -258,9 +258,9 @@ static int init_fw_ctxt(struct hinic_hwdev *hwdev) ...@@ -258,9 +258,9 @@ static int init_fw_ctxt(struct hinic_hwdev *hwdev)
&fw_ctxt, sizeof(fw_ctxt), &fw_ctxt, sizeof(fw_ctxt),
&fw_ctxt, &out_size); &fw_ctxt, &out_size);
if (err || (out_size != sizeof(fw_ctxt)) || fw_ctxt.status) { if (err || (out_size != sizeof(fw_ctxt)) || fw_ctxt.status) {
dev_err(&pdev->dev, "Failed to init FW ctxt, ret = %d\n", dev_err(&pdev->dev, "Failed to init FW ctxt, err: %d, status: 0x%x, out size: 0x%x\n",
fw_ctxt.status); err, fw_ctxt.status, out_size);
return -EFAULT; return -EIO;
} }
return 0; return 0;
...@@ -425,9 +425,9 @@ static int get_base_qpn(struct hinic_hwdev *hwdev, u16 *base_qpn) ...@@ -425,9 +425,9 @@ static int get_base_qpn(struct hinic_hwdev *hwdev, u16 *base_qpn)
&cmd_base_qpn, sizeof(cmd_base_qpn), &cmd_base_qpn, sizeof(cmd_base_qpn),
&cmd_base_qpn, &out_size); &cmd_base_qpn, &out_size);
if (err || (out_size != sizeof(cmd_base_qpn)) || cmd_base_qpn.status) { if (err || (out_size != sizeof(cmd_base_qpn)) || cmd_base_qpn.status) {
dev_err(&pdev->dev, "Failed to get base qpn, status = %d\n", dev_err(&pdev->dev, "Failed to get base qpn, err: %d, status: 0x%x, out size: 0x%x\n",
cmd_base_qpn.status); err, cmd_base_qpn.status, out_size);
return -EFAULT; return -EIO;
} }
*base_qpn = cmd_base_qpn.qpn; *base_qpn = cmd_base_qpn.qpn;
......
...@@ -953,3 +953,42 @@ void hinic_ceqs_free(struct hinic_ceqs *ceqs) ...@@ -953,3 +953,42 @@ void hinic_ceqs_free(struct hinic_ceqs *ceqs)
for (q_id = 0; q_id < ceqs->num_ceqs; q_id++) for (q_id = 0; q_id < ceqs->num_ceqs; q_id++)
remove_eq(&ceqs->ceq[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));
}
}
...@@ -162,7 +162,7 @@ enum hinic_eqe_state { ...@@ -162,7 +162,7 @@ enum hinic_eqe_state {
struct hinic_aeq_elem { struct hinic_aeq_elem {
u8 data[HINIC_AEQE_DATA_SIZE]; u8 data[HINIC_AEQE_DATA_SIZE];
u32 desc; __be32 desc;
}; };
struct hinic_eq_work { struct hinic_eq_work {
...@@ -254,4 +254,8 @@ int hinic_ceqs_init(struct hinic_ceqs *ceqs, struct hinic_hwif *hwif, ...@@ -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_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 #endif
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
#define WAIT_HWIF_READY_TIMEOUT 10000 #define WAIT_HWIF_READY_TIMEOUT 10000
#define HINIC_SELFTEST_RESULT 0x883C
/** /**
* hinic_msix_attr_set - set message attribute for msix entry * hinic_msix_attr_set - set message attribute for msix entry
* @hwif: the HW interface of a pci function device * @hwif: the HW interface of a pci function device
...@@ -369,6 +371,26 @@ u16 hinic_pf_id_of_vf_hw(struct hinic_hwif *hwif) ...@@ -369,6 +371,26 @@ u16 hinic_pf_id_of_vf_hw(struct hinic_hwif *hwif)
return HINIC_FA0_GET(attr0, PF_IDX); 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 * hinic_init_hwif - initialize the hw interface
* @hwif: the HW interface of a pci function device * @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) ...@@ -398,6 +420,7 @@ int hinic_init_hwif(struct hinic_hwif *hwif, struct pci_dev *pdev)
err = wait_hwif_ready(hwif); err = wait_hwif_ready(hwif);
if (err) { if (err) {
dev_err(&pdev->dev, "HW interface is not ready\n"); dev_err(&pdev->dev, "HW interface is not ready\n");
__print_selftest_reg(hwif);
goto err_hwif_ready; goto err_hwif_ready;
} }
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
#include <linux/types.h> #include <linux/types.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#define HINIC_PCIE_LINK_DOWN 0xFFFFFFFF
#define HINIC_DMA_ATTR_ST_SHIFT 0 #define HINIC_DMA_ATTR_ST_SHIFT 0
#define HINIC_DMA_ATTR_AT_SHIFT 8 #define HINIC_DMA_ATTR_AT_SHIFT 8
#define HINIC_DMA_ATTR_PH_SHIFT 10 #define HINIC_DMA_ATTR_PH_SHIFT 10
...@@ -249,13 +251,17 @@ struct hinic_hwif { ...@@ -249,13 +251,17 @@ struct hinic_hwif {
static inline u32 hinic_hwif_read_reg(struct hinic_hwif *hwif, u32 reg) 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, static inline void hinic_hwif_write_reg(struct hinic_hwif *hwif, u32 reg,
u32 val) 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, int hinic_msix_attr_set(struct hinic_hwif *hwif, u16 msix_index,
......
...@@ -650,6 +650,7 @@ wait_for_mbox_seg_completion(struct hinic_mbox_func_to_func *func_to_func, ...@@ -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)) { if (!wait_for_completion_timeout(done, jif)) {
dev_err(&hwdev->hwif->pdev->dev, "Send mailbox segment timeout\n"); dev_err(&hwdev->hwif->pdev->dev, "Send mailbox segment timeout\n");
dump_mox_reg(hwdev); dump_mox_reg(hwdev);
hinic_dump_aeq_info(hwdev);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
...@@ -897,6 +898,7 @@ int hinic_mbox_to_func(struct hinic_mbox_func_to_func *func_to_func, ...@@ -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); set_mbox_to_func_event(func_to_func, EVENT_TIMEOUT);
dev_err(&func_to_func->hwif->pdev->dev, dev_err(&func_to_func->hwif->pdev->dev,
"Send mbox msg timeout, msg_id: %d\n", msg_info.msg_id); "Send mbox msg timeout, msg_id: %d\n", msg_info.msg_id);
hinic_dump_aeq_info(func_to_func->hwdev);
err = -ETIMEDOUT; err = -ETIMEDOUT;
goto err_send_mbox; goto err_send_mbox;
} }
......
...@@ -276,6 +276,7 @@ static int msg_to_mgmt_sync(struct hinic_pf_to_mgmt *pf_to_mgmt, ...@@ -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)) { if (!wait_for_completion_timeout(recv_done, timeo)) {
dev_err(&pdev->dev, "MGMT timeout, MSG id = %d\n", msg_id); dev_err(&pdev->dev, "MGMT timeout, MSG id = %d\n", msg_id);
hinic_dump_aeq_info(pf_to_mgmt->hwdev);
err = -ETIMEDOUT; err = -ETIMEDOUT;
goto unlock_sync_msg; goto unlock_sync_msg;
} }
......
...@@ -61,8 +61,8 @@ static int change_mac(struct hinic_dev *nic_dev, const u8 *addr, ...@@ -61,8 +61,8 @@ static int change_mac(struct hinic_dev *nic_dev, const u8 *addr,
(port_mac_cmd.status && (port_mac_cmd.status &&
port_mac_cmd.status != HINIC_PF_SET_VF_ALREADY && port_mac_cmd.status != HINIC_PF_SET_VF_ALREADY &&
port_mac_cmd.status != HINIC_MGMT_STATUS_EXIST)) { port_mac_cmd.status != HINIC_MGMT_STATUS_EXIST)) {
dev_err(&pdev->dev, "Failed to change MAC, ret = %d\n", dev_err(&pdev->dev, "Failed to change MAC, err: %d, status: 0x%x, out size: 0x%x\n",
port_mac_cmd.status); err, port_mac_cmd.status, out_size);
return -EFAULT; return -EFAULT;
} }
...@@ -129,8 +129,8 @@ int hinic_port_get_mac(struct hinic_dev *nic_dev, u8 *addr) ...@@ -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, sizeof(port_mac_cmd),
&port_mac_cmd, &out_size); &port_mac_cmd, &out_size);
if (err || (out_size != sizeof(port_mac_cmd)) || port_mac_cmd.status) { if (err || (out_size != sizeof(port_mac_cmd)) || port_mac_cmd.status) {
dev_err(&pdev->dev, "Failed to get mac, ret = %d\n", dev_err(&pdev->dev, "Failed to get mac, err: %d, status: 0x%x, out size: 0x%x\n",
port_mac_cmd.status); err, port_mac_cmd.status, out_size);
return -EFAULT; return -EFAULT;
} }
...@@ -172,9 +172,9 @@ int hinic_port_set_mtu(struct hinic_dev *nic_dev, int new_mtu) ...@@ -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, err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_CHANGE_MTU,
&port_mtu_cmd, sizeof(port_mtu_cmd), &port_mtu_cmd, sizeof(port_mtu_cmd),
&port_mtu_cmd, &out_size); &port_mtu_cmd, &out_size);
if (err || (out_size != sizeof(port_mtu_cmd)) || port_mtu_cmd.status) { if (err || out_size != sizeof(port_mtu_cmd) || port_mtu_cmd.status) {
dev_err(&pdev->dev, "Failed to set mtu, ret = %d\n", dev_err(&pdev->dev, "Failed to set mtu, err: %d, status: 0x%x, out size: 0x%x\n",
port_mtu_cmd.status); err, port_mtu_cmd.status, out_size);
return -EFAULT; return -EFAULT;
} }
...@@ -264,8 +264,8 @@ int hinic_port_link_state(struct hinic_dev *nic_dev, ...@@ -264,8 +264,8 @@ int hinic_port_link_state(struct hinic_dev *nic_dev,
&link_cmd, sizeof(link_cmd), &link_cmd, sizeof(link_cmd),
&link_cmd, &out_size); &link_cmd, &out_size);
if (err || (out_size != sizeof(link_cmd)) || link_cmd.status) { if (err || (out_size != sizeof(link_cmd)) || link_cmd.status) {
dev_err(&pdev->dev, "Failed to get link state, ret = %d\n", dev_err(&pdev->dev, "Failed to get link state, err: %d, status: 0x%x, out size: 0x%x\n",
link_cmd.status); err, link_cmd.status, out_size);
return -EINVAL; return -EINVAL;
} }
...@@ -298,8 +298,8 @@ int hinic_port_set_state(struct hinic_dev *nic_dev, enum hinic_port_state state) ...@@ -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, sizeof(port_state),
&port_state, &out_size); &port_state, &out_size);
if (err || (out_size != sizeof(port_state)) || port_state.status) { if (err || (out_size != sizeof(port_state)) || port_state.status) {
dev_err(&pdev->dev, "Failed to set port state, ret = %d\n", dev_err(&pdev->dev, "Failed to set port state, err: %d, status: 0x%x, out size: 0x%x\n",
port_state.status); err, port_state.status, out_size);
return -EFAULT; return -EFAULT;
} }
...@@ -330,8 +330,8 @@ int hinic_port_set_func_state(struct hinic_dev *nic_dev, ...@@ -330,8 +330,8 @@ int hinic_port_set_func_state(struct hinic_dev *nic_dev,
&func_state, sizeof(func_state), &func_state, sizeof(func_state),
&func_state, &out_size); &func_state, &out_size);
if (err || (out_size != sizeof(func_state)) || func_state.status) { if (err || (out_size != sizeof(func_state)) || func_state.status) {
dev_err(&pdev->dev, "Failed to set port func state, ret = %d\n", dev_err(&pdev->dev, "Failed to set port func state, err: %d, status: 0x%x, out size: 0x%x\n",
func_state.status); err, func_state.status, out_size);
return -EFAULT; return -EFAULT;
} }
...@@ -361,9 +361,9 @@ int hinic_port_get_cap(struct hinic_dev *nic_dev, ...@@ -361,9 +361,9 @@ int hinic_port_get_cap(struct hinic_dev *nic_dev,
port_cap, &out_size); port_cap, &out_size);
if (err || (out_size != sizeof(*port_cap)) || port_cap->status) { if (err || (out_size != sizeof(*port_cap)) || port_cap->status) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"Failed to get port capabilities, ret = %d\n", "Failed to get port capabilities, err: %d, status: 0x%x, out size: 0x%x\n",
port_cap->status); err, port_cap->status, out_size);
return -EINVAL; return -EIO;
} }
return 0; return 0;
...@@ -393,9 +393,9 @@ int hinic_port_set_tso(struct hinic_dev *nic_dev, enum hinic_tso_state state) ...@@ -393,9 +393,9 @@ int hinic_port_set_tso(struct hinic_dev *nic_dev, enum hinic_tso_state state)
&tso_cfg, &out_size); &tso_cfg, &out_size);
if (err || out_size != sizeof(tso_cfg) || tso_cfg.status) { if (err || out_size != sizeof(tso_cfg) || tso_cfg.status) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"Failed to set port tso, ret = %d\n", "Failed to set port tso, err: %d, status: 0x%x, out size: 0x%x\n",
tso_cfg.status); err, tso_cfg.status, out_size);
return -EINVAL; return -EIO;
} }
return 0; return 0;
...@@ -423,9 +423,9 @@ int hinic_set_rx_csum_offload(struct hinic_dev *nic_dev, u32 en) ...@@ -423,9 +423,9 @@ int hinic_set_rx_csum_offload(struct hinic_dev *nic_dev, u32 en)
&rx_csum_cfg, &out_size); &rx_csum_cfg, &out_size);
if (err || !out_size || rx_csum_cfg.status) { if (err || !out_size || rx_csum_cfg.status) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"Failed to set rx csum offload, ret = %d\n", "Failed to set rx csum offload, err: %d, status: 0x%x, out size: 0x%x\n",
rx_csum_cfg.status); err, rx_csum_cfg.status, out_size);
return -EINVAL; return -EIO;
} }
return 0; return 0;
...@@ -480,9 +480,9 @@ int hinic_set_max_qnum(struct hinic_dev *nic_dev, u8 num_rqs) ...@@ -480,9 +480,9 @@ int hinic_set_max_qnum(struct hinic_dev *nic_dev, u8 num_rqs)
&rq_num, &out_size); &rq_num, &out_size);
if (err || !out_size || rq_num.status) { if (err || !out_size || rq_num.status) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"Failed to rxq number, ret = %d\n", "Failed to set rxq number, err: %d, status: 0x%x, out size: 0x%x\n",
rq_num.status); err, rq_num.status, out_size);
return -EINVAL; return -EIO;
} }
return 0; return 0;
...@@ -508,9 +508,9 @@ static int hinic_set_rx_lro(struct hinic_dev *nic_dev, u8 ipv4_en, u8 ipv6_en, ...@@ -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); &lro_cfg, &out_size);
if (err || !out_size || lro_cfg.status) { if (err || !out_size || lro_cfg.status) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"Failed to set lro offload, ret = %d\n", "Failed to set lro offload, err: %d, status: 0x%x, out size: 0x%x\n",
lro_cfg.status); err, lro_cfg.status, out_size);
return -EINVAL; return -EIO;
} }
return 0; return 0;
...@@ -542,10 +542,10 @@ static int hinic_set_rx_lro_timer(struct hinic_dev *nic_dev, u32 timer_value) ...@@ -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) { if (err || !out_size || lro_timer.status) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"Failed to set lro timer, ret = %d\n", "Failed to set lro timer, err: %d, status: 0x%x, out size: 0x%x\n",
lro_timer.status); err, lro_timer.status, out_size);
return -EINVAL; return -EIO;
} }
return 0; return 0;
......
...@@ -40,9 +40,9 @@ static int hinic_set_mac(struct hinic_hwdev *hwdev, const u8 *mac_addr, ...@@ -40,9 +40,9 @@ static int hinic_set_mac(struct hinic_hwdev *hwdev, const u8 *mac_addr,
if (err || out_size != sizeof(mac_info) || if (err || out_size != sizeof(mac_info) ||
(mac_info.status && mac_info.status != HINIC_PF_SET_VF_ALREADY && (mac_info.status && mac_info.status != HINIC_PF_SET_VF_ALREADY &&
mac_info.status != HINIC_MGMT_STATUS_EXIST)) { mac_info.status != HINIC_MGMT_STATUS_EXIST)) {
dev_err(&hwdev->func_to_io.hwif->pdev->dev, "Failed to change MAC, ret = %d\n", dev_err(&hwdev->func_to_io.hwif->pdev->dev, "Failed to set MAC, err: %d, status: 0x%x, out size: 0x%x\n",
mac_info.status); err, mac_info.status, out_size);
return -EFAULT; return -EIO;
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment