Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
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};