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;