> selftests/bpf: Add bpf_xdp_metadata_rx_checksum support to xdp_hw_metadat prog

This isn't a bug, but there's a typo in the subject line - "xdp_hw_metadat"
should be "xdp_hw_metadata".

> diff --git a/tools/testing/selftests/bpf/xdp_hw_metadata.c 
> b/tools/testing/selftests/bpf/xdp_hw_metadata.c
> --- a/tools/testing/selftests/bpf/xdp_hw_metadata.c
> +++ b/tools/testing/selftests/bpf/xdp_hw_metadata.c

[ ... ]

> +     if (meta->hint_valid & XDP_META_FIELD_CHECKSUM)
> +             print_rx_cksum(meta->ip_summed, meta->cksum_meta);
> +     else
> +             printf("No rx_chsum, err=%d\n", meta->rx_cksum_err);
                    ^^^^^^^^

Should "rx_chsum" be "rx_checksum"?  The other error messages in this
function use the full field names: "rx_hash", "rx_timestamp",
"rx_vlan_tci".

> diff --git a/tools/testing/selftests/bpf/progs/xdp_hw_metadata.c 
> b/tools/testing/selftests/bpf/progs/xdp_hw_metadata.c
> --- a/tools/testing/selftests/bpf/progs/xdp_hw_metadata.c
> +++ b/tools/testing/selftests/bpf/progs/xdp_hw_metadata.c

[ ... ]

> +     err = bpf_xdp_metadata_rx_checksum(ctx, &meta->ip_summed,
> +                                        &meta->cksum_meta);

The file declares extern __ksym for the other XDP metadata kfuncs:

    extern int bpf_xdp_metadata_rx_timestamp(...) __ksym;
    extern int bpf_xdp_metadata_rx_hash(...) __ksym;
    extern int bpf_xdp_metadata_rx_vlan_tag(...) __ksym;

Should bpf_xdp_metadata_rx_checksum have a matching extern declaration
for consistency?


---
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/21875603263

AI-authorship-score: low
AI-authorship-explanation: The presence of typos and natural integration with 
existing kernel patterns suggest human authorship; no AI-like patterns detected.
issues-found: 3
issue-severity-score: low
issue-severity-explanation: Three minor issues found in test code: two typos 
(commit subject, error message) and a missing extern declaration for 
consistency.

Reply via email to