Received: by 10.223.185.111 with SMTP id b44csp1006423wrg; Fri, 9 Mar 2018 19:01:27 -0800 (PST) X-Google-Smtp-Source: AG47ELt15UYS781M9D5S/FIgLonlEfvGOsD3oG7bM9QQY6x2rl5Rkjb1u/ECWvWxvkgTPX0V8ZUg X-Received: by 2002:a17:902:6582:: with SMTP id c2-v6mr679655plk.189.1520650886922; Fri, 09 Mar 2018 19:01:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520650886; cv=none; d=google.com; s=arc-20160816; b=BD/4TXVTjVBTXrqe/wNcasjMNGrsKwQj/HFDecchyM99w34T1p0gqkPSbUFvm8eO2m wzLalSXHkEU9vXXqGIH2rf0LXyXNlN1d2uGtTUXKDHnU3yz0ko9EH8icfxuxiXzjmPPY NbcDWfsAGW+aUp3JQObBpFlQ1v2JN4Ix4vD6vlvRYVc0tA5NbB1hGSDgmaeH76P7wDAk OawOA/2WC4E4gmDJfxknhbTPLjUmWIeTOk3s5AXj2QbT+SMLHCGq8ByaXQuP0CUDP6AV SPQM0A5vJTyaF51TyAjMJpcuB1N9hWlDMkjZDmEDWv2WeBd5pZu2PfZETswrQK2Q7mW0 h66A== 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=DFeUG0tTwlS3lgiU6N+1yRkJmZWh3p8Z7irYr9dOy3U=; b=J3ac/qQXs64tvQvZkGDutTGZg/fC/4HXfFTX9S+cRh9MB+7NXsdQyVDXIhjULMdiQ2 ngzMGV4aEDpAHMdNNXtK7QbcJ2b9ofd0W46W1vZ1GY4mOujh4xMdxqlyTGDbhB0Nkc2P OYAXlLa+pyQWILoDRt+gAPTSsaMpbkLNYL+RFnxtQLhjQ9ggFLBaOqznrvl3tSFSxeHH hEtOrKU04FFeTWa/TtfYvR5XmPSGHzZYE4d0jkBzrjkCLFkLRxzVuRCsOVWJJXbSxoBW eiaObkbEHvukLJbWisT/xiaX4RIvJphKeK7N+Sd5BoLgbSfYmaPNPJ5Zg3hTHqZxJu12 ZypQ== 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 b24-v6si1986799pls.222.2018.03.09.19.01.12; Fri, 09 Mar 2018 19:01:26 -0800 (PST) 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 S1751791AbeCJC5h (ORCPT + 99 others); Fri, 9 Mar 2018 21:57:37 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:6222 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751349AbeCJC5f (ORCPT ); Fri, 9 Mar 2018 21:57:35 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 849719507D782; Sat, 10 Mar 2018 10:57:21 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.361.1; Sat, 10 Mar 2018 10:57:17 +0800 From: Peng Li To: CC: , , , , Subject: [PATCH net-next 07/12] net: hns3: fix for loopback failure when vlan filter is enable Date: Sat, 10 Mar 2018 11:29:28 +0800 Message-ID: <1520652573-75644-8-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1520652573-75644-1-git-send-email-lipeng321@huawei.com> References: <1520652573-75644-1-git-send-email-lipeng321@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.71.200.31] 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 When vlan ctag filter is enabled, the loopback selftest fails because loopback selftest does not support vlan. This patch fixes it by disabling the vlan ctag filter when runnig loopback selftest. Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c index 26274bc..2db127c 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c @@ -309,6 +309,9 @@ static void hns3_self_test(struct net_device *ndev, struct hnae3_handle *h = priv->ae_handle; int st_param[HNS3_SELF_TEST_TPYE_NUM][2]; bool if_running = netif_running(ndev); +#if IS_ENABLED(CONFIG_VLAN_8021Q) + bool dis_vlan_filter; +#endif int test_index = 0; u32 i; @@ -323,6 +326,14 @@ static void hns3_self_test(struct net_device *ndev, if (if_running) dev_close(ndev); +#if IS_ENABLED(CONFIG_VLAN_8021Q) + /* Disable the vlan filter for selftest does not support it */ + dis_vlan_filter = (ndev->features & NETIF_F_HW_VLAN_CTAG_FILTER) && + h->ae_algo->ops->enable_vlan_filter; + if (dis_vlan_filter) + h->ae_algo->ops->enable_vlan_filter(h, false); +#endif + set_bit(HNS3_NIC_STATE_TESTING, &priv->state); for (i = 0; i < HNS3_SELF_TEST_TPYE_NUM; i++) { @@ -345,6 +356,11 @@ static void hns3_self_test(struct net_device *ndev, clear_bit(HNS3_NIC_STATE_TESTING, &priv->state); +#if IS_ENABLED(CONFIG_VLAN_8021Q) + if (dis_vlan_filter) + h->ae_algo->ops->enable_vlan_filter(h, true); +#endif + if (if_running) dev_open(ndev); } -- 2.9.3