Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2476491imm; Mon, 16 Jul 2018 08:38:46 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfLAZ0Cjy0omqAc7sBiTQUcPU+BRX/SuNXolaGQAb0dQ+0lOZLd9YKf8QkRmVhcIG0WhwH6 X-Received: by 2002:a17:902:6b4c:: with SMTP id g12-v6mr16877286plt.159.1531755526846; Mon, 16 Jul 2018 08:38:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531755526; cv=none; d=google.com; s=arc-20160816; b=IVnYANsuN27oivRAdHlKxc9NOMeNMQirktdXETMFh8C/7Bh3FyT3BbR0Pzag8lrFJ7 F1xAD5RTgquULuIVnfzAiMGaSY/NgK7/GXuOBgkucn9N4mh8EIIjnpwUkBD8QZJC+xO2 KG4dxieka4eCWhdEip5c208LNSYc/mZp48wzupzdsgk2sy8LnpxQtNNVIZ9OmV/b8x3U eIoupAfJ/1nG94DS+naGLBtNwCATtZgbI464VbUPgaA0BMLE4zPdLgo3MEbYuOd2/T7j Kcqb+VHG5udhk+1hYPXwyQZvYf60hBBre0uIjWw20YTBN5cyEQe3RsT2JA3y97m/gC6v FQfw== 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 f5-v6si6128977pga.340.2018.07.16.08.38.32; Mon, 16 Jul 2018 08:38: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 S1731470AbeGPQFl (ORCPT + 99 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 Content-Type: text/plain 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(-) 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; -- 2.7.4