* [PATCH] selftests/bpf: Enforce definition order for __msg macros in BPF tests
@ 2026-03-05 13:00 Cupertino Miranda
2026-03-06 1:22 ` Kumar Kartikeya Dwivedi
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Cupertino Miranda @ 2026-03-05 13:00 UTC (permalink / raw)
To: bpf; +Cc: Cupertino Miranda, David Faust, Jose Marchesi, Elena Zannoni
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>
---
tools/testing/selftests/bpf/test_loader.c | 76 +++++++++++++----------
tools/testing/selftests/bpf/test_progs.h | 1 +
2 files changed, 45 insertions(+), 32 deletions(-)
diff --git a/tools/testing/selftests/bpf/test_loader.c b/tools/testing/selftests/bpf/test_loader.c
index 338c035c3688..fd9d41917de8 100644
--- a/tools/testing/selftests/bpf/test_loader.c
+++ b/tools/testing/selftests/bpf/test_loader.c
@@ -208,11 +208,12 @@ static int compile_regex(const char *pattern, regex_t *regex)
}
static int __push_msg(const char *pattern, bool on_next_line, bool negative,
- struct expected_msgs *msgs)
+ struct expected_msgs *msgs, int index)
{
struct expect_msg *msg;
void *tmp;
int err;
+ int i;
tmp = realloc(msgs->patterns,
(1 + msgs->cnt) * sizeof(struct expect_msg));
@@ -221,11 +222,15 @@ static int __push_msg(const char *pattern, bool on_next_line, bool negative,
return -ENOMEM;
}
msgs->patterns = tmp;
- msg = &msgs->patterns[msgs->cnt];
+ for (i = msgs->cnt; i > 0 && msgs->patterns[i-1].index > index; i--)
+ msgs->patterns[i] = msgs->patterns[i-1];
+
+ msg = &msgs->patterns[i];
msg->on_next_line = on_next_line;
msg->substr = pattern;
msg->negative = negative;
msg->is_regex = false;
+ msg->index = index;
if (strstr(pattern, "{{")) {
err = compile_regex(pattern, &msg->regex);
if (err)
@@ -243,19 +248,19 @@ static int clone_msgs(struct expected_msgs *from, struct expected_msgs *to)
for (i = 0; i < from->cnt; i++) {
msg = &from->patterns[i];
- err = __push_msg(msg->substr, msg->on_next_line, msg->negative, to);
+ err = __push_msg(msg->substr, msg->on_next_line, msg->negative, to, msg->index);
if (err)
return err;
}
return 0;
}
-static int push_msg(const char *substr, bool negative, struct expected_msgs *msgs)
+static int push_msg(const char *substr, bool negative, struct expected_msgs *msgs, int index)
{
- return __push_msg(substr, false, negative, msgs);
+ return __push_msg(substr, false, negative, msgs, index);
}
-static int push_disasm_msg(const char *regex_str, bool *on_next_line, struct expected_msgs *msgs)
+static int push_disasm_msg(const char *regex_str, bool *on_next_line, struct expected_msgs *msgs, int index)
{
int err;
@@ -263,7 +268,7 @@ static int push_disasm_msg(const char *regex_str, bool *on_next_line, struct exp
*on_next_line = false;
return 0;
}
- err = __push_msg(regex_str, *on_next_line, false, msgs);
+ err = __push_msg(regex_str, *on_next_line, false, msgs, index);
if (err)
return err;
*on_next_line = true;
@@ -359,13 +364,19 @@ static void update_flags(int *flags, int flag, bool clear)
*
* And the purpose of this function is to extract 'foo' from the above.
*/
-static const char *skip_dynamic_pfx(const char *s, const char *pfx)
+static const char *skip_dynamic_pfx(const char *s, const char *pfx, int *index)
{
const char *msg;
if (strncmp(s, pfx, strlen(pfx)) != 0)
return NULL;
msg = s + strlen(pfx);
+
+ errno = 0;
+ *index = strtol(msg, NULL, 10);
+ /* Make sure to always return a valid index. */
+ if (errno)
+ *index = INT_MAX;
msg = strchr(msg, '=');
if (!msg)
return NULL;
@@ -443,6 +454,7 @@ static int parse_test_spec(struct test_loader *tester,
const struct btf_type *t;
bool clear;
int flags;
+ int index;
t = btf__type_by_id(btf, i);
if (!btf_is_decl_tag(t))
@@ -474,59 +486,59 @@ static int parse_test_spec(struct test_loader *tester,
} else if (strcmp(s, TEST_TAG_AUXILIARY_UNPRIV) == 0) {
spec->auxiliary = true;
spec->mode_mask |= UNPRIV;
- } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_EXPECT_MSG_PFX))) {
- err = push_msg(msg, false, &spec->priv.expect_msgs);
+ } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_EXPECT_MSG_PFX, &index))) {
+ err = push_msg(msg, false, &spec->priv.expect_msgs, index);
if (err)
goto cleanup;
spec->mode_mask |= PRIV;
- } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_EXPECT_NOT_MSG_PFX))) {
- err = push_msg(msg, true, &spec->priv.expect_msgs);
+ } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_EXPECT_NOT_MSG_PFX, &index))) {
+ err = push_msg(msg, true, &spec->priv.expect_msgs, index);
if (err)
goto cleanup;
spec->mode_mask |= PRIV;
- } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_EXPECT_MSG_PFX_UNPRIV))) {
- err = push_msg(msg, false, &spec->unpriv.expect_msgs);
+ } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_EXPECT_MSG_PFX_UNPRIV, &index))) {
+ err = push_msg(msg, false, &spec->unpriv.expect_msgs, index);
if (err)
goto cleanup;
spec->mode_mask |= UNPRIV;
- } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_EXPECT_NOT_MSG_PFX_UNPRIV))) {
- err = push_msg(msg, true, &spec->unpriv.expect_msgs);
+ } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_EXPECT_NOT_MSG_PFX_UNPRIV, &index))) {
+ err = push_msg(msg, true, &spec->unpriv.expect_msgs, index);
if (err)
goto cleanup;
spec->mode_mask |= UNPRIV;
- } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_JITED_PFX))) {
+ } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_JITED_PFX, &index))) {
if (arch_mask == 0) {
PRINT_FAIL("__jited used before __arch_*");
goto cleanup;
}
if (collect_jit) {
err = push_disasm_msg(msg, &jit_on_next_line,
- &spec->priv.jited);
+ &spec->priv.jited, index);
if (err)
goto cleanup;
spec->mode_mask |= PRIV;
}
- } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_JITED_PFX_UNPRIV))) {
+ } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_JITED_PFX_UNPRIV, &index))) {
if (arch_mask == 0) {
PRINT_FAIL("__unpriv_jited used before __arch_*");
goto cleanup;
}
if (collect_jit) {
err = push_disasm_msg(msg, &unpriv_jit_on_next_line,
- &spec->unpriv.jited);
+ &spec->unpriv.jited, index);
if (err)
goto cleanup;
spec->mode_mask |= UNPRIV;
}
- } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_EXPECT_XLATED_PFX))) {
+ } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_EXPECT_XLATED_PFX, &index))) {
err = push_disasm_msg(msg, &xlated_on_next_line,
- &spec->priv.expect_xlated);
+ &spec->priv.expect_xlated, index);
if (err)
goto cleanup;
spec->mode_mask |= PRIV;
- } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_EXPECT_XLATED_PFX_UNPRIV))) {
+ } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_EXPECT_XLATED_PFX_UNPRIV, &index))) {
err = push_disasm_msg(msg, &unpriv_xlated_on_next_line,
- &spec->unpriv.expect_xlated);
+ &spec->unpriv.expect_xlated, index);
if (err)
goto cleanup;
spec->mode_mask |= UNPRIV;
@@ -615,24 +627,24 @@ static int parse_test_spec(struct test_loader *tester,
err = -EINVAL;
goto cleanup;
}
- } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_EXPECT_STDERR_PFX))) {
+ } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_EXPECT_STDERR_PFX, &index))) {
err = push_disasm_msg(msg, &stderr_on_next_line,
- &spec->priv.stderr);
+ &spec->priv.stderr, index);
if (err)
goto cleanup;
- } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_EXPECT_STDERR_PFX_UNPRIV))) {
+ } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_EXPECT_STDERR_PFX_UNPRIV, &index))) {
err = push_disasm_msg(msg, &unpriv_stderr_on_next_line,
- &spec->unpriv.stderr);
+ &spec->unpriv.stderr, index);
if (err)
goto cleanup;
- } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_EXPECT_STDOUT_PFX))) {
+ } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_EXPECT_STDOUT_PFX, &index))) {
err = push_disasm_msg(msg, &stdout_on_next_line,
- &spec->priv.stdout);
+ &spec->priv.stdout, index);
if (err)
goto cleanup;
- } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_EXPECT_STDOUT_PFX_UNPRIV))) {
+ } else if ((msg = skip_dynamic_pfx(s, TEST_TAG_EXPECT_STDOUT_PFX_UNPRIV, &index))) {
err = push_disasm_msg(msg, &unpriv_stdout_on_next_line,
- &spec->unpriv.stdout);
+ &spec->unpriv.stdout, index);
if (err)
goto cleanup;
} else if (str_has_pfx(s, TEST_TAG_LINEAR_SIZE)) {
diff --git a/tools/testing/selftests/bpf/test_progs.h b/tools/testing/selftests/bpf/test_progs.h
index eebfc18cdcd2..dc4b3aeb1137 100644
--- a/tools/testing/selftests/bpf/test_progs.h
+++ b/tools/testing/selftests/bpf/test_progs.h
@@ -553,6 +553,7 @@ struct expect_msg {
bool is_regex;
bool on_next_line;
bool negative;
+ int index;
};
struct expected_msgs {
--
2.47.3
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH] selftests/bpf: Enforce definition order for __msg macros in BPF tests
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
2026-03-18 23:07 ` Eduard Zingerman
2 siblings, 0 replies; 8+ messages in thread
From: Kumar Kartikeya Dwivedi @ 2026-03-06 1:22 UTC (permalink / raw)
To: Cupertino Miranda; +Cc: bpf, David Faust, Jose Marchesi, Elena Zannoni
On Thu, 5 Mar 2026 at 14:04, Cupertino Miranda
<cupertino.miranda@oracle.com> 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>
> ---
>
The logic looks correct to me, so:
Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
> [...]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] selftests/bpf: Enforce definition order for __msg macros in BPF tests
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
2026-03-18 23:07 ` Eduard Zingerman
2 siblings, 0 replies; 8+ messages in thread
From: Yonghong Song @ 2026-03-11 18:19 UTC (permalink / raw)
To: Cupertino Miranda, bpf; +Cc: David Faust, Jose Marchesi, Elena Zannoni
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>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] selftests/bpf: Enforce definition order for __msg macros in BPF tests
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
@ 2026-03-18 23:07 ` Eduard Zingerman
2026-03-19 13:45 ` Cupertino Miranda
2 siblings, 1 reply; 8+ messages in thread
From: Eduard Zingerman @ 2026-03-18 23:07 UTC (permalink / raw)
To: Cupertino Miranda, bpf; +Cc: David Faust, Jose Marchesi, Elena Zannoni
On Thu, 2026-03-05 at 13:00 +0000, 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>
> ---
Looks like this patch fell through the cracks.
It looks a bit intrusive, given the amount of places index has to be
passed through. An alternative would be to modify parse_test_spec()
such that it collects decl tag ids into the array first and then sorts
the array. It will have to use strverscmp() for comparator, though.
This way all the changes would be localized to a single function
collecting the array.
Up to you if that is worth the hassle.
Reviewed-by: Eduard Zingerman <eddyz87@gmail.com>
[...]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] selftests/bpf: Enforce definition order for __msg macros in BPF tests
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
0 siblings, 2 replies; 8+ messages in thread
From: Cupertino Miranda @ 2026-03-19 13:45 UTC (permalink / raw)
To: Eduard Zingerman, bpf; +Cc: David Faust, Jose Marchesi, Elena Zannoni
Hi Eduard,
I might be mistaken, but as it is skip_dynamic_pfx is dropping the index
from the string that is passed to push_msg.
This is the case since it is matching the '=' in its passed macros;
#define TEST_TAG_EXPECT_MSG_PFX "comment:test_expect_msg="
dropping the index and the other equal in the call to strchr(msg, '=').
I know the patch is rather bigger then perhaps minimally necessary but I
did not want to change the semantics of current implementation, except
the array ordering.
Did not really thought about string ordering it later, however, if I
think about it, I would personally prefer to order the array at the
push. Ordering later during a processing stage IMHO would obfuscate the
fact that the array is ordered by its index.
If we change skip_dynamic_pfx to also return the "<index>=" then we
could parse the string and insert it ordered in push_msg, not really
needing to wait for a later stage.
Anyway, up to you. If you think it is worth it, I can do that.
Cheers,
Cupertino
On 18-03-2026 11:07 PM, Eduard Zingerman wrote:
> On Thu, 2026-03-05 at 13:00 +0000, 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>
>> ---
>
> Looks like this patch fell through the cracks.
>
> It looks a bit intrusive, given the amount of places index has to be
> passed through. An alternative would be to modify parse_test_spec()
> such that it collects decl tag ids into the array first and then sorts
> the array. It will have to use strverscmp() for comparator, though.
> This way all the changes would be localized to a single function
> collecting the array.
>
> Up to you if that is worth the hassle.
>
> Reviewed-by: Eduard Zingerman <eddyz87@gmail.com>
>
> [...]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] selftests/bpf: Enforce definition order for __msg macros in BPF tests
2026-03-19 13:45 ` Cupertino Miranda
@ 2026-03-19 13:47 ` Cupertino Miranda
2026-03-20 5:27 ` Eduard Zingerman
1 sibling, 0 replies; 8+ messages in thread
From: Cupertino Miranda @ 2026-03-19 13:47 UTC (permalink / raw)
To: Eduard Zingerman, bpf
Cc: David Faust, Jose Marchesi, Elena Zannoni, cupertinomiranda
+CC: cupertinomiranda@gmail.com
On 19-03-2026 1:45 PM, Cupertino Miranda wrote:
> Hi Eduard,
>
> I might be mistaken, but as it is skip_dynamic_pfx is dropping the index
> from the string that is passed to push_msg.
> This is the case since it is matching the '=' in its passed macros;
>
> #define TEST_TAG_EXPECT_MSG_PFX "comment:test_expect_msg="
>
> dropping the index and the other equal in the call to strchr(msg, '=').
>
> I know the patch is rather bigger then perhaps minimally necessary but I
> did not want to change the semantics of current implementation, except
> the array ordering.
>
> Did not really thought about string ordering it later, however, if I
> think about it, I would personally prefer to order the array at the
> push. Ordering later during a processing stage IMHO would obfuscate the
> fact that the array is ordered by its index.
>
> If we change skip_dynamic_pfx to also return the "<index>=" then we
> could parse the string and insert it ordered in push_msg, not really
> needing to wait for a later stage.
>
> Anyway, up to you. If you think it is worth it, I can do that.
>
> Cheers,
> Cupertino
>
> On 18-03-2026 11:07 PM, Eduard Zingerman wrote:
>> On Thu, 2026-03-05 at 13:00 +0000, 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>
>>> ---
>>
>> Looks like this patch fell through the cracks.
>>
>> It looks a bit intrusive, given the amount of places index has to be
>> passed through. An alternative would be to modify parse_test_spec()
>> such that it collects decl tag ids into the array first and then sorts
>> the array. It will have to use strverscmp() for comparator, though.
>> This way all the changes would be localized to a single function
>> collecting the array.
>>
>> Up to you if that is worth the hassle.
>>
>> Reviewed-by: Eduard Zingerman <eddyz87@gmail.com>
>>
>> [...]
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] selftests/bpf: Enforce definition order for __msg macros in BPF tests
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
1 sibling, 1 reply; 8+ messages in thread
From: Eduard Zingerman @ 2026-03-20 5:27 UTC (permalink / raw)
To: Cupertino Miranda, bpf
Cc: David Faust, Jose Marchesi, Elena Zannoni, cupertinomiranda
On Thu, 2026-03-19 at 13:45 +0000, Cupertino Miranda wrote:
> Hi Eduard,
>
> I might be mistaken, but as it is skip_dynamic_pfx is dropping the index
> from the string that is passed to push_msg.
> This is the case since it is matching the '=' in its passed macros;
>
> #define TEST_TAG_EXPECT_MSG_PFX "comment:test_expect_msg="
>
> dropping the index and the other equal in the call to strchr(msg, '=').
>
> I know the patch is rather bigger then perhaps minimally necessary but I
> did not want to change the semantics of current implementation, except
> the array ordering.
>
> Did not really thought about string ordering it later, however, if I
> think about it, I would personally prefer to order the array at the
> push. Ordering later during a processing stage IMHO would obfuscate the
> fact that the array is ordered by its index.
>
> If we change skip_dynamic_pfx to also return the "<index>=" then we
> could parse the string and insert it ordered in push_msg, not really
> needing to wait for a later stage.
>
> Anyway, up to you. If you think it is worth it, I can do that.
Hi Cupertino,
Could you please check if [1] works as expected with gcc-bpf?
It is bigger than your patch, but I think it is a nice cleanup.
(I took a liberty of putting your 'Co-developed-by' tag in
the patch #3, please let me know if that was inappropriate).
[1] https://github.com/kernel-patches/bpf/pull/11484/commits
Thanks,
Eduard
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] selftests/bpf: Enforce definition order for __msg macros in BPF tests
2026-03-20 5:27 ` Eduard Zingerman
@ 2026-03-23 13:02 ` Cupertino Miranda
0 siblings, 0 replies; 8+ messages in thread
From: Cupertino Miranda @ 2026-03-23 13:02 UTC (permalink / raw)
To: Eduard Zingerman, bpf
Cc: David Faust, Jose Marchesi, Elena Zannoni, cupertinomiranda
Hi Eduard,
> Hi Cupertino,
>
> Could you please check if [1] works as expected with gcc-bpf?
Yes, it does work in gcc.
> It is bigger than your patch, but I think it is a nice cleanup.
> (I took a liberty of putting your 'Co-developed-by' tag in
> the patch #3, please let me know if that was inappropriate).
Thanks for sharing the credit! Fair enough!
Cheers,
Cupertino
>
> [1] https://github.com/kernel-patches/bpf/pull/11484/commits
>
> Thanks,
> Eduard
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-03-23 13:02 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.