mirror of https://github.com/aya-rs/aya
integration-test: Remove multimap C test
libbpf 1.0 doesn't support multimaps defined in `maps` section, it supports only BTF maps. At the same time, we already test multimaps loading with the Rust example (`integration-ebpf/src/bpf/map_test.rs`), so we can just remove the failing C test. Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>pull/398/head
parent
43aff57793
commit
325391892c
@ -1,47 +0,0 @@
|
|||||||
#include <linux/bpf.h>
|
|
||||||
#include <bpf/bpf_helpers.h>
|
|
||||||
|
|
||||||
const int XDP_ACTION_MAX = (XDP_TX + 1);
|
|
||||||
|
|
||||||
struct datarec {
|
|
||||||
__u64 rx_packets;
|
|
||||||
};
|
|
||||||
|
|
||||||
// stats keyed by XDP Action
|
|
||||||
struct bpf_map_def SEC("maps") xdp_stats_map = {
|
|
||||||
.type = BPF_MAP_TYPE_ARRAY,
|
|
||||||
.key_size = sizeof(__u32),
|
|
||||||
.value_size = sizeof(struct datarec),
|
|
||||||
.max_entries = XDP_ACTION_MAX,
|
|
||||||
};
|
|
||||||
|
|
||||||
// tracks number of times called
|
|
||||||
struct bpf_map_def SEC("maps") prog_stats_map = {
|
|
||||||
.type = BPF_MAP_TYPE_ARRAY,
|
|
||||||
.key_size = sizeof(__u32),
|
|
||||||
.value_size = sizeof(__u64),
|
|
||||||
.max_entries = 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
SEC("xdp/stats")
|
|
||||||
int xdp_stats(struct xdp_md *ctx)
|
|
||||||
{
|
|
||||||
__u64 *stats;
|
|
||||||
struct datarec *rec;
|
|
||||||
__u32 key = XDP_PASS;
|
|
||||||
__u32 k1 = 0;
|
|
||||||
|
|
||||||
stats = bpf_map_lookup_elem(&prog_stats_map, &k1);
|
|
||||||
if (!stats)
|
|
||||||
return XDP_ABORTED;
|
|
||||||
__sync_fetch_and_add(stats, 1);
|
|
||||||
|
|
||||||
rec = bpf_map_lookup_elem(&xdp_stats_map, &key);
|
|
||||||
if (!rec)
|
|
||||||
return XDP_ABORTED;
|
|
||||||
__sync_fetch_and_add(&rec->rx_packets, 1);
|
|
||||||
|
|
||||||
return XDP_PASS;
|
|
||||||
}
|
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
|
Loading…
Reference in New Issue