Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3540725pxj; Mon, 24 May 2021 09:00:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwq4IH4MfsppmdHkX4pDH8BhXQePDXGYhezXCs4MD387zk5lI1ixkxJK7qHJ9TtCThDmS2k X-Received: by 2002:a05:6e02:d03:: with SMTP id g3mr16769368ilj.156.1621872012040; Mon, 24 May 2021 09:00:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621872012; cv=none; d=google.com; s=arc-20160816; b=ABjGNdezyVwM9FqyKpQgX9v/bTJQ9eHBdMcdqNIiqoQmTji7IDhbMN7ZSydMaGpGdv SaYO/g/KsmMpOq8JJNhx+1+qFBQNukLRqv0QlwaWxhA8NCiuFgOkBrgP9/z/WoIHaHZJ YsExoJCVZC85owqiaJ5O1lRoCWqTJj3tcqtY+HyKzIzIKpo15p7t7+EPy7/Dy143nTqQ phad9hkUMpfyzMt/i4rOHeXvaZLX6T0fEc5nirN1ixJlVoQjtREZDvVYg7GxWLvLoonD sWCWDxYKf2wc8rm/8O9onZmmZX7Ai9cWYF9Rs7XLMJM3spMCaelaMJ7eWOGoSjZ88Use hjFA== 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=2boYP7l12pxxWVPrOCJPYd3osKCBC9oZBSG2q9H942g=; b=j9hheyfOCkFgf51MuWGMNPkI72fLNVLxeozl1HZ0VE6QrrV538MKUx7TuoFRpCXQ1f 4BqL25hPDt7MW+SrizZpGnFLyyDMh24bkQYij0q40Sr4BkjVcilMgIcMc3ahUV6Iqag8 iMg5t3aTKDPxbyfm+YHctjdDtKSojd5eY+WbwZJ5vjqP3GOIP/SDxaorSLFhVELgbEEf OW7XZqXJiZ+6HmUodk7RpdC5EJZXGJc6VOP3tEcCzLRNVOrverCNwzfFIYWDbZoWk/y7 xNNh+AUTPf/MU/pXa7rOu7UgjeQzmfIR0vYAX5pH7ftM9s/YaNaK2YqRIJpuA79qG/6z 17BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uqRhff6Z; 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 g10si14903015iow.86.2021.05.24.08.59.58; Mon, 24 May 2021 09:00:12 -0700 (PDT) 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=uqRhff6Z; 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 S235731AbhEXP7J (ORCPT + 99 others); Mon, 24 May 2021 11:59:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:40466 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234863AbhEXPyr (ORCPT ); Mon, 24 May 2021 11:54:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C86696186A; Mon, 24 May 2021 15:39:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621870797; bh=vdoP4yMYzxFXHcybiFzw8eogToT0ph495trWNwqm/ek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uqRhff6ZlwbPla2IjeOjlbuljhAQvEy5uV+LWa7Tnj8LAuaf1QTjZt3Sbdf1Tg2F6 sQ1DNFxAV8APLOdD9sA0N3LlchGjxHbv4VrYlARgtQkk9z3c/e4/FeMYV0wBqR9aNp 7SSWA+G36e17rOwGTGv3mm3fxBFbHA4TiAGSywuY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yishai Hadas , Maor Gottlieb , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.10 021/104] RDMA/mlx5: Fix query DCT via DEVX Date: Mon, 24 May 2021 17:25:16 +0200 Message-Id: <20210524152333.526920968@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152332.844251980@linuxfoundation.org> References: <20210524152332.844251980@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: Maor Gottlieb [ Upstream commit cfa3b797118eda7d68f9ede9b1a0279192aca653 ] When executing DEVX command to query QP object, we need to take the QP type from the mlx5_ib_qp struct which hold the driver specific QP types as well, such as DC. Fixes: 34613eb1d2ad ("IB/mlx5: Enable modify and query verbs objects via DEVX") Link: https://lore.kernel.org/r/6eee15d63f09bb70787488e0cf96216e2957f5aa.1621413654.git.leonro@nvidia.com Reviewed-by: Yishai Hadas Signed-off-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/mlx5/devx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/devx.c b/drivers/infiniband/hw/mlx5/devx.c index efb9ec99b68b..06a873257619 100644 --- a/drivers/infiniband/hw/mlx5/devx.c +++ b/drivers/infiniband/hw/mlx5/devx.c @@ -559,9 +559,8 @@ static bool devx_is_valid_obj_id(struct uverbs_attr_bundle *attrs, case UVERBS_OBJECT_QP: { struct mlx5_ib_qp *qp = to_mqp(uobj->object); - enum ib_qp_type qp_type = qp->ibqp.qp_type; - if (qp_type == IB_QPT_RAW_PACKET || + if (qp->type == IB_QPT_RAW_PACKET || (qp->flags & IB_QP_CREATE_SOURCE_QPN)) { struct mlx5_ib_raw_packet_qp *raw_packet_qp = &qp->raw_packet_qp; @@ -578,10 +577,9 @@ static bool devx_is_valid_obj_id(struct uverbs_attr_bundle *attrs, sq->tisn) == obj_id); } - if (qp_type == MLX5_IB_QPT_DCT) + if (qp->type == MLX5_IB_QPT_DCT) return get_enc_obj_id(MLX5_CMD_OP_CREATE_DCT, qp->dct.mdct.mqp.qpn) == obj_id; - return get_enc_obj_id(MLX5_CMD_OP_CREATE_QP, qp->ibqp.qp_num) == obj_id; } -- 2.30.2