From patchwork Mon Sep 3 10:21:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 145778 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2313333ljw; Mon, 3 Sep 2018 03:23:23 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaoHYCvy9OmOtnG3nNmkEavItuJcsKVTZC8nOWzvzkW1vJMC8nfVlNC/Lelag7MYDfMRiX8 X-Received: by 2002:a63:2022:: with SMTP id g34-v6mr21589188pgg.235.1535970203619; Mon, 03 Sep 2018 03:23:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535970203; cv=none; d=google.com; s=arc-20160816; b=tg1VHAqposgTwmtyMh9QCRHXGKrVVShEo1gY94SHOXvLLyVUA1ibkJ/uBQjLNSs1AA 9PjdMGTlQ7JjdlIcTLqIeaJ/gmEVapKHdC2PlXZXuJoSJ9U/HCeXJxTzZczyrxiYSJWG 7gv9oyJxtSCbWgcvo2+5QBDr1n7fHH+n/pr/REov6ZSlJO555wQf2KyZ7L0z7yvIC/Al oF7BOB7L7QAFRcFDWp4v43nqyGoR2KrvFf2Q2rCM0ikbAilnITaV+vgRSgBQOu56jD/q bsWH98edEkCogg2omGI4NmcZjrpPmPT/95zmvev8k2F6+6TJqIbiEaKc7yaW49o8dFDB jLWw== 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 s68-v6si18298436pgc.16.2018.09.03.03.23.23; Mon, 03 Sep 2018 03:23:23 -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 S1727989AbeICOmv (ORCPT + 32 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 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(+) -- 2.7.4 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) {