From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: bpf <bpf@vger.kernel.org>, Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Eduard Zingerman <eddyz87@gmail.com>, Hao Luo <haoluo@google.com>,
Jiri Olsa <jolsa@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>,
Song Liu <song@kernel.org>, Stanislav Fomichev <sdf@fomichev.me>,
Thomas Gleixner <tglx@linutronix.de>,
Yonghong Song <yonghong.song@linux.dev>,
kernel test robot <lkp@intel.com>
Subject: Re: [PATCH v2 bpf-next 1/3] bpf: Add casts to keep sparse quiet.
Date: Thu, 4 Jul 2024 10:00:33 +0200 [thread overview]
Message-ID: <20240704080033.eaXWEjdS@linutronix.de> (raw)
In-Reply-To: <CAADnVQKPLGKWT9Dx750CcR6B53cw1cW_cihQtONwBmHqrCRjDA@mail.gmail.com>
On 2024-07-03 14:39:16 [-0700], Alexei Starovoitov wrote:
> > diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
> > index 25ea393cf084b..f45b03706e4e9 100644
> > --- a/include/uapi/linux/bpf.h
> > +++ b/include/uapi/linux/bpf.h
> > @@ -6290,12 +6290,12 @@ struct bpf_tunnel_key {
> > */
> > struct bpf_xfrm_state {
> > __u32 reqid;
> > - __u32 spi; /* Stored in network byte order */
> > + __be32 spi; /* Stored in network byte order */
> > __u16 family;
> > __u16 ext; /* Padding, future use. */
> > union {
> > - __u32 remote_ipv4; /* Stored in network byte order */
> > - __u32 remote_ipv6[4]; /* Stored in network byte order */
> > + __be32 remote_ipv4; /* Stored in network byte order */
> > + __be32 remote_ipv6[4]; /* Stored in network byte order */
> > };
> > };
>
> I don't think we should be changing uapi because of sparse.
> I would ignore the warnings.
There are other struct member within this bpf.h which use __be32 so it
is known to userland (in terms of the compiler won't complain about an
unknown type due to missing include). The type is essentially the same
since the __bitwise attribute is empty except for sparse (which defines
__CHECKER_).
Therefore I wouldn't say this changes the uapi in an incompatible way.
Sebastian
next prev parent reply other threads:[~2024-07-04 8:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-02 14:21 [PATCH v2 bpf-next 0/3] bpf: sparse cleanup Sebastian Andrzej Siewior
2024-07-02 14:21 ` [PATCH v2 bpf-next 1/3] bpf: Add casts to keep sparse quiet Sebastian Andrzej Siewior
2024-07-03 21:39 ` Alexei Starovoitov
2024-07-04 8:00 ` Sebastian Andrzej Siewior [this message]
2024-07-07 0:42 ` Alexei Starovoitov
2024-07-02 14:21 ` [PATCH v2 bpf-next 2/3] bpf: Move a few bpf_func_proto declarations Sebastian Andrzej Siewior
2024-07-02 22:30 ` Andrii Nakryiko
2024-07-02 14:21 ` [PATCH v2 bpf-next 3/3] bpf: Implement bpf_check_basics_ok() as a macro Sebastian Andrzej Siewior
2024-07-02 16:27 ` Jiri Olsa
2024-07-02 18:12 ` Sebastian Andrzej Siewior
2024-07-02 22:26 ` Andrii Nakryiko
2024-07-03 12:39 ` Sebastian Andrzej Siewior
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=20240704080033.eaXWEjdS@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=lkp@intel.com \
--cc=martin.lau@linux.dev \
--cc=sdf@fomichev.me \
--cc=song@kernel.org \
--cc=tglx@linutronix.de \
--cc=yonghong.song@linux.dev \
/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