Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Gal Pressman <galpress@amazon.com>
To: Jason Gunthorpe <jgg@ziepe.ca>,
	Doug Ledford <dledford@redhat.com>,
	"Leon Romanovsky" <leon@kernel.org>
Cc: <linux-rdma@vger.kernel.org>, Gal Pressman <galpress@amazon.com>
Subject: [PATCH for-rc] RDMA/restrack: Track driver QP types in resource tracker
Date: Tue, 30 Jul 2019 14:01:37 +0300	[thread overview]
Message-ID: <20190730110137.37826-1-galpress@amazon.com> (raw)

The check for QP type different than XRC has wrongly excluded driver QP
types from the resource tracker.

Fixes: 78a0cd648a80 ("RDMA/core: Add resource tracking for create and destroy QPs")
Signed-off-by: Gal Pressman <galpress@amazon.com>
---
 drivers/infiniband/core/core_priv.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/core/core_priv.h b/drivers/infiniband/core/core_priv.h
index 589ed805e0ad..3a8b0911c3bc 100644
--- a/drivers/infiniband/core/core_priv.h
+++ b/drivers/infiniband/core/core_priv.h
@@ -321,7 +321,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);
@@ -339,7 +341,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);
-- 
2.22.0


             reply	other threads:[~2019-07-30 11:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-30 11:01 Gal Pressman [this message]
2019-07-30 12:19 ` [PATCH for-rc] RDMA/restrack: Track driver QP types in resource tracker Jason Gunthorpe
2019-07-30 12:21   ` Gal Pressman
2019-07-30 13:38 ` Leon Romanovsky
2019-07-30 13:49   ` Gal Pressman
2019-07-30 15:19     ` Leon Romanovsky
2019-07-31  7:05       ` Gal Pressman
2019-07-31  7:46         ` Leon Romanovsky
2019-07-31  7:53           ` Gal Pressman
2019-07-31  8:34             ` Leon Romanovsky
2019-07-31  8:51               ` Gal Pressman
2019-07-31 10:01                 ` Leon Romanovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190730110137.37826-1-galpress@amazon.com \
    --to=galpress@amazon.com \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox