Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp174089imd; Wed, 31 Oct 2018 16:48:51 -0700 (PDT) X-Google-Smtp-Source: AJdET5fs1mMigFRxrifq8pKgUxsNKNSA/W9QE+ImiVs7q5w6fUeeyml1qTns1Vbqfpi2OGl3Hcpg X-Received: by 2002:a65:55ca:: with SMTP id k10mr4995220pgs.448.1541029730952; Wed, 31 Oct 2018 16:48:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541029730; cv=none; d=google.com; s=arc-20160816; b=E7zp3Q1uK7x+25JhpWreQYE4CJqmBpNNMQUUbCG/Qac0h3ZUcxOfvk8qli0XcKAlrQ Fm3YO24c3KdAzyERh55H0/cLiZ3PlXboT+Co1KgQ9FExdxwPlJ2CmEmBuZhDWtJNg1Cn yDx8XViuKIvYSUCrZ9NiAt+k1vehTG7q5gNcoKoWjEeET0tZ//LYcPpQ9cMNntWuirNn FNWxYaoPbhFUPg9NU2GWx1G3XaB6oqSwKSAXJOZL0AnIjRYLHdi9vrkGpsKFbT9md51u 7vYoreUxUOZcclOVfRx8hcTG992/dtwS5CYbKKncqD8+DC64QTfbV1469zOcCAc/7xh2 wmtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=R9R/Om9LbkGWUi/BKanwtrpEJ7wrkbbIcAwkHT7ho/4=; b=UvtCaC/HdVhuQXwItJfNeXQtdZmKrk0J2XoWQlAaeTHpev2WlDfiILsgUiEU+ARVdz buOyevZJQ2JfA0bIcbQb8WRjX7zGFH41PL+njXvvB98u/quIBeylvUrQJA9wiSLPt0rE eIsDL59/xjBb/JTLEygiRjYOcQNqmp7X/YK0M9GEHCPLU6adXZGNU73ZL/mZv7JwWHTe UxK8eZyUnx7GKcpLi9RbL5sZ6bIEc6o4Ica2ukNiaaHpGK5EPcsvspyw2CXMX518oVaH SJM2rglnu+LM31TXk6wi8nRlqqHCUx9UBgYEaLVGRJ1cH0oCbGG+U54tyZtMIe/fnvG9 RjpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Z2EGee7H; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3-v6si28023606pgq.536.2018.10.31.16.48.34; Wed, 31 Oct 2018 16:48:50 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Z2EGee7H; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728468AbeKAIG5 (ORCPT + 99 others); Thu, 1 Nov 2018 04:06:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:54278 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728445AbeKAIG4 (ORCPT ); Thu, 1 Nov 2018 04:06:56 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 61D2F208A3; Wed, 31 Oct 2018 23:06:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027206; bh=QGXDVHmPstaaUpqNSPdLWRkqUfefjoSwEmGB+NG8ctY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z2EGee7HIZSusImg6X9rAQLOEO6xa3SNjbfIeWDgrIseIkmDhatB3roxQCusAVnTQ KcRM+1p6V2AWgfQHlt8YAiUpzvltqFelCInNDopA8pbinbzoCzfYmJ3ocmbRPgOb7B 0HTxCOg2x3BMmEiaCbnoHKe9oOJWt87mUAjdV+vE= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Yunsheng Lin , Peng Li , Salil Mehta , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.19 069/146] net: hns3: Preserve vlan 0 in hardware table Date: Wed, 31 Oct 2018 19:04:24 -0400 Message-Id: <20181031230541.28822-69-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yunsheng Lin [ Upstream commit daaa8521760ee4d4e65f309c4c37b3a1e58c9d4e ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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 dd1e390ed68e..2d58726893f4 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -4739,6 +4739,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.17.1