linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gal Pressman <galpress@amazon.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Leon Romanovsky <leon@kernel.org>,
	Doug Ledford <dledford@redhat.com>, <linux-rdma@vger.kernel.org>,
	Alexander Matushevsky <matua@amazon.com>,
	"Firas JahJah" <firasj@amazon.com>,
	Yossi Leybovich <sleybo@amazon.com>
Subject: Re: [PATCH for-next] RDMA/efa: Move provider specific attributes to ucontext allocation response
Date: Thu, 18 Jun 2020 14:30:20 +0300	[thread overview]
Message-ID: <626dd909-a766-9973-7a44-f174176641ea@amazon.com> (raw)
In-Reply-To: <ff3413c8-ca1e-e864-aba5-fa6abe491a8d@amazon.com>

On 17/06/2020 20:49, Gal Pressman wrote:
> On 17/06/2020 18:36, Jason Gunthorpe wrote:
>> On Tue, Jun 16, 2020 at 08:44:37PM +0300, Gal Pressman wrote:
>>> On 16/06/2020 12:38, Leon Romanovsky wrote:
>>>> On Tue, Jun 16, 2020 at 11:53:11AM +0300, Gal Pressman wrote:
>>>>> On 16/06/2020 9:30, Leon Romanovsky wrote:
>>>>>> On Mon, Jun 15, 2020 at 10:59:20AM +0300, Gal Pressman wrote:
>>>>>>> Provider specific attributes which are necessary for the userspace
>>>>>>> functionality should be part of the alloc ucontext response, not query
>>>>>>> device. This way a userspace provider could work without issuing a query
>>>>>>> device verb call. However, the fields will remain in the query device
>>>>>>> ABI in order to maintain backwards compatibility.
>>>>>>
>>>>>> I don't really understand why "should be ..."? Device properties exposed
>>>>>> here are per-device and will be equal to all ucontexts, so instead of
>>>>>> doing one very fast system call, you are "punishing" every ucontext
>>>>>> call.
>>>>>
>>>>> I talked about it with Jason in the past, the query device verb is intended to
>>>>> follow the IBA verb, alloc ucontext should return driver specific data that's
>>>>> required to operate the user space provider.
>>>>> A query device call should not be mandatory to load the provider.
>>>>
>>>> Why? query_device is declared as mandatory verb for any provider, so
>>>> anyway all in-the-tree RDMA drivers will have such verb.
>>>
>>> I don't think the concern here is if the verb exists or not, my understanding is
>>> that query device should be used for IBA query device attributes, not other
>>> provider specific stuff.
>>> Jason, want to chime in with your thoughts?
>>
>> query_device should be used to implement the ibverb query_device and
>> query_device_ex
>>
>> It should only return rdma-core defined common stuff because that is
>> what that verb does - there is no reason to return driver specific
>> things as there is nothing the driver can do with it.
>>
>> The only exception might be some provider specific query_device dv
>> that needs more information.
>>
>> query_device should not be used as some two-part
>> create_context. Information related only to create_context that is not
>> already exposed to query_device should not be added to query_device
>> only for create_context's use.
>>
>> Similarly, information in query_device should not be duplicated into
>> create_context just to save a system call.
> 
> That makes sense.
> To clarify, the "duplicated" fields in this patch are moved to the ucontext
> allocation, where they originally belong as all of them are necessary for the
> provider's functionality.
> Future fields such as these will only be added to alloc_ucontext, not both, so
> there's no duplication.
> 
> Otherwise, future extensions will either have to be added to query_device, which
> is the wrong place, just to be consistent with the existing code. Or we add them
> to the ucontext response, where they belong, and end up with some hybrid
> solution where different fields are gathered from different places (yuck :\).
> 
> We got it wrong the first place but it's a two way door, let's fix it.

Uhh.. We can't really get rid of the query device call as the provider needs the
max_qp attribute in order to allocate the QP table properly.

I still think we should move the fields to keep things clean, but I can drop
this change if you prefer to avoid the churn. The provider will always call
query device on context initialization and gather different fields from
different system calls.

Thoughts?

  reply	other threads:[~2020-06-18 11:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15  7:59 [PATCH for-next] RDMA/efa: Move provider specific attributes to ucontext allocation response Gal Pressman
2020-06-16  6:30 ` Leon Romanovsky
2020-06-16  8:53   ` Gal Pressman
2020-06-16  9:38     ` Leon Romanovsky
2020-06-16 17:44       ` Gal Pressman
2020-06-17  4:55         ` Leon Romanovsky
2020-06-17 15:36         ` Jason Gunthorpe
2020-06-17 17:49           ` Gal Pressman
2020-06-18 11:30             ` Gal Pressman [this message]
2020-06-25 10:53 ` Gal Pressman

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=626dd909-a766-9973-7a44-f174176641ea@amazon.com \
    --to=galpress@amazon.com \
    --cc=dledford@redhat.com \
    --cc=firasj@amazon.com \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=matua@amazon.com \
    --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).