提交 b88d1be3 编写于 作者: H Huazhong Tan 提交者: Xie XiuQi

net: hns3: add a reset_done interface to notify reset result

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA
Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
Reviewed-by: Ntianjinchuan1 <tianjinchuan1@huawei.com>
Reviewed-by: Nlipeng <lipeng321@huawei.com>
Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 537964d2
......@@ -477,7 +477,7 @@ struct hnae3_ae_ops {
u16 (*get_global_queue_id)(struct hnae3_handle *handle, u16 queue_id);
int (*mac_connect_phy)(struct hnae3_handle *handle);
void (*mac_disconnect_phy)(struct hnae3_handle *handle);
bool (*reset_fail)(struct hnae3_handle *handle);
bool (*reset_done)(struct hnae3_handle *handle, bool done);
void (*restore_vlan_table)(struct hnae3_handle *handle);
#ifdef CONFIG_HNS3_TEST
int (*send_cmdq)(struct hnae3_handle *handle, void *data, int num);
......
......@@ -376,7 +376,6 @@ int hclge_cmd_init(struct hclge_dev *hdev)
* reset may happen when lower level reset is being processed.
*/
if ((hclge_is_reset_pending(hdev))) {
set_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state);
ret = -EBUSY;
goto err_cmd_init;
}
......
......@@ -2885,8 +2885,8 @@ static bool hclge_reset_err_handle(struct hclge_dev *hdev, bool is_timeout)
hclge_clear_reset_cause(hdev);
if (handle && handle->ae_algo->ops->reset_fail)
handle->ae_algo->ops->reset_fail(handle);
if (handle && handle->ae_algo->ops->reset_done)
handle->ae_algo->ops->reset_done(handle, false);
return false;
}
......@@ -3005,9 +3005,10 @@ static void hclge_reset(struct hclge_dev *hdev)
hdev->reset_fail_cnt = 0;
hdev->rst_stats.reset_done_cnt++;
ae_dev->reset_type = HNAE3_NONE_RESET;
del_timer(&hdev->reset_timer);
if (handle && handle->ae_algo->ops->reset_fail)
handle->ae_algo->ops->reset_fail(handle);
if (handle && handle->ae_algo->ops->reset_done)
handle->ae_algo->ops->reset_done(handle, true);
return;
......@@ -3079,17 +3080,15 @@ static void hclge_reset_timer(struct timer_list *t)
hclge_reset_event(hdev->pdev, NULL);
}
bool hclge_reset_fail(struct hnae3_handle *handle)
bool hclge_reset_done(struct hnae3_handle *handle, bool done)
{
struct hclge_vport *vport = hclge_get_vport(handle);
struct hclge_dev *hdev = vport->back;
if (hdev->reset_fail_cnt >= HCLGE_RESET_MAX_FAIL_CNT) {
if (hdev->reset_fail_cnt >= HCLGE_RESET_MAX_FAIL_CNT)
dev_err(&hdev->pdev->dev, "Reset fail!\n");
return false;
}
return true;
return done;
}
static void hclge_reset_subtask(struct hclge_dev *hdev)
......@@ -8927,7 +8926,7 @@ struct hnae3_ae_ops hclge_ops = {
.get_global_queue_id = hclge_covert_handle_qid_global,
.mac_connect_phy = hclge_mac_connect_phy,
.mac_disconnect_phy = hclge_mac_disconnect_phy,
.reset_fail = hclge_reset_fail,
.reset_done = hclge_reset_done,
.restore_vlan_table = hclge_restore_vlan_table,
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册