From: sashiko-bot@kernel.org
To: "Maxim Skokov" <skokovmaksimevg@gmail.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf 2/2] selftests/bpf: Cover test_run csum validation after bpf_skb_change_tail()
Date: Wed, 07 Oct 2026 18:18:00 +0000 [thread overview]
Message-ID: <sashiko-outbox-163281@kernel.org> (raw)
In-Reply-To: <20261007181249.352831-3-skokovmaksimevg@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] bpf: multi-line comments do not follow the preferred BPF style
--
commit 5ce414e78d4de76ae6dba0dcb75c0182e95cd2d2
Author: Maxim Skokov <skokovmaksimevg@gmail.com>
selftests/bpf: Cover test_run csum validation after bpf_skb_change_tail()
This commit adds BPF_F_TEST_SKB_CHECKSUM_COMPLETE tests for tc programs
that modify the skb using bpf_skb_change_tail(), moving it out of
CHECKSUM_COMPLETE. It verifies that csum validation still correctly spots
invalid checksums.
> diff --git a/tools/testing/selftests/bpf/progs/skb_csum_complete.c b/tools/testing/selftests/bpf/progs/skb_csum_complete.c
> new file mode 100644
> index 0000000000000..8e8d53530899a
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/progs/skb_csum_complete.c
> @@ -0,0 +1,44 @@
> +// SPDX-License-Identifier: GPL-2.0
> +#include <vmlinux.h>
> +#include <bpf/bpf_helpers.h>
> +
> +SEC("tc")
> +int change_tail_trim(struct __sk_buff *skb)
> +{
> + /* Drops CHECKSUM_COMPLETE. skb->csum still covers the trimmed bytes,
> + * which hold the non-zero tcp.urg_ptr of pkt_v4, so it no longer
> + * matches the packet.
> + */
[Severity: Low]
This isn't a bug, but does this multi-line comment follow the preferred BPF
subsystem style? The global guidelines mandate that multi-line comments in BPF
files should have the opening '/*' on its own line, with the comment text
starting on the next line.
> + if (bpf_skb_change_tail(skb, skb->len - 4, 0))
> + return 1;
> + return 0;
> +}
> +
> +SEC("tc")
> +int change_tail_grow_write(struct __sk_buff *skb)
> +{
> + __u8 val = 0xab;
> +
> + /* Drops CHECKSUM_COMPLETE. The new bytes are zero and do not change
> + * the sum, but the write below can no longer update skb->csum.
> + */
[Severity: Low]
This isn't a bug, but similar to the previous comment, shouldn't the opening
'/*' be on its own line to match the required kernel comment style for BPF
files?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261007181249.352831-1-skokovmaksimevg@gmail.com?part=2
next prev parent reply other threads:[~2026-10-07 18:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-07 18:12 [PATCH bpf 0/2] bpf: test_run: Fix false -EBADMSG with BPF_F_TEST_SKB_CHECKSUM_COMPLETE Maxim Skokov
2026-10-07 18:12 ` [PATCH bpf 1/2] bpf: test_run: Fix false -EBADMSG after skb leaves CHECKSUM_COMPLETE Maxim Skokov
2026-10-07 18:45 ` bot+bpf-ci
2026-10-08 17:17 ` Maxim Skokov
2026-10-07 18:12 ` [PATCH bpf 2/2] selftests/bpf: Cover test_run csum validation after bpf_skb_change_tail() Maxim Skokov
2026-10-07 18:18 ` sashiko-bot [this message]
2026-10-08 17:17 ` Maxim Skokov
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=sashiko-outbox-163281@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=skokovmaksimevg@gmail.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 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.