Linux userland API discussions
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Meng Zhuo <mengzhuo1203@gmail.com>
Cc: linux-api@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: Please remove all bit fields in bpf uapi
Date: Fri, 18 Dec 2020 09:56:58 +0100	[thread overview]
Message-ID: <X9xu2q8QFCCf70r7@kroah.com> (raw)
In-Reply-To: <CACt3ES2LCfNDq-nskrySJjWD5EO9WCAst_+kJT7UbhYOmD+45g@mail.gmail.com>

On Fri, Dec 18, 2020 at 04:52:15PM +0800, Meng Zhuo wrote:
> Hi, all
> 
> I'm tring to port bpf.h to Go, however it's very hard to make it right
> with cgo since bit fields some fields didn't match any type of Go.
> 
> i.e.
> struct bpf_prog_info {
>         /* .... */
>         __u32 gpl_compatible:1;             <-- boolean ?
>         __u32 :31; /* alignment pad */   <--- padding with 31 ?
> 
> UAPI(User application interface) not just for GCC only right? If it's
> true, I think remove all bit fields is more appropriate.

It's a bit late to change a user-visable api, sorry.  Go has to have
some way of properly handling bit fields, this isn't a new thing :)

good luck!

greg k-h

  reply	other threads:[~2020-12-18  8:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18  8:52 Please remove all bit fields in bpf uapi Meng Zhuo
2020-12-18  8:56 ` Greg KH [this message]
2020-12-18  9:09   ` Meng Zhuo
2020-12-18 10:31     ` Greg KH
2020-12-18 11:04       ` Florian Weimer
2020-12-18 13:05         ` Daniel Borkmann

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=X9xu2q8QFCCf70r7@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=bpf@vger.kernel.org \
    --cc=linux-api@vger.kernel.org \
    --cc=mengzhuo1203@gmail.com \
    /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