From patchwork Wed Sep 26 18:28:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 147622 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp1058682lji; Wed, 26 Sep 2018 11:29:55 -0700 (PDT) X-Google-Smtp-Source: ACcGV61wU3Sg63XCtQJiuGbzTQ1IT46uWw5I/pDSedo19ERAGWLNjfTyf9+l2OcZ1KDLA//LvpwC X-Received: by 2002:a63:1752:: with SMTP id 18-v6mr6817959pgx.131.1537986595094; Wed, 26 Sep 2018 11:29:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537986595; cv=none; d=google.com; s=arc-20160816; b=uRse3aPgxoCYJpfkvn6S3vrL0SFNuiaY+WvSH2fVA4z3f8yco32R5Gb+wkIBMrykkj LNsZSE3is8d4nfbOoI2+mH2VYk4K6FONwBsxDbWa5GToZ0Uosc0W5NvMIe1zt2iIoEYj gdlMb1c05h4UEeNVrDKwaLUCoAZNqjeQHQal4f0/jMQqA6qGhQNQz8+GBNjqqW4TAV3B qwsr3dvVlaCEle1TaOikBRUOhiJ+B2yL8sG/drRUpeCE7SDllsAXeYcUDOeKAvnQxvPU C7CWz+aeInXXOx2IJukQe8HZSUQ8HVIohyzslvA1FJT25YX195oXJ/aW5YAY8QQfG6EO Bnlg== 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 q24-v6si5936288pgb.11.2018.09.26.11.29.54; Wed, 26 Sep 2018 11:29:55 -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 S1728909AbeI0AoG (ORCPT + 32 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 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(-) -- 2.7.4 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))