Commit d1cb8494 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'fix-some-issues-in-huawei-hinic-driver'

Zhengchao Shao says:

====================
fix some issues in Huawei hinic driver

Fix some issues in Huawei hinic driver. This patchset is compiled only,
not tested.
====================

Link: https://lore.kernel.org/r/20221019095754.189119-1-shaozhengchao@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 4a7a8304 8ec2f4c6
......@@ -85,6 +85,7 @@ static int hinic_dbg_get_func_table(struct hinic_dev *nic_dev, int idx)
struct tag_sml_funcfg_tbl *funcfg_table_elem;
struct hinic_cmd_lt_rd *read_data;
u16 out_size = sizeof(*read_data);
int ret = ~0;
int err;
read_data = kzalloc(sizeof(*read_data), GFP_KERNEL);
......@@ -111,20 +112,25 @@ static int hinic_dbg_get_func_table(struct hinic_dev *nic_dev, int idx)
switch (idx) {
case VALID:
return funcfg_table_elem->dw0.bs.valid;
ret = funcfg_table_elem->dw0.bs.valid;
break;
case RX_MODE:
return funcfg_table_elem->dw0.bs.nic_rx_mode;
ret = funcfg_table_elem->dw0.bs.nic_rx_mode;
break;
case MTU:
return funcfg_table_elem->dw1.bs.mtu;
ret = funcfg_table_elem->dw1.bs.mtu;
break;
case RQ_DEPTH:
return funcfg_table_elem->dw13.bs.cfg_rq_depth;
ret = funcfg_table_elem->dw13.bs.cfg_rq_depth;
break;
case QUEUE_NUM:
return funcfg_table_elem->dw13.bs.cfg_q_num;
ret = funcfg_table_elem->dw13.bs.cfg_q_num;
break;
}
kfree(read_data);
return ~0;
return ret;
}
static ssize_t hinic_dbg_cmd_read(struct file *filp, char __user *buffer, size_t count,
......
......@@ -924,7 +924,7 @@ int hinic_init_cmdqs(struct hinic_cmdqs *cmdqs, struct hinic_hwif *hwif,
err_set_cmdq_depth:
hinic_ceq_unregister_cb(&func_to_io->ceqs, HINIC_CEQ_CMDQ);
free_cmdq(&cmdqs->cmdq[HINIC_CMDQ_SYNC]);
err_cmdq_ctxt:
hinic_wqs_cmdq_free(&cmdqs->cmdq_pages, cmdqs->saved_wqs,
HINIC_MAX_CMDQ_TYPES);
......
......@@ -877,7 +877,7 @@ int hinic_set_interrupt_cfg(struct hinic_hwdev *hwdev,
if (err)
return -EINVAL;
interrupt_info->lli_credit_cnt = temp_info.lli_timer_cnt;
interrupt_info->lli_credit_cnt = temp_info.lli_credit_cnt;
interrupt_info->lli_timer_cnt = temp_info.lli_timer_cnt;
err = hinic_msg_to_mgmt(&pfhwdev->pf_to_mgmt, HINIC_MOD_COMM,
......
......@@ -1174,7 +1174,6 @@ int hinic_vf_func_init(struct hinic_hwdev *hwdev)
dev_err(&hwdev->hwif->pdev->dev,
"Failed to register VF, err: %d, status: 0x%x, out size: 0x%x\n",
err, register_info.status, out_size);
hinic_unregister_vf_mbox_cb(hwdev, HINIC_MOD_L2NIC);
return -EIO;
}
} else {
......
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