Skip to content

Commit

Permalink
xdp-udp: pin map
Browse files Browse the repository at this point in the history
pin map so when xdp-loader load
then unload, and load again, the
same map can be reused.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
  • Loading branch information
vincentmli committed Sep 3, 2024
1 parent ad3bc83 commit 2e0a242
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions xdp-udp/xdp_udp.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ struct {
__type(key, __u32);
__type(value, __u16);
__uint(max_entries, MAX_ALLOWED_PORTS);
__uint(pinning, LIBBPF_PIN_BY_NAME);
} udp_ports SEC(".maps");


Expand All @@ -88,6 +89,7 @@ struct {
__type(key, __u32);
__type(value, struct bucket_time);
__uint(max_entries, RRL_SIZE);
__uint(pinning, LIBBPF_PIN_BY_NAME);
} udp_state_map __section(".maps");

/** Copied from the kernel module of the base03-map-counter example of the
Expand Down

0 comments on commit 2e0a242

Please sign in to comment.