All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Wenpeng Liang <liangwenpeng@huawei.com>
Cc: dledford@redhat.com, linux-rdma@vger.kernel.org, linuxarm@huawei.com
Subject: Re: [PATCH v2 for-next] RDMA/hns: Add a new mmap implementation
Date: Mon, 25 Oct 2021 09:55:23 -0300	[thread overview]
Message-ID: <20211025125523.GU2744544@nvidia.com> (raw)
In-Reply-To: <7397cd8d-c976-fd81-8bb5-ae6c679a9e03@huawei.com>

On Fri, Oct 22, 2021 at 05:46:19PM +0800, Wenpeng Liang wrote:
> > Just write
> > 
> >  if (entry->mmap_type != HNS_ROCE_MMAP_TYPE_TPTR)
> >     prot = pgprot_noncached(prot);
> >  ret = rdma_user_mmap_io(uctx, vma, pfn,
> > 			rdma_entry->npages * PAGE_SIZE,
> > 			pgprot_noncached(prot), rdma_entry);
> > 
> > No need for the big case statement
> > 
> 
> In the future, we will have multiple new features that will add
> new branches to this switch. We hope to reduce the coupling
> between subsequent patches, so we hope to keep this switch.

Why? The only choice that should be made at mmap time is if this is
noncached or not - the address and everything else should be setup
during the creation of the entry.

> >>  struct hns_roce_ib_alloc_ucontext_resp {
> >>  	__u32	qp_tab_size;
> >>  	__u32	cqe_size;
> >>  	__u32	srq_tab_size;
> >> -	__u32	reserved;
> >> +	__u8    config;
> >> +	__u8    rsv[3];
> >> +	__aligned_u64 db_mmap_key;
> > 
> > I'm confused, this doesn't change the uAPI, so why add this stuff?
> > This should go in a later patch?
> > 
> 
> The related userspace has also been modified, the link is:
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.spinics.net%2Flists%2Flinux-rdma%2Fmsg106056.html&amp;data=04%7C01%7Cjgg%40nvidia.com%7Cffac1b9f0afb458a4da308d99540ce99%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C637704927843133708%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=BAszHlXQWWh%2F8hrb%2F8qEStm3VBrhvbMshfPN3pc6wKI%3D&amp;reserved=0
> 
> I don’t know if I understood your question correctly. These fields
> are used for compatibility, so they are necessary. The user space
> and kernel space of different versions are handshake through 'config'.

That is for later patches, this patch doesn't seem to change the uAPI
at all. The compat mmaps remain at the same offsets they were always
at, there is nothing to negotiate at this point.

Move it to a later series?

Jason

  reply	other threads:[~2021-10-25 12:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-12 12:41 [PATCH v2 for-next] RDMA/hns: Add a new mmap implementation Wenpeng Liang
2021-10-20 23:15 ` Jason Gunthorpe
2021-10-22  8:56   ` Wenpeng Liang
2021-10-22  9:31     ` Wenpeng Liang
2021-10-22  9:46   ` Wenpeng Liang
2021-10-25 12:55     ` Jason Gunthorpe [this message]
2021-10-26 13:02       ` Wenpeng Liang

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=20211025125523.GU2744544@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=dledford@redhat.com \
    --cc=liangwenpeng@huawei.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linuxarm@huawei.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.