> bpf: test_run: Fix false -EBADMSG after skb leaves CHECKSUM_COMPLETE

TL;DR: Nit only: the multi-line comment in bpf_prog_test_run_skb() should
start with /* on its own line, per BPF style. No functional problems raised.

> diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
> index 513354e928cb..45718fa9adfd 100644
> --- a/net/bpf/test_run.c
> +++ b/net/bpf/test_run.c
> @@ -1237,7 +1237,12 @@ int bpf_prog_test_run_skb(struct bpf_prog *prog, const 
> union bpf_attr *kattr,
>               memset(__skb_push(skb, hh_len), 0, hh_len);
>       }
>
> -     if (kattr->test.flags & BPF_F_TEST_SKB_CHECKSUM_COMPLETE) {
> +     /* A helper such as bpf_skb_change_tail() may have downgraded the skb
> +      * from CHECKSUM_COMPLETE. skb->csum is then unused by the stack and
> +      * there is nothing to validate.
> +      */

This isn't a bug, but could the opening of this multi-line comment be put on
its own line, with the text starting on the next line, as is preferred for
BPF code?

        /*
         * A helper such as bpf_skb_change_tail() may have downgraded the skb
         * from CHECKSUM_COMPLETE. skb->csum is then unused by the stack and
         * there is nothing to validate.
         */

> +     if ((kattr->test.flags & BPF_F_TEST_SKB_CHECKSUM_COMPLETE) &&
> +         skb->ip_summed == CHECKSUM_COMPLETE) {
>               const int off = skb_network_offset(skb);
>               int len = skb->len - off;
>               __wsum csum;


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/37667470582

Reply via email to