Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3801731pxb; Mon, 4 Oct 2021 09:54:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoGZKeNzxqbU3B17umpDMca/D/WzT+at8S8Hc87Ee5zz16HXPcs9SnR9eRPSPqhm1o+l+R X-Received: by 2002:a05:6a00:2d0:b0:446:d18c:9aac with SMTP id b16-20020a056a0002d000b00446d18c9aacmr26203896pft.16.1633366452126; Mon, 04 Oct 2021 09:54:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633366452; cv=none; d=google.com; s=arc-20160816; b=gOsdufayiBaEV4fTLi1EFa3LB1AqTeHF7oJT6lzDTVC3/jUKsXghLhRItEugLRj7iU l08YNnV4LA5K5pzB6kr1Fj67/kZJDmzfs47IkzW1yxw5EOTZJ6BzeRvWQ7ejzyDILXuW 6mGXyuhzU6L9VtUQ7ZzqSw/r4dL2gRBhY6LjIc0AFxqTVL+prjXqupuvQ5gegbz2DUaJ YP7hF+v2nXr4sGJ3oY97i0wsQ2wx9U4LdIbhWb9EusAAZYry+g0ogtrp/rCsC9AJEa/A MVJjyZMrfH5nCzJxK28TVwKdNZnHVLvrwaJbrYhj7/VjZ8RUxDXBCikZ34R6ljb0SXMj 7Q7A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pGHTWj7bDbe8y+tgUuH4e4u4RY7h1wlZLwlQJNr7Nnw=; b=oBIwJp1BNnsdpt17a1FvW5d2WmvF7Mkzkfv80/6Fsoy1rI2OVdlPtow2SWCRr9PUm/ OP6PdyKjgGtyGAebs4AukINWjUkL1mNet+VjXD0WJWSKU61c3yNmXrT9cQLeaAEKU2e3 7wrWVXWluiB0VV74XOQq3J0mTZpV6HG22rmZgQyCXWDHiXnV9W1pCImeCnwYrF8BD46s faudUTAyDKxFP5EA54BRY2KHobLLioLZf7WmWUzuAeSDFkDWu/xxi3wInUfu5ETnzV/P fx0eQHlz3mHrFBFw//ztNAaD52TCs8WTLw7HVMJJVn8w/G7c3iDaZxsh4oWxod7Vz2nc 9yDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RJg16r96; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n64si19998431pji.92.2021.10.04.09.53.51; Mon, 04 Oct 2021 09:54:12 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RJg16r96; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238510AbhJDNkg (ORCPT + 99 others); Mon, 4 Oct 2021 09:40:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:51998 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238490AbhJDNih (ORCPT ); Mon, 4 Oct 2021 09:38:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DACAB61B31; Mon, 4 Oct 2021 13:17:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633353461; bh=QYt9trg1oSaefnwroeaWSvTpXmJbnJK1xVb51c0jn6U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RJg16r96z0vpI8enwFcfApXFH0eSXhDlY5uDUECh3kyBnS6EHjCeu9o/zLBla4+GY KnMTetwbyMwfNGyARZ+DsbzL8i4nJlNqqFyCv7pZ+nWRCTpSpxFebtvYxj4sv2h7/W Hkuib3LH0PRIJg0Bf1pvhAjXMVN9QSZHXho15epw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guangbin Huang , "David S. Miller" , Sasha Levin Subject: [PATCH 5.14 130/172] net: hns3: fix always enable rx vlan filter problem after selftest Date: Mon, 4 Oct 2021 14:53:00 +0200 Message-Id: <20211004125049.163432672@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125044.945314266@linuxfoundation.org> References: <20211004125044.945314266@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guangbin Huang [ Upstream commit 27bf4af69fcb9845fb2f0076db5d562ec072e70f ] Currently, the rx vlan filter will always be disabled before selftest and be enabled after selftest as the rx vlan filter feature is fixed on in old device earlier than V3. However, this feature is not fixed in some new devices and it can be disabled by user. In this case, it is wrong if rx vlan filter is enabled after selftest. So fix it. Fixes: bcc26e8dc432 ("net: hns3: remove unused code in hns3_self_test()") Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c index 69b253424da8..83ee0f41322c 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c @@ -348,7 +348,8 @@ static void hns3_selftest_prepare(struct net_device *ndev, #if IS_ENABLED(CONFIG_VLAN_8021Q) /* Disable the vlan filter for selftest does not support it */ - if (h->ae_algo->ops->enable_vlan_filter) + if (h->ae_algo->ops->enable_vlan_filter && + ndev->features & NETIF_F_HW_VLAN_CTAG_FILTER) h->ae_algo->ops->enable_vlan_filter(h, false); #endif @@ -373,7 +374,8 @@ static void hns3_selftest_restore(struct net_device *ndev, bool if_running) h->ae_algo->ops->halt_autoneg(h, false); #if IS_ENABLED(CONFIG_VLAN_8021Q) - if (h->ae_algo->ops->enable_vlan_filter) + if (h->ae_algo->ops->enable_vlan_filter && + ndev->features & NETIF_F_HW_VLAN_CTAG_FILTER) h->ae_algo->ops->enable_vlan_filter(h, true); #endif -- 2.33.0