Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2236344ybi; Thu, 20 Jun 2019 11:21:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqx+msgMAWN0r2G4wwTMLzHOwmd79sRTlRCGsUPLMDHRbKgy4uk5MOCG7eOLTl2KCkBLI+n5 X-Received: by 2002:a17:902:6a4:: with SMTP id 33mr20469525plh.338.1561054899824; Thu, 20 Jun 2019 11:21:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561054899; cv=none; d=google.com; s=arc-20160816; b=h2M0fD1V51vmgqFlWlHn1kim4zPxrBSlGBIhnlt1KvoRTBtssNyuZ9YiKq5ACKkA+J QWH9TVn6+zB+3ZV6ezue17DNXWlrKX+3I76Y8310h5rFIPJXhKVX5ds0C4IkKEW5HwMo PxpKGgMYdycmAOBJR0tqNK5wNIJWkGvNDvPU6ZGjAAxwizK7n6KW21Zx8Y8TDTT+ErzR nmetoxSadYEbPnSk/N32DSdu83gLMj3mYwiBCcu7Ptz1g+Ah5MbbrlDf/fET2WZuerIi hr4crLNBrIMw7C74PEkhktFp+cGl78uWj/vgpksroc95kf5O5a1Y0+SzDxPiGdalfX75 Y0FQ== 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=6Mu7MH7Zg70bXKeN2+jcIRiqy6lU5Zdmeho+6rHk0NI=; b=jTWY6CRWTx5UWNRNNheccYqX9HwF71OmVFFh6ZIXjP8w3Anm4/WMYFY07u529MrUPx Lb06rxRF0eSz5OUxzM8iJUxhKpWbVrrpxb5v14747WuNxFlXQcRGC03suZr976uTk8rD l7p/Xaxz4jKoQM+68cHotxvT8Lu+7Yb99F8JPl2qWRy0434npTwy5sQ+SSeuctROZ/6L cwgkPZK6LlWkVSfH0FfHHkKOzkIO/mWvjdfh88Vbjp9H/Tgn8iXkk5TKz+fwWFDf/BPr 1Hpd5y0ryLXhVczOZ/OYkrYmTAU8vJBEpTRooZkBPTJ3X4FpwMqpKt+HkJYNJiM57OXR t8Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pzLLHj0A; 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 g9si401829plm.207.2019.06.20.11.21.25; Thu, 20 Jun 2019 11:21:39 -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=pzLLHj0A; 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 S1729389AbfFTSOH (ORCPT + 99 others); Thu, 20 Jun 2019 14:14:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:42244 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729379AbfFTSOE (ORCPT ); Thu, 20 Jun 2019 14:14:04 -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 D5FA02082C; Thu, 20 Jun 2019 18:14:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561054443; bh=51G2RfOZqniUpFsAvtY2p//KMg0DjegK6uTOlGuPi8w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pzLLHj0Ap226XiGenkQuX+SbyDxivpJREiAUTUiWtK8jaD9nyvvY011i+jyIC7wt3 jmXMQf/BOXmxsbr1F3Q+QJKVHyI4CsyMKrI79YRJb72d7u2GrVPQYF6+keqA6jg32C 8/6dDE7phHLL2pPWTUxnIJCDF571QaSwGzwhlu4I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alaa Hleihel , Roi Dayan , Saeed Mahameed Subject: [PATCH 5.1 31/98] net/mlx5e: Avoid detaching non-existing netdev under switchdev mode Date: Thu, 20 Jun 2019 19:56:58 +0200 Message-Id: <20190620174350.526714136@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190620174349.443386789@linuxfoundation.org> References: <20190620174349.443386789@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 From: Alaa Hleihel After introducing dedicated uplink representor, the netdev instance set over the esw manager vport (PF) became no longer in use, so it was removed in the cited commit once we're on switchdev mode. However, the mlx5e_detach function was not updated accordingly, and it still tries to detach a non-existing netdev, causing a kernel crash. This patch fixes this issue. Fixes: aec002f6f82c ("net/mlx5e: Uninstantiate esw manager vport netdev on switchdev mode") Signed-off-by: Alaa Hleihel Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -5165,6 +5165,11 @@ static void mlx5e_detach(struct mlx5_cor struct mlx5e_priv *priv = vpriv; struct net_device *netdev = priv->netdev; +#ifdef CONFIG_MLX5_ESWITCH + if (MLX5_ESWITCH_MANAGER(mdev) && vpriv == mdev) + return; +#endif + if (!netif_device_present(netdev)) return;