From patchwork Tue Sep 19 01:06:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 112957 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4321195qgf; Mon, 18 Sep 2017 18:07:40 -0700 (PDT) X-Google-Smtp-Source: AOwi7QANqDPPjbKcf8BjIlvzhZ0uCl/H4tnU8IUS9i+ctKIXQLVxwAV79Wah7LsAQ3NsrivQcoBV X-Received: by 10.84.194.226 with SMTP id h89mr424826pld.54.1505783260783; Mon, 18 Sep 2017 18:07:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505783260; cv=none; d=google.com; s=arc-20160816; b=mJU7ShHRtGf90ikBCJtMwKff2sTZSWrVZqmeZR1oH/TTX6xnpxtmv+iqPmotG9BjaD sMuR9FKKNPZXlIoNYA7k1ZPk8lux3eCsiKj6IGhsEcFUgePjZsDCqWAT+hCD6YWYPQ4i alESjOFCl4X1taWYRWMetagBSk2629WZHz6hyNoSlL7TOc0uvDALVQg3QWnBp7m39Qhx Osh7H+NUEL6lh38tlRuQMS7nHawu9rQauE4BSed4l8ZG93KqxLdZD8nqzXxZZcl5kH7Z ybnsf9kjpLWoCDOwhA3XCXK/4DiRkadtu1E6IOM5Ryb0imCVb05eeN4ZzplZQCJxQ3XB nBGQ== 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:arc-authentication-results; bh=moXkX7znz709kXZxZLbni7DdUv8/zajUee3L2hf3Ioo=; b=Qsqx/VJEZeq+g0uLCg2OmAnXD30dKeG3JNi6GVnwIyvgscGOvhg1ABguD4J7oVxH/3 gfeMnF9g3LV3GjvBFUEdFnVNhNCxzDt1aMcfJKwM15krGPevWDFuneXU1XOldtXzaioU eX66RyNH3VwwkoqVomXRA8dAniCCp3hYnCccPL6fGn437aKMZvgpm6edMxAbpMsnDTME gdkAkPxMb9GzUTYgQPi6ghh7yd8LXnLWUAaYaT3oIoWrGaCyjZ8DeMu7XLObP1opa6RS 1JF2UiKg27H6T2HCzMgcdrAWdf/hiCF5Vy16SNHtAhXxiEW0c6AlFXsFqvjpghDViC8K eGow== 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 m11si5672403pla.144.2017.09.18.18.07.40; Mon, 18 Sep 2017 18:07:40 -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 S1751572AbdISBHj (ORCPT + 26 others); Mon, 18 Sep 2017 21:07:39 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:6069 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751416AbdISBHd (ORCPT ); Mon, 18 Sep 2017 21:07:33 -0400 Received: from 172.30.72.60 (EHLO DGGEMS411-HUB.china.huawei.com) ([172.30.72.60]) by dggrg05-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DHO21287; Tue, 19 Sep 2017 09:07:31 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.47.92.71) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.301.0; Tue, 19 Sep 2017 09:07:20 +0800 From: Salil Mehta To: CC: , , , , , , , Subject: [PATCH net 4/7] net: hns3: fix a bug of set mac address Date: Tue, 19 Sep 2017 02:06:25 +0100 Message-ID: <20170919010628.175732-5-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20170919010628.175732-1-salil.mehta@huawei.com> References: <20170919010628.175732-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.47.92.71] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020201.59C06DD3.0133, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: a2efa8880ab61e8574fc0bdad7b666d8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lipeng HNS3 driver get mac address from NCL_config file and set the mac address to HW. If the mac address in NCL_config is invalid, driver will set a random mac address, and use this address. The current code will set random mac address to HW, but will not set the valid mac address from NCL_config file to HW. This patch fix the bug. Signed-off-by: Lipeng Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.11.0 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c index 1c3e29447891..4d68d6ea5143 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c @@ -2705,10 +2705,11 @@ static void hns3_init_mac_addr(struct net_device *netdev) eth_hw_addr_random(netdev); dev_warn(priv->dev, "using random MAC address %pM\n", netdev->dev_addr); - /* Also copy this new MAC address into hdev */ - if (h->ae_algo->ops->set_mac_addr) - h->ae_algo->ops->set_mac_addr(h, netdev->dev_addr); } + + if (h->ae_algo->ops->set_mac_addr) + h->ae_algo->ops->set_mac_addr(h, netdev->dev_addr); + } static void hns3_nic_set_priv_ops(struct net_device *netdev)