Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1844080lql; Wed, 13 Mar 2024 09:36:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU5PpSVyGKojQKldARi6feSpMiMdbCqaIDKRQbRGldWxMfiIg+uEbgb1A/PuAO8cHL8Yo+5k2EbLKfXaOCHu9z79RQBnJdrhjU2Mejy7g== X-Google-Smtp-Source: AGHT+IHXvaePSOXsL/En8GhDg0cBSvnO2f14hUXLt4lmqw22+cBDxIKBi3FCiP/nDUytpWDt89oK X-Received: by 2002:a17:907:c70d:b0:a46:66c6:2c29 with SMTP id ty13-20020a170907c70d00b00a4666c62c29mr951272ejc.1.1710347793180; Wed, 13 Mar 2024 09:36:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710347793; cv=pass; d=google.com; s=arc-20160816; b=P1kOXNeiVto0fEej2wS32oy1RkBjdrdAKnKVc295d/YFRmfFfJJgLDoe+mraXL4JoT SFwdEURw0kqh6qBNgqblMr/Stqbmt9BuhuuS1x1Pa8AKo5J9nhOtxh8eIKoDgmuEbpZ5 romUu6sP1rHJEOo1f52Tn5j6xrgpq1UKEJQy5lN9/52OX4mt9sRJ+1YvIY5zkjrgyk0M FRk443Gn7k6i3Gwvitid/LgOf32VtVYIyhZ3wzSOEfwV6f9g/xijoljeuop2CmGQysuj wB6Y6irg+nIMVVynT6A4cIa9x0XDWW44ayRFSnLs84MfYod8A4Gx3xebt8P+mHCoP73C W/ww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=bliJ54UfDRVs5GkkId7ODW7aG8UMnsfCItYfTxZA3ys=; fh=peDr1RsWVvoj7AAdLX8CVMD52Pnezr/sxa3iLID71NI=; b=N0WbZrMTrsl8QX2lLzepzAswWYCB0zFzW3TukiDEVES9zDdnCNNrXQUApJWKGdH44A YyJFYrGsewGdNrqlzVWIg+uNEzMlWqHdVvGl86g4GN6iMyRfKHIngTi2b/ul6TnBhQpJ 7zYj2bM0Iiqd5bJXNwzfg96ag9WL5zqqlTTn6i4bitX5Udk6nMg0E2ih4xTlpj+PMsky fQEuDOOfwT1Cdo74+LoJ7YBbUjHaiWltRtu+I6yW/Jxl3RFKjbvaxxNBQdQMRKA/z4s7 o3B4B46F09K5R1DdI4024/Wm6yOgiGXNWIeBK2nmjlfJsThlGONQpjLO5qxtvN3jjsv9 IpQw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Exu/UC5E"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101755-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101755-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n20-20020a170906689400b00a466047d498si571511ejr.832.2024.03.13.09.36.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:36:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101755-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Exu/UC5E"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101755-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101755-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E1A5C1F231FA for ; Wed, 13 Mar 2024 16:36:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C02005D758; Wed, 13 Mar 2024 16:32:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Exu/UC5E" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E55A65D47A; Wed, 13 Mar 2024 16:32:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710347579; cv=none; b=qh8eshFxZS1xAe2APMN6mnE3JZI63Ka29sZPLQ8lS21xYJwH1ADt2uzl4qwZ435de4tTnPL1t6L3zwWyxjeaUKM9m6F7tdfd17lqWZGR4NlCrYgTinDgEsahWk6R41MC/Kw0uQV+yRMwryG7Qox70styMyNy7UQh248aOOu8OZo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710347579; c=relaxed/simple; bh=S44Bxf3H3YLvcP2MTqG0v13+jDgLG9ITI6aZKtwfMf0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jTQHl1pdGJ8vINYTHOWDIsb/HInARWWvl0P78/fuJMU/uIOnJzoqMbH1Ri4h0agJfrTPafSBAq56UC7Eb1IKwHLqv7UQWqrcRObITuzSj2Gb3NPrplQtyaAHyCxi140Cf2AeNNcohbrULg+dGWks2MW89KePNqoqrQ6B2+LBPEg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Exu/UC5E; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D43F3C433F1; Wed, 13 Mar 2024 16:32:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710347578; bh=S44Bxf3H3YLvcP2MTqG0v13+jDgLG9ITI6aZKtwfMf0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Exu/UC5EZNisX7/yC7MFY2f2ih+S1YHdofxgYF0ybWdaGOakwv9Q18SmEcI3m3+/8 O/lD+cea+H/nBqpw7kqKCVPF8DrzGXxlTE21bV48zEBKVqjuq92Ei1asrUMLvTxp9o wfYL+hRma7OmfaWcVvoEf36TeMlflRvLGHkYDdjFuNsHg7uMAKlwpJfLJpi6d2+mZh lloQqjA6DtJ8TrDuvRS5BGWLa11LdmmC6/zo8r4tfN5ObIe4jbrtxW7GOXNgT3l38G 63GEa01SDvBgYzNY/7q+eMP7WdrLohK+j1zGXkq9Dy8jpCVucZ1aDVPCqBWfEFLEzU aNZ9PKhEkBM7w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Gavin Li , Jiri Pirko , Saeed Mahameed , Sasha Levin Subject: [PATCH 6.7 16/61] Revert "net/mlx5: Block entering switchdev mode with ns inconsistency" Date: Wed, 13 Mar 2024 12:31:51 -0400 Message-ID: <20240313163236.613880-17-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313163236.613880-1-sashal@kernel.org> References: <20240313163236.613880-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.7.10-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-6.7.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 6.7.10-rc1 X-KernelTest-Deadline: 2024-03-15T16:32+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Gavin Li [ Upstream commit 8deeefb24786ea7950b37bde4516b286c877db00 ] This reverts commit 662404b24a4c4d839839ed25e3097571f5938b9b. The revert is required due to the suspicion it is not good for anything and cause crash. Fixes: 662404b24a4c ("net/mlx5e: Block entering switchdev mode with ns inconsistency") Signed-off-by: Gavin Li Reviewed-by: Jiri Pirko Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- .../mellanox/mlx5/core/eswitch_offloads.c | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index b0455134c98ef..14b3bd3c5e2f7 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -3658,22 +3658,6 @@ static int esw_inline_mode_to_devlink(u8 mlx5_mode, u8 *mode) return 0; } -static bool esw_offloads_devlink_ns_eq_netdev_ns(struct devlink *devlink) -{ - struct mlx5_core_dev *dev = devlink_priv(devlink); - struct net *devl_net, *netdev_net; - bool ret = false; - - mutex_lock(&dev->mlx5e_res.uplink_netdev_lock); - if (dev->mlx5e_res.uplink_netdev) { - netdev_net = dev_net(dev->mlx5e_res.uplink_netdev); - devl_net = devlink_net(devlink); - ret = net_eq(devl_net, netdev_net); - } - mutex_unlock(&dev->mlx5e_res.uplink_netdev_lock); - return ret; -} - int mlx5_eswitch_block_mode(struct mlx5_core_dev *dev) { struct mlx5_eswitch *esw = dev->priv.eswitch; @@ -3718,13 +3702,6 @@ int mlx5_devlink_eswitch_mode_set(struct devlink *devlink, u16 mode, if (esw_mode_from_devlink(mode, &mlx5_mode)) return -EINVAL; - if (mode == DEVLINK_ESWITCH_MODE_SWITCHDEV && - !esw_offloads_devlink_ns_eq_netdev_ns(devlink)) { - NL_SET_ERR_MSG_MOD(extack, - "Can't change E-Switch mode to switchdev when netdev net namespace has diverged from the devlink's."); - return -EPERM; - } - mlx5_lag_disable_change(esw->dev); err = mlx5_esw_try_lock(esw); if (err < 0) { -- 2.43.0