aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/core_priv.h
diff options
context:
space:
mode:
authorGal Pressman <galpress@amazon.com>2019-08-01 13:43:54 +0300
committerDoug Ledford <dledford@redhat.com>2019-08-01 11:54:13 -0400
commit52e0a118a20308dd6aa531e20a5ab5907d2264c8 (patch)
treea0060ecd4a527e68e7f9f16fa52c32b3f361274a /drivers/infiniband/core/core_priv.h
parentIB/mlx5: Fix MR registration flow to use UMR properly (diff)
downloadlinux-dev-52e0a118a20308dd6aa531e20a5ab5907d2264c8.tar.xz
linux-dev-52e0a118a20308dd6aa531e20a5ab5907d2264c8.zip
RDMA/restrack: Track driver QP types in resource tracker
The check for QP type different than XRC has excluded driver QP types from the resource tracker. As a result, "rdma resource show" user command would not show opened driver QPs which does not reflect the real state of the system. Check QP type explicitly instead of assuming enum values/ordering. Fixes: 40909f664d27 ("RDMA/efa: Add EFA verbs implementation") Signed-off-by: Gal Pressman <galpress@amazon.com> Reviewed-by: Leon Romanovsky <leonro@mellanox.com> Link: https://lore.kernel.org/r/20190801104354.11417-1-galpress@amazon.com Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/core/core_priv.h')
-rw-r--r--drivers/infiniband/core/core_priv.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/infiniband/core/core_priv.h b/drivers/infiniband/core/core_priv.h
index 888d89ce81df..beee7b7e0d9a 100644
--- a/drivers/infiniband/core/core_priv.h
+++ b/drivers/infiniband/core/core_priv.h
@@ -302,7 +302,9 @@ static inline struct ib_qp *_ib_create_qp(struct ib_device *dev,
struct ib_udata *udata,
struct ib_uobject *uobj)
{
+ enum ib_qp_type qp_type = attr->qp_type;
struct ib_qp *qp;
+ bool is_xrc;
if (!dev->ops.create_qp)
return ERR_PTR(-EOPNOTSUPP);
@@ -320,7 +322,8 @@ static inline struct ib_qp *_ib_create_qp(struct ib_device *dev,
* and more importantly they are created internaly by driver,
* see mlx5 create_dev_resources() as an example.
*/
- if (attr->qp_type < IB_QPT_XRC_INI) {
+ is_xrc = qp_type == IB_QPT_XRC_INI || qp_type == IB_QPT_XRC_TGT;
+ if ((qp_type < IB_QPT_MAX && !is_xrc) || qp_type == IB_QPT_DRIVER) {
qp->res.type = RDMA_RESTRACK_QP;
if (uobj)
rdma_restrack_uadd(&qp->res);