From: shenhao shenhao21@huawei.com
driver inclusion category: bugfix bugzilla: NA CVE: NA
--------------------------------------------
This patch fixes the following two points: 1. Net device can not change mtu with stream. So if 'net stop' failed, mtu setting should abort. this patch fixes this. 2. Fixes some coding style with the location of parameter.
Signed-off-by: Guojia Liao liaoguojia@huawei.com Signed-off-by: shenhao shenhao21@huawei.com Reviewed-by: Zhong Zhaohui zhongzhaohui@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 1fef35f..eb2c6ef 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -5286,10 +5286,10 @@ static int hclge_config_key(struct hclge_dev *hdev, u8 stage, struct hclge_fd_key_cfg *key_cfg = &hdev->fd_cfg.key_cfg[stage]; u8 key_x[MAX_KEY_BYTES], key_y[MAX_KEY_BYTES]; u8 *cur_key_x, *cur_key_y; - unsigned int i; - int ret; u8 meta_data_region; u8 tuple_size; + int ret; + u32 i;
memset(key_x, 0, sizeof(key_x)); memset(key_y, 0, sizeof(key_y)); @@ -9431,7 +9431,11 @@ int hclge_set_vport_mtu(struct hclge_vport *vport, int new_mtu) return -EINVAL; }
- hclge_notify_client(hdev, HNAE3_DOWN_CLIENT); + ret = hclge_notify_client(hdev, HNAE3_DOWN_CLIENT); + if (ret) { + mutex_unlock(&hdev->vport_lock); + return ret; + }
ret = hclge_set_mac_mtu(hdev, max_frm_size); if (ret) {