]> git.bitcoin.ninja Git - flowspec-xdp/commitdiff
Use BPF_F_NO_COMMON_LRU on BPF_MAP_TYPE_LRU_PERCPU_HASH maps
authorMatt Corallo <git@bluematt.me>
Tue, 25 May 2021 03:07:17 +0000 (03:07 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 25 May 2021 03:38:06 +0000 (03:38 +0000)
xdp.c

diff --git a/xdp.c b/xdp.c
index 75a44ff2a16d0a22a3cd462107feeec7dd3997c1..87544ba80c16578cb548db9491fb5bc655dde178 100644 (file)
--- a/xdp.c
+++ b/xdp.c
@@ -204,6 +204,7 @@ struct percpu_ratelimit {
 #define V6_SRC_RATE_DEFINE(n, limit) \
 struct { \
        __uint(type, BPF_MAP_TYPE_LRU_PERCPU_HASH); \
+       __uint(map_flags, BPF_F_NO_COMMON_LRU); \
        __uint(max_entries, limit); \
        uint128_t *key; \
        struct percpu_ratelimit *value; \
@@ -212,6 +213,7 @@ struct { \
 #define V4_SRC_RATE_DEFINE(n, limit) \
 struct { \
        __uint(type, BPF_MAP_TYPE_LRU_PERCPU_HASH); \
+       __uint(map_flags, BPF_F_NO_COMMON_LRU); \
        __uint(max_entries, limit); \
        __u32 *key; \
        struct percpu_ratelimit *value; \