Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ebpf_base.h usability in C #777

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
elazarg marked this conversation as resolved.
Show resolved Hide resolved

// 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
elazarg marked this conversation as resolved.
Show resolved Hide resolved

// 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)
Loading