From patchwork Fri Oct 12 14:34:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 148767 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp810977lji; Fri, 12 Oct 2018 07:34:55 -0700 (PDT) X-Google-Smtp-Source: ACcGV60m1soTXBLwW0ueo46CiPV/gS6QMU0tSq43RvK33w2p1Ui7poZePcb6WWWCQIXAzmvWqERF X-Received: by 2002:a62:401:: with SMTP id 1-v6mr6342185pfe.236.1539354895306; Fri, 12 Oct 2018 07:34:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539354895; cv=none; d=google.com; s=arc-20160816; b=U1KGbE/VoqnqJe2G+D6sDfdZclLzlUPys0hk8EFFx/N5k4qpyfacqNugL3o/gQhhid u0VbIeZdj+o5gO/rL/GvgsLI4ijmfTtf0/i9SJvcBcHl39NZcfX/OTw3Kdp810Wxw2qx gAYups/f+HvtB/xWIj7ZLnJxJSEB9J4Uej2Pjk1M9JR083okD2Fua0RGUBdlvzQsQhI0 tqyQ93U7qfNL/SGDkIH03HzeJ76LFKA/RUUXVb6y/ic2sGsgDaKkcyNp1zWW4lRzxt7F e/phd2aoDzg5Ai1IR9ZtMGB4zYF5BFXpUwiRerO8kuV8K/OHlK/tNpFweO23BB2JyRi2 4Hjw== 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 i6-v6si1406090pgl.50.2018.10.12.07.34.55; Fri, 12 Oct 2018 07:34:55 -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 S1729007AbeJLWHg (ORCPT + 32 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 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(-) -- 2.7.4 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; }