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

Set stack as function of max call depth #608

Merged
merged 1 commit into from
Nov 13, 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
15 changes: 8 additions & 7 deletions vm/inc/ubpf.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,18 @@ extern "C"
#define UBPF_MAX_INSTS 65536
#endif

/**
* @brief Default maximum number of nested calls in the VM.
*/
#if !defined(UBPF_MAX_CALL_DEPTH)
#define UBPF_MAX_CALL_DEPTH 8
#endif

/**
* @brief Default stack size for the eBPF program. Must be divisible by 16.
*/
#if !defined(UBPF_EBPF_STACK_SIZE)
#define UBPF_EBPF_STACK_SIZE (8 * 1024)
#define UBPF_EBPF_STACK_SIZE (UBPF_MAX_CALL_DEPTH * 512)
#endif

/**
Expand All @@ -60,12 +67,6 @@ extern "C"

#define UBPF_EBPF_NONVOLATILE_SIZE (sizeof(uint64_t) * 5)

/**
* @brief Default maximum number of nested calls in the VM.
*/
#if !defined(UBPF_MAX_CALL_DEPTH)
#define UBPF_MAX_CALL_DEPTH 10
#endif

/**
* @brief Opaque type for a the uBPF VM.
Expand Down
Loading