Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp843827imm; Fri, 12 Oct 2018 07:35:44 -0700 (PDT) X-Google-Smtp-Source: ACcGV60+oZpHFH5o45ZIAaMJKAsI2CqoSe6SsIvuVDt5FVwIYk/5jaB0mPKlnhM4zIPbCpXksMAv X-Received: by 2002:a63:501:: with SMTP id 1-v6mr5746688pgf.205.1539354944928; Fri, 12 Oct 2018 07:35:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539354944; cv=none; d=google.com; s=arc-20160816; b=BwYQ5ozT1VbPvfjERmY7lHBi0+fCjUV0ocyJZR1mo0ktpZohIL886yby6Zwmz/ajP/ C9O/4HjyaWNHGkNSLug1yr7My7VW59ODSG3+h6jQf2jgSD/NuQpfgDror7mZ48/e5jZE kJ9+d4JPrTZRWvb44rrk6uFu20WGzKClQyuRrTTsUPhX3IQcAn6tVAm/uj9npPi10FuF Vey+EYvGvFWfa1UbpG16Aw4ZQEZYXlwkqEFZNFC9Ap8wpPZf0mCLDuLfjkr3YWpXmFip QTqoq8Q2C0LYog10nZ/Z3Jmyn2x42/RaR0Y0bXtWxa1FeFIUbFsUK4ybarnSUNfgEVOB N5RQ== 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=yYbRsIRtdkadBojZdgCn8LM+oxPTmLniUWq1MybCPDg=; b=eS02nX3oQ5QrGFg8ILOGGVMBXi0j6aUdJaKYIJzr4Y3JOTUwVtzfO1PzKVsOOBSpCa lhQh5335++BeXaK17ydWTd99tFrCRMd3zd3Zu1tljHr2CZdjD+xyYKcMScGEhMcxWHyt 241ct9H2KSTP2XqHjGHVb7zB+aYLen06qMUQJQXIBWzB0U/Uk+1NEfsg/ukoylWwscdl +i7UsV5a/dqn3z6jS8QLK0vNJ+62lu+vQAKnnhq6EzY8UH/Yle/5UVUAV5g+sEDgiOKJ 7TSpyELjHhjr0j+KBHnudv+eQcqFB3CXRosxGIly+uOcXmEFowTuQ2pcvKCeCKo1u3Nc Fqbw== 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 r12-v6si1410785pga.346.2018.10.12.07.35.30; Fri, 12 Oct 2018 07:35:44 -0700 (PDT) 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 S1729003AbeJLWHg (ORCPT + 99 others); Fri, 12 Oct 2018 18:07:36 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:59987 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728937AbeJLWHf (ORCPT ); Fri, 12 Oct 2018 18:07:35 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 7A4256003C1A7; Fri, 12 Oct 2018 22:34:48 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.226.54) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.399.0; Fri, 12 Oct 2018 22:34:42 +0800 From: Salil Mehta To: CC: , , , , , , , Jian Shen Subject: [PATCH net-next 3/3] net: hns3: Resume promisc mode and vlan filter status after loopback test Date: Fri, 12 Oct 2018 15:34:06 +0100 Message-ID: <20181012143406.22600-4-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20181012143406.22600-1-salil.mehta@huawei.com> References: <20181012143406.22600-1-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen This patch resumes promisc mode and vlan filter status after loopback test. Fixes: 3b75c3df599d ("net: hns3: net: hns3: Add support for IFF_ALLMULTI flag") Signed-off-by: Jian Shen Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c index f1354f6..a4762c2 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c @@ -71,6 +71,7 @@ struct hns3_link_mode_mapping { static int hns3_lp_setup(struct net_device *ndev, enum hnae3_loop loop, bool en) { struct hnae3_handle *h = hns3_get_handle(ndev); + bool vlan_filter_enable; int ret; if (!h->ae_algo->ops->set_loopback || @@ -91,7 +92,14 @@ static int hns3_lp_setup(struct net_device *ndev, enum hnae3_loop loop, bool en) if (ret) return ret; - h->ae_algo->ops->set_promisc_mode(h, en, en); + if (en) { + h->ae_algo->ops->set_promisc_mode(h, true, true); + } else { + /* recover promisc mode before loopback test */ + hns3_update_promisc_mode(ndev, h->netdev_flags); + vlan_filter_enable = ndev->flags & IFF_PROMISC ? false : true; + hns3_enable_vlan_filter(ndev, vlan_filter_enable); + } return ret; } -- 2.7.4