Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7149718ybi; Mon, 8 Jul 2019 15:38:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqwl7l4S9D/j1zHbgt9Uo/8GeXaTbhmDD0oYnRVWFl+QpV2JY49u9K7TJcmDhgDFsqOC7Cy7 X-Received: by 2002:a63:5920:: with SMTP id n32mr12050009pgb.352.1562625520676; Mon, 08 Jul 2019 15:38:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562625520; cv=none; d=google.com; s=arc-20160816; b=d0G4nh/KnMJhBY4kQNQkgJxfZbOsVIgoeeCHcYZBIx+hjUu3dXmWeANsb9MocFbU4Z FbZfTAPyqckegWkxMEB0IKJHzwKDipFs8AL0FLhmGHISGcHDycBCghOAVplaTAkNAWmc +8EFHU2N9FffQ/kxuSkQnH6fizS9A6WW0WQpHi/20fkLPUKgGgO67juClK0MtYCQQIAT Mhx8VII8B/2NL37WhSJrD5anWjbju7+7wMCgKdeKI6gwGWU9f7ysjibLBIoQmhidw4ku 0ESYVA9lSOXfI2Yj8Zn3DUHbpaLe0TI6DZI/PbzzsIJy7+Fk7TMblsp754QjZZyGXzpe TLjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0qI5g4RVErLn6Iyzd9JHx07GvYdlxDZ9aFQq//xIAsQ=; b=AY0UYqJGl1kY43bN7IdXUV0NCvGkVD17zVKQ1Qot5SU6TWybNzDdkD+PcwRfqR3mow l5ZD/DiRlWm0E2RyTR7U2jeltlU18mlvyaTP6bffaCKw7WpDb80clLuQl5+oSNyTxCjs jOb1A3NPoHdQDMmyfRhAhHPaAElQUbwiA6rfyJji+RE/2ctEb0NRk0smljXFQEQrFc0B k+mjPQ+RVp5CCc3L0GXXzxyVQuP+573WWMujWEywT5x35gF644SDBfRf/Hx9508G3Zft LFk22WwELJ569jyXRM5/pvfgDqJZxxhrVLKuguTgYC1Q05WWxX1sTPSU85CgooCvgdGG ZUuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZZFWfYzO; 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 p8si15123760pgi.6.2019.07.08.15.38.25; Mon, 08 Jul 2019 15:38:40 -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=ZZFWfYzO; 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 S2389439AbfGHP3K (ORCPT + 99 others); Mon, 8 Jul 2019 11:29:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:57828 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729984AbfGHP3H (ORCPT ); Mon, 8 Jul 2019 11:29:07 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E456B20645; Mon, 8 Jul 2019 15:29:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562599746; bh=73jRZ6iwEIMn0gQH0betICznSgckgcGhuUC5XcftbRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZZFWfYzOmejRoyzwaLP/CYTolSGLPVlMwSvcSobiuCLaSQ1xrfczcQW+2FGmndzDO Xsdmkz+elUrWtUCoSg5q9PpUQMURQ1QG52SikY3/erEimsk7Gb+4HOk2AX9yUjbXHF 7SO1zFrKCeEz6/XHuAWYV+u/rthxUo5wYNpxVjoI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ido Schimmel , Petr Machata , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 64/90] mlxsw: spectrum: Handle VLAN device unlinking Date: Mon, 8 Jul 2019 17:13:31 +0200 Message-Id: <20190708150525.627075755@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190708150521.829733162@linuxfoundation.org> References: <20190708150521.829733162@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit e149113a74c35f0a28d1bfe17d2505a03563c1d5 ] In commit 993107fea5ee ("mlxsw: spectrum_switchdev: Fix VLAN device deletion via ioctl") I fixed a bug caused by the fact that the driver views differently the deletion of a VLAN device when it is deleted via an ioctl and netlink. Instead of relying on a specific order of events (device being unregistered vs. VLAN filter being updated), simply make sure that the driver performs the necessary cleanup when the VLAN device is unlinked, which always happens before the other two events. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c index ff2f6b8e2fab..0cab06046e5d 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c @@ -4681,6 +4681,16 @@ static int mlxsw_sp_netdevice_port_upper_event(struct net_device *lower_dev, } else if (netif_is_macvlan(upper_dev)) { if (!info->linking) mlxsw_sp_rif_macvlan_del(mlxsw_sp, upper_dev); + } else if (is_vlan_dev(upper_dev)) { + struct net_device *br_dev; + + if (!netif_is_bridge_port(upper_dev)) + break; + if (info->linking) + break; + br_dev = netdev_master_upper_dev_get(upper_dev); + mlxsw_sp_port_bridge_leave(mlxsw_sp_port, upper_dev, + br_dev); } break; } -- 2.20.1