From: Jason Gunthorpe <jgg@nvidia.com>
To: Yishai Hadas <yishaih@nvidia.com>
Cc: Leon Romanovsky <leon@kernel.org>,
Doug Ledford <dledford@redhat.com>, <linux-rdma@vger.kernel.org>,
Yishai Hadas <yishaih@nvida.com>,
Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH rdma-next v1 4/4] RDMA/mlx5: Sync device with CPU pages upon ODP MR registration
Date: Mon, 21 Sep 2020 14:08:21 -0300 [thread overview]
Message-ID: <20200921170821.GY3699@nvidia.com> (raw)
In-Reply-To: <cf4516e4-f5f3-295f-d4ef-f0411765c9e8@nvidia.com>
On Mon, Sep 21, 2020 at 08:04:43PM +0300, Yishai Hadas wrote:
> On 9/21/2020 5:25 PM, Jason Gunthorpe wrote:
> > On Thu, Sep 17, 2020 at 02:21:52PM +0300, Leon Romanovsky wrote:
> >
> > > diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
> > > index dea65e511a3e..234a5d25a072 100644
> > > +++ b/drivers/infiniband/hw/mlx5/mr.c
> > > @@ -1431,7 +1431,7 @@ struct ib_mr *mlx5_ib_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
> > > mr->umem = umem;
> > > set_mr_fields(dev, mr, npages, length, access_flags);
> > >
> > > - if (xlt_with_umr) {
> > > + if (xlt_with_umr && !(access_flags & IB_ACCESS_ON_DEMAND)) {
> > > /*
> > > * If the MR was created with reg_create then it will be
> > > * configured properly but left disabled. It is safe to go ahead
> > > @@ -1439,9 +1439,6 @@ struct ib_mr *mlx5_ib_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
> > > */
> > > int update_xlt_flags = MLX5_IB_UPD_XLT_ENABLE;
> > >
> > > - if (access_flags & IB_ACCESS_ON_DEMAND)
> > > - update_xlt_flags |= MLX5_IB_UPD_XLT_ZAP;
> > > -
> > > err = mlx5_ib_update_xlt(mr, 0, ncont, page_shift,
> > > update_xlt_flags);
> > > if (err) {
> > > @@ -1467,6 +1464,12 @@ struct ib_mr *mlx5_ib_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
> > > dereg_mr(dev, mr);
> > > return ERR_PTR(err);
> > > }
> > > +
> > > + err = mlx5_ib_init_odp_mr(mr, start, length, xlt_with_umr);
> > No reason to pass start/length, that is already in the mr
> >
> > Jason
>
> The start / iova is set on 'ib_mr' in the uverbs layer post returning from
> reg_user_mr for all drivers [1], so the function just got both.
> Makes sense ?
The information is stored in the umem_odp
Jason
next prev parent reply other threads:[~2020-09-21 17:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-17 11:21 [PATCH rdma-next v1 0/4] Improve ODP by using HMM API Leon Romanovsky
2020-09-17 11:21 ` [PATCH rdma-next v1 1/4] IB/core: Improve ODP to use hmm_range_fault() Leon Romanovsky
2020-09-21 14:23 ` Jason Gunthorpe
2020-09-21 15:17 ` Yishai Hadas
2020-09-21 15:26 ` Jason Gunthorpe
2020-09-21 17:23 ` Yishai Hadas
2020-09-17 11:21 ` [PATCH rdma-next v1 2/4] IB/core: Enable ODP sync without faulting Leon Romanovsky
2020-09-17 11:21 ` [PATCH rdma-next v1 3/4] RDMA/mlx5: Extend advice MR to support non faulting mode Leon Romanovsky
2020-09-17 11:21 ` [PATCH rdma-next v1 4/4] RDMA/mlx5: Sync device with CPU pages upon ODP MR registration Leon Romanovsky
2020-09-21 14:25 ` Jason Gunthorpe
2020-09-21 17:04 ` Yishai Hadas
2020-09-21 17:08 ` Jason Gunthorpe [this message]
2020-09-21 17:26 ` Yishai Hadas
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=20200921170821.GY3699@nvidia.com \
--to=jgg@nvidia.com \
--cc=dledford@redhat.com \
--cc=hch@infradead.org \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=yishaih@nvida.com \
--cc=yishaih@nvidia.com \
/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.