Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1547797imm; Mon, 3 Sep 2018 03:25:17 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb8cAzwoggKyB4TE9Scp7iuWIh8GT71Q+mKeFHUrnx8x3zcoVu4Vm8je3Hdiq97DltOsFQo X-Received: by 2002:a63:c44a:: with SMTP id m10-v6mr25815093pgg.416.1535970317882; Mon, 03 Sep 2018 03:25:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535970317; cv=none; d=google.com; s=arc-20160816; b=ZdeSkBQzilheW6G497sZkXwb+xc2FoIrpQEfgbCvey1Nal2tg8rD9IjN+3R6IPZLau bhGvfTP4MJ84cKpofX9w5NEc0xyQ72Xw6+RyF8clB0drfRp1BCtGhTbjd+Cuhvrzrf/s gpqPwAEcx6Rws1gzWqylV/yGOf4pGP/rI9aW89pR94ympaWVPC0Jrb0BwjLol3DHDRTj i755Dy9zLBcsyWDJfpJKZctSH3RmkWnG+LdPi3wPo6SWRzmuNUE6ze1njxMDn/zaU8C+ 5Uumfyqjb7fQEigofmiqtXwgHLDNz8X3mDyNJ4GOtRb3xTeBPVCUDWU9ALQl0+vqIeGR 057A== 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=U4a8LMXGfrvLaBhzkVCk2MmqSbYTnMOT1GMnbiMvG7k=; b=J+8BG4p1MLDYU4feupIkpCS6b35u+2pXaZN7XExu447a+RxsAaX71ejWqNwZxbzagq tYax1T7LlyJRIKb0MdmktlIqjd+bAECONbsxsFmI4UaCy3t2DTpcLHL/Zv2Y2JV0xLep 1E9HlSuXtNYYYjqBXcyOp1FiuDZE9D0aSwQRuBXb827qYtY8CwWjA6j9ttP6kNQidGNJ iJ12ICjRZyh1v3+THQrMzLvsuMqkpO9PId4bFKa5fBsfbvOIV+FarxkCWyUzf+o/hnmh 1TCQtuIIX4TrNE/wI3os88kRBZr4VVcqlg15yKn3l4gM/wfrmul3pH6CfDl42o1BScQb Lvcw== 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 b4-v6si11822066pla.420.2018.09.03.03.25.03; Mon, 03 Sep 2018 03:25:17 -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 S1727983AbeICOmv (ORCPT + 99 others); Mon, 3 Sep 2018 10:42:51 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:51618 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726047AbeICOmu (ORCPT ); Mon, 3 Sep 2018 10:42:50 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id D395115F31176; Mon, 3 Sep 2018 18:23:14 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.226.54) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.399.0; Mon, 3 Sep 2018 18:23:09 +0800 From: Salil Mehta To: CC: , , , , , , , Yunsheng Lin Subject: [PATCH net-next 07/11] net: hns3: Preserve vlan 0 in hardware table Date: Mon, 3 Sep 2018 11:21:52 +0100 Message-ID: <20180903102156.18676-8-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180903102156.18676-1-salil.mehta@huawei.com> References: <20180903102156.18676-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: Yunsheng Lin When netdev is down, the stack will delete the vlan from hardware including vlan0, which will cause problem when doing loopback selftest when netdev is down. This patch fixes it by always preserving vlan 0 in hardware, because vlan 0 is defalut vlan, which should always be in hardware. Fixes: c39c4d98dc65 ("net: hns3: Add mac loopback selftest support in hns3 driver") Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 4c7442e..004bfc1 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -4749,6 +4749,9 @@ static int hclge_set_vlan_filter_hw(struct hclge_dev *hdev, __be16 proto, u16 vport_idx, vport_num = 0; int ret; + if (is_kill && !vlan_id) + return 0; + ret = hclge_set_vf_vlan_common(hdev, vport_id, is_kill, vlan_id, 0, proto); if (ret) { -- 2.7.4