From: Yonghong Song <yonghong.song@linux.dev>
To: Cupertino Miranda <cupertino.miranda@oracle.com>, bpf@vger.kernel.org
Cc: David Faust <david.faust@oracle.com>,
Jose Marchesi <jose.marchesi@oracle.com>,
Elena Zannoni <elena.zannoni@oracle.com>
Subject: Re: [PATCH] selftests/bpf: Enforce definition order for __msg macros in BPF tests
Date: Wed, 11 Mar 2026 11:19:52 -0700 [thread overview]
Message-ID: <1b8a2b72-b08f-49fb-940e-f23d90ecec7d@linux.dev> (raw)
In-Reply-To: <20260305130035.192080-1-cupertino.miranda@oracle.com>
On 3/5/26 5:00 AM, Cupertino Miranda wrote:
> Ensure that __msg macros, and similars, used for BPF test validation are
> processed in the order they are defined in the source code.
>
> Neither GCC nor the C standard defines the order in which function
> attributes are consumed. While Clang tends to preserve definition order,
> GCC may process them out of sequence. This inconsistency causes BPF
> tests with multiple __msg entries to fail when compiled with GCC.
>
> This patch fixes the test runner to explicitly sort or process these
> attributes to guarantee predictable matching behavior across different
> compilers.
>
> Signed-off-by: Cupertino Miranda <cupertino.miranda@oracle.com>
> Cc: David Faust <david.faust@oracle.com>
> Cc: Jose Marchesi <jose.marchesi@oracle.com>
> Cc: Elena Zannoni <elena.zannoni@oracle.com>
I simulated with a few examples, e.g., message sequence numbers
like [4 3 5 2 0 1] and the patch looks correct. So
Acked-by: Yonghong Song <yonghong.song@linux.dev>
next prev parent reply other threads:[~2026-03-11 18:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-05 13:00 [PATCH] selftests/bpf: Enforce definition order for __msg macros in BPF tests Cupertino Miranda
2026-03-06 1:22 ` Kumar Kartikeya Dwivedi
2026-03-11 18:19 ` Yonghong Song [this message]
2026-03-18 23:07 ` Eduard Zingerman
2026-03-19 13:45 ` Cupertino Miranda
2026-03-19 13:47 ` Cupertino Miranda
2026-03-20 5:27 ` Eduard Zingerman
2026-03-23 13:02 ` Cupertino Miranda
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=1b8a2b72-b08f-49fb-940e-f23d90ecec7d@linux.dev \
--to=yonghong.song@linux.dev \
--cc=bpf@vger.kernel.org \
--cc=cupertino.miranda@oracle.com \
--cc=david.faust@oracle.com \
--cc=elena.zannoni@oracle.com \
--cc=jose.marchesi@oracle.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