Regressions List Tracking
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Anton Protopopov" <aspsk@isovalent.com>,
	"Alexander Lobakin" <aleksander.lobakin@intel.com>
Cc: "Naresh Kamboju" <naresh.kamboju@linaro.org>,
	"open list" <linux-kernel@vger.kernel.org>,
	lkft-triage@lists.linaro.org,
	"Linux Regressions" <regressions@lists.linux.dev>,
	"Anders Roxell" <anders.roxell@linaro.org>,
	"Dan Carpenter" <dan.carpenter@linaro.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"David Ahern" <dsahern@kernel.org>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Russell King" <rmk+kernel@armlinux.org.uk>,
	"Ard Biesheuvel" <ardb@kernel.org>,
	"Linus Walleij" <linus.walleij@linaro.org>
Subject: Re: include/linux/build_bug.h:78:41: error: static assertion failed: "struct bpf_fib_lookup size check"
Date: Wed, 03 Apr 2024 13:17:05 +0200	[thread overview]
Message-ID: <80d7ab36-2746-43c7-a9b5-184f59981b81@app.fastmail.com> (raw)
In-Reply-To: <CAPyNcWdPJYOtDbun-qUJApm9ndsVkEj-sHDfbMWK2yCT6FOwdA@mail.gmail.com>

On Wed, Apr 3, 2024, at 12:09, Anton Protopopov wrote:
> On Wed, Apr 3, 2024 at 11:57 AM Anton Protopopov <aspsk@isovalent.com> wrote:
 end.
>>
>> Yeah, I am sending a patch for this right now. Better not to depend on
>> compiler options
>
> One __packed__ was not enough though. The problem was also with the
> union of two __u16's which is padded to be 32 bits when AEABI=n and
> the whole structure is packed (so total size is 66 in this case).

The __packed attribute is easy to misunderstand, in this case you
would need to mark every internal union and struct as well, since
you otherwise run into one or both of these problems:

- an inner aggregate with explicit packing still requires
  32-bit alignment (and padding) for each member, even if the
  outer struct puts it at an unaligned position

- You get a compiler warning if an internal structure
  is follows the normal alignment constraints but is located
  at an unaligned offset, since that violates the alignment
  constraints of the C standard.

      Arnd

      parent reply	other threads:[~2024-04-03 11:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03  8:03 include/linux/build_bug.h:78:41: error: static assertion failed: "struct bpf_fib_lookup size check" Naresh Kamboju
2024-04-03  8:10 ` Anton Protopopov
2024-04-03  8:45   ` Arnd Bergmann
2024-04-03  9:37     ` Alexander Lobakin
2024-04-03  9:57       ` Anton Protopopov
2024-04-03 10:09         ` Anton Protopopov
2024-04-03 10:12           ` Alexander Lobakin
2024-04-03 11:17           ` Arnd Bergmann [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=80d7ab36-2746-43c7-a9b5-184f59981b81@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=aleksander.lobakin@intel.com \
    --cc=anders.roxell@linaro.org \
    --cc=ardb@kernel.org \
    --cc=aspsk@isovalent.com \
    --cc=ast@kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=daniel@iogearbox.net \
    --cc=dsahern@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkft-triage@lists.linaro.org \
    --cc=naresh.kamboju@linaro.org \
    --cc=regressions@lists.linux.dev \
    --cc=rmk+kernel@armlinux.org.uk \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).