Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1980607imm; Sat, 29 Sep 2018 07:59:34 -0700 (PDT) X-Google-Smtp-Source: ACcGV60RD78DzdRXgw3kq/6KeL0YS82VUslt8BkYF5LmrwDc7WyvKnXxIZmdMEvWgJ76soB6TXdh X-Received: by 2002:a63:4443:: with SMTP id t3-v6mr3247282pgk.102.1538233174370; Sat, 29 Sep 2018 07:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538233174; cv=none; d=google.com; s=arc-20160816; b=CR74802pJJXCPCmhhFAhI8bVSw8HXkamwuC0xokf9XhwZMVuSdlARvdNw6ZatMgkZE Nubg+si9sP2BZXuJoa7BbjF61tg+MqP5Def+LNNTbf7DnBgdmqdZ4AsEf+edWXk8O9up Z76Uhxh/HQVCBjssYN3fsWI7+Fmik2yYCmIu1Ar3gY8GGHtCypbdlQ7d/QoHN4oke5WA Pf4Byw/uea/B0f4rRevQzhwJE+x60pigSmlTTSBIGGz6bA/ZEwUseU8Lv7PQL1W0boHD A/PjmdXwl0Q0KW/3fnYIY7BMhtMLhlVd317tQjrFJLu0CNQ7xkkGXQwz3ppSc+iGGJ4d 2h4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=su7FeHs6PSsjf5lW095kR9vnHle3boB/p0nzTR/fFwQ=; b=mJ1NCObOqDxgeA+dyBoQd4Mm7NVi+LX3KtpEXgQ/viNmBEQPDGcbiyxOqwQbU5jLFN dXLrwhTnmA3Ae2c9JLdX7DO8mP6HYd9KMvtiGhANbAILUoZ2keXk9tMN+HR5VsHMjni9 +vwCVVk7bG5r2xK9AZ5K+kn6aod4m8WVgIGxfGs781ugUfEo7+x5RErLRlWcNIrLKFhh 3ADIJa0ynKkJd7oZOlj+jgRgzq4j+DW/+7q8k6ZJccRDez5FRXU45lq+X6zGmqK/eZXl RTTkeowrRxB26UBvBeE5LDosmRZXnvD3MmRBYuEeDmTL+Scn23Y2U4Sl2+fNUJ6AxU0z dUQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q8-v6si7691185pgc.347.2018.09.29.07.59.20; Sat, 29 Sep 2018 07:59:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728535AbeI2V1n (ORCPT + 99 others); Sat, 29 Sep 2018 17:27:43 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:13175 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728477AbeI2V1n (ORCPT ); Sat, 29 Sep 2018 17:27:43 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 1A8B739F00E61; Sat, 29 Sep 2018 22:58:52 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.47.85.66) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.399.0; Sat, 29 Sep 2018 22:58:47 +0800 From: Salil Mehta To: CC: , , , , , , , Yunsheng Lin Subject: [PATCH V2 net-next 07/10] net: hns3: Fix for netdev not up problem when setting mtu Date: Sat, 29 Sep 2018 15:56:19 +0100 Message-ID: <20180929145622.5448-8-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180929145622.5448-1-salil.mehta@huawei.com> References: <20180929145622.5448-1-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.47.85.66] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yunsheng Lin Currently hns3_nic_change_mtu will try to down the netdev before setting mtu, and it does not up the netdev when the setting fails, which causes netdev not up problem. This patch fixes it by not returning when the setting fails. Fixes: a8e8b7ff3517 ("net: hns3: Add support to change MTU in HNS3 hardware") Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 3fc38228f459..545777ae2bc6 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -1491,13 +1491,11 @@ static int hns3_nic_change_mtu(struct net_device *netdev, int new_mtu) } ret = h->ae_algo->ops->set_mtu(h, new_mtu); - if (ret) { + if (ret) netdev_err(netdev, "failed to change MTU in hardware %d\n", ret); - return ret; - } - - netdev->mtu = new_mtu; + else + netdev->mtu = new_mtu; /* if the netdev was running earlier, bring it up again */ if (if_running && hns3_nic_net_open(netdev)) -- 2.11.0