From patchwork Tue Sep 19 01:06:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 112960 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4321565qgf; Mon, 18 Sep 2017 18:08:10 -0700 (PDT) X-Google-Smtp-Source: AOwi7QA6xRcp5e3YVKO/HJDTaXCHJoFmjNkY7TgtqnAtgXJl7LCkANxcIm6sPEVyUSO1ZTCkvZP4 X-Received: by 10.101.93.5 with SMTP id e5mr409000pgr.55.1505783290717; Mon, 18 Sep 2017 18:08:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505783290; cv=none; d=google.com; s=arc-20160816; b=zWEDa8Pm+QUbfL3VHb2XA7NBB9ITRukVKhtLjiX3Zsx5j9dTDrp0tefBI/rUXGmU7D IxkWszM/H2TzBMkPHU3o0xZDKml88dIHXnggBqxPlUQP+W1vWwuRm3rRV6L9ViOiyG0F Y8SSCgXCDVgF8s1fWwb9tA45BrqEKPVRnPERPk4UO664j7pd3Fvbc4N6P3tK+hH7msH3 lqzSru8AuUvmWPHr9HKSf/uGRINoElmj/keh2BemSgikJ6GwRiX36q4mqRGjsdBf2iKB zMWSzmTkFqHJ9LUFthU/09W1Bcw7MY5hnjwo0Nlkk+5npzqnI2v2B8G4w7woDKi6Mrtu 2fQQ== 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=G7QLg+CoV855PDFebKzC9TDkrfZOFMabgvy7Laj6TbU=; b=QyiNWREZOhw5ihrEVFXFgEyFRWtUaFyIyl/t5AoL6AYhOt3PAOt1IsNNjDwU2D0m/y IswdaFGGvLaw3pox8FFjzwgILoQWFdHGzfjFvqUejZIalMhLDqYFD0KE6MGquAhS4jSV cYUEC9/9ghVpKdUP3YjrNSaitfme8WJDd6Wfu5Tvll616K05+EITCBQrKWslqpn0Yi4t buTh5/DkZlncefqeqhRRMbjwz4V6vR3Uq102iCP9hJ5FtJTCE8Q07I4b16PiW6HKQKwl 1CF65pEty3sHzkPeZgEOIJhOeNwTBn6YjW5qIleEYhU57+CuU4M7PdSvTPY9xLNkSlVm FEHw== 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 j25si487401pga.60.2017.09.18.18.08.10; Mon, 18 Sep 2017 18:08:10 -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 S1751660AbdISBHt (ORCPT + 26 others); Mon, 18 Sep 2017 21:07:49 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6489 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751610AbdISBHq (ORCPT ); Mon, 18 Sep 2017 21:07:46 -0400 Received: from 172.30.72.58 (EHLO DGGEMS411-HUB.china.huawei.com) ([172.30.72.58]) by dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DHM20745; Tue, 19 Sep 2017 09:07:23 +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:11 +0800 From: Salil Mehta To: CC: , , , , , , , Subject: [PATCH net 1/7] net: hns3: get phy addr from NCL_config Date: Tue, 19 Sep 2017 02:06:22 +0100 Message-ID: <20170919010628.175732-2-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.0A020203.59C06DDD.01BB, 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: 5655954c9c8ac429b7267239b2a7bd24 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lipeng NCL_config file defines phy address for every port. Driver should get phy address from NCL_config file.If do not get the right phy address, every port will use the default phy address 0, different port use the same phy address will cause error. Signed-off-by: Lipeng Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 1 + 1 file changed, 1 insertion(+) -- 2.11.0 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index bb45365fb817..db4e07dac29a 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -1066,6 +1066,7 @@ static int hclge_configure(struct hclge_dev *hdev) for (i = 0; i < ETH_ALEN; i++) hdev->hw.mac.mac_addr[i] = cfg.mac_addr[i]; hdev->hw.mac.media_type = cfg.media_type; + hdev->hw.mac.phy_addr = cfg.phy_addr; hdev->num_desc = cfg.tqp_desc_num; hdev->tm_info.num_pg = 1; hdev->tm_info.num_tc = cfg.tc_num; From patchwork Tue Sep 19 01:06:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 112959 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4321375qgf; Mon, 18 Sep 2017 18:07:54 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBaBkgsz6C/nyEMYwi8U0XNU8lqNxRzL36i3c+dcxpI/TzsyPm98te6d3qER18xyYio5MdZ X-Received: by 10.84.132.34 with SMTP id 31mr388881ple.225.1505783273987; Mon, 18 Sep 2017 18:07:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505783273; cv=none; d=google.com; s=arc-20160816; b=VIjTZElLdQGH3WvuhnccQIdWJi0YAcrgp2vPTPgPOvbAq1UMMtfNf0PJcg3KhjPPc0 e6HQn4P2rt+5++hdJ4Usju8/Ycc1mrK4/XO6z9giFeKPAt55cOeoGJdodfzUriZmGiaG q0z/tlsJKTCILnXBwCJsyt5WZ19Y1Z7oXVvyB1NHclTtHz6/x038FkcE6jNAzB2U+X6J kLKZ0BiUSpN9Kk9oGm2XDQcMVSH37dIF1uPQ2ThR3tM7PBmHO+6WKwCxkavb7urGbvTC U+Jk/dU2fvCX3F/QZI4fTS+r284DqPXJxOHHi2UWPxg7nhuwmMN6zCIrhoS50WnLUfiC GdVA== 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=6SzVnQpyaH83H7IPuUA2YfeFd3VvKf5XA2dQK/KpwGQ=; b=vFS624+8n1xU2iWvfaYjHNLE1VwS9aFQdt8J4kpu7ks34KJg1uALlu3oPLttjKz+qd kH+a3/AdMdOtcA9h+JE0xlv7/pm74nKXFBigUA0t+vT2XKE55IYe1hPqR1qdPPrBfhOY 3vMORdnu1njKpZiTbhuW1yZeAYJ7u3suFGOJ83y4iIYQwxDrQPQwuNXWR+u/dJl0MYcg CM8/rbzdFOhD8pdcxm6Wiy/8RIST0FvOfm534Vaue/IL1B7iqiXUfpGYDH341S+GiTrX pgvJSwcaXXwJT3fAN/26o5ehjTYLnNfyRWR7lmgpkdZwvfvSKqk8gRUDJeSD4OsgU4eh JIMA== 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 k190si470031pfc.298.2017.09.18.18.07.53; Mon, 18 Sep 2017 18:07:53 -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 S1751687AbdISBHv (ORCPT + 26 others); Mon, 18 Sep 2017 21:07:51 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6488 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751609AbdISBHq (ORCPT ); Mon, 18 Sep 2017 21:07:46 -0400 Received: from 172.30.72.58 (EHLO DGGEMS411-HUB.china.huawei.com) ([172.30.72.58]) by dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DHM20743; Tue, 19 Sep 2017 09:07:23 +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:14 +0800 From: Salil Mehta To: CC: , , , , , , , Subject: [PATCH net 2/7] net: hns3: fix the command used to unmap ring from vector Date: Tue, 19 Sep 2017 02:06:23 +0100 Message-ID: <20170919010628.175732-3-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.0A020204.59C06DDD.01BC, 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: 3d5bbc83020cb00ec7d2b30e8c99cd20 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lipeng When unmap ring from vector, it use wrong command, this will cause error if the unmap action need multi command description. This patch fix the error. Signed-off-by: Lipeng Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.11.0 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index db4e07dac29a..e324bc6e9f4f 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2779,7 +2779,7 @@ static int hclge_unmap_ring_from_vector( } i = 0; hclge_cmd_setup_basic_desc(&desc, - HCLGE_OPC_ADD_RING_TO_VECTOR, + HCLGE_OPC_DEL_RING_TO_VECTOR, false); req->int_vector_id = vector_id; } From patchwork Tue Sep 19 01:06:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 112956 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4321101qgf; Mon, 18 Sep 2017 18:07:32 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDJNnS4whw7mA8UJd6Px7Lhkts+l7Rim4hulYM7BeX/mXDYAl2xf7F1STJMzjf0E+erL4b4 X-Received: by 10.99.100.131 with SMTP id y125mr401488pgb.161.1505783252736; Mon, 18 Sep 2017 18:07:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505783252; cv=none; d=google.com; s=arc-20160816; b=ijcKI/oPSkGHdm2POM+YeH44mhy8/hSBcs0lQiZ/EkHVWMkBQxw+BmW1NbYVy2Ylmf czHpzw+ftUQ2qWpEHjTpcYsfPwasjzPxee4G0RKhJgATp3pkNAHOiBDmViBsp20W5uEt ELdEaBIg1R0VGJTz8dXRxK+96BmXKY9CbI3TrOWJ27wjLK2+cv9Oo8UgJ91/XQP9ambr 03BvPTy1JPohUjOK5mTrg9rmQLvImz1BnFJFyMIpq4KeOz6L6syVSOF3zT5f91ye2UWM sEI5VV0iY8Sm2o7yl9W1/34thkiaqT9cSGBx1QW8GVd36YHfeLK5GlqbgDAX6RGjj+Md 8gFw== 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=ceeSwaX2pvydujlOOpi1BHbs6l1/uUsk1lRMaRUO3bc=; b=ZEUfHo2dJ6h0GYlBjHPHo2yUrb92mIu6ryq5VovHiY0nlXXkuydESFy1zfDaGdiSjL jylHdNlkRFhVurcc95tqqOHmZZ7Wo3zHq18z76TBKnrleizcWXLZMcUrshujnJrQwP2M sTJcv9+SmU2one8ky8u65WhYIwvfUN2Dmp8M2v0HOUpvJiJASWfhIgs6TXsFDhjw+PiT tpzBZueECpKKNoH043lGofxhi/gzq5cZxD2IX7hLlJZcYGEomdT3qwSjEQqWUnTPQDkC fH4H+5pEtJVV3StT/hC/F9WduhfvPQXdWgrOxgCfe51gzrEASusr9BNLWu09Q05Conmb Y2pQ== 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 y7si458724pfy.161.2017.09.18.18.07.32; Mon, 18 Sep 2017 18:07: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 S1751411AbdISBHb (ORCPT + 26 others); Mon, 18 Sep 2017 21:07:31 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:6068 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751283AbdISBH2 (ORCPT ); Mon, 18 Sep 2017 21:07:28 -0400 Received: from 172.30.72.59 (EHLO DGGEMS411-HUB.china.huawei.com) ([172.30.72.59]) by dggrg05-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DHO21277; Tue, 19 Sep 2017 09:07:26 +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:17 +0800 From: Salil Mehta To: CC: , , , , , , , , Mingguang Qu Subject: [PATCH net 3/7] net: hns3: Fix ring and vector map command Date: Tue, 19 Sep 2017 02:06:24 +0100 Message-ID: <20170919010628.175732-4-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.0A020206.59C06DCE.00C9, 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: 46f6cb5684d4cc80572216f4a2c60ad6 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lipeng This patch add INT_GL and VF id to vector configure when bind ring with vector. INT_GL means Interrupt Gap Limiting. Vector id starts from 0 in each VF, so the bind command must specify VF id. Signed-off-by: Lipeng Signed-off-by: Mingguang Qu Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 8 ++++++-- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 8 ++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) -- 2.11.0 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h index 91ae0135ee50..c2b613b40509 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h @@ -238,7 +238,7 @@ struct hclge_tqp_map { u8 rsv[18]; }; -#define HCLGE_VECTOR_ELEMENTS_PER_CMD 11 +#define HCLGE_VECTOR_ELEMENTS_PER_CMD 10 enum hclge_int_type { HCLGE_INT_TX, @@ -252,8 +252,12 @@ struct hclge_ctrl_vector_chain { #define HCLGE_INT_TYPE_S 0 #define HCLGE_INT_TYPE_M 0x3 #define HCLGE_TQP_ID_S 2 -#define HCLGE_TQP_ID_M (0x3fff << HCLGE_TQP_ID_S) +#define HCLGE_TQP_ID_M (0x7ff << HCLGE_TQP_ID_S) +#define HCLGE_INT_GL_IDX_S 13 +#define HCLGE_INT_GL_IDX_M (0x3 << HCLGE_INT_GL_IDX_S) __le16 tqp_type_and_id[HCLGE_VECTOR_ELEMENTS_PER_CMD]; + u8 vfid; + u8 rsv; }; #define HCLGE_TC_NUM 8 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index e324bc6e9f4f..eafd9c678162 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2680,7 +2680,11 @@ int hclge_map_vport_ring_to_vector(struct hclge_vport *vport, int vector_id, hnae_get_bit(node->flag, HNAE3_RING_TYPE_B)); hnae_set_field(req->tqp_type_and_id[i], HCLGE_TQP_ID_M, HCLGE_TQP_ID_S, node->tqp_index); + hnae_set_field(req->tqp_type_and_id[i], HCLGE_INT_GL_IDX_M, + HCLGE_INT_GL_IDX_S, + hnae_get_bit(node->flag, HNAE3_RING_TYPE_B)); req->tqp_type_and_id[i] = cpu_to_le16(req->tqp_type_and_id[i]); + req->vfid = vport->vport_id; if (++i >= HCLGE_VECTOR_ELEMENTS_PER_CMD) { req->int_cause_num = HCLGE_VECTOR_ELEMENTS_PER_CMD; @@ -2764,8 +2768,12 @@ static int hclge_unmap_ring_from_vector( hnae_get_bit(node->flag, HNAE3_RING_TYPE_B)); hnae_set_field(req->tqp_type_and_id[i], HCLGE_TQP_ID_M, HCLGE_TQP_ID_S, node->tqp_index); + hnae_set_field(req->tqp_type_and_id[i], HCLGE_INT_GL_IDX_M, + HCLGE_INT_GL_IDX_S, + hnae_get_bit(node->flag, HNAE3_RING_TYPE_B)); req->tqp_type_and_id[i] = cpu_to_le16(req->tqp_type_and_id[i]); + req->vfid = vport->vport_id; if (++i >= HCLGE_VECTOR_ELEMENTS_PER_CMD) { req->int_cause_num = HCLGE_VECTOR_ELEMENTS_PER_CMD; 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) From patchwork Tue Sep 19 01:06:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 112962 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4322653qgf; Mon, 18 Sep 2017 18:09:35 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCcat7YDyKNEo+F3lXyEwqpKT2yAMSltCsdn0yfwt1fjTQv1pcBYX8ViCrm0LUb5gjWKv2g X-Received: by 10.84.216.6 with SMTP id m6mr402940pli.143.1505783375257; Mon, 18 Sep 2017 18:09:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505783375; cv=none; d=google.com; s=arc-20160816; b=zEjQ87uUmBgZOnwJ5FzHIwPQhP9f/fhQPdjUNlyenP42TDehtR9013w84AHp0joMFr 3j8+oOpbLFbr4bJlYu+ubiunCtxEMI1p6OYJz9y6X3bP9ygunEnu4CR1DeNKTGioNZK6 tl8hiD86pJzFhoopGjJKibpcGjO93BFaeXNWCBq6q3WtLcRWzQC7Sg/l3j9fmFCm463C vR+CsEo6HOSCJycuIafbvYGlQD1p36XRU5fma0gr+pLb8UTPGfrkjS1sYiYy9lnICzOx ou6t8DmEK44RBHjoNB5gpoKWfNUXeOP4bbtn9bgY1FSSxU+9vQo6Rk75a5nGhvMTePCj XEgg== 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=60HPu66eQUZL4Rt+d6kTp8bom0GG2lznsqJLP/KLZkY=; b=I8VzGEOUm9oL6m20uuWQYMmRbcnDKY9Ty4WMlKKMb9VnZBkgb2LundT/R7Z4nQwOa4 Tp9TslmCu+KvrU2B3EIoStWJkfirC1V4kcXOR5XmQUkobW7NtDL+580RrbFTKfrev7e5 bMOX2GBRzRsPnbSR/fVTY4G1/UETt9Ot2Qe7wB3/2GlakprSZNZL9sBnyJksalAmH/dZ WOzU6uc8P2IH1o/yO1jG9TboZf1k5/A9u53ujc9DW6DtJBnWnbz+qRTbez5tA8MYvCOE JVIB0FVRiMEu1Em1OP9IVFgWzUSUk+elTkl+ZseEkAMaGYb/WKDurvf63f1eUfUlki/N rBgw== 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 b14si469476pfe.412.2017.09.18.18.09.35; Mon, 18 Sep 2017 18:09:35 -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 S1751512AbdISBHh (ORCPT + 26 others); Mon, 18 Sep 2017 21:07:37 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:6070 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751431AbdISBHd (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 DHO21288; 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:23 +0800 From: Salil Mehta To: CC: , , , , , , , Subject: [PATCH net 5/7] net: hns3: fixes the ether address copy with more appropriate API Date: Tue, 19 Sep 2017 02:06:26 +0100 Message-ID: <20170919010628.175732-6-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.0A020206.59C06DD3.0172, 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: 3c0644f06c3cf8d70d8bb955b7965edf Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch replaces the ethernet address copy instance with more appropriate ether_addr_copy() function. Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.11.0 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index eafd9c678162..8e172afd4876 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -1063,8 +1063,7 @@ static int hclge_configure(struct hclge_dev *hdev) hdev->base_tqp_pid = 0; hdev->rss_size_max = 1; hdev->rx_buf_len = cfg.rx_buf_len; - for (i = 0; i < ETH_ALEN; i++) - hdev->hw.mac.mac_addr[i] = cfg.mac_addr[i]; + ether_addr_copy(hdev->hw.mac.mac_addr, cfg.mac_addr); hdev->hw.mac.media_type = cfg.media_type; hdev->hw.mac.phy_addr = cfg.phy_addr; hdev->num_desc = cfg.tqp_desc_num; From patchwork Tue Sep 19 01:06:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 112961 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4322053qgf; Mon, 18 Sep 2017 18:08:47 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBHCslE6MoRm5dpfrj1oVAlMBZKbQECP2BkLgZLgDb6ISt+ogI2tUb3CDf7bpScbrABpHcm X-Received: by 10.99.4.7 with SMTP id 7mr395293pge.400.1505783327156; Mon, 18 Sep 2017 18:08:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505783327; cv=none; d=google.com; s=arc-20160816; b=YSB6m6k4TKRl0senBVShgut/YHysvqws1mBJl4mLfDw9Zl38A0HBWuFne5ijPlPwiy e48awbTIY/4KQ+j0wIOn0ZlyIVAR0/5tvWNAC4qzHzmsPLPhoXlSxeHTmGzcAQpulCqT VsYlsXG9W4W7yeCB40q3G4HRPkAiuBoKt4tqRfKEDYekM65g5+3SLTFLKOpvP5LKCzGT m16KEsF1dy0SH31e+IDkG6XAGOWxKuey5SBzwtA9y22bLt7/gv1a9P5cwMMQygpNT/+r 6F3tdRS1rd1a4+F+Vd5Bea7ut/4+cK6AqLB0Pr9TgEmLFKuvDulMxuLm1p0hbfmpY+Nj 2OuA== 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=v3vSCQ/W6pNRQP8YH8CcQbp1qoox3+VEHGRAVlqwZzY=; b=fVytrsspS5ksAAwGs13CdR4iTjWiv9AmF4kWpE4HaC+v8mTsyII40LjhexgS2KOg13 AQTHwE1dqz/D//qLQobIPPRU5nRnc5DGZvOI/pxZPNIybCPnT3AXTZ+5E6jeCyzsPBsr wpbO/2VapQGbc0KOs2JSDi60Mg8sLYkaj2BSu3Wd5JVyPAI/CaeGavF4B8zlC3CRV3fU NMHB8w8C/BRhD5JHIIqV/lb2PiscWyKw3UMzq1ZS0Zw0vmaJbBw5o+R3qT7XtRyg9RQT Y+vMofyZzV9H14zKS8cNfYqY/AzDAws6kmChUsBMrKkGpGGfxb00KcuhNA6OzjK7a1Fj ssjA== 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 t74si494023pgc.205.2017.09.18.18.08.46; Mon, 18 Sep 2017 18:08:47 -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 S1751846AbdISBIp (ORCPT + 26 others); Mon, 18 Sep 2017 21:08:45 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:6072 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751578AbdISBHn (ORCPT ); Mon, 18 Sep 2017 21:07:43 -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 DHO21307; Tue, 19 Sep 2017 09:07:41 +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:31 +0800 From: Salil Mehta To: CC: , , , , , , , Subject: [PATCH net 7/7] net: hns3: Fixes the premature exit of loop when matching clients Date: Tue, 19 Sep 2017 02:06:28 +0100 Message-ID: <20170919010628.175732-8-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.0A020206.59C06DDD.01A1, 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: 20579b3dca37263aa01b11cb1172398e Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lipeng When register/unregister ae_dev, ae_dev should match all client in the client_list. Enet and roce can co-exists together so we should continue checking for enet and roce presence together. So break should not be there. Above caused problems in loading and unloading of modules. Signed-off-by: Lipeng Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hnae3.c | 43 ++++++----------------------- 1 file changed, 9 insertions(+), 34 deletions(-) -- 2.11.0 diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.c b/drivers/net/ethernet/hisilicon/hns3/hnae3.c index 59efbd605416..5bcb2238acb2 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hnae3.c +++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.c @@ -37,20 +37,15 @@ static bool hnae3_client_match(enum hnae3_client_type client_type, } static int hnae3_match_n_instantiate(struct hnae3_client *client, - struct hnae3_ae_dev *ae_dev, - bool is_reg, bool *matched) + struct hnae3_ae_dev *ae_dev, bool is_reg) { int ret; - *matched = false; - /* check if this client matches the type of ae_dev */ if (!(hnae3_client_match(client->type, ae_dev->dev_type) && hnae_get_bit(ae_dev->flag, HNAE3_DEV_INITED_B))) { return 0; } - /* there is a match of client and dev */ - *matched = true; /* now, (un-)instantiate client by calling lower layer */ if (is_reg) { @@ -69,7 +64,6 @@ int hnae3_register_client(struct hnae3_client *client) { struct hnae3_client *client_tmp; struct hnae3_ae_dev *ae_dev; - bool matched; int ret = 0; mutex_lock(&hnae3_common_lock); @@ -86,7 +80,7 @@ int hnae3_register_client(struct hnae3_client *client) /* if the client could not be initialized on current port, for * any error reasons, move on to next available port */ - ret = hnae3_match_n_instantiate(client, ae_dev, true, &matched); + ret = hnae3_match_n_instantiate(client, ae_dev, true); if (ret) dev_err(&ae_dev->pdev->dev, "match and instantiation failed for port\n"); @@ -102,12 +96,11 @@ EXPORT_SYMBOL(hnae3_register_client); void hnae3_unregister_client(struct hnae3_client *client) { struct hnae3_ae_dev *ae_dev; - bool matched; mutex_lock(&hnae3_common_lock); /* un-initialize the client on every matched port */ list_for_each_entry(ae_dev, &hnae3_ae_dev_list, node) { - hnae3_match_n_instantiate(client, ae_dev, false, &matched); + hnae3_match_n_instantiate(client, ae_dev, false); } list_del(&client->node); @@ -124,7 +117,6 @@ int hnae3_register_ae_algo(struct hnae3_ae_algo *ae_algo) const struct pci_device_id *id; struct hnae3_ae_dev *ae_dev; struct hnae3_client *client; - bool matched; int ret = 0; mutex_lock(&hnae3_common_lock); @@ -151,13 +143,10 @@ int hnae3_register_ae_algo(struct hnae3_ae_algo *ae_algo) * initialize the figure out client instance */ list_for_each_entry(client, &hnae3_client_list, node) { - ret = hnae3_match_n_instantiate(client, ae_dev, true, - &matched); + ret = hnae3_match_n_instantiate(client, ae_dev, true); if (ret) dev_err(&ae_dev->pdev->dev, "match and instantiation failed\n"); - if (matched) - break; } } @@ -175,7 +164,6 @@ void hnae3_unregister_ae_algo(struct hnae3_ae_algo *ae_algo) const struct pci_device_id *id; struct hnae3_ae_dev *ae_dev; struct hnae3_client *client; - bool matched; mutex_lock(&hnae3_common_lock); /* Check if there are matched ae_dev */ @@ -187,12 +175,8 @@ void hnae3_unregister_ae_algo(struct hnae3_ae_algo *ae_algo) /* check the client list for the match with this ae_dev type and * un-initialize the figure out client instance */ - list_for_each_entry(client, &hnae3_client_list, node) { - hnae3_match_n_instantiate(client, ae_dev, false, - &matched); - if (matched) - break; - } + list_for_each_entry(client, &hnae3_client_list, node) + hnae3_match_n_instantiate(client, ae_dev, false); ae_algo->ops->uninit_ae_dev(ae_dev); hnae_set_bit(ae_dev->flag, HNAE3_DEV_INITED_B, 0); @@ -212,7 +196,6 @@ int hnae3_register_ae_dev(struct hnae3_ae_dev *ae_dev) const struct pci_device_id *id; struct hnae3_ae_algo *ae_algo; struct hnae3_client *client; - bool matched; int ret = 0; mutex_lock(&hnae3_common_lock); @@ -246,13 +229,10 @@ int hnae3_register_ae_dev(struct hnae3_ae_dev *ae_dev) * initialize the figure out client instance */ list_for_each_entry(client, &hnae3_client_list, node) { - ret = hnae3_match_n_instantiate(client, ae_dev, true, - &matched); + ret = hnae3_match_n_instantiate(client, ae_dev, true); if (ret) dev_err(&ae_dev->pdev->dev, "match and instantiation failed\n"); - if (matched) - break; } out_err: @@ -270,7 +250,6 @@ void hnae3_unregister_ae_dev(struct hnae3_ae_dev *ae_dev) const struct pci_device_id *id; struct hnae3_ae_algo *ae_algo; struct hnae3_client *client; - bool matched; mutex_lock(&hnae3_common_lock); /* Check if there are matched ae_algo */ @@ -279,12 +258,8 @@ void hnae3_unregister_ae_dev(struct hnae3_ae_dev *ae_dev) if (!id) continue; - list_for_each_entry(client, &hnae3_client_list, node) { - hnae3_match_n_instantiate(client, ae_dev, false, - &matched); - if (matched) - break; - } + list_for_each_entry(client, &hnae3_client_list, node) + hnae3_match_n_instantiate(client, ae_dev, false); ae_algo->ops->uninit_ae_dev(ae_dev); hnae_set_bit(ae_dev->flag, HNAE3_DEV_INITED_B, 0);