summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/xdp_hw_metadata.c
diff options
context:
space:
mode:
authorJesper Dangaard Brouer <brouer@redhat.com>2023-04-12 21:49:00 +0200
committerAlexei Starovoitov <ast@kernel.org>2023-04-13 11:15:11 -0700
commit0f26b74e7d071b0dc18e2c43d79d496c2b144035 (patch)
tree27fc5232d3f0adfc0a960e0971c074fce437a829 /tools/testing/selftests/bpf/progs/xdp_hw_metadata.c
parent9123397aeeb4f93dda5828e37c35312f1b62231e (diff)
selftests/bpf: Adjust bpf_xdp_metadata_rx_hash for new arg
Update BPF selftests to use the new RSS type argument for kfunc bpf_xdp_metadata_rx_hash. Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Acked-by: Toke Høiland-Jørgensen <toke@redhat.com> Acked-by: Stanislav Fomichev <sdf@google.com> Link: https://lore.kernel.org/r/168132894068.340624.8914711185697163690.stgit@firesoul Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/xdp_hw_metadata.c')
-rw-r--r--tools/testing/selftests/bpf/progs/xdp_hw_metadata.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/testing/selftests/bpf/progs/xdp_hw_metadata.c b/tools/testing/selftests/bpf/progs/xdp_hw_metadata.c
index 0687d11162f6..e1c787815e44 100644
--- a/tools/testing/selftests/bpf/progs/xdp_hw_metadata.c
+++ b/tools/testing/selftests/bpf/progs/xdp_hw_metadata.c
@@ -18,8 +18,8 @@ __u64 pkts_redir = 0;
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) __ksym;
+extern int bpf_xdp_metadata_rx_hash(const struct xdp_md *ctx, __u32 *hash,
+ enum xdp_rss_hash_type *rss_type) __ksym;
SEC("xdp")
int rx(struct xdp_md *ctx)
@@ -80,9 +80,9 @@ int rx(struct xdp_md *ctx)
if (err)
meta->rx_timestamp = 0; /* Used by AF_XDP as not avail signal */
- err = bpf_xdp_metadata_rx_hash(ctx, &meta->rx_hash);
- if (err)
- meta->rx_hash = 0; /* Used by AF_XDP as not avail signal */
+ err = bpf_xdp_metadata_rx_hash(ctx, &meta->rx_hash, &meta->rx_hash_type);
+ if (err < 0)
+ meta->rx_hash_err = err; /* Used by AF_XDP as no hash signal */
__sync_add_and_fetch(&pkts_redir, 1);
return bpf_redirect_map(&xsk, ctx->rx_queue_index, XDP_PASS);