From mboxrd@z Thu Jan 1 00:00:00 1970 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 E07B51E1023; Wed, 19 Mar 2025 14:37:13 +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=1742395034; cv=none; b=fWoHExlin1EFgG3lQaKY/WYoZuUTEs/Wi0IP1iMiBswQtqMV3z3Jr/kx6zL8qfrD0PuK8bSdulrAAZHTqVs9KzoXKoDbHlTgWg5/bh3FV+2nCYINnrpjpcqhiksQl3v+BrCdleZMzWHqkkxZnxTq9NYPidpWB2/2YkNZnyUilps= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742395034; c=relaxed/simple; bh=b2Sb3oaFQb3Aw0Y7oPuBYAvR31nUHJdoOq+ATdfyRoM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=s62d+taqEKcUT3DksJn/g7HbnlvjPAkBxZeOMjYmXC/i9ukESbM8ItNmGUVGLdj14LxzgeGh8wVWYKo5oL0SpgigQeNqSBOBRON0gFwrekRinTU+M+UrvtyKmSaWSdVEJ6eyRYnEiZDniG+66IW6vu+AhN6TNjr3G84ryaXYNM0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hUTlOdJ3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="hUTlOdJ3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6B03C4CEE4; Wed, 19 Mar 2025 14:37:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1742395033; bh=b2Sb3oaFQb3Aw0Y7oPuBYAvR31nUHJdoOq+ATdfyRoM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hUTlOdJ3TuTmPaXRS/kY5621NXDRP4Jsm8RvAueFlhdsDT0Vfa4wMb4L3+sB0AJ7g 1yCSanjB703BEd25s3EtUuYbG0fb1b8k7yANaTC364Xr/fGRmMga/9HzLLGMwGiW3Z 9/fCcg2dNl97OUz6ApLbG0s0aYRgBgUiWoHycTSU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Carolina Jubran , Jianbo Liu , Tariq Toukan , Michal Swiatkowski , Paolo Abeni , Sasha Levin Subject: [PATCH 6.12 055/231] net/mlx5e: Prevent bridge link show failure for non-eswitch-allowed devices Date: Wed, 19 Mar 2025 07:29:08 -0700 Message-ID: <20250319143028.184045346@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250319143026.865956961@linuxfoundation.org> References: <20250319143026.865956961@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Carolina Jubran [ Upstream commit e92df790d07a8eea873efcb84776e7b71f81c7d5 ] mlx5_eswitch_get_vepa returns -EPERM if the device lacks eswitch_manager capability, blocking mlx5e_bridge_getlink from retrieving VEPA mode. Since mlx5e_bridge_getlink implements ndo_bridge_getlink, returning -EPERM causes bridge link show to fail instead of skipping devices without this capability. To avoid this, return -EOPNOTSUPP from mlx5e_bridge_getlink when mlx5_eswitch_get_vepa fails, ensuring the command continues processing other devices while ignoring those without the necessary capability. Fixes: 4b89251de024 ("net/mlx5: Support ndo bridge_setlink and getlink") Signed-off-by: Carolina Jubran Reviewed-by: Jianbo Liu Signed-off-by: Tariq Toukan Reviewed-by: Michal Swiatkowski Link: https://patch.msgid.link/1741644104-97767-7-git-send-email-tariqt@nvidia.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 62b8a7c1c6b54..1c087fa1ca269 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -5099,11 +5099,9 @@ static int mlx5e_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, struct mlx5e_priv *priv = netdev_priv(dev); struct mlx5_core_dev *mdev = priv->mdev; u8 mode, setting; - int err; - err = mlx5_eswitch_get_vepa(mdev->priv.eswitch, &setting); - if (err) - return err; + if (mlx5_eswitch_get_vepa(mdev->priv.eswitch, &setting)) + return -EOPNOTSUPP; mode = setting ? BRIDGE_MODE_VEPA : BRIDGE_MODE_VEB; return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, -- 2.39.5