Skip to content

Commit

Permalink
bpf: remove rate limit maps and structs for kernel <5.3
Browse files Browse the repository at this point in the history
Since the rate limit feature is only available for LARGE_BPF_PROG, let's
remove the unnecessary map and the struct from the small BPF progs.

Signed-off-by: Mahe Tardy <mahe.tardy@gmail.com>
  • Loading branch information
mtardy committed Jun 14, 2024
1 parent 2d999fd commit ed824b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bpf/process/types/basic.h
Original file line number Diff line number Diff line change
Expand Up @@ -1891,6 +1891,7 @@ FUNC_INLINE void do_action_signal(int signal)
*/
#define KEY_BYTES_PER_ARG 40

#ifdef __LARGE_BPF_PROG
/* Rate limit scope. */
#define ACTION_RATE_LIMIT_SCOPE_THREAD 0
#define ACTION_RATE_LIMIT_SCOPE_PROCESS 1
Expand Down Expand Up @@ -1932,7 +1933,6 @@ struct {
__type(value, __u8[sizeof(struct ratelimit_key) + 128]);
} ratelimit_ro_heap SEC(".maps");

#ifdef __LARGE_BPF_PROG
FUNC_INLINE bool
rate_limit(__u64 ratelimit_interval, __u64 ratelimit_scope, struct msg_generic_kprobe *e)
{
Expand Down

0 comments on commit ed824b3

Please sign in to comment.