Skip to content

Commit

Permalink
Fix ebpf_base.h usability in C
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Thaler <[email protected]>
  • Loading branch information
dthaler authored and elazarg committed Nov 7, 2024
1 parent 9309034 commit 0669c85
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ebpf_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ typedef struct _ebpf_context_descriptor {

// Maximum number of nested function calls allowed in eBPF programs.
// This limit helps prevent stack overflow and ensures predictable behavior.
constexpr int MAX_CALL_STACK_FRAMES = 8;
#define MAX_CALL_STACK_FRAMES 8

// Stack space allocated for each subprogram (in bytes).
// This ensures each function call has its own dedicated stack space.
constexpr int EBPF_SUBPROGRAM_STACK_SIZE = 512;
#define EBPF_SUBPROGRAM_STACK_SIZE 512

// Total stack space usable with nested subprogram calls.
constexpr int EBPF_TOTAL_STACK_SIZE = MAX_CALL_STACK_FRAMES * EBPF_SUBPROGRAM_STACK_SIZE;
#define EBPF_TOTAL_STACK_SIZE (MAX_CALL_STACK_FRAMES * EBPF_SUBPROGRAM_STACK_SIZE)

0 comments on commit 0669c85

Please sign in to comment.