Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1093067imm; Wed, 26 Sep 2018 11:30:32 -0700 (PDT) X-Google-Smtp-Source: ACcGV63oA6x5VvKs6+K6xGMMsMLvmlcCVw+Pd1yDqFR9ZlvlKuTsL80dSQigCaBtDaVwomxm35Wh X-Received: by 2002:a63:fb54:: with SMTP id w20-v6mr1361300pgj.321.1537986632224; Wed, 26 Sep 2018 11:30:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537986632; cv=none; d=google.com; s=arc-20160816; b=LFRP3lZJP8jkljQIJSMqA+ln87CGIEtL5rmnuVy9cqfIthxP0Ik/CA7GUW4Bb9qufy GS9Ts/lU/rCKsqU7tq4rAl7w+fyWdI1vt3zVgODw9vz9g/pvPE46/2mVk3ABvSDFRVTd Qp0sagR/CbAskCJXTFSJDOJLbFNISnGzdUfYNE/Hk98nOzQH2a7ke19WgdgnVnWEEWa/ XWgB8FeCD2cuPNHYwBu4uW4vM+Wk2A7HvIaE4g5OYKOCSTx0P2XH4gkeQhuYK+qlxMgy tfOWL0YBirxrFfWo2B1S9clBkdleOAfS6nzgTIwB9uNynLX0gzcwMJ6mrAJPs/3vdD93 ZvzQ== 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=X8sAeipC2Qc9Qzs8ZYAuxK4xDa55tWI+CeqAY4JTTuQ=; b=Pl7ToWKbeZjiZl+YIsdgpxoHA9dGccb1IVMqhHopGQuJRj0iCLD/SVS58Wc9jZzFuf 5ZbpAXq/gj4khyP+7zReoKs8qUvRGirF0Am0RwWm9toUPPrx25D3tVZUJMlz3o1R45sK /Hh9KX2xxvy+QnH/ckGHMj7D3yNMYUzzp08jo1R9D6gra9EpdJEotmtrmMkdiKOoQnc0 syL434ZIeAX1V8cQcWbnNMIPKIrnZuKLr2g6YghgYbhmDIW8r73yZdIZsseRFPkYz4ai +fmDJnPG5xL0Ex+PblqHfV63cGZQkDxMyAATUVrj1OFVpIqyMFsN/0yAgsoPwG7lItUu ntVA== 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 h18-v6si5375705pgl.398.2018.09.26.11.30.17; Wed, 26 Sep 2018 11:30:32 -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 S1728900AbeI0AoG (ORCPT + 99 others); Wed, 26 Sep 2018 20:44:06 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:13156 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728845AbeI0AoG (ORCPT ); Wed, 26 Sep 2018 20:44:06 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id A1F2259504C68; Thu, 27 Sep 2018 02:29:48 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.226.54) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.399.0; Thu, 27 Sep 2018 02:29:40 +0800 From: Salil Mehta To: CC: , , , , , , , Yunsheng Lin Subject: [PATCH net-next 07/10] net: hns3: Fix for netdev not up problem when setting mtu Date: Wed, 26 Sep 2018 19:28:37 +0100 Message-ID: <20180926182840.28392-8-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180926182840.28392-1-salil.mehta@huawei.com> References: <20180926182840.28392-1-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.202.226.54] 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 3fc3822..545777a 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.7.4