Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp725948pxb; Tue, 2 Feb 2021 16:49:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxoY1NfsxaBHLcHdfdRqGVHmoLSmnkuNgXAz8gGnaGOOkAMMw9C8tycc04MtCGksWdeAzJV X-Received: by 2002:a17:906:442:: with SMTP id e2mr626919eja.9.1612313372823; Tue, 02 Feb 2021 16:49:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612313372; cv=none; d=google.com; s=arc-20160816; b=BWmiH6VRE8socs78vHwxeYtBii2SXbFDiaUAUT4Am/qSdeBOUT8JHWAoDVSTgmVIWR Z9pYzSHYpPDjz8xV1TiqXOqjZz1myW5o/N9WUek5BEizLuBvhoGrrYuoshwafxulwQjv 1+/72OsjSHrOzB3m7nXdAwV/Jknv2oPYAChxcCYYgsTzWVIe+8El2wpDEd6aVaEzjAtP hfi+lZ4fN9q3XZOukJGy/vs/G3BUJ9HnpNGs+Aw8kxDs66Nvy0QnoRB/jnEz5JdC/m+t U6WEr9RnD/Gynt4BWpfw6FLIWjOcvmAYute/jHIOPjwhry+QhBBGJ117VanVbpkKDL6G yiqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Dw5fSWAbbqkHg7oYSwaZuJWNRoQjBFvJ3viKL0ymf60=; b=EEC7M+tUijPNtTOl6/HxVPkApxseqifsnOetWRDGDDD5oeuzl4DV+HdFllE9nFYWMt 7YL9QWWEtwfSOJH6vN3HSKyyntYR7X+6N++GmUXO8bKcXJtcnDmPhPcMTCmbAvVCXoDu w1uTBUYXQnPJ1nWToHtH4hFMO1fnd62U6UCi23BBXxehg3kae3E5LWwbWGjP+boUS7dY dsj497JH5pxp1r71TzMWP4R+DcVzsGcsgDCbtv55CdrYLVFQFvBErHnPdqIot4FPD9N1 21+QVsoHNePTvF57pmKBfpX2WpgdtX3ESO/PQXqhgETbv85mBwUAjad5dYh3ZNa0Vbae CUIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="TueGE/pj"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i4si218481edq.149.2021.02.02.16.49.08; Tue, 02 Feb 2021 16:49:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="TueGE/pj"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240122AbhBBTsl (ORCPT + 99 others); Tue, 2 Feb 2021 14:48:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:42642 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232846AbhBBNwY (ORCPT ); Tue, 2 Feb 2021 08:52:24 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D2FD364FC2; Tue, 2 Feb 2021 13:43:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612273428; bh=M3hMHsjq09ci8Qg/KUAlhjHMI2YUvYmm1qjx55veBsA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TueGE/pj9WToekQnkQ0ajtn2pfHF4KQQAQKQRRMhHyyo3J92eqWkMRwq3Qr+xl56q INOlLUNeaCQjKCwuexo2rXkJaQQ7JQTzPAwGxpATsXWttv5DIj92+uzdAwAL2OsSS8 Bw22rc1xEEgj6XcqGdmSU6CHksQaz8lYs+qiY2WY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Parav Pandit , Leon Romanovsky , Jason Gunthorpe Subject: [PATCH 5.10 076/142] Revert "RDMA/mlx5: Fix devlink deadlock on net namespace deletion" Date: Tue, 2 Feb 2021 14:37:19 +0100 Message-Id: <20210202133000.853368399@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210202132957.692094111@linuxfoundation.org> References: <20210202132957.692094111@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Parav Pandit commit de641d74fb00f5b32f054ee154e31fb037e0db88 upstream. This reverts commit fbdd0049d98d44914fc57d4b91f867f4996c787b. Due to commit in fixes tag, netdevice events were received only in one net namespace of mlx5_core_dev. Due to this when netdevice events arrive in net namespace other than net namespace of mlx5_core_dev, they are missed. This results in empty GID table due to RDMA device being detached from its net device. Hence, revert back to receive netdevice events in all net namespaces to restore back RDMA functionality in non init_net net namespace. The deadlock will have to be addressed in another patch. Fixes: fbdd0049d98d ("RDMA/mlx5: Fix devlink deadlock on net namespace deletion") Link: https://lore.kernel.org/r/20210117092633.10690-1-leon@kernel.org Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/mlx5/main.c | 6 ++---- drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h | 5 +++++ include/linux/mlx5/driver.h | 18 ------------------ 3 files changed, 7 insertions(+), 22 deletions(-) --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -3305,8 +3305,7 @@ static int mlx5_add_netdev_notifier(stru int err; dev->port[port_num].roce.nb.notifier_call = mlx5_netdev_event; - err = register_netdevice_notifier_net(mlx5_core_net(dev->mdev), - &dev->port[port_num].roce.nb); + err = register_netdevice_notifier(&dev->port[port_num].roce.nb); if (err) { dev->port[port_num].roce.nb.notifier_call = NULL; return err; @@ -3318,8 +3317,7 @@ static int mlx5_add_netdev_notifier(stru static void mlx5_remove_netdev_notifier(struct mlx5_ib_dev *dev, u8 port_num) { if (dev->port[port_num].roce.nb.notifier_call) { - unregister_netdevice_notifier_net(mlx5_core_net(dev->mdev), - &dev->port[port_num].roce.nb); + unregister_netdevice_notifier(&dev->port[port_num].roce.nb); dev->port[port_num].roce.nb.notifier_call = NULL; } } --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h @@ -90,4 +90,9 @@ int mlx5_create_encryption_key(struct ml u32 key_type, u32 *p_key_id); void mlx5_destroy_encryption_key(struct mlx5_core_dev *mdev, u32 key_id); +static inline struct net *mlx5_core_net(struct mlx5_core_dev *dev) +{ + return devlink_net(priv_to_devlink(dev)); +} + #endif --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -1213,22 +1213,4 @@ static inline bool mlx5_is_roce_enabled( return val.vbool; } -/** - * mlx5_core_net - Provide net namespace of the mlx5_core_dev - * @dev: mlx5 core device - * - * mlx5_core_net() returns the net namespace of mlx5 core device. - * This can be called only in below described limited context. - * (a) When a devlink instance for mlx5_core is registered and - * when devlink reload operation is disabled. - * or - * (b) during devlink reload reload_down() and reload_up callbacks - * where it is ensured that devlink instance's net namespace is - * stable. - */ -static inline struct net *mlx5_core_net(struct mlx5_core_dev *dev) -{ - return devlink_net(priv_to_devlink(dev)); -} - #endif /* MLX5_DRIVER_H */