public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	talal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org
Subject: Re: [PATCH V3 libibverbs 2/7] Add member functions to poll an extended CQ
Date: Thu, 26 May 2016 11:07:23 -0600	[thread overview]
Message-ID: <20160526170723.GB27115@obsidianresearch.com> (raw)
In-Reply-To: <153e0a54-2ca6-f05a-d36a-05e736a348d7-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

On Thu, May 26, 2016 at 06:00:09PM +0300, Matan Barak wrote:

> >This ensures if we add new function pointers to the end then they are
> >null'd even if libibverbs is older, which is a little safer than
> >overflowing memory.
> 
> In order to use read_xxxx function, a user should allocate a suitable CQ
> (with the correct flag). If a support for a flag is needed in libibverbs, it
> should be checked in the create function.

The purpose is to make the API safer by ensuring null's are present in
unsupported function pointers in case the user accidently calls
them. Of course the user shouldn't call them.

> >The driver should also null fields accessor function pointers that it
> >cannot return.
> 
> We could have checked when creating a QP if the to-be attached CQ doesn't
> support querying invalid attributes in respect of this QP (i.e SLID in RC),
> but doing that you won't be able to attach the same CQ to several QP types
> and get various QP-type specific attributes, as you can today. Thus, we
> prefer the current approach.

Hum, this is an interesting point.

My inclination is to prefer safety over generality, a CQ should not be
bound to a QP that cannot provide all the attributes the CQ is setup
for.

Requiring an app to have a few CQs of different types does not seem
like a significant burden, and directly prevents stupid mistakes on
the part of the user.

> The fields that the user requested are guaranteed to be correct only when
> querying a completion originated by a supporting QP - exactly like today. We
> of course nullify function pointers the user didn't request.

I've always thought that was confusing and hard to use, to be
honest...

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

  parent reply	other threads:[~2016-05-26 17:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-25 13:02 [PATCH V3 libibverbs 0/7] Completion timestamping Yishai Hadas
     [not found] ` <1464181344-11987-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-05-25 13:02   ` [PATCH V3 libibverbs 1/7] Add support for extended creating CQ verb Yishai Hadas
2016-05-25 13:02   ` [PATCH V3 libibverbs 2/7] Add member functions to poll an extended CQ Yishai Hadas
     [not found]     ` <1464181344-11987-3-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-05-25 17:26       ` Jason Gunthorpe
     [not found]         ` <20160525172624.GA4602-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-05-25 21:12           ` Hefty, Sean
2016-05-26 15:00           ` Matan Barak
     [not found]             ` <153e0a54-2ca6-f05a-d36a-05e736a348d7-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-05-26 17:07               ` Jason Gunthorpe [this message]
2016-05-25 13:02   ` [PATCH V3 libibverbs 3/7] Add timestamp_mask and hca_core_clock to ibv_query_device_ex Yishai Hadas
2016-05-25 13:02   ` [PATCH V3 libibverbs 4/7] Add completion timestamp to poll_cq Yishai Hadas
2016-05-25 13:02   ` [PATCH V3 libibverbs 5/7] Create a single threaded CQ Yishai Hadas
2016-05-25 13:02   ` [PATCH V3 libibverbs 6/7] Add a verb that queries real time values from the HCA Yishai Hadas
2016-05-25 13:02   ` [PATCH V3 libibverbs 7/7] Add timestamp support in rc_pingpong 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=20160526170723.GB27115@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-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