Received: by 2002:a05:6512:2355:0:0:0:0 with SMTP id p21csp197174lfu; Wed, 30 Mar 2022 20:31:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvsycYeHIK+tGKMtlfi2eBfbumch2fgIxvfhUecDVp8F8CKul2vKa18PEj7ALrfd+A3y88 X-Received: by 2002:a05:6a00:1988:b0:4fa:c15d:190d with SMTP id d8-20020a056a00198800b004fac15d190dmr3156393pfl.44.1648697484363; Wed, 30 Mar 2022 20:31:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648697484; cv=none; d=google.com; s=arc-20160816; b=C3eHtDTIFLqIl2zxnRlTYEmk6k3LfTIuqJwVYOlsIeXB9skaIc/B7zzon2btJZI4he 3/5xGrYgzDXsyRfNLZzy8eo9ogl3snQWxjOcnq6/5hJi8nfLuRk+A6zaecWLtuHydBy/ R1Pu15Pn0k1/58zozkqMsMVPJ3u/S/qfhnWmIiLyj0JzHVO1pFF5srTWCUtuuw34gL8V YXaeLooYTc1bSwKGB5cdNbcYxTTuJ6nEa6tPOEW+yKWOfQdGFB3kWZyJZkD0cEwNHyge PfEjtgcJJMMl0Nc3Wpi4yj6WH6/qQAuD7UFs/NKUwGWJqHdvpXXG4G34MqSkCNuyJNSs awow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=WP1FzFzRtpYFoSBMzHol4PRHAHU5IUx0XVEK8y3iYbA=; b=LJEXxp44mB8nGANpW8WYIBIASxqoNZVMkhSLxIO7gmwnxrfV+Ye95kFTt+rFKrCLeN nmTJi9NyxwH4OmWONFrLy6ElAY56AMMmq4t1CegRs/kI/JQibE3eWO884AzHlOMZJrB7 azgc2QiGtNMQqHGAsxOSiIIp0bCRFfRThGtynelL0nG7YLxgbVda6fFQFJT5Enal4vZK QGWO/kZnfbDlxEvEH9FONr+rqa5voLbN0YM0cgEINQrvrlYe20CriV3mqsTteJ0lAcLp mK/zBv3P9emRndwt4rZPKdsJkdtKKHn2/6Pk2eULKzxidMwyrDBkeejA+2spszI6RZSi r9Yw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f17-20020a170902ce9100b00153b2d165a5si25673501plg.429.2022.03.30.20.31.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 20:31:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 607E712151B; Wed, 30 Mar 2022 19:56:26 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346565AbiC3Nwx (ORCPT + 99 others); Wed, 30 Mar 2022 09:52:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346494AbiC3Nw2 (ORCPT ); Wed, 30 Mar 2022 09:52:28 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A04891342F9; Wed, 30 Mar 2022 06:50:41 -0700 (PDT) Received: from kwepemi100014.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4KT79T00CQzdZLq; Wed, 30 Mar 2022 21:50:20 +0800 (CST) Received: from kwepemm600016.china.huawei.com (7.193.23.20) by kwepemi100014.china.huawei.com (7.221.188.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 30 Mar 2022 21:50:38 +0800 Received: from localhost.localdomain (10.67.165.24) by kwepemm600016.china.huawei.com (7.193.23.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 30 Mar 2022 21:50:38 +0800 From: Guangbin Huang To: , CC: , , , , Subject: [PATCH net 2/2] net: hns3: fix software vlan talbe of vlan 0 inconsistent with hardware Date: Wed, 30 Mar 2022 21:45:06 +0800 Message-ID: <20220330134506.36635-3-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220330134506.36635-1-huangguangbin2@huawei.com> References: <20220330134506.36635-1-huangguangbin2@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600016.china.huawei.com (7.193.23.20) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When user delete vlan 0, as driver will not delete vlan 0 for hardware in function hclge_set_vlan_filter_hw(), so vlan 0 in software vlan talbe should not be deleted. Fixes: fe4144d47eef ("net: hns3: sync VLAN filter entries when kill VLAN ID failed") Signed-off-by: Guangbin Huang --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 2a5e6a241d52..8cebb180c812 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -10323,11 +10323,11 @@ int hclge_set_vlan_filter(struct hnae3_handle *handle, __be16 proto, } if (!ret) { - if (is_kill) - hclge_rm_vport_vlan_table(vport, vlan_id, false); - else + if (!is_kill) hclge_add_vport_vlan_table(vport, vlan_id, writen_to_tbl); + else if (is_kill && vlan_id != 0) + hclge_rm_vport_vlan_table(vport, vlan_id, false); } else if (is_kill) { /* when remove hw vlan filter failed, record the vlan id, * and try to remove it from hw later, to be consistence -- 2.33.0