File Index
Files and directories
Sign in
FILE

fd_htab_lookup.c

File preview with syntax highlighting.

linux-6.19.14/tools/testing/selftests/bpf/progs/fd_htab_lookup.c C
 1// SPDX-License-Identifier: GPL-2.0
 2/* Copyright (C) 2025. Huawei Technologies Co., Ltd */
 3#include <linux/bpf.h>
 4#include <bpf/bpf_helpers.h>
 5
 6char _license[] SEC("license") = "GPL";
 7
 8struct inner_map_type {
 9	__uint(type, BPF_MAP_TYPE_ARRAY);
10	__uint(key_size, 4);
11	__uint(value_size, 4);
12	__uint(max_entries, 1);
13} inner_map SEC(".maps");
14
15struct {
16	__uint(type, BPF_MAP_TYPE_HASH_OF_MAPS);
17	__uint(max_entries, 64);
18	__type(key, int);
19	__type(value, int);
20	__array(values, struct inner_map_type);
21} outer_map SEC(".maps") = {
22	.values = {
23		[0] = &inner_map,
24	},
25};
~/ Read-only file preview.