Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp554031lqh; Tue, 7 May 2024 07:19:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWMTuqkXQY/AnN+r8ccXUVQrYiaDuLFPGhad4YsiYD6Y6ZOqX1ZBj2rcA9S49FO+q+5WS4eExpDXUtqTuH7XVJr2p0VQ0mWSevCr9k3Dw== X-Google-Smtp-Source: AGHT+IF0txTq/qarnS+cb+tszLwfkUGbho5W3DkRVZjWyOWQF1MAM+LuzU5n3R7iWrSfn5ijzr08 X-Received: by 2002:a17:90a:e513:b0:2b5:af18:4222 with SMTP id t19-20020a17090ae51300b002b5af184222mr3178692pjy.44.1715091561945; Tue, 07 May 2024 07:19:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715091561; cv=pass; d=google.com; s=arc-20160816; b=EDe7Dj5y3Jk0fItw7EGMQ2oU7+W3XTmAUcajUDJfbelDMUW7v5O6wbSZ1buitJZTJk MZ0rAIWKrvz0AQH3uncSbxHm4gUUJ503M4aE4xGivqz5Q1kTIM1YWu0Uv/vJRtZbJI/i 3E2zkfVOhgYrA6LdHZiLFZR8ZmUaR/JmZtZcfSjBz8alGW7LCijkYwdEiwZj6jA8Y2ZN YXsWYakg+XPEq9Qpy98RfUPxPQspDP+Qz+s3vwavSr/bgz47uwBnqMHQwbcztzAwRU5s rI0jKBG7dSs/HIU57OeS/Ei8smwmnRd7cMTuHgF15IEdqdy8v1oX7ZNSHfC32i36jSOi pRTA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=WHcVc07KZzwJEHPK28VNz1zsd9w62BCk+bxRKMOJA7o=; fh=mENY5E4eClWonIkCOtlFWWTx/Dt7WFkfxCrepuo/4GQ=; b=BPzQk2gZjRFUy8uEW+lK3dXfhiNPs9EBXPO7wdnmDRpVZNWuOM51I2aoF8KH8/9ifh YNHGYNKmyEMIVWxHMPhge4/oW1voHUXiUHtTQjZTHD42f+0AspTy+cUIsIwxGkjm64DC vQKwKMDWRhgOO6ViU/BuCGz/RBV2+ZbyRfyaQtOLfB3ld/ygQ7mE03VYS3BC5xZsK0xK z4gtD495a92SM1Jo1hqxjoRcV/LBn8cxmnKlimrSRySm26KjnfVZQh7hWvAYWdyYkSQp y4kcnGYrMv/sIN9t3lSLMve4GI8pYwG5VEqGDCPkSQMZNn6B5TYqIlCAnarSQ04GvMQS IZxQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-171464-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171464-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c18-20020a637252000000b0061b0ca89265si9948420pgn.807.2024.05.07.07.19.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 07:19:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171464-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-171464-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171464-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 32494B24A6E for ; Tue, 7 May 2024 13:51:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DCC9D15F31D; Tue, 7 May 2024 13:49:57 +0000 (UTC) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5BD015E1E2; Tue, 7 May 2024 13:49:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715089797; cv=none; b=MD7pC1eqTDAirj46RVL5+I6RQldvuX9KmUFQ3rlKYM7hoNzYwx+k8SpF2tuSVUkpkCcLpumFJhUT7f+RMpvcAbBAoNEfnKTSQrSS4ZIASIr2rR1WAIq/wiUUdHkNDa2guEgE7L+Kww2fCpGG17ztwgJ/xZytU1F/fEJfSYUTcDM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715089797; c=relaxed/simple; bh=/AbDuZt3pjEgkh846hZAInVPUoDfLlXHUb3YUhBRjKk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=kelSEWnHmW5OEX6vN013EZTkDl8v4bDF8bUBZzdpkKOy8iB0Q0n07GOe1LBlrIv/RUfDzLuV5eHVnuMqNJ7yZa1Osbar2VHnhnb5/LaNkz+iDKbW/bDfJSyosrk+BCr7J73kmXWcvZ5RObLwfQ/xZZfir+okxTW+0ki/8ftjHQ0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4VYfhp5kQwzNwJt; Tue, 7 May 2024 21:47:06 +0800 (CST) Received: from kwepemm600007.china.huawei.com (unknown [7.193.23.208]) by mail.maildlp.com (Postfix) with ESMTPS id 8C784180080; Tue, 7 May 2024 21:49:52 +0800 (CST) Received: from localhost.localdomain (10.90.30.45) by kwepemm600007.china.huawei.com (7.193.23.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 7 May 2024 21:49:51 +0800 From: Jijie Shao To: , , , , , , , CC: , , , , , , Subject: [PATCH V3 net 6/7] net: hns3: fix port vlan filter not disabled issue Date: Tue, 7 May 2024 21:42:23 +0800 Message-ID: <20240507134224.2646246-7-shaojijie@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240507134224.2646246-1-shaojijie@huawei.com> References: <20240507134224.2646246-1-shaojijie@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600007.china.huawei.com (7.193.23.208) From: Yonglong Liu According to hardware limitation, for device support modify VLAN filter state but not support bypass port VLAN filter, it should always disable the port VLAN filter. but the driver enables port VLAN filter when initializing, if there is no VLAN(except VLAN 0) id added, the driver will disable it in service task. In most time, it works fine. But there is a time window before the service task shceduled and net device being registered. So if user adds VLAN at this time, the driver will not update the VLAN filter state, and the port VLAN filter remains enabled. To fix the problem, if support modify VLAN filter state but not support bypass port VLAN filter, set the port vlan filter to "off". Fixes: 184cd221a863 ("net: hns3: disable port VLAN filter when support function level VLAN filter control") Fixes: 2ba306627f59 ("net: hns3: add support for modify VLAN filter state") Signed-off-by: Yonglong Liu Signed-off-by: Jijie Shao Reviewed-by: Simon Horman --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index e3d6a64b4575..0773124440e9 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -9910,6 +9910,7 @@ static int hclge_set_vlan_protocol_type(struct hclge_dev *hdev) static int hclge_init_vlan_filter(struct hclge_dev *hdev) { struct hclge_vport *vport; + bool enable = true; int ret; int i; @@ -9929,8 +9930,12 @@ static int hclge_init_vlan_filter(struct hclge_dev *hdev) vport->cur_vlan_fltr_en = true; } + if (test_bit(HNAE3_DEV_SUPPORT_VLAN_FLTR_MDF_B, hdev->ae_dev->caps) && + !test_bit(HNAE3_DEV_SUPPORT_PORT_VLAN_BYPASS_B, hdev->ae_dev->caps)) + enable = false; + return hclge_set_vlan_filter_ctrl(hdev, HCLGE_FILTER_TYPE_PORT, - HCLGE_FILTER_FE_INGRESS, true, 0); + HCLGE_FILTER_FE_INGRESS, enable, 0); } static int hclge_init_vlan_type(struct hclge_dev *hdev) -- 2.30.0