public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: "Hefty, Sean" <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: "linux-rdma
	(linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 3/8] libibverbs: Introduce XRC domains
Date: Mon, 24 Sep 2012 18:04:19 -0600	[thread overview]
Message-ID: <20120925000419.GB12418@obsidianresearch.com> (raw)
In-Reply-To: <1828884A29C6694DAF28B7E6B8A8237346A8F087-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>

On Mon, Sep 24, 2012 at 11:00:00PM +0000, Hefty, Sean wrote:
> > > Verbs doesn't allocate the structures, so it can't store anything.
> > 
> > Well, that is the point, verbs shouldn't be storing things, any change
> > to the object state must go through the provider.
> 
> Verbs does stuff like this:

This is all just internal bookkeeping between verbs and the provider,
it doesn't need to be exposed to the user. Verbs and the provider can
negotiate what the internal layout of these object allocations will be
through the context.

> > > Adding a bunch of get/set calls seems worse to me than just placing
> > > the items in a structure.
> > 
> > Really?
> > 
> >  if (cq->comp_mask & IBV_CQ_COMP_MASK_SRQ_NUM)
> >    srq_num = cq->srq_num
> > 
> > vs
> > 
> >  ibv_cq_get_srq_num(cq); // Returns 0 on error
> > 
> > Betcha at least 50% of apps would do the first one wrong....
> 
> An app which uses XRC just needs to access srq->srq_num.  No other
> checks are needed.  If they have an XRC SRQ, the SRQ number must be
> valid.  The mask seems pointless to me.

The mask is part of the API, and not all cases in the future are
guarenteed to be like XRC. Sometimes (like with this XRC example) you
can omit the comp_mask check, others times you can't. It is just too
complex for something low speed.

A function call can't be done wrong ;)

> If you're suggesting that verbs.h remains untouched (for patch 1 of
> this series), but that new structures are defined between the verbs
> and the provider only, that seems reasonable.  It would likely
> result in a bunch of typecasts everywhere.

I'm suggesting this group of provider-allocated structures remain
opaque to the user and we don't add new user-visible things to them at
all (having them non-opaque to start with was a mistake).

Use accessors to implement new functionality on these objects.

Accessors are an overall better strategy for keeping ABI stability,
and should be used whenever possible.

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:[~2012-09-25  0:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-20 21:43 [PATCH 3/8] libibverbs: Introduce XRC domains Hefty, Sean
     [not found] ` <1828884A29C6694DAF28B7E6B8A8237346A8E7FB-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-09-24 20:36   ` Jason Gunthorpe
     [not found]     ` <20120924203618.GC9472-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2012-09-24 20:45       ` Hefty, Sean
     [not found]         ` <1828884A29C6694DAF28B7E6B8A8237346A8F01C-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-09-24 21:19           ` Jason Gunthorpe
     [not found]             ` <20120924211911.GA11120-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2012-09-24 21:54               ` Hefty, Sean
     [not found]                 ` <1828884A29C6694DAF28B7E6B8A8237346A8F05F-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-09-24 22:09                   ` Jason Gunthorpe
     [not found]                     ` <20120924220912.GA12418-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2012-09-24 23:00                       ` Hefty, Sean
     [not found]                         ` <1828884A29C6694DAF28B7E6B8A8237346A8F087-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-09-25  0:04                           ` Jason Gunthorpe [this message]

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=20120925000419.GB12418@obsidianresearch.com \
    --to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@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