Thread (4 messages) flat view 4 messages, 2 authors, 2020-12-18

Re: Please remove all bit fields in bpf uapi

From: Meng Zhuo <hidden>
Date: 2020-12-18 09:10:52
Also in: bpf

Hi, Greg

Thank you for your reply
It's fine to do compile bit fields "by hand".
However is it possible to setup a guideline that forrbid "bit fields"
in uapi in the future?

Thanks

Greg KH [off-list ref] 于2020年12月18日周五 下午4:57写道:
On Fri, Dec 18, 2020 at 04:52:15PM +0800, Meng Zhuo wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help