From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796221318; b=2Zvdpm2iB+sF09K2tZap0ZvsyljCB5PEU/w8R4qMak4qQj4N0ATUdEG9J5J3iTF2ci2v gqI6tIok2dfZ+ZvgZXVnYxfo7yewFeYTwHf+EJdzD9U4FV4ngZOmXzY/xPxj69+WlZAD3 d5ZEKGNwqTl/V+uMyet9LEfr1WU5Kx0zrJG+OyomH2JsyoZEQt4tFZXE2Oki447KUNFdA wC2zwr4OsRkBQ0MtMEGFRyvaRkcjH3+Vd4/f7WhKD/fw21ainOR/XPi4Xy4P2GCwGX55l aM2Tw0Xm/DqXl8C2SlucOdsAY3621bV7mEAjh5TTyYhcdkNRL115nStsfmcNXUSkIZw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796221318; h=Received:DKIM-Signature:Subject:To:Cc:From:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=H4Csgc2Y5I6VeANMpCT7QGqt1hs0MzrLZSIg7nByKH0=; b=AXCBqDZTP88jcRCwAjObeA2BYk5mNrphym9cEIJp0bfkTmPK2cxWGRhoRG+uBTpr4GfD R9Bi3SxOhaFHZSN7I9lnd9biRnYYX30LMHgM0Dxq8U4QYtGehmvilCbKbGOOnQGWdQaWv J/8P67Cpo3NzCFR3EqOqXc+G3s5GTZpLs1WlyAzCyPtzQLcAuImZ89Picr2UNtZ08gQV0 RxHjlPU99B47DjxnG2BOZ01L/JYOj2jXd3yp1L3brqg1fOdbOdfkvn0sFDBnydQiWREX2 TyMvcpaj0BpozWWz2bW6yaS7KR0wxf1dC+ezFiJMn+fP1ZSgv4Cb+xZCOUbj3zukQlA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=F0QVO8Aa; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E202606A32F for ; Wed, 2 Dec 2026 14:21:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=F0QVO8Aa Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E0931F00926; Wed, 2 Dec 2026 14:21:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796221318; bh=H4Csgc2Y5I6VeANMpCT7QGqt1hs0MzrLZSIg7nByKH0=; h=Subject:To:Cc:From:Date; b=F0QVO8AapIBfKLpSMeCwojra1VWHt+MIQKVpHZK0z03Y3YDuEZEGE6F1tpAiRt/e8 /gKfyjZvp995W7EvR2e7UTe+st1OouOUB7ixek0eHnrPRQy3/UXERey2UqBc95KoRT CT+JY8zxFZzJzxUVfgPaf6h4HMNVGtc7oaGjVGS0= Subject: FAILED: patch "[PATCH] RDMA/mlx5: Skip vport context query on FW without ib_virt" failed to apply to 6.1-stable tree To: moshe@nvidia.com,edwards@nvidia.com,leon@kernel.org,tonyb@cybernetics.com Cc: From: Date: Wed, 02 Dec 2026 14:38:52 +0100 Message-ID: <2026120252-growing-fifth-4da3@gregkh> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.1-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y git checkout FETCH_HEAD git cherry-pick -x e7732ec135b501e87ab060d992b3b5f2ec4396c9 # git commit -s git send-email --to '' --in-reply-to '2026120252-growing-fifth-4da3@gregkh' --subject-prefix 'PATCH 6.1.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From e7732ec135b501e87ab060d992b3b5f2ec4396c9 Mon Sep 17 00:00:00 2001 From: Moshe Shemesh Date: Thu, 12 Nov 2026 15:27:19 +0200 Subject: [PATCH] RDMA/mlx5: Skip vport context query on FW without ib_virt support Since commit b02289b3d60f ("RDMA: Validate grh_required when handling AVs"), mlx5_port_immutable() unconditionally issues QUERY_HCA_VPORT_CONTEXT on InfiniBand ports to read grh_required. Devices that do not support the InfiniBand virtualization interface (ib_virt cleared) are not guaranteed to implement this command. For example, Connect-IB with FW 10.10.5020 rejects it and mlx5_ib fails to probe: mlx5_core 0000:01:00.0: mlx5_cmd_out_err:810:(pid 731): QUERY_HCA_VPORT_CONTEXT(0x762) op_mod(0x0) failed, status bad operation(0x2), syndrome (0x3590f5), err(-22) infiniband mlx5_0: Couldn't create per-port data mlx5_ib.rdma: probe of mlx5_core.rdma.0 failed with error -12 All other HCA vport context users in mlx5_ib are already gated on ib_virt, either directly, as in set_has_smi_cap(), mlx5_ib_get_plane_num() and mlx5_ib_modify_port(), or via mlx5_use_mad_ifc(), which selects MAD_IFC for port queries when ib_virt is not supported. Skipping the query loses nothing. grh_required indicates a GID-based vport, which only exists with InfiniBand virtualization. Without ib_virt the port is always LID-based and the field is zero, even on firmware that accepts the command. This also matches the behavior before b02289b3d60f, when grh_required was filled in only by mlx5_query_hca_port() and was never set on the MAD_IFC path. Fixes: b02289b3d60f ("RDMA: Validate grh_required when handling AVs") Cc: stable@vger.kernel.org Reported-by: Tony Battersby Closes: https://lore.kernel.org/all/064dfa67-8fd4-40f0-b925-6d1e0cd42e6a@cybernetics.com/ Tested-by: Tony Battersby Signed-off-by: Moshe Shemesh Signed-off-by: Edward Srouji Link: https://patch.msgid.link/20261112-moshe-ib-virt-guard-v1-1-6d2caf8bdb1b@nvidia.com Signed-off-by: Leon Romanovsky diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 65455aedd559..2ab38068db83 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -3536,7 +3536,8 @@ static int mlx5_port_immutable(struct ib_device *ibdev, u32 port_num, if (err) return err; - if (ll == IB_LINK_LAYER_INFINIBAND) { + if (ll == IB_LINK_LAYER_INFINIBAND && + MLX5_CAP_GEN(dev->mdev, ib_virt)) { if (ibdev->type == RDMA_DEVICE_TYPE_SMI) port_num = smi_to_native_portnum(dev, port_num);