mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
The test covers basic re-use of a pinned DEVMAP map, with both matching and mismatching parameters. Signed-off-by: Yureka Lilian <yuka@yuka.dev> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Eduard Zingerman <eddyz87@gmail.com> Link: https://lore.kernel.org/bpf/20250814180113.1245565-4-yuka@yuka.dev
21 lines
443 B
C
21 lines
443 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#include <linux/bpf.h>
|
|
#include <bpf/bpf_helpers.h>
|
|
|
|
struct {
|
|
__uint(type, BPF_MAP_TYPE_DEVMAP);
|
|
__uint(max_entries, 1);
|
|
__type(key, __u32);
|
|
__type(value, __u32);
|
|
__uint(pinning, LIBBPF_PIN_BY_NAME);
|
|
} pinmap1 SEC(".maps");
|
|
|
|
struct {
|
|
__uint(type, BPF_MAP_TYPE_DEVMAP);
|
|
__uint(max_entries, 2);
|
|
__type(key, __u32);
|
|
__type(value, __u32);
|
|
__uint(pinning, LIBBPF_PIN_BY_NAME);
|
|
} pinmap2 SEC(".maps");
|