From: "Steve Wise" <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
To: 'Leon Romanovsky' <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: RE: [PATCH RESEND v1 rdma-next 5/6] RDMA/nldev: provide detailed MR information
Date: Wed, 14 Feb 2018 10:31:11 -0600 [thread overview]
Message-ID: <039b01d3a5b1$39a44e20$acecea60$@opengridcomputing.com> (raw)
In-Reply-To: <20180214134346.GZ2197-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
Hey Leon,
...
> > diff --git a/drivers/infiniband/core/uverbs_cmd.c
> b/drivers/infiniband/core/uverbs_cmd.c
> > index 256934d..3f026c4 100644
> > --- a/drivers/infiniband/core/uverbs_cmd.c
> > +++ b/drivers/infiniband/core/uverbs_cmd.c
> > @@ -694,6 +694,8 @@ ssize_t ib_uverbs_reg_mr(struct ib_uverbs_file
> *file,
> > mr->pd = pd;
> > mr->uobject = uobj;
> > atomic_inc(&pd->usecnt);
> > + mr->res.type = RDMA_RESTRACK_MR;
> > + rdma_restrack_add(&mr->res);
> >
> > uobj->object = mr;
> >
> > @@ -819,6 +821,7 @@ ssize_t ib_uverbs_dereg_mr(struct ib_uverbs_file
> *file,
> > struct ib_uverbs_dereg_mr cmd;
> > struct ib_uobject *uobj;
> > int ret = -EINVAL;
> > + struct ib_mr *mr;
> >
> > if (copy_from_user(&cmd, buf, sizeof cmd))
> > return -EFAULT;
> > @@ -828,6 +831,9 @@ ssize_t ib_uverbs_dereg_mr(struct ib_uverbs_file
> *file,
> > if (IS_ERR(uobj))
> > return PTR_ERR(uobj);
> >
> > + mr = uobj->object;
> > + rdma_restrack_del(&mr->res);
> > +
>
> It is wrong function to rdma_restrack_del(). The best place to put
> rdma_restrack_add() is right after device->xxx() call and
> rdma_restrack_del() is right before device->yyy() call.
>
> Thanks
You're right. In fact, the resource is already being deleted from the
restrack db in ib_dereg_mr() called by uverbs_free_mr(). So the above chunk
is not needed at all.
Thanks,
Steve.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2018-02-14 16:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-13 20:13 [PATCH RESEND v1 rdma-next 0/6] cm_id, cq, mr, and pd resource tracking Steve Wise
[not found] ` <cover.1518552800.git.swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2018-01-30 16:59 ` [PATCH RESEND v1 rdma-next 2/6] RDMA/nldev: provide detailed CM_ID information Steve Wise
[not found] ` <1510713d3e0f14b101bea7dc9e02084e46e580ec.1518552800.git.swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2018-02-13 20:43 ` Parav Pandit
[not found] ` <VI1PR0502MB300833C7A62DB411AB8E7982D1F60-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2018-02-13 20:59 ` Steve Wise
2018-02-13 21:13 ` Parav Pandit
2018-02-01 16:20 ` [PATCH RESEND v1 rdma-next 1/6] RDMA/CM: move rdma_id_private to cma_priv.h Steve Wise
2018-02-01 16:58 ` [PATCH RESEND v1 rdma-next 3/6] RDMA/nldev: provide detailed CQ information Steve Wise
[not found] ` <624bf08040287a4c558f3b84d2bd60a9423b8dca.1518552800.git.swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2018-02-15 13:28 ` Leon Romanovsky
2018-02-01 20:51 ` [PATCH RESEND v1 rdma-next 5/6] RDMA/nldev: provide detailed MR information Steve Wise
[not found] ` <be7f33b8ce1e7311e9ed408267d8475166e48d9b.1518552800.git.swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2018-02-14 13:43 ` Leon Romanovsky
[not found] ` <20180214134346.GZ2197-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2018-02-14 16:31 ` Steve Wise [this message]
2018-02-01 22:41 ` [PATCH RESEND v1 rdma-next 4/6] iw_cxgb4: initialize ib_mr fields for user mrs Steve Wise
2018-02-02 21:24 ` [PATCH RESEND v1 rdma-next 6/6] RDMA/nldev: provide detailed PD information Steve Wise
[not found] ` <f272bfd34c913d540bd74008cccfa2544d8e100f.1518552800.git.swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2018-02-14 13:33 ` 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='039b01d3a5b1$39a44e20$acecea60$@opengridcomputing.com' \
--to=swise-7bpotxp6k4+p2yhjcf5u+vpxobypeauw@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.