From: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: Jason Gunthorpe
<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc: "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
<roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
"hadarh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org"
<hadarh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Shawn Bohrer
<shawn.bohrer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"Hefty,
Sean" <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH V4 for-next 3/4] IB/core: Export ib_create/destroy_flow through uverbs
Date: Tue, 3 Sep 2013 16:36:38 +0300 [thread overview]
Message-ID: <5225E5E6.2000503@mellanox.com> (raw)
In-Reply-To: <20130903041636.GA3875-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
On 3/9/2013 7:16 AM, Jason Gunthorpe wrote:
> On Mon, Sep 02, 2013 at 12:26:06PM +0300, Matan Barak wrote:
>
>>> The correct comp_mask should always match the fields that are
>>> initialized by the caller. That is simple to explain and easy to audit
>>> for correctness.
>
>> I agree, but the request could be rejected if an unsupported
>> comp_mask field was given. The user should query the device
>
> No, that is the exact opposite of what I said.
>
> You are trying to make comp_mask indicate if the command should use
> the data, I only want the comp_mask to indicate that the data has been
> initialized (all new members must have a no-action value), they are
> completely different things.
>
If the kernel treats unprovided fields as "no action" by default (for
new kernel with old user space), why does it matter if the user
initialized them with "no action" or the kernel just assumes so ? Why do
we need a comp_mask for this ?
I think that comp_mask should be used only for fields with an "action"
value that the user requests the kernel to handle.
> We already have commands that don't touch every member of an input
> structure depending on context. eg commands acting on a UD QP don't
> touch fields that are used only by RC QPs.
>
We use attr_mask and the QP type in order to know which fields should be
treated.
>> capabilities, see if the feature he wants is supported and set the
>> fields accordingly. It's simple, it's like every other stack and
>> it's robust.
>
> It is certainly not robust. You are relying on userspace to set the
> correct value for the kernel version being used, and there is no way
> for developers to test this because the latest kernel will accept all
> values in comp_mask.
If treating comp_mask as "action" fields (instead of "initialized"
fields), comp_mask = 0 is always valid. It means that all extended
fields have their default/"older" values. In other words, the kernel
always knows how to support "older" user space.
>
> That is horrible. Our carefully designed ABI compatability is worth
> nothing in practice if commands return EINVAL on old kerenls!
>
> Old and new kernels must behave consistently.
>
> The way to handle comp_mask is to have new kernels *VALIDATE* and old
> kernels ignore. New kernels will require a *no action* value in all
> situations where the feature is not supported (eg an older HCA,
> feature not enabled, feature not present in device caps, etc).
>
> This way the new kernel runtime tests the input, in a manner that is
> consistent with the handling of old kernels (old kernel treat
> unsupported members as no-action). Testing your app on a new
> kernel, with a HCA that does not support the feature is sufficent to
> show that it will work on past kernels that do not support the
> feature.
>
Basically, I think I understand the ABI you suggest. I think it could
lead to a situation that an old kernel will ignore an "action" field and
process the command differently than expected.
Saying that, I'm opened to other opinions.
> Jason
>
Matan
--
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:[~2013-09-03 13:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-28 12:47 [PATCH V4 for-next 0/4] Add receive Flow Steering support Matan Barak
[not found] ` <1377694075-29287-1-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2013-08-28 12:47 ` [PATCH V4 for-next 1/4] IB/core: " Matan Barak
2013-08-28 12:47 ` [PATCH V4 for-next 2/4] IB/core: Infrastructure to support verbs extensions through uverbs Matan Barak
2013-08-28 12:47 ` [PATCH V4 for-next 3/4] IB/core: Export ib_create/destroy_flow " Matan Barak
[not found] ` <1377694075-29287-4-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2013-08-28 16:20 ` Jason Gunthorpe
[not found] ` <20130828162050.GA31381-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2013-09-01 9:18 ` Matan Barak
[not found] ` <52230648.5000302-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2013-09-01 22:23 ` Jason Gunthorpe
[not found] ` <20130901222304.GB3422-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2013-09-02 9:26 ` Matan Barak
[not found] ` <522459AE.9070107-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2013-09-03 4:16 ` Jason Gunthorpe
[not found] ` <20130903041636.GA3875-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2013-09-03 13:36 ` Matan Barak [this message]
2013-09-11 14:04 ` Yann Droneaud
[not found] ` <1378908269.2258.31.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2013-09-11 15:10 ` Or Gerlitz
[not found] ` <523087CE.4080007-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2013-09-11 15:25 ` Yann Droneaud
2013-09-17 12:35 ` Matan Barak
[not found] ` <52384C9D.6050900-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2013-09-17 13:00 ` Yann Droneaud
2013-08-28 12:47 ` [PATCH V4 for-next 4/4] IB/mlx4: Add receive Flow Steering support Matan Barak
-- strict thread matches above, loose matches on Subject: below --
2013-08-07 11:01 [PATCH V4 for-next 0/4] " Or Gerlitz
[not found] ` <1375873322-19384-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2013-08-07 11:02 ` [PATCH V4 for-next 3/4] IB/core: Export ib_create/destroy_flow through uverbs Or Gerlitz
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=5225E5E6.2000503@mellanox.com \
--to=matanb-vpraknaxozvwk0htik3j/w@public.gmane.org \
--cc=hadarh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=shawn.bohrer-Re5JQEeQqe8AvxtiuMwx3w@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 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).