From: Michal Kalderon <mkalderon@marvell.com>
To: Gal Pressman <galpress@amazon.com>
Cc: Ariel Elior <aelior@marvell.com>, "jgg@ziepe.ca" <jgg@ziepe.ca>,
"dledford@redhat.com" <dledford@redhat.com>,
"bmt@zurich.ibm.com" <bmt@zurich.ibm.com>,
"sleybo@amazon.com" <sleybo@amazon.com>,
"leon@kernel.org" <leon@kernel.org>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
Ariel Elior <aelior@marvell.com>
Subject: RE: [PATCH v10 rdma-next 3/7] RDMA/efa: Use the common mmap_xa helpers
Date: Wed, 4 Sep 2019 14:09:18 +0000 [thread overview]
Message-ID: <MN2PR18MB318225B7C3799584D2C7CF28A1B80@MN2PR18MB3182.namprd18.prod.outlook.com> (raw)
In-Reply-To: <d6e4d513-556f-d2a4-f5c6-42a54c0ae7f1@amazon.com>
> From: Gal Pressman <galpress@amazon.com>
> Sent: Wednesday, September 4, 2019 4:24 PM
>
> On 04/09/2019 10:15, Michal Kalderon wrote:
> > static int __efa_mmap(struct efa_dev *dev, struct efa_ucontext
> *ucontext,
> > - struct vm_area_struct *vma, u64 key, u64 length)
> > + struct vm_area_struct *vma, u64 key, size_t length)
> > {
> > - struct efa_mmap_entry *entry;
> > + struct rdma_user_mmap_entry *rdma_entry;
> > + struct efa_user_mmap_entry *entry;
> > unsigned long va;
> > u64 pfn;
> > int err;
> >
> > - entry = mmap_entry_get(dev, ucontext, key, length);
> > - if (!entry) {
> > + rdma_entry = rdma_user_mmap_entry_get(&ucontext-
> >ibucontext, key,
> > + length, vma);
> > + if (!rdma_entry) {
> > ibdev_dbg(&dev->ibdev, "key[%#llx] does not have valid
> entry\n",
> > key);
> > return -EINVAL;
> > }
> > + entry = to_emmap(rdma_entry);
> > + if (entry->length != length) {
> > + ibdev_dbg(&dev->ibdev,
> > + "key[%#llx] does not have valid length[%#zx]
> expected[%#zx]\n",
> > + key, length, entry->length);
> > + err = -EINVAL;
> > + goto err;
> > + }
> >
> > ibdev_dbg(&dev->ibdev,
> > - "Mapping address[%#llx], length[%#llx],
> mmap_flag[%d]\n",
> > - entry->address, length, entry->mmap_flag);
> > + "Mapping address[%#llx], length[%#zx],
> mmap_flag[%d]\n",
> > + entry->address, entry->length, entry->mmap_flag);
> >
> > pfn = entry->address >> PAGE_SHIFT;
> > switch (entry->mmap_flag) {
> > @@ -1630,15 +1623,16 @@ static int __efa_mmap(struct efa_dev *dev,
> struct efa_ucontext *ucontext,
> > err = -EINVAL;
> > }
> >
> > - if (err) {
> > - ibdev_dbg(
> > - &dev->ibdev,
> > - "Couldn't mmap address[%#llx] length[%#llx]
> mmap_flag[%d] err[%d]\n",
> > - entry->address, length, entry->mmap_flag, err);
> > - return err;
> > - }
> > + if (err)
> > + goto err;
>
> Thanks Michal,
> Acked-by: Gal Pressman <galpress@amazon.com>
thanks
>
> If you're planning on doing another cycle, this error path now prints nothing, I
> meant move the print from the goto inside this if (before goto err).
Yes, I'll need to send a v11 because of a siw issue. I'll send you the patch before I send it out for review before I send v11.
Thanks,
Michal
>
> >
> > return 0;
> > +
> > +err:
> > + rdma_user_mmap_entry_put(&ucontext->ibucontext,
> > + rdma_entry);
> > +
> > + return err;
> > }
next prev parent reply other threads:[~2019-09-04 14:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-04 7:15 [PATCH v10 rdma-next 0/7] RDMA/qedr: Use the doorbell overflow recovery mechanism for RDMA Michal Kalderon
2019-09-04 7:15 ` [PATCH v10 rdma-next 1/7] RDMA/core: Move core content from ib_uverbs to ib_core Michal Kalderon
2019-09-04 7:15 ` [PATCH v10 rdma-next 2/7] RDMA/core: Create mmap database and cookie helper functions Michal Kalderon
2019-09-04 7:15 ` [PATCH v10 rdma-next 3/7] RDMA/efa: Use the common mmap_xa helpers Michal Kalderon
2019-09-04 13:24 ` Gal Pressman
2019-09-04 14:09 ` Michal Kalderon [this message]
2019-09-04 7:15 ` [PATCH v10 rdma-next 4/7] RDMA/siw: " Michal Kalderon
2019-09-04 7:15 ` [PATCH v10 rdma-next 5/7] RDMA/qedr: Use the common mmap API Michal Kalderon
2019-09-04 7:15 ` [PATCH v10 rdma-next 6/7] RDMA/qedr: Add doorbell overflow recovery support Michal Kalderon
2019-09-04 7:15 ` [PATCH v10 rdma-next 7/7] RDMA/qedr: Add iWARP doorbell " Michal Kalderon
2019-09-04 11:09 ` [PATCH v10 rdma-next 4/7] RDMA/siw: Use the common mmap_xa helpers Bernard Metzler
2019-09-04 11:55 ` [EXT] " Michal Kalderon
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=MN2PR18MB318225B7C3799584D2C7CF28A1B80@MN2PR18MB3182.namprd18.prod.outlook.com \
--to=mkalderon@marvell.com \
--cc=aelior@marvell.com \
--cc=bmt@zurich.ibm.com \
--cc=dledford@redhat.com \
--cc=galpress@amazon.com \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=sleybo@amazon.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).