From patchwork Mon Jul 16 15:36:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 142039 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2569549ljj; Mon, 16 Jul 2018 08:38:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfUXgveerJKYkFeqJsGxKHngrpi/gNJKqGg7YPyp3RU8geBrmrTIwBTRgXS3ulUop9FcWM6 X-Received: by 2002:a63:5c7:: with SMTP id 190-v6mr15634614pgf.385.1531755511220; Mon, 16 Jul 2018 08:38:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531755511; cv=none; d=google.com; s=arc-20160816; b=xE6rVOOESZGzW2pqYnUYs1lM/XusDq1y3ZHcv1Ww/QwoYb3aOwkei/6IWgk2FczW0A zkp8PXWIPfoqVbDuEaDSEcryUF7eqo4IqSgPjtnpnWXG1c6X6bPA/o1MAPv4vlApei0t deLbeRJRmkv4h/aLTedVG9JeJYfGS9buWXAusFIYRStBmE1fDTDpOgGzjq2dzJPZTej9 wBRLB966n7/yl9jjN/62gVntRiLUDFMfi7BBr1WoKyg+f000nYApDP1/wSbuapcXltDI gaB46/bBmEQqsiEMHML23gRS5xYEOfJu39TZvjc1BqYYQzLEfZ9EwVtG+hccR1iJ8+CM lwjg== 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=RydeVn7HLC1NSYoqB0O/U3s9982d2tocwGiI60kFjrc=; b=TRo/S+I0/qC9H7HYEFOfyGP/pag++poCDo2ZrsipS0SO7llGG40Ny/8pr5z1sRQ3xi cyTPCQpLHSn/HDmVj/6og5PtzLoAEpZ1LzRxFuY4Xy8Qfh9n5bsyMv1k9R2PVOdYR6yx vQ90WddWNOaAyvcHXffHqf+wNEqHg9SA6Y3suY5FG1kbJfa3RB8l5RvNTTtFVObDisY7 WvB361qc/Mu3kG2s3Fn3PaeavOOFwPh+0oVc02bit4931iXtgKBgDZmQuymm1HByJdtb jSpJNqZCzISWHxIK7GgRjnkOu2VLgDLPDkxZZKXw69mYk/5U8rEB066EXUXfE6G1PrFJ xusg== 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 m3-v6si27402922pgr.108.2018.07.16.08.38.30; Mon, 16 Jul 2018 08:38:31 -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 S1730795AbeGPQFX (ORCPT + 31 others); Mon, 16 Jul 2018 12:05:23 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:9626 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727715AbeGPQFW (ORCPT ); Mon, 16 Jul 2018 12:05:22 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 128E92D81D973; Mon, 16 Jul 2018 23:37:09 +0800 (CST) Received: from S00293818-DELL1.huawei.com (10.202.226.54) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.382.0; Mon, 16 Jul 2018 23:37:04 +0800 From: Salil Mehta To: CC: , , , , , , , Huazhong Tan Subject: [PATCH net-next 1/9] net: hns3: Modify the order of initializing command queue register Date: Mon, 16 Jul 2018 16:36:19 +0100 Message-ID: <20180716153627.476-2-salil.mehta@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180716153627.476-1-salil.mehta@huawei.com> References: <20180716153627.476-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: Huazhong Tan According to hardware's description, the head pointer register should be written before the tail pointer register while doing command queue initialization. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c index eca4b23..cf40afc 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c @@ -119,8 +119,8 @@ static void hclge_cmd_config_regs(struct hclge_cmq_ring *ring) hclge_write_dev(hw, HCLGE_NIC_CSQ_DEPTH_REG, (ring->desc_num >> HCLGE_NIC_CMQ_DESC_NUM_S) | HCLGE_NIC_CMQ_ENABLE); - hclge_write_dev(hw, HCLGE_NIC_CSQ_TAIL_REG, 0); hclge_write_dev(hw, HCLGE_NIC_CSQ_HEAD_REG, 0); + hclge_write_dev(hw, HCLGE_NIC_CSQ_TAIL_REG, 0); } else { hclge_write_dev(hw, HCLGE_NIC_CRQ_BASEADDR_L_REG, lower_32_bits(dma)); @@ -129,8 +129,8 @@ static void hclge_cmd_config_regs(struct hclge_cmq_ring *ring) hclge_write_dev(hw, HCLGE_NIC_CRQ_DEPTH_REG, (ring->desc_num >> HCLGE_NIC_CMQ_DESC_NUM_S) | HCLGE_NIC_CMQ_ENABLE); - hclge_write_dev(hw, HCLGE_NIC_CRQ_TAIL_REG, 0); hclge_write_dev(hw, HCLGE_NIC_CRQ_HEAD_REG, 0); + hclge_write_dev(hw, HCLGE_NIC_CRQ_TAIL_REG, 0); } } From patchwork Mon Jul 16 15:36:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 142033 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2568397ljj; Mon, 16 Jul 2018 08:37:30 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdiRvvP8beqLxC3OnoMvlZPeM+er0yp6rrVg+Ev/tOQ1cOIBh3ooIILOJF4GUSjJ2wEn0zW X-Received: by 2002:a65:49c7:: with SMTP id t7-v6mr16102633pgs.23.1531755450593; Mon, 16 Jul 2018 08:37:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531755450; cv=none; d=google.com; s=arc-20160816; b=jgoA3I0fGm42m5iu9obOW/lzQ0nPR/6Pvxj2RxnBeLVn+RUTcCUBHV/F4Go9xsQ08a m/42LWwahXT+NoC2iDZowjpto2bP9y5pnsaNpGih28FjOBaKcm6JUEUM8XIZDqyFBsPN 6ZvbxjLMS9HLgUzru5sD12pjaU8nSioncVxwmYRNmjccNc5QvNJAPlJhjw5CnPEt+VIT jvUHxHUbMzeoMLEf3r4U5qrgtQI5vScK83ip57r7FF5nX4cnUjkHyF2nhkfyZvw79vCy dezS58jDo21xqo129MGiQnk3E3BP8YgV5Dne+teq/NDhYt5v10Tq4TLs1DplQ6+E2FJe E3pw== 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=2hX8LvQPAcOUSAcEZBJELh70FXXVI19QOxTjW+97nk4=; b=s13fDvzK8sBe748v3PZt0c941hXNVmXDwuP5DErdv81GjxKmpL0MPBzROiLYZKUA3J 27nruHYYaj1y+dzt9A90dOEjtqSVlAmxIazREoQUfKPMMArxmEDQv7AKDTm5hgPGbX3Z /OpvkCuV2GVbejOMFZQZT23PtdoFppsR7bplL60jhjsSd5pp2nCrMjZ9VeQgt5QlQqZb aUi3OaxRTtcbCzTIvqZpW9w5IneNV6YX8OI64mtMk8CE+gd2rqSQK7iKyMwUzP7X703R C02kw4JHWAID0qyMTT76CBj06adlqYJeF3WM27OWX2/pIhctcTWddXHHvImFOzFfHCjN P+oQ== 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 138-v6si9724114pga.188.2018.07.16.08.37.30; Mon, 16 Jul 2018 08:37:30 -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 S1731221AbeGPQFZ (ORCPT + 31 others); Mon, 16 Jul 2018 12:05:25 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:9678 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727653AbeGPQFZ (ORCPT ); Mon, 16 Jul 2018 12:05:25 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id C722E7B6DBD14; Mon, 16 Jul 2018 23:37:12 +0800 (CST) Received: from S00293818-DELL1.huawei.com (10.202.226.54) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.382.0; Mon, 16 Jul 2018 23:37:07 +0800 From: Salil Mehta To: CC: , , , , , , , Huazhong Tan Subject: [PATCH net-next 2/9] net: hns3: Reset net device with rtnl_lock Date: Mon, 16 Jul 2018 16:36:20 +0100 Message-ID: <20180716153627.476-3-salil.mehta@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180716153627.476-1-salil.mehta@huawei.com> References: <20180716153627.476-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: Huazhong Tan Since current locking was not covering certain code where netdev was being accessed or manipulated, this patch fixes it. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 8bbf4e5..3886290 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2820,15 +2820,13 @@ static void hclge_clear_reset_cause(struct hclge_dev *hdev) static void hclge_reset(struct hclge_dev *hdev) { /* perform reset of the stack & ae device for a client */ - + rtnl_lock(); hclge_notify_client(hdev, HNAE3_DOWN_CLIENT); if (!hclge_reset_wait(hdev)) { - rtnl_lock(); hclge_notify_client(hdev, HNAE3_UNINIT_CLIENT); hclge_reset_ae_dev(hdev->ae_dev); hclge_notify_client(hdev, HNAE3_INIT_CLIENT); - rtnl_unlock(); hclge_clear_reset_cause(hdev); } else { @@ -2838,6 +2836,7 @@ static void hclge_reset(struct hclge_dev *hdev) } hclge_notify_client(hdev, HNAE3_UP_CLIENT); + rtnl_unlock(); } static void hclge_reset_event(struct hnae3_handle *handle) From patchwork Mon Jul 16 15:36:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 142030 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2568311ljj; Mon, 16 Jul 2018 08:37:25 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcmsTBRT7rysoaY8XqItfEIsmZI5jnc64xoV/Ya7u94eYUSAN4CUG2zCFWUUWD+xbtoKpOR X-Received: by 2002:a63:aa44:: with SMTP id x4-v6mr16263352pgo.120.1531755445232; Mon, 16 Jul 2018 08:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531755445; cv=none; d=google.com; s=arc-20160816; b=fAceOn0sP3J1xUEjGBsoANN6b4Y3s/drpdxmcy2ahETXfhOaHgCyBz3bA/pqAHND4A 0uYg9tjKMaRHtzweWYS+3VwGOmDa+uzm55cx8kulc6ih37bC2sio9c62gYVTfNYuxiSS ov4jAifB2zZNn9HNpYwTgxXBEt55gy1mva8tX/SZjBp9klFVi5nDJvZwUGMteCggur75 sag3Gd0AK12sqkwT7zAvuJpdScCzv4IuO4DgOUtKZg2UwLvJeTWyNFK0rvG/j/H34Cq9 Kq49zHk06iEzlNbPQkCX5vc7AZE66unVgqR7yRg3laX/IfzDIfrPMgdBChLCGelKI+TZ KTgA== 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=n+o2RF3TpgKg1cnWCkYBCbVYu4cnzCDocFISmKMIm3I=; b=gIhZuhq+La/yPse/RCCjJTob55wRW01Uu00ly8rQ9LjdpTRyO9bqqNhoDMtlonPk4r WoWrHGZ3fUKimAK1h8t0uUsuQ3bAG1ZWBG1CxyqqhvhSGsjhrygbtGOm1wWcHrtP22Jw Do+pI4GRu/prlemOr5oyWFwdMVxFvJRZ+t/ZkCZuYS3x/s8+++P3pSeAG3WbIWz6lDt8 Q2CCoUR0/+eGoHpXmCu4fR1aamHLecYJDH2V9w+xG55Rt/S84LRlwL5DbeX9g6CeANlv 288iMBYhFPsn40ib5cOiPqHp6orOcoeP0G7OlOHSPb33S4CHeuP6klW1oJitxH/grVw/ vIog== 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 k91-v6si31061405pld.248.2018.07.16.08.37.24; Mon, 16 Jul 2018 08:37:25 -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 S1729552AbeGPQFT (ORCPT + 31 others); Mon, 16 Jul 2018 12:05:19 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:46263 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727653AbeGPQFT (ORCPT ); Mon, 16 Jul 2018 12:05:19 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id AFF36F0AC063D; Mon, 16 Jul 2018 23:37:18 +0800 (CST) Received: from S00293818-DELL1.huawei.com (10.202.226.54) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.382.0; Mon, 16 Jul 2018 23:37:10 +0800 From: Salil Mehta To: CC: , , , , , , , Huazhong Tan Subject: [PATCH net-next 3/9] net: hns3: Prevent to request reset frequently Date: Mon, 16 Jul 2018 16:36:21 +0100 Message-ID: <20180716153627.476-4-salil.mehta@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180716153627.476-1-salil.mehta@huawei.com> References: <20180716153627.476-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: Huazhong Tan Netdevice reset should not be requested frequently, a new one must wait a moment since there may be some work not completed. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 3886290..a1886a3 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2819,7 +2819,10 @@ static void hclge_clear_reset_cause(struct hclge_dev *hdev) static void hclge_reset(struct hclge_dev *hdev) { + struct hnae3_handle *handle; + /* perform reset of the stack & ae device for a client */ + handle = &hdev->vport[0].nic; rtnl_lock(); hclge_notify_client(hdev, HNAE3_DOWN_CLIENT); @@ -2836,6 +2839,7 @@ static void hclge_reset(struct hclge_dev *hdev) } hclge_notify_client(hdev, HNAE3_UP_CLIENT); + handle->last_reset_time = jiffies; rtnl_unlock(); } @@ -2849,8 +2853,13 @@ static void hclge_reset_event(struct hnae3_handle *handle) * know this if last reset request did not occur very recently (watchdog * timer = 5*HZ, let us check after sufficiently large time, say 4*5*Hz) * In case of new request we reset the "reset level" to PF reset. + * And if it is a repeat reset request of the most recent one then we + * want to make sure we throttle the reset request. Therefore, we will + * not allow it again before 3*HZ times. */ - if (time_after(jiffies, (handle->last_reset_time + 4 * 5 * HZ))) + if (time_before(jiffies, (handle->last_reset_time + 3 * HZ))) + return; + else if (time_after(jiffies, (handle->last_reset_time + 4 * 5 * HZ))) handle->reset_level = HNAE3_FUNC_RESET; dev_info(&hdev->pdev->dev, "received reset event , reset type is %d", @@ -2862,8 +2871,6 @@ static void hclge_reset_event(struct hnae3_handle *handle) if (handle->reset_level < HNAE3_GLOBAL_RESET) handle->reset_level++; - - handle->last_reset_time = jiffies; } static void hclge_reset_subtask(struct hclge_dev *hdev) From patchwork Mon Jul 16 15:36:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 142031 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2568351ljj; Mon, 16 Jul 2018 08:37:28 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd4WUL/Up7NxGf/o20L4vRqO4FKZUZcdSes/Y4vNHhqh91L5zJP4uN0tp/L4u4TzFCCogio X-Received: by 2002:a63:6501:: with SMTP id z1-v6mr16216021pgb.419.1531755447877; Mon, 16 Jul 2018 08:37:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531755447; cv=none; d=google.com; s=arc-20160816; b=zgQoCNEcDuZbR2Xt8jLQkzYg3GPmjgJ2dB5ofrfjGkT839k07d7sx2XQ6K+jktZD2B tRhb7//xrCAwu+MmTqdhbCRg/yK+FawC18eVP/XtQZaPPiQW3crpZDm3AtforAGQ+Wr6 47sdNHtgpkvW+zQowmEPWghhRAPZ2D3TT5Hs6IPEeh8wgirM1TBc7IYtIQ88c2CWNN6e gozk8wbaVtV3Ch9Hag5a+G0lD1LB6yAkaMqjKtQnTpe/K0lHmK0ee/ER5M2s/zifsk/Z PXA+DJtrDQuKZVvBDd6v+Zzrh/cebACz+/7+F8KhZefijo/ux+ca5CysqUtT1SYlf/s5 KCrg== 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=c7IVz6eDE3XBUlt/kcLj14dlrJikPq3bY2CtlDJe5OY=; b=EdcOcp6CD1ow1Mudp7fgIX/Gap6BUBcK0Mf8yC/oQa6lvHlkl5xFaUu06jUCZ3+/9l ztMHZK1MxY20NTS/3kM3LXqhwPlGiMjbIvzPwFE9vn4MQMTgF+bGT1mmmJ1Y/fuOtuk/ 2KlEJoroDUPtQlwd5LipSziEuZ+JZ1mL5cKxv3ASHR+9HorlGXtZ+mvb4XpecrTqN6Y1 r0h7K3wu168f17RZYdQQOmwKgsd230jApCCg/mQSAEzpqPQMxjyenTqcaXgVPGsEZkAA yG+6weRWLXuktiEsTpYfzVPhnLrjeHf+3uaJHPV3CH27Nsue6TnegPYb5lZ8GeldWcOH IWZw== 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 g33-v6si31615058plb.297.2018.07.16.08.37.27; Mon, 16 Jul 2018 08:37:27 -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 S1730043AbeGPQFV (ORCPT + 31 others); Mon, 16 Jul 2018 12:05:21 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:46269 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727957AbeGPQFV (ORCPT ); Mon, 16 Jul 2018 12:05:21 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id BE95CA4782E65; Mon, 16 Jul 2018 23:37:18 +0800 (CST) Received: from S00293818-DELL1.huawei.com (10.202.226.54) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.382.0; Mon, 16 Jul 2018 23:37:12 +0800 From: Salil Mehta To: CC: , , , , , , , Huazhong Tan Subject: [PATCH net-next 4/9] net: hns3: Correct reset event status register Date: Mon, 16 Jul 2018 16:36:22 +0100 Message-ID: <20180716153627.476-5-salil.mehta@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180716153627.476-1-salil.mehta@huawei.com> References: <20180716153627.476-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: Huazhong Tan According to hardware's description, driver should get reset event from VECTOR0_PF_OTHER_INT_ST(0x20800) instead of VECTOR0_PF_OTHER_INT_SRC(0x20700). Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index a1886a3..266c686 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2495,7 +2495,7 @@ static u32 hclge_check_event_cause(struct hclge_dev *hdev, u32 *clearval) u32 cmdq_src_reg; /* fetch the events from their corresponding regs */ - rst_src_reg = hclge_read_dev(&hdev->hw, HCLGE_MISC_RESET_STS_REG); + rst_src_reg = hclge_read_dev(&hdev->hw, HCLGE_MISC_VECTOR_INT_STS); cmdq_src_reg = hclge_read_dev(&hdev->hw, HCLGE_VECTOR0_CMDQ_SRC_REG); /* Assumption: If by any chance reset and mailbox events are reported diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h index 20abe82..a5abf8e 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h @@ -89,6 +89,7 @@ /* Reset related Registers */ #define HCLGE_MISC_RESET_STS_REG 0x20700 +#define HCLGE_MISC_VECTOR_INT_STS 0x20800 #define HCLGE_GLOBAL_RESET_REG 0x20A00 #define HCLGE_GLOBAL_RESET_BIT 0x0 #define HCLGE_CORE_RESET_BIT 0x1 From patchwork Mon Jul 16 15:36:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 142036 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2568596ljj; Mon, 16 Jul 2018 08:37:42 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfRwLUpV/8N+02iWg83UYgaURoCSXPizK10el4gzCOBUpaXeSwdycW24FsSOvhtXxeu+P8d X-Received: by 2002:a62:201b:: with SMTP id g27-v6mr18519404pfg.253.1531755462415; Mon, 16 Jul 2018 08:37:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531755462; cv=none; d=google.com; s=arc-20160816; b=ToTVUnTil3g1T9EACa43J+9KGT2OarrB8t8nnaONkLd6R97aZrELgIxRP7GImQJ1yR iNuFXmTbCrfSz63PaTfTL0e5f3Lp8HdP5EwagqkyrhUG1jgt3YZOizttHCCgoqQwebbS fC8Vq6eRc3fa0+O3tPjot+lOZyi+PW5VbEBtB8O3pN1CIXXfm9j2S+NE/QRY8+WlcTQG 7Agm+nhU5HgwhRACYKwkYjz7eEXDflKjYlnSahJAJVLSPei50dJ18VzKWPEe+sWM6kmY VWbZ0zG5g5e3+WY2684wDF/OXcBWvEMAgSsXPE9SMiL6iu3Nl3mFvNOP7/6JqnFqLrvI gHAg== 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=bDuOzb9dX0vkZB7cL5PdKl9ZcsToy+tsxhxMmKOKrVg=; b=Nk/dc2pQC/G6bwc9n9/OCBOEi2vNR2Ne2FxQ/1WzucIC8HPPb2KJHRUo9kyU82avh4 B7L1jqTUkuUnH6MSKe3zjAp8mmX9g2/F/owc9bev9dEB5Yx3o4mq6WAcZ05fi1uqEvoD zBzv4vnkpA7gGPjcGgEBj98XkJYe2orZIgrhoSzoFPW0uXZsiAZ4544h7jOwS0qFphgJ tnzDOd5wzgYKjtfziX+1VWeeJSLitXgRBZmaEL8+oOOYvKxgU4dx3vG/aG+dW052t/NZ 6yd4cwZfBUoiBN7B80pa7aGFU1zfHcRTvpk0GtgIXMeMf0eVWCsHTdMMeEJD5MdgMKif yRAA== 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 g12-v6si31332773pll.384.2018.07.16.08.37.42; Mon, 16 Jul 2018 08:37:42 -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 S1731412AbeGPQFh (ORCPT + 31 others); Mon, 16 Jul 2018 12:05:37 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:9679 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727403AbeGPQFh (ORCPT ); Mon, 16 Jul 2018 12:05:37 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 1CA63F282CBF7; Mon, 16 Jul 2018 23:37:23 +0800 (CST) Received: from S00293818-DELL1.huawei.com (10.202.226.54) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.382.0; Mon, 16 Jul 2018 23:37:15 +0800 From: Salil Mehta To: CC: , , , , , , , Huazhong Tan Subject: [PATCH net-next 5/9] net: hns3: Fix return value error in hns3_reset_notify_down_enet Date: Mon, 16 Jul 2018 16:36:23 +0100 Message-ID: <20180716153627.476-6-salil.mehta@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180716153627.476-1-salil.mehta@huawei.com> References: <20180716153627.476-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: Huazhong Tan When doing reset, netdev has not been brought up is not an error, it means that we do not need do the stop operation, so just return zero. Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index c211450..8296446 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -3396,7 +3396,7 @@ static int hns3_reset_notify_down_enet(struct hnae3_handle *handle) struct net_device *ndev = kinfo->netdev; if (!netif_running(ndev)) - return -EIO; + return 0; return hns3_nic_net_stop(ndev); } From patchwork Mon Jul 16 15:36:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 142034 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2568448ljj; Mon, 16 Jul 2018 08:37:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcncQn87h/DMSsnZzOBpt97sbjMEgCV6hMNHnGu4qbAeANPUNReB02ZWKVwOcytY1BLXkOS X-Received: by 2002:a62:9541:: with SMTP id p62-v6mr18412403pfd.152.1531755452979; Mon, 16 Jul 2018 08:37:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531755452; cv=none; d=google.com; s=arc-20160816; b=zUs74po7UUpxwRZBLOU0n7ZIGPDrgGJXPitW++v1m4k5EPFBi3hoy/limuHTCNIS9S SThYOMSIEzxQaeyqpwcHS4WB/81qk7Q0Dog2HDnPggXvFFKpS6W9v+Id7kuULxkaPKZS fI6Vw7jmmawU5OXxRNqNRenCdHMt6/NELhYMlWLQPSgz3XF65HCPdWdFxnPrYJFltGsN UkOVuhLplqfltGpLvx9z/nebD8AamdmO9NNfEvjEOSFDmoMnvzjZ9Q/FE/0xW+tHicWw KUJSsnieSPs9KNnIBf+z8s/WRAvIxjWr3gpEh0ew5vOO+YsbfQEApyCIfkULLIShACk8 U+Ug== 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=XWmNRu2KkHOqCtXc7R0HoegS8s41d+2hJa4qb2Jkcok=; b=de9E1J7/kcGkvo/hQqYZQj0aHct7RnTm+HyeO1VCuI+Dw7e2K8mux0V2u79eSY8YMt A2LNYe1xBAmI4h8AxUe7GgQSjh+Rbm2QpgFvNqLXExe5kzlDDEB4YlgGJK0GQfMWw4cI U5dhnVIyMiKbpOdkQV1h3j4dLnCuwPkFakCzQHGBpTc1Jp6Uj4/8lXP/B+U5bqf2KgEo Pl34sIV0SPUJ6rPclE5x3xLg9Ljei+h6XuV5X/tVHc6v2d7pdFmWDSG+1GF7x39NZFHB 1cChnxDRjnQVjIvSDvp/zeaYKl6qRNj8KWXU4/YcIZdhEv2w39hfZ1iusQgtHRLV8ngw Rumg== 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 38-v6si30819730plc.446.2018.07.16.08.37.32; Mon, 16 Jul 2018 08:37: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 S1731282AbeGPQF2 (ORCPT + 31 others); Mon, 16 Jul 2018 12:05:28 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:45318 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727653AbeGPQF0 (ORCPT ); Mon, 16 Jul 2018 12:05:26 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 60F43F3EA9ED0; Mon, 16 Jul 2018 23:37:23 +0800 (CST) Received: from S00293818-DELL1.huawei.com (10.202.226.54) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.382.0; Mon, 16 Jul 2018 23:37:18 +0800 From: Salil Mehta To: CC: , , , , , , , Huazhong Tan Subject: [PATCH net-next 6/9] net: hns3: remove unnecessary ring configuration operation while resetting Date: Mon, 16 Jul 2018 16:36:24 +0100 Message-ID: <20180716153627.476-7-salil.mehta@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180716153627.476-1-salil.mehta@huawei.com> References: <20180716153627.476-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: Huazhong Tan The configuration of the ring will be used to reinitialize the ring after the hardware reset is completed. So we should not release and reacquire this configuration during reset. Fixes: bb6b94a896d4 ("net: hns3: Add reset interface implementation in client") Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 8 -------- 1 file changed, 8 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 8296446..24f82b7 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -3436,10 +3436,6 @@ static int hns3_reset_notify_init_enet(struct hnae3_handle *handle) /* Carrier off reporting is important to ethtool even BEFORE open */ netif_carrier_off(netdev); - ret = hns3_get_ring_config(priv); - if (ret) - return ret; - ret = hns3_nic_init_vector_data(priv); if (ret) return ret; @@ -3471,10 +3467,6 @@ static int hns3_reset_notify_uninit_enet(struct hnae3_handle *handle) if (ret) netdev_err(netdev, "uninit ring error\n"); - hns3_put_ring_config(priv); - - priv->ring_data = NULL; - hns3_uninit_mac_addr(netdev); return ret; From patchwork Mon Jul 16 15:36:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 142037 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2568686ljj; Mon, 16 Jul 2018 08:37:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdHhqA7WtlrpsU74k0O7fkIVSr7DPToVq57PAkdD5NAs9FtfcwK492TKptzElW4xsKG4htm X-Received: by 2002:a63:bf08:: with SMTP id v8-v6mr15623484pgf.3.1531755466984; Mon, 16 Jul 2018 08:37:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531755466; cv=none; d=google.com; s=arc-20160816; b=ClTTveapeBRoR05gCThdIAs7T8BUwQ7TKtbb050BylRi0DrkRWEns0EFoNSLq8KkUS +qlUES4K/o0QFb+qtd2tklidTzhDl+HQPRKbHZ4ky3DeUTiYZkJn22FK/C3IlteYk7Km GwQwPgtek/iCXhKA91IMVElxR8sV+j1MFl+Q4VNtOkidcRQvqwK7F14xWYiq6p8ne45F tTioG7pqyitAiz28M6mNcpDMwlLqqSwtrDUeLgf9FeJHBx8Un3fyhXSYNS5j12PiUFJ+ Bp2uY9MHPFRQC3Lubwu/HWfTp/bfnHPZPaw44LWpsPfn6mCquPI3lHS0NbZ+bLGaIDDK j2Cg== 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=cKoaqzx3mj/6H+6mXjD73zABdspRFGQ7OMvP8zmHMWc=; b=lNsKVKc7YBtYJA7gC/MiqVvncxotbuD3SpXOloel+Jr0F+Mf9Mpj3ujjTYd50VdS2G bsAqWu+wz3QVGdVV4USOaV0XpPSvDxIfCKgsnJYQ89jTFUX0BMwD5KZbpMY4tQpHKJbE bRPYHkVtqEvfJS0ZGpdyppRVSnq3hwV0SfMl1V7MhwHlZ42ZP4Xy46IxYHxkORf1pslF rlHozvuwjW5fnNv/DEFDzpL86Uee0Fla+suOH1K4oGxtYfYudsQUHEDflFKf1PGv1Gvh yOS6TP6Ph5f1xhdkKOcYqd5AU4p1EnJuPLz3H+aJXb2Ofoc9eroBgj8nDeFvIGyZ4jnR TJfw== 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 l15-v6si3471048pgh.593.2018.07.16.08.37.46; Mon, 16 Jul 2018 08:37:46 -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 S1731477AbeGPQFl (ORCPT + 31 others); Mon, 16 Jul 2018 12:05:41 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:9629 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727403AbeGPQFk (ORCPT ); Mon, 16 Jul 2018 12:05:40 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 583779E115361; Mon, 16 Jul 2018 23:37:29 +0800 (CST) Received: from S00293818-DELL1.huawei.com (10.202.226.54) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.382.0; Mon, 16 Jul 2018 23:37:21 +0800 From: Salil Mehta To: CC: , , , , , , , Yunsheng Lin Subject: [PATCH net-next 7/9] net: hns3: Fix for reset_level default assignment probelm Date: Mon, 16 Jul 2018 16:36:25 +0100 Message-ID: <20180716153627.476-8-salil.mehta@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180716153627.476-1-salil.mehta@huawei.com> References: <20180716153627.476-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 handle->reset_level is assigned to HNAE3_NONE_RESET when client is initialized, if a tx timeout happens right after initialization, then handle->reset_level is not resetted to HNAE3_FUNC_RESET in hclge_reset_event, which will cause reset event not properly handled problem. This patch fixes it by setting handle->reset_level properly when client is initialized. Fixes: 6d4c3981a8d8 ("net: hns3: Changes to make enet watchdog timeout func common for PF/VF") Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 24f82b7..29be96e 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -3085,7 +3085,6 @@ static int hns3_client_init(struct hnae3_handle *handle) priv->dev = &pdev->dev; priv->netdev = netdev; priv->ae_handle = handle; - priv->ae_handle->reset_level = HNAE3_NONE_RESET; priv->ae_handle->last_reset_time = jiffies; priv->tx_timeout_count = 0; @@ -3106,6 +3105,11 @@ static int hns3_client_init(struct hnae3_handle *handle) /* Carrier off reporting is important to ethtool even BEFORE open */ netif_carrier_off(netdev); + if (handle->flags & HNAE3_SUPPORT_VF) + handle->reset_level = HNAE3_VF_RESET; + else + handle->reset_level = HNAE3_FUNC_RESET; + ret = hns3_get_ring_config(priv); if (ret) { ret = -ENOMEM; From patchwork Mon Jul 16 15:36:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 142038 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2568754ljj; Mon, 16 Jul 2018 08:37:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfB+QQheWxYnsn/tPuf5jHbgAp8IhGVrlNg8U8VmdJK5tqDiaIeJgGNQD0gaXY84GFSUFx7 X-Received: by 2002:a62:d39b:: with SMTP id z27-v6mr18695909pfk.182.1531755470542; Mon, 16 Jul 2018 08:37:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531755470; cv=none; d=google.com; s=arc-20160816; b=Y0qqt6/GoXFQK1cJfWg1mTJBfm9IgHz5HtVO1iYK/jvrW5QYJEpM8xn42NMXG30IkM T4/uVLoczETc/hjFc+Tw+8yP/iBVAK+Dfzm92vigJMsuHYhBfVojbCCWVNaAYzBlma7n VP8oMnIZKWzAAv4GOecmh5PBV2aSbDFl31a4VQPBUKuD7ylExFEoYhd6vMe/qqeyKpaJ ooNVibe5oiK0kJSt3xtyJIF+kNlQaOxhsY4uxLd6Nzq+goA1+qWVxiiKolbLxeWWbtOd VesksgLb/HmuUYbDhT8hidsAglQXFEKytA2/TZxLFtZqL5d5YWsxOqBLSWiWWhlYxxrt AuHA== 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=BW5xnvMRbmtpq858RGGQDztF6ni0OgyjVO0a6q0Vtg8=; b=uSl4oMEQnvZ+EG26l7jD3SNxnNjSZ0gAkhFZ7RoHwEAfjuOgzOUTTXvp1b4jVXlp06 iEjU+mnBYbppkUPF2ZO4l2xjUMAPFoqIHzA0C8NG1X5APZjjo9D2SW+FNXmA76jyzB8g GAmYFaFvrRZE0mgC0ZZao86pJScNdAu+rZF4iJsmqf++bK6mlgf2NABk0ZVEh6R4TYtt bgLRZ/iWMzkzZkJCpO4hv9GaWXAG6KQb4f13QQbwQJ7fYLl+3995lRuz5W0t6twfZoU8 +rgquxAR+8TzXSztjntko8BL7SWV2HSLe78tfIqE2NUDFoGeAq0Jz7HWKOPoBeqpK9jy xWng== 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 c3-v6si6041087pld.457.2018.07.16.08.37.50; Mon, 16 Jul 2018 08:37:50 -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 S1731556AbeGPQFp (ORCPT + 31 others); Mon, 16 Jul 2018 12:05:45 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:9628 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731420AbeGPQFp (ORCPT ); Mon, 16 Jul 2018 12:05:45 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 49F4C50490F97; Mon, 16 Jul 2018 23:37:29 +0800 (CST) Received: from S00293818-DELL1.huawei.com (10.202.226.54) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.382.0; Mon, 16 Jul 2018 23:37:23 +0800 From: Salil Mehta To: CC: , , , , , , , Fuyun Liang Subject: [PATCH net-next 8/9] net: hns3: Fix for using wrong mask and shift in hclge_get_ring_chain_from_mbx Date: Mon, 16 Jul 2018 16:36:26 +0100 Message-ID: <20180716153627.476-9-salil.mehta@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180716153627.476-1-salil.mehta@huawei.com> References: <20180716153627.476-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: Fuyun Liang HCLGE_INT_GL_IDX_M and HCLGE_INT_GL_IDX_S are used to set fireware cmd. When getting int_gl value from mailbox message, we should use HNAE3_RING_GL_IDX_M and HNAE3_RING_GL_IDX_S. Fixes: 79eee4108541 ("net: hns3: add int_gl_idx setup for VF") Signed-off-by: Fuyun Liang Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c index 50ae2f8..9d36bcc 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c @@ -131,8 +131,8 @@ static int hclge_get_ring_chain_from_mbx( hnae3_set_bit(ring_chain->flag, HNAE3_RING_TYPE_B, req->msg[3]); ring_chain->tqp_index = hclge_get_queue_id(vport->nic.kinfo.tqp[req->msg[4]]); - hnae3_set_field(ring_chain->int_gl_idx, HCLGE_INT_GL_IDX_M, - HCLGE_INT_GL_IDX_S, + hnae3_set_field(ring_chain->int_gl_idx, HNAE3_RING_GL_IDX_M, + HNAE3_RING_GL_IDX_S, req->msg[5]); cur_chain = ring_chain; @@ -151,8 +151,8 @@ static int hclge_get_ring_chain_from_mbx( [req->msg[HCLGE_MBX_RING_NODE_VARIABLE_NUM * i + HCLGE_MBX_RING_MAP_BASIC_MSG_NUM + 1]]); - hnae3_set_field(new_chain->int_gl_idx, HCLGE_INT_GL_IDX_M, - HCLGE_INT_GL_IDX_S, + hnae3_set_field(new_chain->int_gl_idx, HNAE3_RING_GL_IDX_M, + HNAE3_RING_GL_IDX_S, req->msg[HCLGE_MBX_RING_NODE_VARIABLE_NUM * i + HCLGE_MBX_RING_MAP_BASIC_MSG_NUM + 2]); From patchwork Mon Jul 16 15:36:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 142035 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2568547ljj; Mon, 16 Jul 2018 08:37:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpesU9rxRFmb54yVqarx7qmuRxFhqhvZAiUAPNJkFnYMX7uXeNEuH8993PXy3nb6Brl7EiQs X-Received: by 2002:a62:2352:: with SMTP id j79-v6mr18144935pfj.221.1531755460122; Mon, 16 Jul 2018 08:37:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531755460; cv=none; d=google.com; s=arc-20160816; b=0DfCLIJD3WtGqC7mYhjXlfb9LnEttSVO2WVEeJKwRQNFEe5xK0jKcr19G09ETiX2yf MiOsTDw1/s2Kg54ryFeSxG0LgztJw+p+eAVhx76bERC4/RRo/GPnvapqvbS1m0PwQ33k VFOkVi9zI7h3+J0UFOBKnzSRNOXtJ33zwpQeLM73ByxSjEjZjuMBP4DZE1DWFZZrXGse YAJP+7C9DeKHb7g3Mv5xi9orVirB38GhZq4ZgHBEg3AvSA8ApFxVz8NLKLM9cBheOF31 0tquggKRLaDkXi9OiMHlaOFJEl6psIQUN51gAAjp8Vw7aKl5F+dKBuHpPFx1KjjB2lP1 LuOg== 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=jWr2y6KzSXoV9YOk5FAAJvwZMglKQtUD9fbCRe1jp0s=; b=mPxXVs7Zi0rNxJ/v/b4ejT2mBCAbsH1Owxjiu5FdE6bR0arVCx2cFAnaOdQvuqGSA6 vGq8F7yhBM9Dq+OaK1N8SDx4+O400azHK/czq2wep7GVjmCcKsDd/irkeVoypnHJCGrZ U6YBZiLja0hNPfF8hRYv2l6EJt9zq0XJ1H5L4I6UoZHzI8+tDSyYNMF0KnaHDQiiOpzq H2mmzwMJ4GxlxqIAAJ9Hn8RXI+34+Xu0j33D8zRkNoNN+tsq5sGqBqK9ZC0h8cUxrh30 as3iX5m9p7Jx8opacTzdjA4tJsQkOd7samTZTgfCNuUn7AKnNlBU9VNyAxls9iDoS/By e/Gw== 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 d26-v6si29433228pge.679.2018.07.16.08.37.39; Mon, 16 Jul 2018 08:37: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 S1731325AbeGPQFf (ORCPT + 31 others); Mon, 16 Jul 2018 12:05:35 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:45356 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727403AbeGPQFe (ORCPT ); Mon, 16 Jul 2018 12:05:34 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 80C39E5987905; Mon, 16 Jul 2018 23:37:33 +0800 (CST) Received: from S00293818-DELL1.huawei.com (10.202.226.54) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.382.0; Mon, 16 Jul 2018 23:37:26 +0800 From: Salil Mehta To: CC: , , , , , , , Fuyun Liang Subject: [PATCH net-next 9/9] net: hns3: Fix comments for hclge_get_ring_chain_from_mbx Date: Mon, 16 Jul 2018 16:36:27 +0100 Message-ID: <20180716153627.476-10-salil.mehta@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180716153627.476-1-salil.mehta@huawei.com> References: <20180716153627.476-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: Fuyun Liang Actually, hclge_get_ring_chain_from_mbx is used to get ring type, tqp id, and int_gl index from mailbox message. So the comments is incorrect. This patch fixes it. Fixes: dde1a86e93ca ("net: hns3: Add mailbox support to PF driver") Signed-off-by: Fuyun Liang Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c index 9d36bcc..f34851c 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c @@ -104,13 +104,15 @@ static void hclge_free_vector_ring_chain(struct hnae3_ring_chain_node *head) } } -/* hclge_get_ring_chain_from_mbx: get ring type & tqpid from mailbox message +/* hclge_get_ring_chain_from_mbx: get ring type & tqp id & int_gl idx + * from mailbox message * msg[0]: opcode * msg[1]: * msg[2]: ring_num * msg[3]: first ring type (TX|RX) * msg[4]: first tqp id - * msg[5] ~ msg[14]: other ring type and tqp id + * msg[5]: first int_gl idx + * msg[6] ~ msg[14]: other ring type, tqp id and int_gl idx */ static int hclge_get_ring_chain_from_mbx( struct hclge_mbx_vf_to_pf_cmd *req,