Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 
0003 #include <linux/bpf.h>
0004 #include <bpf/bpf_helpers.h>
0005 
0006 #define IFINDEX_LO  1
0007 
0008 struct {
0009     __uint(type, BPF_MAP_TYPE_CPUMAP);
0010     __uint(key_size, sizeof(__u32));
0011     __uint(value_size, sizeof(struct bpf_cpumap_val));
0012     __uint(max_entries, 4);
0013 } cpu_map SEC(".maps");
0014 
0015 SEC("xdp/cpumap")
0016 int xdp_dummy_cm(struct xdp_md *ctx)
0017 {
0018     return XDP_PASS;
0019 }
0020 
0021 SEC("xdp.frags/cpumap")
0022 int xdp_dummy_cm_frags(struct xdp_md *ctx)
0023 {
0024     return XDP_PASS;
0025 }
0026 
0027 char _license[] SEC("license") = "GPL";