From 2e0a24243eb1db32c69636a91bfc365cfe4d0a8d Mon Sep 17 00:00:00 2001 From: Vincent Li Date: Tue, 3 Sep 2024 21:38:28 +0000 Subject: [PATCH] xdp-udp: pin map pin map so when xdp-loader load then unload, and load again, the same map can be reused. Signed-off-by: Vincent Li --- xdp-udp/xdp_udp.bpf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xdp-udp/xdp_udp.bpf.c b/xdp-udp/xdp_udp.bpf.c index 8a5452f2..3d8191aa 100644 --- a/xdp-udp/xdp_udp.bpf.c +++ b/xdp-udp/xdp_udp.bpf.c @@ -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"); @@ -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