Skip to content

Commit

Permalink
Set required_irql in sockops and sockaddr program information
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Jowett <[email protected]>
  • Loading branch information
Alan Jowett committed Jan 5, 2024
1 parent 4e69b3b commit 0e4949b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/eBpfExtensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ functions that override the global helper functions provided by the eBPF runtime
structure from provided data and context buffers.
* `context_destroy`: Pointer to `ebpf_program_context_destroy_t` function that destroys a program type specific
context structure and populates the returned data and context buffers.
* `required_irql`: IRQL that the eBPF program runs at.
* `required_irql`: IRQL that the eBPF program runs at when being invoked via bpf_prog_test_run_opts.

#### `ebpf_program_info_t` Struct
The various fields of this structure should be set as follows:
Expand Down
4 changes: 3 additions & 1 deletion netebpfext/net_ebpf_ext_sock_addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,9 @@ static ebpf_program_data_t _ebpf_sock_addr_program_data = {
.program_type_specific_helper_function_addresses = &_ebpf_sock_addr_specific_helper_function_address_table,
.global_helper_function_addresses = &_ebpf_sock_addr_global_helper_function_address_table,
.context_create = &_ebpf_sock_addr_context_create,
.context_destroy = &_ebpf_sock_addr_context_destroy};
.context_destroy = &_ebpf_sock_addr_context_destroy,
.required_irql = DISPATCH_LEVEL,
};

static ebpf_extension_data_t _ebpf_sock_addr_program_info_provider_data = {
NET_EBPF_EXTENSION_NPI_PROVIDER_VERSION, sizeof(_ebpf_sock_addr_program_data), &_ebpf_sock_addr_program_data};
Expand Down
4 changes: 3 additions & 1 deletion netebpfext/net_ebpf_ext_sock_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ _ebpf_sock_ops_context_destroy(
static ebpf_program_data_t _ebpf_sock_ops_program_data = {
.program_info = &_ebpf_sock_ops_program_info,
.context_create = &_ebpf_sock_ops_context_create,
.context_destroy = &_ebpf_sock_ops_context_destroy};
.context_destroy = &_ebpf_sock_ops_context_destroy,
.required_irql = DISPATCH_LEVEL,
};

static ebpf_extension_data_t _ebpf_sock_ops_program_info_provider_data = {
NET_EBPF_EXTENSION_NPI_PROVIDER_VERSION, sizeof(_ebpf_sock_ops_program_data), &_ebpf_sock_ops_program_data};
Expand Down

0 comments on commit 0e4949b

Please sign in to comment.