Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Bernard Metzler <BMT@zurich.ibm.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: Re: [PATCH 1/1] Make user mmapped CQ arming flags field 32 bit size to remove 64 bit architecture dependency of siw.
Date: Tue, 6 Aug 2019 14:35:26 -0300	[thread overview]
Message-ID: <20190806173526.GJ11627@ziepe.ca> (raw)
In-Reply-To: <OF3F75D9B9.20A30B62-ON0025844E.005D311D-0025844E.005D8CF2@notes.na.collabserv.com>

On Tue, Aug 06, 2019 at 05:01:49PM +0000, Bernard Metzler wrote:
> 
> >To: "Bernard Metzler" <BMT@zurich.ibm.com>
> >From: "Jason Gunthorpe" <jgg@ziepe.ca>
> >Date: 08/06/2019 06:39PM
> >Cc: linux-rdma@vger.kernel.org
> >Subject: Re: Re: [PATCH 1/1] Make user mmapped CQ arming flags field
> >32 bit size to remove 64 bit architecture dependency of siw.
> >
> >On Tue, Aug 06, 2019 at 04:36:26PM +0000, Bernard Metzler wrote:
> >> 
> >> >To: "Bernard Metzler" <BMT@zurich.ibm.com>
> >> >From: "Jason Gunthorpe" <jgg@ziepe.ca>
> >> >Date: 08/06/2019 05:31PM
> >> >Cc: linux-rdma@vger.kernel.org
> >> >Subject: Re: Re: [PATCH 1/1] Make user mmapped CQ arming flags
> >field
> >> >32 bit size to remove 64 bit architecture dependency of siw.
> >> >
> >> >On Tue, Aug 06, 2019 at 02:53:49PM +0000, Bernard Metzler wrote:
> >> >
> >> >> >> index 7de68f1dc707..af735f55b291 100644
> >> >> >> +++ b/include/uapi/rdma/siw-abi.h
> >> >> >> @@ -180,6 +180,7 @@ struct siw_cqe {
> >> >> >>   * to control CQ arming.
> >> >> >>   */
> >> >> >>  struct siw_cq_ctrl {
> >> >> >> -	__aligned_u64 notify;
> >> >> >> +	__u32 flags;
> >> >> >> +	__u32 pad;
> >> >> >
> >> >> >The commit message needs to explain why this is compatible with
> >> >> >existing user space, if it is even is safe..
> >> >> >
> >> >> Old libsiw would remain compatible with the new layout, since it
> >> >> simply reads the 32bit 'flags' and zeroed 32bit 'pad' into a
> >64bit
> >> >> 'notify', ending with reading the same bits.
> >> >
> >> >Even on big endian?
> >> >
> >> Well I do not have access to a BE system right now to verify.
> >> But on a BE system, the lowest 3 bits (which are in use) of the
> >first
> >> 32bit variable 'flags' shall be the lowest (leftmost) 3 bits of an
> >> 'overlayed' 64bit variable 'notify' as well...
> >
> >One of LE or BE won't work with this scheme, it can't, the flag bit
> >will end up in the pad.
> >
> Sitting here on a x86 (LE), and it works. On a 64bits machine,
> two consecutive 32bits are obviously reordered in memory. Leaves
> 32bit LE broken, which is currently not supported.

? I still think 64 bit BE will be broken as the low two bits will
overlap the pad, not the new flags.

> Anyway, what would you suggest as the best path forward? A new ABI
> version? If we move to test_and_clear_bit(), 'flags' size would
> become architecture dependent...and we would break the ABI as well,
> no?

Maybe a #ifdef __big_endian__ and swap the order of the pad/flags ?

Jason

  reply	other threads:[~2019-08-06 17:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-05 14:17 [PATCH 0/1] Fix siw CQ processing for 32 bit archtecture support Bernard Metzler
2019-08-05 14:17 ` [PATCH 1/1] Make user mmapped CQ arming flags field 32 bit size to remove 64 bit architecture dependency of siw Bernard Metzler
2019-08-05 17:09   ` Leon Romanovsky
2019-08-06 11:58     ` Bernard Metzler
2019-08-06 12:10   ` Jason Gunthorpe
2019-08-06 12:32     ` Doug Ledford
2019-08-06 13:09       ` Bernard Metzler
2019-08-06 14:53     ` Bernard Metzler
2019-08-06 15:31       ` Jason Gunthorpe
2019-08-06 16:36         ` Bernard Metzler
2019-08-06 16:39           ` Jason Gunthorpe
2019-08-06 17:01             ` Bernard Metzler
2019-08-06 17:35               ` Jason Gunthorpe [this message]
2019-08-07 17:49                 ` Bernard Metzler
2019-08-07 18:53                   ` Doug Ledford
2019-08-08 14:17                     ` Bernard Metzler
2019-08-08 15:39                       ` Jason Gunthorpe

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=20190806173526.GJ11627@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=BMT@zurich.ibm.com \
    --cc=linux-rdma@vger.kernel.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