From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Yishai Hadas <yishaih-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
Cc: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
"talal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org"
<talal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: Upcoming libibverbs release
Date: Mon, 27 Jun 2016 12:17:58 -0600 [thread overview]
Message-ID: <20160627181758.GD23540@obsidianresearch.com> (raw)
In-Reply-To: <4ec1d8e6-a908-bb49-a137-415856ec6faa-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
On Sun, Jun 26, 2016 at 07:54:21PM +0300, Yishai Hadas wrote:
> > I'm still very much of the opinion that extended CQs should only allow
> > compatible QP's to be added.
>
> Application may create a CQ with large subset of flags that may fit some of
> its attached QP types. Semantically, it is similar to what we have today, it
> allows to put different QP types on the same CQ and by thus allow
> application to have ordered completion events.
This is repeating your argument, I disagree, it is a horrible API
design, you need to defend this with an actual use case.
> We don't see a good reason to change from current behavior and hurt
> applications that expect that valid behavior.
Safety for the API consumer.
> > Add a compatibility layer
>
> A real application wants to achieve performance, to use a compatibility
> layer over a vendor that doesn???t support the new API, might be a very bad
> idea as of below.
Well, NAK on this from me then.
Doug and I have both stated we don't want to see so many
single-provider APIs and churn in libibverbs. This was designed to be
a generic API that all providers can implement.
The responsibility falls on you to make sure that it works
universally. Compat is one option.
This is also why it is necessary to get the other provider authors to
say this works on their hardware, because they *all* ultimately have
to implement it.
I don't think many people realize this yet.
> > Exact set of access flags
>
> Application can ask for subset of the available bits, in addition, it has an
> option to ask for all legacy ones (i.e. IBV_WC_STANDARD_FLAGS) for a case
> that a CQ needs to support all legacy attribute and could be attached to
> both RC and UD QPs.
Again, this is pretty much nonsense. Asking for data that can't be
returned is just an insane API design.
> Low priority issue that can be added in the future based on users demand.
No it can't, the enum and flags are part of the API and have to be
designed correctly from the start.
> From bench mark testing, we found that gathering few fields in one
> ibv_wc_read_xxx has low benefit comparing the case that each field is read
> by itself.
This might be a good argument.
> If you still think that adding some extra ibv_wc_read_xxx groups from day
> one is really needed, let's define it and add now by an incremental patch.
> Till now didn't see any user specific request for.
What? 'user request' for a just designed API? How is that even
possible?
> > Minor coding issues and micro optimizations
>
> Not sure what exactly that point refers to from API point of view, assuming
> that it relates to few comments given on libmlx5 as of below.
I vaugely remember there being lots of comments, you guys basically
abandoned the whole discussion once Doug merged it, so I don't really
recall anymore.
> > +static inline uint32_t mlx5_cq_read_wc_qp_num(struct ibv_cq_ex *ibcq)
> > +{
> > + struct mlx5_cq *cq = to_mcq(ibv_cq_ex_to_cq(ibcq));
>
> > You might want to look at having the caller pass in 'cq' from a member
> > in ibv_cq_ex. That way the caller can hold the cq in a register
> > instead of constantly reloading it like this - I'm assuming to_mcq is
> > not just an container_of??
>
> The assumption is *incorrect*, the internal access from ibv_cq_ex to driver
> CQ is done via offsetof/container_of which is done in compile time, no need
> to have some change from the clean usage of the API to that mode.
Fine on cq, but the wqe pointer may benifit, and other drivers may
benifit. It still needs to be studied.
> > *ibcq)
> > You need to go through everything you've written and make sure it is
> > const-correct.
> > You should also annotate with restrict.
> > Doing this properly can increase performance by allowing the caller to
> > avoid reloads.
>
> From performance point of view we don't expect a change here, we followed
> the created assembly code and saw no difference even when it was annotated
> with 'restrict'.
The annotations help the caller.
> In addition, please note the 'restrict' notation was only became standard as
> part of C99, in previous compilers it may not work at all or requires
> different key word to be defined as part of the CONFIG step.
Use __restrict like glibc does.
> We can go ahead and define the ibv_wc_read_xxx with const qualifier on its
> input struct ibv_cq_ex *ibcq in some extra incremental patch if makes sense.
Of course it makes sense, you need to fix all of this stuff in all
the patches you wrote.
Jason
--
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:[~2016-06-27 18:17 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-23 16:51 Upcoming libibverbs release Doug Ledford
[not found] ` <3b89c411-72be-ddc5-5ebf-009eeee29692-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-06-24 11:50 ` Yishai Hadas
2016-06-26 16:54 ` Yishai Hadas
[not found] ` <4ec1d8e6-a908-bb49-a137-415856ec6faa-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-06-27 18:17 ` Jason Gunthorpe [this message]
[not found] ` <20160627181758.GD23540-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-06-28 5:02 ` Leon Romanovsky
[not found] ` <20160628050246.GB3584-2ukJVAZIZ/Y@public.gmane.org>
2016-06-28 15:52 ` Knut Omang
[not found] ` <1467129133.8638.75.camel-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2016-06-28 16:22 ` Leon Romanovsky
2016-06-28 16:20 ` Jason Gunthorpe
[not found] ` <20160628162028.GA27518-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-06-28 17:05 ` Leon Romanovsky
[not found] ` <20160628170549.GE3584-2ukJVAZIZ/Y@public.gmane.org>
2016-06-28 19:12 ` Steve Wise
2016-06-28 21:14 ` Jason Gunthorpe
[not found] ` <20160628211441.GA5786-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-06-28 21:26 ` Hefty, Sean
[not found] ` <1828884A29C6694DAF28B7E6B8A82373AB0663DA-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2016-06-29 5:19 ` Leon Romanovsky
[not found] ` <20160629051956.GG3584-2ukJVAZIZ/Y@public.gmane.org>
2016-06-29 18:30 ` Jason Gunthorpe
[not found] ` <20160629183042.GC17031-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-06-30 18:17 ` Liran Liss
[not found] ` <HE1PR05MB14189E07EE8EE458E0CCD4DAB1240-eBadYZ65MZ87O8BmmlM1zNqRiQSDpxhJvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2016-06-30 19:07 ` Jason Gunthorpe
2016-07-19 19:57 ` Doug Ledford
[not found] ` <babed655-b61f-e97b-2351-b1ea6692b18d-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-07-19 20:09 ` Jason Gunthorpe
2016-06-28 21:18 ` Jason Gunthorpe
[not found] ` <20160628211858.GB5786-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-06-29 5:15 ` Leon Romanovsky
[not found] ` <20160629051507.GF3584-2ukJVAZIZ/Y@public.gmane.org>
2016-06-29 17:07 ` Knut Omang
[not found] ` <1467220072.8638.166.camel-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2016-06-29 18:59 ` Yishai Hadas
2016-06-29 12:09 ` Christoph Hellwig
[not found] ` <20160629120920.GA24151-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2016-06-29 18:34 ` Jason Gunthorpe
[not found] ` <20160629183414.GD17031-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-06-29 18:46 ` Steve Wise
2016-06-29 18:57 ` Jason Gunthorpe
[not found] ` <20160629185757.GA17839-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-06-29 19:15 ` Steve Wise
2016-06-29 19:21 ` Hefty, Sean
[not found] ` <1828884A29C6694DAF28B7E6B8A82373AB06699A-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2016-06-29 19:25 ` Steve Wise
2016-06-29 20:34 ` Hefty, Sean
[not found] ` <1828884A29C6694DAF28B7E6B8A82373AB0669F5-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2016-06-29 20:44 ` Steve Wise
2016-06-29 20:54 ` Steve Wise
2016-06-29 21:40 ` Doug Ledford
[not found] ` <1d03eaca-142a-3912-badf-aa9b14f6b2f6-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-06-29 22:03 ` Steve Wise
2016-06-29 19:27 ` Jason Gunthorpe
[not found] ` <20160629192730.GA18394-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-06-29 20:40 ` Doug Ledford
2016-06-28 13: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=20160627181758.GD23540@obsidianresearch.com \
--to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=talal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=yishaih-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
--cc=yishaih-VPRAkNaXOzVWk0Htik3J/w@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