> diff --git a/tools/testing/selftests/bpf/progs/xdp_hw_metadata.c
> b/tools/testing/selftests/bpf/progs/xdp_hw_metadata.c
> index 330ece2eabdb..dc62d572e3ac 100644
> --- a/tools/testing/selftests/bpf/progs/xdp_hw_metadata.c
> +++ b/tools/testing/selftests/bpf/progs/xdp_hw_metadata.c
> @@ -110,6 +110,13 @@ int rx(struct xdp_md *ctx)
> else
> meta->hint_valid |= XDP_META_FIELD_VLAN_TAG;
>
> + err = bpf_xdp_metadata_rx_checksum(ctx, &meta->ip_summed,
> + &meta->cksum_meta);
This call to bpf_xdp_metadata_rx_checksum() appears to be missing its extern
declaration. The other kfuncs in this file have declarations like:
extern int bpf_xdp_metadata_rx_timestamp(const struct xdp_md *ctx,
__u64 *timestamp) __ksym;
extern int bpf_xdp_metadata_rx_hash(const struct xdp_md *ctx, __u32 *hash,
enum xdp_rss_hash_type *rss_type) __ksym;
extern int bpf_xdp_metadata_rx_vlan_tag(const struct xdp_md *ctx,
__be16 *vlan_proto,
__u16 *vlan_tci) __ksym;
Should there be a corresponding declaration for bpf_xdp_metadata_rx_checksum?
> + if (err)
> + meta->rx_cksum_err = err;
> + else
> + meta->hint_valid |= XDP_META_FIELD_CHECKSUM;
> +
> __sync_add_and_fetch(&pkts_redir, 1);
> return bpf_redirect_map(&xsk, ctx->rx_queue_index, XDP_PASS);
> }
> diff --git a/tools/testing/selftests/bpf/xdp_hw_metadata.c
> b/tools/testing/selftests/bpf/xdp_hw_metadata.c
[ ... ]
> @@ -254,6 +277,11 @@ static void verify_xdp_metadata(void *data, clockid_t
> clock_id)
> printf("No rx_vlan_tci or rx_vlan_proto, err=%d\n",
> meta->rx_vlan_tag_err);
> }
> +
> + 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);
^^^^^^
Minor typo: "rx_chsum" should be "rx_cksum" to match the variable naming
(rx_cksum_err) and be consistent with other similar messages.
---
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 commit is from an established kernel maintainer
and follows existing code patterns, with the errors being typical human
oversights (missing declaration, typo) rather than AI-generated issues.
issues-found: 2
issue-severity-score: medium
issue-severity-explanation: Missing extern declaration for kfunc will cause
compilation failure of the BPF selftest program, plus a minor typo in error
output.