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=1796381111; b=GZh5vvU5Fu7DIc6ORsxVJGU9IIcyaTe0gTBhWP7nnHkOznsz0csBq9ZdpmByfyWEKMg+ +qGolDHa7HQkvsXfpP8yM/N4YBO9rCkkPT1RNy4naD61TMW+aXC7yx6MWBD6S39YUxqn9 UIpMFaCX041bZ9n08ZaR+RFIVFgvtWdJMFDOVvm6tgM1Jg7Kf+lDKc8TYTbLeSVte7H6Q myMa4X4Jra5EzEslX2jdZJTkn54NEg+eeEllyB/FLPbjZbN+s84O4ZoGdZVXe/nuVAlNK /X8oQ+DSSWSnQTRb6N80ED0ZYvGxmXNBDKJnNSUNMKxrevU6bVMQ8TBfGtdFl2fZKrA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381111; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=oN3XazI3wNDGluRtnw3QA/jRYevcsabLqUD7KZNQ89Y=; b=sLCMJSnVAl8YfRGnPuzjIYXd0aPJuwTpepDNqHTy+J+Zro2Ph3S9xwNaM05sFIdQtt8S Dtx7x+Y0JVSvA5uyF2rekE4Syh2pheSaT4ER63VupaWLsGJqAz/fL+ZpHaiAbyLBwCq+8 5LfUiLpRuiR6CU1B8cZevArlwEAxK4VV6RAajmkrAUIUDxk9lR1bWAOQ44MfSGIIrFxdY q2wh9v/gSn7TUAWSP84n4zZkeWbWBIxhKq47cANAsiHljKiFiVMvq4YDIYnkDNz53O7A8 xRJUdt5y63SoisuNE+a4m/ssFq96+I1TOTNZPn4/bCpjle3lkWTQOjd2Vpi2OhnH9Uw== 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=xvqIsliF; 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) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02FA6606A334; Fri, 4 Dec 2026 10:45:11 +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=xvqIsliF Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73D521F00A11; Fri, 4 Dec 2026 10:45:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381110; bh=oN3XazI3wNDGluRtnw3QA/jRYevcsabLqUD7KZNQ89Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=xvqIsliFJX6JFjupo1CjtYQtJTPhuQsH76LvA/mQ1kFpC4G6hUN5d8xzpoSilf+YR 76++/flNi79z597NCRyy3NnNniOu0FLphjRY+ypOlSwvBicLTJ74+6MUwRaOoy1KD/ WWrnr8IBGMSLDjf+n6vfzXZZ/ay9RTlB8GFQeOHE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tony Battersby , Moshe Shemesh , Edward Srouji , Leon Romanovsky Subject: [PATCH 7.3 562/742] RDMA/mlx5: Skip vport context query on FW without ib_virt support Date: Fri, 4 Dec 2026 19:07:06 +0900 Message-ID: <20261204100650.077227856@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Moshe Shemesh commit e7732ec135b501e87ab060d992b3b5f2ec4396c9 upstream. 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 Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/mlx5/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -3617,7 +3617,8 @@ static int mlx5_port_immutable(struct ib 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);