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