From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: sashiko-reviews@lists.linux.dev
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next] selftests/bpf: Replace %pK output with 0
Date: Mon, 14 Sep 2026 10:43:09 +0200 [thread overview]
Message-ID: <20260914084309.f4ivXcU5@linutronix.de> (raw)
In-Reply-To: <20260911150338.91D3E1F000FF@smtp.kernel.org>
On 2026-09-11 15:03:37 [+0000], sashiko-bot@kernel.org wrote:
> > diff --git a/tools/testing/selftests/bpf/progs/bpf_iter_udp4.c b/tools/testing/selftests/bpf/progs/bpf_iter_udp4.c
> > index 23b2aa2604de2..9b789f09f1462 100644
> > --- a/tools/testing/selftests/bpf/progs/bpf_iter_udp4.c
> > +++ b/tools/testing/selftests/bpf/progs/bpf_iter_udp4.c
> > @@ -57,13 +57,13 @@ int dump_udp4(struct bpf_iter__udp *ctx)
> > BPF_SEQ_PRINTF(seq, "%5d: %08X:%04X %08X:%04X ",
> > ctx->bucket, src, srcp, dest, destp);
> >
> > - BPF_SEQ_PRINTF(seq, "%02X %08X:%08X %02X:%08lX %08X %5u %8d %lu %d %pK %u\n",
> > + BPF_SEQ_PRINTF(seq, "%02X %08X:%08X %02X:%08lX %08X %5u %8d %lu %d %8d %u\n",
>
> [Severity: Low]
> Does this %8d format incorrectly pad the 0 with spaces?
>
> The networking subsystem replaced %pK with a literal 0, but replacing it with
> %8d here in dump_udp4() causes a mismatch with the native /proc/net/ output.
> Since BPF iterators are designed as exact drop-in replacements, could this
> mismatch break parsers that rely on strict spacing?
Indeed. I tried to match the pointer spacing for some reason. The
formatting in net does not align with the columns starting with the
inode which is %lu instead having 5 width same goes for ref. So I just
ignored and moved on with a plain 0. I could update if this is
considered important.
> [ ... ]
>
> > diff --git a/tools/testing/selftests/bpf/progs/bpf_iter_udp6.c b/tools/testing/selftests/bpf/progs/bpf_iter_udp6.c
> > index c48b05aa2a4b2..9766eff7069ff 100644
> > --- a/tools/testing/selftests/bpf/progs/bpf_iter_udp6.c
> > +++ b/tools/testing/selftests/bpf/progs/bpf_iter_udp6.c
> > @@ -65,13 +65,13 @@ int dump_udp6(struct bpf_iter__udp *ctx)
> > dest->s6_addr32[0], dest->s6_addr32[1],
> > dest->s6_addr32[2], dest->s6_addr32[3], destp);
> >
> > - BPF_SEQ_PRINTF(seq, "%02X %08X:%08X %02X:%08lX %08X %5u %8d %lu %d %pK %u\n",
> > + BPF_SEQ_PRINTF(seq, "%02X %08X:%08X %02X:%08lX %08X %5u %8d %lu %d %8d %u\n",
>
> [Severity: Low]
> Is the use of %8d here in dump_udp6() introducing the same formatting
> mismatch as in dump_udp4()?
>
> It seems it should use a literal 0 instead of %8d to exactly match the
> networking subsystem's native output format.
Yes it does but the extra spacing intends to align with the columns…
Sebastian
next prev parent reply other threads:[~2026-09-14 8:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-11 14:50 [PATCH bpf-next] selftests/bpf: Replace %pK output with 0 Sebastian Andrzej Siewior
2026-09-11 15:03 ` sashiko-bot
2026-09-14 8:43 ` Sebastian Andrzej Siewior [this message]
2026-09-11 15:41 ` bot+bpf-ci
2026-09-14 9:22 ` Sebastian Andrzej Siewior
2026-09-14 23:39 ` Emil Tsalapatis
2026-09-15 6:48 ` 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=20260914084309.f4ivXcU5@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=bpf@vger.kernel.org \
--cc=sashiko-reviews@lists.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 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.