Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp169690ybg; Mon, 27 Jul 2020 19:22:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOXqxaQL1WdXYLaGXE3feMy5FDRxZPIT+E6XYc63d9d94ZdV5x97KOoRN41z+ccs3gpaVS X-Received: by 2002:a17:906:5ac8:: with SMTP id x8mr16231158ejs.486.1595902953132; Mon, 27 Jul 2020 19:22:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595902953; cv=none; d=google.com; s=arc-20160816; b=HbSGwNUCFsh8veV9YPqS/B4DtD4pJD4sseRHOg6I4Zfe/8iztiS3Je5rMi20oMQtpw 9goGCM6X+qdc4XuE0mQMoTo3IRR5icFmX+IlhX0gNUtBLpMrbQ7YOZ2wY0H177eBvrVN t94DgFCrIVLjNazrMfrZ8rccJKoL7RmUVwvLKQQPfdnObEoacv9s75D4eGNdM2wSxrFp MqVS6J5yG9NCBoom8eqXpGuRhgExgX82rKYTh9jch5nrgWssSCFmHNDNDJd6YdJE2UkD QpClFRRS4uJXTpwXGBH/gskNVSIUDbzfT+tuR/OPEcL4vw8OCpHrnzmYMUpIm0I7UOhE 17tQ== 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; bh=Ogk59PePFjKiBWm52xN7poBWKdxMB9nw4C8QnDewuCs=; b=YrQs4ZS5r8UzrX3eXZkkKLOGLTR0TMXArvCnjkajg7RcvvhcrTlMTTzBIzPQjeyTCj ma9I3v3QiyKRF5XHrPxfFUjUWhSAp4dyZm2aXhzuaUoSwGZoduCODWnG1x00sicPmEKw qTX4dmwrxIyzlnIY0drX6LxkpNs1q2M9D13grU0rdRYOj9sIulX53Lhv7eDZgcq3MISs 3h7kQu+eCNah3M3cYAfoScfNTgF/HCVAJsxvgvUJaRzpLMrcSIEJO9xg3FHtTZS/3oCk zLyK9VLL309M2EiOKjmWdaUdvH96Cc6eJsDDSrL1ZGa5qwaRAozjU/ZOr1fKKALcHKsy XiNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 12si6667582edx.70.2020.07.27.19.22.10; Mon, 27 Jul 2020 19:22:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727124AbgG1CTc (ORCPT + 99 others); Mon, 27 Jul 2020 22:19:32 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:8285 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726313AbgG1CTJ (ORCPT ); Mon, 27 Jul 2020 22:19:09 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 8757C2CEB9A94E21F62C; Tue, 28 Jul 2020 10:19:07 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.487.0; Tue, 28 Jul 2020 10:19:00 +0800 From: Huazhong Tan To: CC: , , , , , , Guojia Liao , Huazhong Tan Subject: [PATCH net 5/5] net: hns3: fix for VLAN config when reset failed Date: Tue, 28 Jul 2020 10:16:52 +0800 Message-ID: <1595902612-12880-6-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1595902612-12880-1-git-send-email-tanhuazhong@huawei.com> References: <1595902612-12880-1-git-send-email-tanhuazhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guojia Liao When device is resetting or reset failed, firmware is unable to handle mailbox. VLAN should not be configured in this case. Fixes: fe4144d47eef ("net: hns3: sync VLAN filter entries when kill VLAN ID failed") Signed-off-by: Guojia Liao Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 7 ++++--- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 10 ++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index cee84e7..36575e7 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -9042,11 +9042,12 @@ int hclge_set_vlan_filter(struct hnae3_handle *handle, __be16 proto, bool writen_to_tbl = false; int ret = 0; - /* When device is resetting, firmware is unable to handle - * mailbox. Just record the vlan id, and remove it after + /* When device is resetting or reset failed, firmware is unable to + * handle mailbox. Just record the vlan id, and remove it after * reset finished. */ - if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state) && is_kill) { + if ((test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state) || + test_bit(HCLGE_STATE_RST_FAIL, &hdev->state)) && is_kill) { set_bit(vlan_id, vport->vlan_del_fail_bmap); return -EBUSY; } diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index b8b72ac..9162856d 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -1592,11 +1592,12 @@ static int hclgevf_set_vlan_filter(struct hnae3_handle *handle, if (proto != htons(ETH_P_8021Q)) return -EPROTONOSUPPORT; - /* When device is resetting, firmware is unable to handle - * mailbox. Just record the vlan id, and remove it after + /* When device is resetting or reset failed, firmware is unable to + * handle mailbox. Just record the vlan id, and remove it after * reset finished. */ - if (test_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state) && is_kill) { + if ((test_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state) || + test_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state)) && is_kill) { set_bit(vlan_id, hdev->vlan_del_fail_bmap); return -EBUSY; } @@ -3443,7 +3444,8 @@ void hclgevf_update_port_base_vlan_info(struct hclgevf_dev *hdev, u16 state, rtnl_lock(); - if (test_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state)) { + if (test_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state) || + test_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state)) { dev_warn(&hdev->pdev->dev, "is resetting when updating port based vlan info\n"); rtnl_unlock(); -- 2.7.4