From 8ab54bd372e29a10edd33688276c49aecd8faa48 Mon Sep 17 00:00:00 2001 From: Sharmi Date: Thu, 15 Feb 2024 16:10:37 -0800 Subject: [PATCH] Release v0.14.1 (#3265) * fix check for static initialization of hash-of-maps key length. (#3260) * fix check for static initialization of hash-of-maps key length. * Delete tests/bpf2c_tests/expected/xdp_adjust_head_unsafe_dll.c * Delete tests/bpf2c_tests/expected/xdp_adjust_head_unsafe_raw.c * Delete tests/bpf2c_tests/expected/xdp_adjust_head_unsafe_sys.c * fix build failure --------- Co-authored-by: Anurag Saxena * Revert "Helper reallocate packet (#3110)" (#3263) This reverts commit 13eed744fe5256c123ed3e216f3ea7b7ad04a5aa. * bump version to 0.14.1 * fix test --------- Co-authored-by: Shankar Seal <74580197+shankarseal@users.noreply.github.com> Co-authored-by: Anurag Saxena --- docs/eBpfExtensions.md | 1 - include/ebpf_program_types.h | 5 - installer/Product.wxs | 2 +- libs/api_common/store_helper_internal.cpp | 7 +- libs/api_common/windows_helpers.cpp | 2 - libs/execution_context/ebpf_program.c | 8 - libs/shared/ebpf_serialize.c | 7 +- libs/store_helper/ebpf_store_helper.c | 5 +- netebpfext/net_ebpf_ext_program_info.h | 3 +- resource/ebpf_version.h | 2 +- .../atomic_instruction_fetch_add_dll.c | 2 +- .../atomic_instruction_fetch_add_raw.c | 2 +- .../atomic_instruction_fetch_add_sys.c | 2 +- .../expected/atomic_instruction_others_dll.c | 2 +- .../expected/atomic_instruction_others_raw.c | 2 +- .../expected/atomic_instruction_others_sys.c | 2 +- tests/bpf2c_tests/expected/bad_map_name_dll.c | 2 +- tests/bpf2c_tests/expected/bad_map_name_raw.c | 2 +- tests/bpf2c_tests/expected/bad_map_name_sys.c | 2 +- tests/bpf2c_tests/expected/bindmonitor_dll.c | 2 +- .../expected/bindmonitor_mt_tailcall_dll.c | 2 +- .../expected/bindmonitor_mt_tailcall_raw.c | 2 +- .../expected/bindmonitor_mt_tailcall_sys.c | 2 +- tests/bpf2c_tests/expected/bindmonitor_raw.c | 2 +- .../expected/bindmonitor_ringbuf_dll.c | 2 +- .../expected/bindmonitor_ringbuf_raw.c | 2 +- .../expected/bindmonitor_ringbuf_sys.c | 2 +- tests/bpf2c_tests/expected/bindmonitor_sys.c | 2 +- .../expected/bindmonitor_tailcall_dll.c | 2 +- .../expected/bindmonitor_tailcall_raw.c | 2 +- .../expected/bindmonitor_tailcall_sys.c | 2 +- tests/bpf2c_tests/expected/bpf_call_dll.c | 2 +- tests/bpf2c_tests/expected/bpf_call_raw.c | 2 +- tests/bpf2c_tests/expected/bpf_call_sys.c | 2 +- tests/bpf2c_tests/expected/bpf_dll.c | 2 +- tests/bpf2c_tests/expected/bpf_raw.c | 2 +- tests/bpf2c_tests/expected/bpf_sys.c | 2 +- .../expected/cgroup_count_connect4_dll.c | 2 +- .../expected/cgroup_count_connect4_raw.c | 2 +- .../expected/cgroup_count_connect4_sys.c | 2 +- .../expected/cgroup_count_connect6_dll.c | 2 +- .../expected/cgroup_count_connect6_raw.c | 2 +- .../expected/cgroup_count_connect6_sys.c | 2 +- .../expected/cgroup_mt_connect4_dll.c | 2 +- .../expected/cgroup_mt_connect4_raw.c | 2 +- .../expected/cgroup_mt_connect4_sys.c | 2 +- .../expected/cgroup_mt_connect6_dll.c | 2 +- .../expected/cgroup_mt_connect6_raw.c | 2 +- .../expected/cgroup_mt_connect6_sys.c | 2 +- .../expected/cgroup_sock_addr2_dll.c | 2 +- .../expected/cgroup_sock_addr2_raw.c | 2 +- .../expected/cgroup_sock_addr2_sys.c | 2 +- .../expected/cgroup_sock_addr_dll.c | 2 +- .../expected/cgroup_sock_addr_raw.c | 2 +- .../expected/cgroup_sock_addr_sys.c | 2 +- .../expected/decap_permit_packet_dll.c | 2 +- .../expected/decap_permit_packet_raw.c | 2 +- .../expected/decap_permit_packet_sys.c | 2 +- .../bpf2c_tests/expected/divide_by_zero_dll.c | 2 +- .../bpf2c_tests/expected/divide_by_zero_raw.c | 2 +- .../bpf2c_tests/expected/divide_by_zero_sys.c | 2 +- tests/bpf2c_tests/expected/droppacket_dll.c | 2 +- tests/bpf2c_tests/expected/droppacket_raw.c | 2 +- tests/bpf2c_tests/expected/droppacket_sys.c | 2 +- .../expected/droppacket_unsafe_dll.c | 2 +- .../expected/droppacket_unsafe_raw.c | 2 +- .../expected/droppacket_unsafe_sys.c | 2 +- tests/bpf2c_tests/expected/empty_dll.c | 2 +- tests/bpf2c_tests/expected/empty_raw.c | 2 +- tests/bpf2c_tests/expected/empty_sys.c | 2 +- .../expected/encap_reflect_packet_dll.c | 2 +- .../expected/encap_reflect_packet_raw.c | 2 +- .../expected/encap_reflect_packet_sys.c | 2 +- tests/bpf2c_tests/expected/hash_of_map_dll.c | 2 +- tests/bpf2c_tests/expected/hash_of_map_raw.c | 2 +- tests/bpf2c_tests/expected/hash_of_map_sys.c | 2 +- tests/bpf2c_tests/expected/inner_map_dll.c | 234 ++++++++++++------ tests/bpf2c_tests/expected/inner_map_raw.c | 234 ++++++++++++------ tests/bpf2c_tests/expected/inner_map_sys.c | 234 ++++++++++++------ .../expected/invalid_helpers_dll.c | 2 +- .../expected/invalid_helpers_raw.c | 2 +- .../expected/invalid_helpers_sys.c | 2 +- .../bpf2c_tests/expected/invalid_maps1_dll.c | 2 +- .../bpf2c_tests/expected/invalid_maps1_raw.c | 2 +- .../bpf2c_tests/expected/invalid_maps1_sys.c | 2 +- .../bpf2c_tests/expected/invalid_maps2_dll.c | 2 +- .../bpf2c_tests/expected/invalid_maps2_raw.c | 2 +- .../bpf2c_tests/expected/invalid_maps2_sys.c | 2 +- .../bpf2c_tests/expected/invalid_maps3_dll.c | 2 +- .../bpf2c_tests/expected/invalid_maps3_raw.c | 2 +- .../bpf2c_tests/expected/invalid_maps3_sys.c | 2 +- tests/bpf2c_tests/expected/map_dll.c | 2 +- .../bpf2c_tests/expected/map_in_map_btf_dll.c | 2 +- .../bpf2c_tests/expected/map_in_map_btf_raw.c | 2 +- .../bpf2c_tests/expected/map_in_map_btf_sys.c | 2 +- .../expected/map_in_map_legacy_id_dll.c | 2 +- .../expected/map_in_map_legacy_id_raw.c | 2 +- .../expected/map_in_map_legacy_id_sys.c | 2 +- .../expected/map_in_map_legacy_idx_dll.c | 2 +- .../expected/map_in_map_legacy_idx_raw.c | 2 +- .../expected/map_in_map_legacy_idx_sys.c | 2 +- tests/bpf2c_tests/expected/map_raw.c | 2 +- tests/bpf2c_tests/expected/map_reuse_2_dll.c | 2 +- tests/bpf2c_tests/expected/map_reuse_2_raw.c | 2 +- tests/bpf2c_tests/expected/map_reuse_2_sys.c | 2 +- tests/bpf2c_tests/expected/map_reuse_dll.c | 2 +- tests/bpf2c_tests/expected/map_reuse_raw.c | 2 +- tests/bpf2c_tests/expected/map_reuse_sys.c | 2 +- tests/bpf2c_tests/expected/map_sys.c | 2 +- tests/bpf2c_tests/expected/pidtgid_dll.c | 2 +- tests/bpf2c_tests/expected/pidtgid_raw.c | 2 +- tests/bpf2c_tests/expected/pidtgid_sys.c | 2 +- tests/bpf2c_tests/expected/printk_dll.c | 2 +- .../bpf2c_tests/expected/printk_legacy_dll.c | 2 +- .../bpf2c_tests/expected/printk_legacy_raw.c | 2 +- .../bpf2c_tests/expected/printk_legacy_sys.c | 2 +- tests/bpf2c_tests/expected/printk_raw.c | 2 +- tests/bpf2c_tests/expected/printk_sys.c | 2 +- .../bpf2c_tests/expected/printk_unsafe_dll.c | 2 +- .../bpf2c_tests/expected/printk_unsafe_raw.c | 2 +- .../bpf2c_tests/expected/printk_unsafe_sys.c | 2 +- .../bpf2c_tests/expected/reflect_packet_dll.c | 2 +- .../bpf2c_tests/expected/reflect_packet_raw.c | 2 +- .../bpf2c_tests/expected/reflect_packet_sys.c | 2 +- tests/bpf2c_tests/expected/sockops_dll.c | 2 +- tests/bpf2c_tests/expected/sockops_raw.c | 2 +- tests/bpf2c_tests/expected/sockops_sys.c | 2 +- .../bpf2c_tests/expected/tail_call_bad_dll.c | 2 +- .../bpf2c_tests/expected/tail_call_bad_raw.c | 2 +- .../bpf2c_tests/expected/tail_call_bad_sys.c | 2 +- tests/bpf2c_tests/expected/tail_call_dll.c | 2 +- .../bpf2c_tests/expected/tail_call_map_dll.c | 2 +- .../bpf2c_tests/expected/tail_call_map_raw.c | 2 +- .../bpf2c_tests/expected/tail_call_map_sys.c | 2 +- .../expected/tail_call_max_exceed_dll.c | 2 +- .../expected/tail_call_max_exceed_raw.c | 2 +- .../expected/tail_call_max_exceed_sys.c | 2 +- .../expected/tail_call_multiple_dll.c | 2 +- .../expected/tail_call_multiple_raw.c | 2 +- .../expected/tail_call_multiple_sys.c | 2 +- tests/bpf2c_tests/expected/tail_call_raw.c | 2 +- .../expected/tail_call_recursive_dll.c | 2 +- .../expected/tail_call_recursive_raw.c | 2 +- .../expected/tail_call_recursive_sys.c | 2 +- .../expected/tail_call_sequential_dll.c | 2 +- .../expected/tail_call_sequential_raw.c | 2 +- .../expected/tail_call_sequential_sys.c | 2 +- tests/bpf2c_tests/expected/tail_call_sys.c | 2 +- .../expected/test_sample_ebpf_dll.c | 2 +- .../expected/test_sample_ebpf_raw.c | 2 +- .../expected/test_sample_ebpf_sys.c | 2 +- .../expected/test_utility_helpers_dll.c | 2 +- .../expected/test_utility_helpers_raw.c | 2 +- .../expected/test_utility_helpers_sys.c | 2 +- tests/end_to_end/netsh_test.cpp | 25 +- tests/sample/undocked/inner_map.c | 34 ++- tests/sample/unsafe/xdp_adjust_head_unsafe.c | 46 ---- tools/bpf2c/bpf2c.cpp | 3 - tools/bpf2c/bpf2c.vcxproj | 16 +- tools/bpf2c/bpf_code_generator.cpp | 9 +- 160 files changed, 676 insertions(+), 483 deletions(-) delete mode 100644 tests/sample/unsafe/xdp_adjust_head_unsafe.c diff --git a/docs/eBpfExtensions.md b/docs/eBpfExtensions.md index 30f19a1f9f..567232c239 100644 --- a/docs/eBpfExtensions.md +++ b/docs/eBpfExtensions.md @@ -130,7 +130,6 @@ Helper function IDs for different program types need not be unique. * `return_type`: Set the appropriate value for the `ebpf_return_type_t` enum that represents the return type of the helper function. * `arguments`: Array of (at most) five helper function arguments of type `ebpf_argument_type_t`. -* `reallocate_packet`: Flag indicating if this helper function performs packet reallocation. #### `ebpf_argument_type_t` Enum This enum describes the various argument types that can be passed to an eBPF helper function. This is defined in the diff --git a/include/ebpf_program_types.h b/include/ebpf_program_types.h index b89513fcec..b1aabfb925 100644 --- a/include/ebpf_program_types.h +++ b/include/ebpf_program_types.h @@ -7,14 +7,12 @@ #include #if !defined(NO_CRT) && !defined(_NO_CRT_STDIO_INLINE) -#include #include #else typedef unsigned char uint8_t; typedef unsigned int uint32_t; typedef unsigned long long uint64_t; typedef unsigned short wchar_t; -#define bool _Bool #endif #define EBPF_MAX_PROGRAM_DESCRIPTOR_NAME_LENGTH 256 @@ -29,15 +27,12 @@ typedef struct _ebpf_program_type_descriptor char is_privileged; } ebpf_program_type_descriptor_t; -#define HELPER_FUNCTION_REALLOCATE_PACKET 0x1 - typedef struct _ebpf_helper_function_prototype { uint32_t helper_id; const char* name; ebpf_return_type_t return_type; ebpf_argument_type_t arguments[5]; - bool reallocate_packet : 1; } ebpf_helper_function_prototype_t; typedef struct _ebpf_program_info diff --git a/installer/Product.wxs b/installer/Product.wxs index 2fdd7ac7ad..0f56478a54 100644 --- a/installer/Product.wxs +++ b/installer/Product.wxs @@ -6,7 +6,7 @@ SPDX-License-Identifier: MIT - + helper_id) + sizeof(helper_prototype->return_type) + - sizeof(helper_prototype->arguments) + sizeof(reallocate_packet); + sizeof(helper_prototype->arguments); status = ebpf_read_registry_value_binary( helper_info_key, EBPF_HELPER_DATA_PROTOTYPE, (uint8_t*)serialized_data, expected_size); @@ -67,10 +66,6 @@ _load_helper_prototype( memcpy(&helper_prototype->arguments, serialized_data + offset, sizeof(helper_prototype->arguments)); offset += sizeof(helper_prototype->arguments); - memcpy(&reallocate_packet, serialized_data + offset, sizeof(reallocate_packet)); - helper_prototype->reallocate_packet = reallocate_packet ? HELPER_FUNCTION_REALLOCATE_PACKET : 0; - offset += sizeof(reallocate_packet); - helper_prototype->name = cxplat_duplicate_string(ebpf_down_cast_from_wstring(std::wstring(helper_name)).c_str()); if (helper_prototype->name == nullptr) { diff --git a/libs/api_common/windows_helpers.cpp b/libs/api_common/windows_helpers.cpp index da1544cc7a..7c0d877f23 100644 --- a/libs/api_common/windows_helpers.cpp +++ b/libs/api_common/windows_helpers.cpp @@ -61,7 +61,5 @@ get_helper_prototype_windows(int32_t n) verifier_prototype.argument_type[i] = raw_prototype->arguments[i]; } - verifier_prototype.reallocate_packet = raw_prototype->reallocate_packet == TRUE; - return verifier_prototype; } diff --git a/libs/execution_context/ebpf_program.c b/libs/execution_context/ebpf_program.c index 3af6abe6eb..d7683eb4ac 100644 --- a/libs/execution_context/ebpf_program.c +++ b/libs/execution_context/ebpf_program.c @@ -2063,7 +2063,6 @@ _IRQL_requires_max_(PASSIVE_LEVEL) static ebpf_result_t _ebpf_program_compute_pr // b. Helper name. // c. Helper return type. // d. Helper argument types. - // e. reallocate_packet flag (if set). // Note: // Order and fields being hashed is important. The order and fields being hashed must match the order and fields @@ -2129,13 +2128,6 @@ _IRQL_requires_max_(PASSIVE_LEVEL) static ebpf_result_t _ebpf_program_compute_pr goto Exit; } } - - if (helper_function_prototype->reallocate_packet) { - result = EBPF_CRYPTOGRAPHIC_HASH_APPEND_STR(cryptographic_hash, "reallocate_packet"); - if (result != EBPF_SUCCESS) { - goto Exit; - } - } } *hash_length = 0; result = ebpf_cryptographic_hash_get_hash_length(cryptographic_hash, hash_length); diff --git a/libs/shared/ebpf_serialize.c b/libs/shared/ebpf_serialize.c index 5fe0fa8af8..5df3cd2f77 100644 --- a/libs/shared/ebpf_serialize.c +++ b/libs/shared/ebpf_serialize.c @@ -29,7 +29,6 @@ typedef struct _ebpf_serialized_helper_function_prototype uint32_t helper_id; ebpf_return_type_t return_type; ebpf_argument_type_t arguments[5]; - uint8_t reallocate_packet; size_t name_length; uint8_t name[1]; } ebpf_serialized_helper_function_prototype_t; @@ -463,8 +462,6 @@ ebpf_serialize_program_info( for (uint16_t index = 0; index < EBPF_COUNT_OF(helper_prototype->arguments); index++) { serialized_helper_prototype->arguments[index] = helper_prototype->arguments[index]; } - serialized_helper_prototype->reallocate_packet = - helper_prototype->reallocate_packet ? HELPER_FUNCTION_REALLOCATE_PACKET : 0; serialized_helper_prototype->name_length = helper_function_name_length; // Copy the program type descriptor name buffer. memcpy(serialized_helper_prototype->name, helper_prototype->name, helper_function_name_length); @@ -630,14 +627,12 @@ ebpf_deserialize_program_info( goto Exit; } - // Deserialize helper prototype. + // Serialize helper prototype. helper_prototype->helper_id = serialized_helper_prototype->helper_id; helper_prototype->return_type = serialized_helper_prototype->return_type; for (int i = 0; i < EBPF_COUNT_OF(helper_prototype->arguments); i++) { helper_prototype->arguments[i] = serialized_helper_prototype->arguments[i]; } - helper_prototype->reallocate_packet = - serialized_helper_prototype->reallocate_packet == HELPER_FUNCTION_REALLOCATE_PACKET; // Adjust remaining buffer length. result = ebpf_safe_size_t_subtract( diff --git a/libs/store_helper/ebpf_store_helper.c b/libs/store_helper/ebpf_store_helper.c index dfa22a6915..94f95537b8 100644 --- a/libs/store_helper/ebpf_store_helper.c +++ b/libs/store_helper/ebpf_store_helper.c @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation // SPDX-License-Identifier: MIT +#include "ebpf_program_types.h" #include "ebpf_registry_helper.h" #include "ebpf_store_helper.h" #include "ebpf_windows.h" @@ -40,7 +41,6 @@ _ebpf_store_update_helper_prototype( uint32_t offset; ebpf_store_key_t helper_function_key = NULL; char serialized_data[sizeof(ebpf_helper_function_prototype_t)] = {0}; - const bool reallocate_packet = helper_info->reallocate_packet; wchar_t* wide_helper_name = ebpf_get_wstring_from_string(helper_info->name); if (wide_helper_name == NULL) { @@ -63,9 +63,6 @@ _ebpf_store_update_helper_prototype( memcpy(serialized_data + offset, helper_info->arguments, sizeof(helper_info->arguments)); offset += sizeof(helper_info->arguments); - memcpy(serialized_data + offset, &reallocate_packet, sizeof(reallocate_packet)); - offset += sizeof(reallocate_packet); - // Save the helper prototype data. result = ebpf_write_registry_value_binary( helper_function_key, EBPF_HELPER_DATA_PROTOTYPE, (uint8_t*)&serialized_data[0], offset); diff --git a/netebpfext/net_ebpf_ext_program_info.h b/netebpfext/net_ebpf_ext_program_info.h index 9ac05e23f3..b3aeccb204 100644 --- a/netebpfext/net_ebpf_ext_program_info.h +++ b/netebpfext/net_ebpf_ext_program_info.h @@ -14,8 +14,7 @@ static const ebpf_helper_function_prototype_t _xdp_test_ebpf_extension_helper_fu {XDP_EXT_HELPER_FUNCTION_START + 1, "bpf_xdp_adjust_head", EBPF_RETURN_TYPE_INTEGER, - {EBPF_ARGUMENT_TYPE_PTR_TO_CTX, EBPF_ARGUMENT_TYPE_ANYTHING}, - HELPER_FUNCTION_REALLOCATE_PACKET}}; + {EBPF_ARGUMENT_TYPE_PTR_TO_CTX, EBPF_ARGUMENT_TYPE_ANYTHING}}}; // XDP_TEST program information. static const ebpf_context_descriptor_t _ebpf_xdp_test_context_descriptor = { diff --git a/resource/ebpf_version.h b/resource/ebpf_version.h index e992711e20..d17e866d05 100644 --- a/resource/ebpf_version.h +++ b/resource/ebpf_version.h @@ -3,7 +3,7 @@ #define EBPF_VERSION_MAJOR 0 #define EBPF_VERSION_MINOR 14 -#define EBPF_VERSION_REVISION 0 +#define EBPF_VERSION_REVISION 1 #define QUOTE(str) #str #define EXPAND_AND_QUOTE(str) QUOTE(str) diff --git a/tests/bpf2c_tests/expected/atomic_instruction_fetch_add_dll.c b/tests/bpf2c_tests/expected/atomic_instruction_fetch_add_dll.c index b5d67d9969..2cebee1b28 100644 --- a/tests/bpf2c_tests/expected/atomic_instruction_fetch_add_dll.c +++ b/tests/bpf2c_tests/expected/atomic_instruction_fetch_add_dll.c @@ -179,7 +179,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/atomic_instruction_fetch_add_raw.c b/tests/bpf2c_tests/expected/atomic_instruction_fetch_add_raw.c index b29e946178..79438f9136 100644 --- a/tests/bpf2c_tests/expected/atomic_instruction_fetch_add_raw.c +++ b/tests/bpf2c_tests/expected/atomic_instruction_fetch_add_raw.c @@ -153,7 +153,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/atomic_instruction_fetch_add_sys.c b/tests/bpf2c_tests/expected/atomic_instruction_fetch_add_sys.c index 8666ddfa6c..b7289763e0 100644 --- a/tests/bpf2c_tests/expected/atomic_instruction_fetch_add_sys.c +++ b/tests/bpf2c_tests/expected/atomic_instruction_fetch_add_sys.c @@ -314,7 +314,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/atomic_instruction_others_dll.c b/tests/bpf2c_tests/expected/atomic_instruction_others_dll.c index 2162fe6e81..74985e2c2f 100644 --- a/tests/bpf2c_tests/expected/atomic_instruction_others_dll.c +++ b/tests/bpf2c_tests/expected/atomic_instruction_others_dll.c @@ -152,7 +152,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/atomic_instruction_others_raw.c b/tests/bpf2c_tests/expected/atomic_instruction_others_raw.c index 38de05d52f..34f5e89559 100644 --- a/tests/bpf2c_tests/expected/atomic_instruction_others_raw.c +++ b/tests/bpf2c_tests/expected/atomic_instruction_others_raw.c @@ -126,7 +126,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/atomic_instruction_others_sys.c b/tests/bpf2c_tests/expected/atomic_instruction_others_sys.c index 5933c69a99..a18db3ac03 100644 --- a/tests/bpf2c_tests/expected/atomic_instruction_others_sys.c +++ b/tests/bpf2c_tests/expected/atomic_instruction_others_sys.c @@ -287,7 +287,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/bad_map_name_dll.c b/tests/bpf2c_tests/expected/bad_map_name_dll.c index bdc6d89386..bc2a4ae681 100644 --- a/tests/bpf2c_tests/expected/bad_map_name_dll.c +++ b/tests/bpf2c_tests/expected/bad_map_name_dll.c @@ -179,7 +179,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/bad_map_name_raw.c b/tests/bpf2c_tests/expected/bad_map_name_raw.c index 75e443bcb2..76e89dab8c 100644 --- a/tests/bpf2c_tests/expected/bad_map_name_raw.c +++ b/tests/bpf2c_tests/expected/bad_map_name_raw.c @@ -153,7 +153,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/bad_map_name_sys.c b/tests/bpf2c_tests/expected/bad_map_name_sys.c index 9530c28e96..243fa9364f 100644 --- a/tests/bpf2c_tests/expected/bad_map_name_sys.c +++ b/tests/bpf2c_tests/expected/bad_map_name_sys.c @@ -314,7 +314,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/bindmonitor_dll.c b/tests/bpf2c_tests/expected/bindmonitor_dll.c index befa1b9d68..20c3dc2678 100644 --- a/tests/bpf2c_tests/expected/bindmonitor_dll.c +++ b/tests/bpf2c_tests/expected/bindmonitor_dll.c @@ -2022,7 +2022,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/bindmonitor_mt_tailcall_dll.c b/tests/bpf2c_tests/expected/bindmonitor_mt_tailcall_dll.c index f59618643a..067455e784 100644 --- a/tests/bpf2c_tests/expected/bindmonitor_mt_tailcall_dll.c +++ b/tests/bpf2c_tests/expected/bindmonitor_mt_tailcall_dll.c @@ -6192,7 +6192,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/bindmonitor_mt_tailcall_raw.c b/tests/bpf2c_tests/expected/bindmonitor_mt_tailcall_raw.c index 13a0bed018..233148c72d 100644 --- a/tests/bpf2c_tests/expected/bindmonitor_mt_tailcall_raw.c +++ b/tests/bpf2c_tests/expected/bindmonitor_mt_tailcall_raw.c @@ -6166,7 +6166,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/bindmonitor_mt_tailcall_sys.c b/tests/bpf2c_tests/expected/bindmonitor_mt_tailcall_sys.c index 47272e66c6..fc721721ea 100644 --- a/tests/bpf2c_tests/expected/bindmonitor_mt_tailcall_sys.c +++ b/tests/bpf2c_tests/expected/bindmonitor_mt_tailcall_sys.c @@ -6327,7 +6327,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/bindmonitor_raw.c b/tests/bpf2c_tests/expected/bindmonitor_raw.c index e16245da7d..9d987c782f 100644 --- a/tests/bpf2c_tests/expected/bindmonitor_raw.c +++ b/tests/bpf2c_tests/expected/bindmonitor_raw.c @@ -1996,7 +1996,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/bindmonitor_ringbuf_dll.c b/tests/bpf2c_tests/expected/bindmonitor_ringbuf_dll.c index 66ec50fd54..d7d4256153 100644 --- a/tests/bpf2c_tests/expected/bindmonitor_ringbuf_dll.c +++ b/tests/bpf2c_tests/expected/bindmonitor_ringbuf_dll.c @@ -183,7 +183,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/bindmonitor_ringbuf_raw.c b/tests/bpf2c_tests/expected/bindmonitor_ringbuf_raw.c index dbcceb11a2..688deaf6a5 100644 --- a/tests/bpf2c_tests/expected/bindmonitor_ringbuf_raw.c +++ b/tests/bpf2c_tests/expected/bindmonitor_ringbuf_raw.c @@ -157,7 +157,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/bindmonitor_ringbuf_sys.c b/tests/bpf2c_tests/expected/bindmonitor_ringbuf_sys.c index 69ff793b2f..fe3b492068 100644 --- a/tests/bpf2c_tests/expected/bindmonitor_ringbuf_sys.c +++ b/tests/bpf2c_tests/expected/bindmonitor_ringbuf_sys.c @@ -318,7 +318,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/bindmonitor_sys.c b/tests/bpf2c_tests/expected/bindmonitor_sys.c index 3811bb402d..f5fb08eeb3 100644 --- a/tests/bpf2c_tests/expected/bindmonitor_sys.c +++ b/tests/bpf2c_tests/expected/bindmonitor_sys.c @@ -2157,7 +2157,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/bindmonitor_tailcall_dll.c b/tests/bpf2c_tests/expected/bindmonitor_tailcall_dll.c index e2049c259a..5c67ba36f2 100644 --- a/tests/bpf2c_tests/expected/bindmonitor_tailcall_dll.c +++ b/tests/bpf2c_tests/expected/bindmonitor_tailcall_dll.c @@ -2233,7 +2233,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/bindmonitor_tailcall_raw.c b/tests/bpf2c_tests/expected/bindmonitor_tailcall_raw.c index 917890a4f5..f7ffb42518 100644 --- a/tests/bpf2c_tests/expected/bindmonitor_tailcall_raw.c +++ b/tests/bpf2c_tests/expected/bindmonitor_tailcall_raw.c @@ -2207,7 +2207,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/bindmonitor_tailcall_sys.c b/tests/bpf2c_tests/expected/bindmonitor_tailcall_sys.c index e158c99eae..3c6de9a837 100644 --- a/tests/bpf2c_tests/expected/bindmonitor_tailcall_sys.c +++ b/tests/bpf2c_tests/expected/bindmonitor_tailcall_sys.c @@ -2368,7 +2368,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/bpf_call_dll.c b/tests/bpf2c_tests/expected/bpf_call_dll.c index 668ac11fda..96bf45d102 100644 --- a/tests/bpf2c_tests/expected/bpf_call_dll.c +++ b/tests/bpf2c_tests/expected/bpf_call_dll.c @@ -179,7 +179,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/bpf_call_raw.c b/tests/bpf2c_tests/expected/bpf_call_raw.c index fd65cb6641..de0bdd72ad 100644 --- a/tests/bpf2c_tests/expected/bpf_call_raw.c +++ b/tests/bpf2c_tests/expected/bpf_call_raw.c @@ -153,7 +153,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/bpf_call_sys.c b/tests/bpf2c_tests/expected/bpf_call_sys.c index 017f3c8371..23d4841731 100644 --- a/tests/bpf2c_tests/expected/bpf_call_sys.c +++ b/tests/bpf2c_tests/expected/bpf_call_sys.c @@ -314,7 +314,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/bpf_dll.c b/tests/bpf2c_tests/expected/bpf_dll.c index 08e2b1fe62..b552a511ce 100644 --- a/tests/bpf2c_tests/expected/bpf_dll.c +++ b/tests/bpf2c_tests/expected/bpf_dll.c @@ -110,7 +110,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/bpf_raw.c b/tests/bpf2c_tests/expected/bpf_raw.c index ef3214beba..b14a37d71e 100644 --- a/tests/bpf2c_tests/expected/bpf_raw.c +++ b/tests/bpf2c_tests/expected/bpf_raw.c @@ -84,7 +84,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/bpf_sys.c b/tests/bpf2c_tests/expected/bpf_sys.c index e34fd0daa2..3e3c7b4b98 100644 --- a/tests/bpf2c_tests/expected/bpf_sys.c +++ b/tests/bpf2c_tests/expected/bpf_sys.c @@ -245,7 +245,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/cgroup_count_connect4_dll.c b/tests/bpf2c_tests/expected/cgroup_count_connect4_dll.c index 44f9cd28b1..30c165a780 100644 --- a/tests/bpf2c_tests/expected/cgroup_count_connect4_dll.c +++ b/tests/bpf2c_tests/expected/cgroup_count_connect4_dll.c @@ -252,7 +252,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/cgroup_count_connect4_raw.c b/tests/bpf2c_tests/expected/cgroup_count_connect4_raw.c index f698c486d3..9a53cb42a4 100644 --- a/tests/bpf2c_tests/expected/cgroup_count_connect4_raw.c +++ b/tests/bpf2c_tests/expected/cgroup_count_connect4_raw.c @@ -226,7 +226,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/cgroup_count_connect4_sys.c b/tests/bpf2c_tests/expected/cgroup_count_connect4_sys.c index 863838289a..bfe8020349 100644 --- a/tests/bpf2c_tests/expected/cgroup_count_connect4_sys.c +++ b/tests/bpf2c_tests/expected/cgroup_count_connect4_sys.c @@ -387,7 +387,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/cgroup_count_connect6_dll.c b/tests/bpf2c_tests/expected/cgroup_count_connect6_dll.c index a79b330b19..2d9053ded4 100644 --- a/tests/bpf2c_tests/expected/cgroup_count_connect6_dll.c +++ b/tests/bpf2c_tests/expected/cgroup_count_connect6_dll.c @@ -252,7 +252,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/cgroup_count_connect6_raw.c b/tests/bpf2c_tests/expected/cgroup_count_connect6_raw.c index 0f77eeb557..126f550e7d 100644 --- a/tests/bpf2c_tests/expected/cgroup_count_connect6_raw.c +++ b/tests/bpf2c_tests/expected/cgroup_count_connect6_raw.c @@ -226,7 +226,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/cgroup_count_connect6_sys.c b/tests/bpf2c_tests/expected/cgroup_count_connect6_sys.c index 41716f4e3e..6402c3c6fc 100644 --- a/tests/bpf2c_tests/expected/cgroup_count_connect6_sys.c +++ b/tests/bpf2c_tests/expected/cgroup_count_connect6_sys.c @@ -387,7 +387,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/cgroup_mt_connect4_dll.c b/tests/bpf2c_tests/expected/cgroup_mt_connect4_dll.c index ea677cd9de..92e9f43a03 100644 --- a/tests/bpf2c_tests/expected/cgroup_mt_connect4_dll.c +++ b/tests/bpf2c_tests/expected/cgroup_mt_connect4_dll.c @@ -191,7 +191,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/cgroup_mt_connect4_raw.c b/tests/bpf2c_tests/expected/cgroup_mt_connect4_raw.c index 266297c97f..b859012296 100644 --- a/tests/bpf2c_tests/expected/cgroup_mt_connect4_raw.c +++ b/tests/bpf2c_tests/expected/cgroup_mt_connect4_raw.c @@ -165,7 +165,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/cgroup_mt_connect4_sys.c b/tests/bpf2c_tests/expected/cgroup_mt_connect4_sys.c index 9a96853408..47bcd0c18e 100644 --- a/tests/bpf2c_tests/expected/cgroup_mt_connect4_sys.c +++ b/tests/bpf2c_tests/expected/cgroup_mt_connect4_sys.c @@ -326,7 +326,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/cgroup_mt_connect6_dll.c b/tests/bpf2c_tests/expected/cgroup_mt_connect6_dll.c index b7fd6e4b3b..742bc747e2 100644 --- a/tests/bpf2c_tests/expected/cgroup_mt_connect6_dll.c +++ b/tests/bpf2c_tests/expected/cgroup_mt_connect6_dll.c @@ -191,7 +191,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/cgroup_mt_connect6_raw.c b/tests/bpf2c_tests/expected/cgroup_mt_connect6_raw.c index 5331b8c06a..0f966e485b 100644 --- a/tests/bpf2c_tests/expected/cgroup_mt_connect6_raw.c +++ b/tests/bpf2c_tests/expected/cgroup_mt_connect6_raw.c @@ -165,7 +165,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/cgroup_mt_connect6_sys.c b/tests/bpf2c_tests/expected/cgroup_mt_connect6_sys.c index ecda1f8bbb..c19281ad06 100644 --- a/tests/bpf2c_tests/expected/cgroup_mt_connect6_sys.c +++ b/tests/bpf2c_tests/expected/cgroup_mt_connect6_sys.c @@ -326,7 +326,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/cgroup_sock_addr2_dll.c b/tests/bpf2c_tests/expected/cgroup_sock_addr2_dll.c index 312b9ee1e2..53ce49b9a6 100644 --- a/tests/bpf2c_tests/expected/cgroup_sock_addr2_dll.c +++ b/tests/bpf2c_tests/expected/cgroup_sock_addr2_dll.c @@ -933,7 +933,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/cgroup_sock_addr2_raw.c b/tests/bpf2c_tests/expected/cgroup_sock_addr2_raw.c index 2c9d11bc02..67d457bcff 100644 --- a/tests/bpf2c_tests/expected/cgroup_sock_addr2_raw.c +++ b/tests/bpf2c_tests/expected/cgroup_sock_addr2_raw.c @@ -907,7 +907,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/cgroup_sock_addr2_sys.c b/tests/bpf2c_tests/expected/cgroup_sock_addr2_sys.c index 835cc07079..3aaf2ef833 100644 --- a/tests/bpf2c_tests/expected/cgroup_sock_addr2_sys.c +++ b/tests/bpf2c_tests/expected/cgroup_sock_addr2_sys.c @@ -1068,7 +1068,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/cgroup_sock_addr_dll.c b/tests/bpf2c_tests/expected/cgroup_sock_addr_dll.c index 2b6355bc9f..608d83325a 100644 --- a/tests/bpf2c_tests/expected/cgroup_sock_addr_dll.c +++ b/tests/bpf2c_tests/expected/cgroup_sock_addr_dll.c @@ -679,7 +679,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/cgroup_sock_addr_raw.c b/tests/bpf2c_tests/expected/cgroup_sock_addr_raw.c index 0d8a0b69f3..7f2c542209 100644 --- a/tests/bpf2c_tests/expected/cgroup_sock_addr_raw.c +++ b/tests/bpf2c_tests/expected/cgroup_sock_addr_raw.c @@ -653,7 +653,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/cgroup_sock_addr_sys.c b/tests/bpf2c_tests/expected/cgroup_sock_addr_sys.c index 396879e74b..a92368668d 100644 --- a/tests/bpf2c_tests/expected/cgroup_sock_addr_sys.c +++ b/tests/bpf2c_tests/expected/cgroup_sock_addr_sys.c @@ -814,7 +814,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/decap_permit_packet_dll.c b/tests/bpf2c_tests/expected/decap_permit_packet_dll.c index ab0b3927f1..ccf71d807f 100644 --- a/tests/bpf2c_tests/expected/decap_permit_packet_dll.c +++ b/tests/bpf2c_tests/expected/decap_permit_packet_dll.c @@ -489,7 +489,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/decap_permit_packet_raw.c b/tests/bpf2c_tests/expected/decap_permit_packet_raw.c index 04abd3cab4..a75f2ad838 100644 --- a/tests/bpf2c_tests/expected/decap_permit_packet_raw.c +++ b/tests/bpf2c_tests/expected/decap_permit_packet_raw.c @@ -463,7 +463,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/decap_permit_packet_sys.c b/tests/bpf2c_tests/expected/decap_permit_packet_sys.c index 5027bd4f19..17a4f3b1a9 100644 --- a/tests/bpf2c_tests/expected/decap_permit_packet_sys.c +++ b/tests/bpf2c_tests/expected/decap_permit_packet_sys.c @@ -624,7 +624,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/divide_by_zero_dll.c b/tests/bpf2c_tests/expected/divide_by_zero_dll.c index e72a2a233a..74b91ace94 100644 --- a/tests/bpf2c_tests/expected/divide_by_zero_dll.c +++ b/tests/bpf2c_tests/expected/divide_by_zero_dll.c @@ -186,7 +186,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/divide_by_zero_raw.c b/tests/bpf2c_tests/expected/divide_by_zero_raw.c index 84851afe83..0f815b8bcc 100644 --- a/tests/bpf2c_tests/expected/divide_by_zero_raw.c +++ b/tests/bpf2c_tests/expected/divide_by_zero_raw.c @@ -160,7 +160,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/divide_by_zero_sys.c b/tests/bpf2c_tests/expected/divide_by_zero_sys.c index 769555a114..8df1d41336 100644 --- a/tests/bpf2c_tests/expected/divide_by_zero_sys.c +++ b/tests/bpf2c_tests/expected/divide_by_zero_sys.c @@ -321,7 +321,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/droppacket_dll.c b/tests/bpf2c_tests/expected/droppacket_dll.c index 5e747099d0..60d04af04a 100644 --- a/tests/bpf2c_tests/expected/droppacket_dll.c +++ b/tests/bpf2c_tests/expected/droppacket_dll.c @@ -321,7 +321,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/droppacket_raw.c b/tests/bpf2c_tests/expected/droppacket_raw.c index 4f19af49bc..ba3799df8d 100644 --- a/tests/bpf2c_tests/expected/droppacket_raw.c +++ b/tests/bpf2c_tests/expected/droppacket_raw.c @@ -295,7 +295,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/droppacket_sys.c b/tests/bpf2c_tests/expected/droppacket_sys.c index ce2e2633c0..bd283bacb6 100644 --- a/tests/bpf2c_tests/expected/droppacket_sys.c +++ b/tests/bpf2c_tests/expected/droppacket_sys.c @@ -456,7 +456,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/droppacket_unsafe_dll.c b/tests/bpf2c_tests/expected/droppacket_unsafe_dll.c index 322bd3771f..814892945d 100644 --- a/tests/bpf2c_tests/expected/droppacket_unsafe_dll.c +++ b/tests/bpf2c_tests/expected/droppacket_unsafe_dll.c @@ -212,7 +212,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/droppacket_unsafe_raw.c b/tests/bpf2c_tests/expected/droppacket_unsafe_raw.c index 12a6618539..1e1864a374 100644 --- a/tests/bpf2c_tests/expected/droppacket_unsafe_raw.c +++ b/tests/bpf2c_tests/expected/droppacket_unsafe_raw.c @@ -186,7 +186,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/droppacket_unsafe_sys.c b/tests/bpf2c_tests/expected/droppacket_unsafe_sys.c index ad7000f3db..bd32bda586 100644 --- a/tests/bpf2c_tests/expected/droppacket_unsafe_sys.c +++ b/tests/bpf2c_tests/expected/droppacket_unsafe_sys.c @@ -347,7 +347,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/empty_dll.c b/tests/bpf2c_tests/expected/empty_dll.c index 22a1e77ae5..96120ce593 100644 --- a/tests/bpf2c_tests/expected/empty_dll.c +++ b/tests/bpf2c_tests/expected/empty_dll.c @@ -74,7 +74,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/empty_raw.c b/tests/bpf2c_tests/expected/empty_raw.c index 33eaaca049..ee005685b6 100644 --- a/tests/bpf2c_tests/expected/empty_raw.c +++ b/tests/bpf2c_tests/expected/empty_raw.c @@ -48,7 +48,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/empty_sys.c b/tests/bpf2c_tests/expected/empty_sys.c index cf5ccc3091..ba5f1e537d 100644 --- a/tests/bpf2c_tests/expected/empty_sys.c +++ b/tests/bpf2c_tests/expected/empty_sys.c @@ -209,7 +209,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/encap_reflect_packet_dll.c b/tests/bpf2c_tests/expected/encap_reflect_packet_dll.c index 5641c0c5c9..ecde183e90 100644 --- a/tests/bpf2c_tests/expected/encap_reflect_packet_dll.c +++ b/tests/bpf2c_tests/expected/encap_reflect_packet_dll.c @@ -1169,7 +1169,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/encap_reflect_packet_raw.c b/tests/bpf2c_tests/expected/encap_reflect_packet_raw.c index d372638711..eeb0c66253 100644 --- a/tests/bpf2c_tests/expected/encap_reflect_packet_raw.c +++ b/tests/bpf2c_tests/expected/encap_reflect_packet_raw.c @@ -1143,7 +1143,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/encap_reflect_packet_sys.c b/tests/bpf2c_tests/expected/encap_reflect_packet_sys.c index b63111cc7e..93f2d02967 100644 --- a/tests/bpf2c_tests/expected/encap_reflect_packet_sys.c +++ b/tests/bpf2c_tests/expected/encap_reflect_packet_sys.c @@ -1304,7 +1304,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/hash_of_map_dll.c b/tests/bpf2c_tests/expected/hash_of_map_dll.c index 5c570233ee..76b66de381 100644 --- a/tests/bpf2c_tests/expected/hash_of_map_dll.c +++ b/tests/bpf2c_tests/expected/hash_of_map_dll.c @@ -223,7 +223,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } #pragma data_seg(push, "map_initial_values") diff --git a/tests/bpf2c_tests/expected/hash_of_map_raw.c b/tests/bpf2c_tests/expected/hash_of_map_raw.c index 8224b22c0d..672f3dae94 100644 --- a/tests/bpf2c_tests/expected/hash_of_map_raw.c +++ b/tests/bpf2c_tests/expected/hash_of_map_raw.c @@ -197,7 +197,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } #pragma data_seg(push, "map_initial_values") diff --git a/tests/bpf2c_tests/expected/hash_of_map_sys.c b/tests/bpf2c_tests/expected/hash_of_map_sys.c index c83e4e9689..b460a89b17 100644 --- a/tests/bpf2c_tests/expected/hash_of_map_sys.c +++ b/tests/bpf2c_tests/expected/hash_of_map_sys.c @@ -358,7 +358,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } #pragma data_seg(push, "map_initial_values") diff --git a/tests/bpf2c_tests/expected/inner_map_dll.c b/tests/bpf2c_tests/expected/inner_map_dll.c index 0f2e5a02be..b300e73191 100644 --- a/tests/bpf2c_tests/expected/inner_map_dll.c +++ b/tests/bpf2c_tests/expected/inner_map_dll.c @@ -52,6 +52,30 @@ static map_entry_t _maps[] = { 11, // The id of the inner map template. }, "outer_map"}, + {NULL, + { + BPF_MAP_TYPE_HASH_OF_MAPS, // Type of map. + 2, // Size in bytes of a map key. + 4, // Size in bytes of a map value. + 1, // Maximum number of entries allowed in the map. + 0, // Inner map index. + LIBBPF_PIN_NONE, // Pinning type for the map. + 25, // Identifier for a map template. + 21, // The id of the inner map template. + }, + "outer_map2"}, + {NULL, + { + BPF_MAP_TYPE_ARRAY, // Type of map. + 4, // Size in bytes of a map key. + 4, // Size in bytes of a map value. + 1024, // Maximum number of entries allowed in the map. + 0, // Inner map index. + LIBBPF_PIN_NONE, // Pinning type for the map. + 21, // Identifier for a map template. + 0, // The id of the inner map template. + }, + "inner_map"}, {NULL, { BPF_MAP_TYPE_ARRAY, // Type of map. @@ -71,7 +95,7 @@ static void _get_maps(_Outptr_result_buffer_maybenull_(*count) map_entry_t** maps, _Out_ size_t* count) { *maps = _maps; - *count = 2; + *count = 4; } static helper_function_entry_t lookup_update_helpers[] = { @@ -84,116 +108,180 @@ static GUID lookup_update_attach_type_guid = { 0xf788ef4b, 0x207d, 0x4dc3, {0x85, 0xcf, 0x0f, 0x2e, 0xa1, 0x07, 0x21, 0x3c}}; static uint16_t lookup_update_maps[] = { 0, + 1, }; #pragma code_seg(push, "sample~1") static uint64_t lookup_update(void* context) -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" { -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" // Prologue -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" uint64_t stack[(UBPF_STACK_SIZE + 7) / 8]; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r0 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r1 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r2 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r3 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r4 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r5 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r6 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r7 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r10 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" r1 = (uintptr_t)context; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" r10 = (uintptr_t)((uint8_t*)stack + sizeof(stack)); // EBPF_OP_MOV64_IMM pc=0 dst=r7 src=r0 offset=0 imm=0 -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" r7 = IMMEDIATE(0); // EBPF_OP_STXW pc=1 dst=r10 src=r7 offset=-4 imm=0 -#line 38 "sample/undocked/inner_map.c" +#line 54 "sample/undocked/inner_map.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-4)) = (uint32_t)r7; - // EBPF_OP_MOV64_REG pc=2 dst=r2 src=r10 offset=0 imm=0 -#line 38 "sample/undocked/inner_map.c" + // EBPF_OP_STXH pc=2 dst=r10 src=r7 offset=-6 imm=0 +#line 55 "sample/undocked/inner_map.c" + *(uint16_t*)(uintptr_t)(r10 + OFFSET(-6)) = (uint16_t)r7; + // EBPF_OP_MOV64_REG pc=3 dst=r2 src=r10 offset=0 imm=0 +#line 55 "sample/undocked/inner_map.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=3 dst=r2 src=r0 offset=0 imm=-4 -#line 38 "sample/undocked/inner_map.c" + // EBPF_OP_ADD64_IMM pc=4 dst=r2 src=r0 offset=0 imm=-4 +#line 55 "sample/undocked/inner_map.c" r2 += IMMEDIATE(-4); - // EBPF_OP_LDDW pc=4 dst=r1 src=r0 offset=0 imm=0 -#line 41 "sample/undocked/inner_map.c" + // EBPF_OP_LDDW pc=5 dst=r1 src=r0 offset=0 imm=0 +#line 60 "sample/undocked/inner_map.c" r1 = POINTER(_maps[0].address); - // EBPF_OP_CALL pc=6 dst=r0 src=r0 offset=0 imm=1 -#line 41 "sample/undocked/inner_map.c" + // EBPF_OP_CALL pc=7 dst=r0 src=r0 offset=0 imm=1 +#line 60 "sample/undocked/inner_map.c" r0 = lookup_update_helpers[0].address -#line 41 "sample/undocked/inner_map.c" +#line 60 "sample/undocked/inner_map.c" (r1, r2, r3, r4, r5); -#line 41 "sample/undocked/inner_map.c" +#line 60 "sample/undocked/inner_map.c" if ((lookup_update_helpers[0].tail_call) && (r0 == 0)) -#line 41 "sample/undocked/inner_map.c" +#line 60 "sample/undocked/inner_map.c" return 0; - // EBPF_OP_MOV64_IMM pc=7 dst=r6 src=r0 offset=0 imm=1 -#line 41 "sample/undocked/inner_map.c" - r6 = IMMEDIATE(1); - // EBPF_OP_JEQ_IMM pc=8 dst=r0 src=r0 offset=9 imm=0 -#line 42 "sample/undocked/inner_map.c" - if (r0 == IMMEDIATE(0)) -#line 42 "sample/undocked/inner_map.c" - goto label_1; - // EBPF_OP_STXW pc=9 dst=r10 src=r7 offset=-8 imm=0 -#line 43 "sample/undocked/inner_map.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint32_t)r7; - // EBPF_OP_MOV64_REG pc=10 dst=r2 src=r10 offset=0 imm=0 -#line 43 "sample/undocked/inner_map.c" + // EBPF_OP_MOV64_REG pc=8 dst=r6 src=r0 offset=0 imm=0 +#line 60 "sample/undocked/inner_map.c" + r6 = r0; + // EBPF_OP_JEQ_IMM pc=9 dst=r6 src=r0 offset=11 imm=0 +#line 61 "sample/undocked/inner_map.c" + if (r6 == IMMEDIATE(0)) +#line 61 "sample/undocked/inner_map.c" + goto label_3; + // EBPF_OP_STXW pc=10 dst=r10 src=r7 offset=-12 imm=0 +#line 62 "sample/undocked/inner_map.c" + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-12)) = (uint32_t)r7; + // EBPF_OP_MOV64_REG pc=11 dst=r2 src=r10 offset=0 imm=0 +#line 62 "sample/undocked/inner_map.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=11 dst=r2 src=r0 offset=0 imm=-8 -#line 43 "sample/undocked/inner_map.c" - r2 += IMMEDIATE(-8); - // EBPF_OP_MOV64_REG pc=12 dst=r1 src=r0 offset=0 imm=0 -#line 44 "sample/undocked/inner_map.c" - r1 = r0; - // EBPF_OP_CALL pc=13 dst=r0 src=r0 offset=0 imm=1 -#line 44 "sample/undocked/inner_map.c" + // EBPF_OP_ADD64_IMM pc=12 dst=r2 src=r0 offset=0 imm=-12 +#line 62 "sample/undocked/inner_map.c" + r2 += IMMEDIATE(-12); + // EBPF_OP_MOV64_REG pc=13 dst=r1 src=r6 offset=0 imm=0 +#line 63 "sample/undocked/inner_map.c" + r1 = r6; + // EBPF_OP_CALL pc=14 dst=r0 src=r0 offset=0 imm=1 +#line 63 "sample/undocked/inner_map.c" r0 = lookup_update_helpers[0].address -#line 44 "sample/undocked/inner_map.c" +#line 63 "sample/undocked/inner_map.c" (r1, r2, r3, r4, r5); -#line 44 "sample/undocked/inner_map.c" +#line 63 "sample/undocked/inner_map.c" if ((lookup_update_helpers[0].tail_call) && (r0 == 0)) -#line 44 "sample/undocked/inner_map.c" +#line 63 "sample/undocked/inner_map.c" return 0; - // EBPF_OP_JEQ_IMM pc=14 dst=r0 src=r0 offset=3 imm=0 -#line 45 "sample/undocked/inner_map.c" + // EBPF_OP_JEQ_IMM pc=15 dst=r0 src=r0 offset=5 imm=0 +#line 64 "sample/undocked/inner_map.c" if (r0 == IMMEDIATE(0)) -#line 45 "sample/undocked/inner_map.c" - goto label_1; - // EBPF_OP_MOV64_IMM pc=15 dst=r1 src=r0 offset=0 imm=1 -#line 45 "sample/undocked/inner_map.c" +#line 64 "sample/undocked/inner_map.c" + goto label_3; +label_1: + // EBPF_OP_MOV64_IMM pc=16 dst=r1 src=r0 offset=0 imm=1 +#line 64 "sample/undocked/inner_map.c" r1 = IMMEDIATE(1); - // EBPF_OP_STXW pc=16 dst=r0 src=r1 offset=0 imm=0 -#line 47 "sample/undocked/inner_map.c" + // EBPF_OP_STXW pc=17 dst=r0 src=r1 offset=0 imm=0 +#line 64 "sample/undocked/inner_map.c" *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint32_t)r1; - // EBPF_OP_MOV64_IMM pc=17 dst=r6 src=r0 offset=0 imm=0 -#line 47 "sample/undocked/inner_map.c" - r6 = IMMEDIATE(0); -label_1: - // EBPF_OP_MOV64_REG pc=18 dst=r0 src=r6 offset=0 imm=0 -#line 52 "sample/undocked/inner_map.c" - r0 = r6; - // EBPF_OP_EXIT pc=19 dst=r0 src=r0 offset=0 imm=0 -#line 52 "sample/undocked/inner_map.c" + // EBPF_OP_MOV64_IMM pc=18 dst=r7 src=r0 offset=0 imm=0 +#line 64 "sample/undocked/inner_map.c" + r7 = IMMEDIATE(0); +label_2: + // EBPF_OP_MOV64_REG pc=19 dst=r0 src=r7 offset=0 imm=0 +#line 84 "sample/undocked/inner_map.c" + r0 = r7; + // EBPF_OP_EXIT pc=20 dst=r0 src=r0 offset=0 imm=0 +#line 84 "sample/undocked/inner_map.c" return r0; -#line 52 "sample/undocked/inner_map.c" +label_3: + // EBPF_OP_MOV64_REG pc=21 dst=r2 src=r10 offset=0 imm=0 +#line 84 "sample/undocked/inner_map.c" + r2 = r10; + // EBPF_OP_ADD64_IMM pc=22 dst=r2 src=r0 offset=0 imm=-6 +#line 84 "sample/undocked/inner_map.c" + r2 += IMMEDIATE(-6); + // EBPF_OP_LDDW pc=23 dst=r1 src=r0 offset=0 imm=0 +#line 72 "sample/undocked/inner_map.c" + r1 = POINTER(_maps[1].address); + // EBPF_OP_CALL pc=25 dst=r0 src=r0 offset=0 imm=1 +#line 72 "sample/undocked/inner_map.c" + r0 = lookup_update_helpers[0].address +#line 72 "sample/undocked/inner_map.c" + (r1, r2, r3, r4, r5); +#line 72 "sample/undocked/inner_map.c" + if ((lookup_update_helpers[0].tail_call) && (r0 == 0)) +#line 72 "sample/undocked/inner_map.c" + return 0; + // EBPF_OP_MOV64_IMM pc=26 dst=r7 src=r0 offset=0 imm=1 +#line 72 "sample/undocked/inner_map.c" + r7 = IMMEDIATE(1); + // EBPF_OP_JEQ_IMM pc=27 dst=r0 src=r0 offset=-9 imm=0 +#line 73 "sample/undocked/inner_map.c" + if (r0 == IMMEDIATE(0)) +#line 73 "sample/undocked/inner_map.c" + goto label_2; + // EBPF_OP_MOV64_IMM pc=28 dst=r1 src=r0 offset=0 imm=0 +#line 73 "sample/undocked/inner_map.c" + r1 = IMMEDIATE(0); + // EBPF_OP_STXW pc=29 dst=r10 src=r1 offset=-16 imm=0 +#line 74 "sample/undocked/inner_map.c" + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint32_t)r1; + // EBPF_OP_MOV64_REG pc=30 dst=r2 src=r10 offset=0 imm=0 +#line 74 "sample/undocked/inner_map.c" + r2 = r10; + // EBPF_OP_ADD64_IMM pc=31 dst=r2 src=r0 offset=0 imm=-16 +#line 74 "sample/undocked/inner_map.c" + r2 += IMMEDIATE(-16); + // EBPF_OP_MOV64_REG pc=32 dst=r1 src=r6 offset=0 imm=0 +#line 75 "sample/undocked/inner_map.c" + r1 = r6; + // EBPF_OP_CALL pc=33 dst=r0 src=r0 offset=0 imm=1 +#line 75 "sample/undocked/inner_map.c" + r0 = lookup_update_helpers[0].address +#line 75 "sample/undocked/inner_map.c" + (r1, r2, r3, r4, r5); +#line 75 "sample/undocked/inner_map.c" + if ((lookup_update_helpers[0].tail_call) && (r0 == 0)) +#line 75 "sample/undocked/inner_map.c" + return 0; + // EBPF_OP_JEQ_IMM pc=34 dst=r0 src=r0 offset=-16 imm=0 +#line 76 "sample/undocked/inner_map.c" + if (r0 == IMMEDIATE(0)) +#line 76 "sample/undocked/inner_map.c" + goto label_2; + // EBPF_OP_JA pc=35 dst=r0 src=r0 offset=-20 imm=0 +#line 76 "sample/undocked/inner_map.c" + goto label_1; +#line 76 "sample/undocked/inner_map.c" } #pragma code_seg(pop) #line __LINE__ __FILE__ @@ -207,10 +295,10 @@ static program_entry_t _programs[] = { "sample_ext", "lookup_update", lookup_update_maps, - 1, + 2, lookup_update_helpers, 1, - 20, + 36, &lookup_update_program_type_guid, &lookup_update_attach_type_guid, }, @@ -229,7 +317,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/inner_map_raw.c b/tests/bpf2c_tests/expected/inner_map_raw.c index 9d9b9a42e3..5308716762 100644 --- a/tests/bpf2c_tests/expected/inner_map_raw.c +++ b/tests/bpf2c_tests/expected/inner_map_raw.c @@ -26,6 +26,30 @@ static map_entry_t _maps[] = { 11, // The id of the inner map template. }, "outer_map"}, + {NULL, + { + BPF_MAP_TYPE_HASH_OF_MAPS, // Type of map. + 2, // Size in bytes of a map key. + 4, // Size in bytes of a map value. + 1, // Maximum number of entries allowed in the map. + 0, // Inner map index. + LIBBPF_PIN_NONE, // Pinning type for the map. + 25, // Identifier for a map template. + 21, // The id of the inner map template. + }, + "outer_map2"}, + {NULL, + { + BPF_MAP_TYPE_ARRAY, // Type of map. + 4, // Size in bytes of a map key. + 4, // Size in bytes of a map value. + 1024, // Maximum number of entries allowed in the map. + 0, // Inner map index. + LIBBPF_PIN_NONE, // Pinning type for the map. + 21, // Identifier for a map template. + 0, // The id of the inner map template. + }, + "inner_map"}, {NULL, { BPF_MAP_TYPE_ARRAY, // Type of map. @@ -45,7 +69,7 @@ static void _get_maps(_Outptr_result_buffer_maybenull_(*count) map_entry_t** maps, _Out_ size_t* count) { *maps = _maps; - *count = 2; + *count = 4; } static helper_function_entry_t lookup_update_helpers[] = { @@ -58,116 +82,180 @@ static GUID lookup_update_attach_type_guid = { 0xf788ef4b, 0x207d, 0x4dc3, {0x85, 0xcf, 0x0f, 0x2e, 0xa1, 0x07, 0x21, 0x3c}}; static uint16_t lookup_update_maps[] = { 0, + 1, }; #pragma code_seg(push, "sample~1") static uint64_t lookup_update(void* context) -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" { -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" // Prologue -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" uint64_t stack[(UBPF_STACK_SIZE + 7) / 8]; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r0 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r1 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r2 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r3 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r4 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r5 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r6 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r7 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r10 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" r1 = (uintptr_t)context; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" r10 = (uintptr_t)((uint8_t*)stack + sizeof(stack)); // EBPF_OP_MOV64_IMM pc=0 dst=r7 src=r0 offset=0 imm=0 -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" r7 = IMMEDIATE(0); // EBPF_OP_STXW pc=1 dst=r10 src=r7 offset=-4 imm=0 -#line 38 "sample/undocked/inner_map.c" +#line 54 "sample/undocked/inner_map.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-4)) = (uint32_t)r7; - // EBPF_OP_MOV64_REG pc=2 dst=r2 src=r10 offset=0 imm=0 -#line 38 "sample/undocked/inner_map.c" + // EBPF_OP_STXH pc=2 dst=r10 src=r7 offset=-6 imm=0 +#line 55 "sample/undocked/inner_map.c" + *(uint16_t*)(uintptr_t)(r10 + OFFSET(-6)) = (uint16_t)r7; + // EBPF_OP_MOV64_REG pc=3 dst=r2 src=r10 offset=0 imm=0 +#line 55 "sample/undocked/inner_map.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=3 dst=r2 src=r0 offset=0 imm=-4 -#line 38 "sample/undocked/inner_map.c" + // EBPF_OP_ADD64_IMM pc=4 dst=r2 src=r0 offset=0 imm=-4 +#line 55 "sample/undocked/inner_map.c" r2 += IMMEDIATE(-4); - // EBPF_OP_LDDW pc=4 dst=r1 src=r0 offset=0 imm=0 -#line 41 "sample/undocked/inner_map.c" + // EBPF_OP_LDDW pc=5 dst=r1 src=r0 offset=0 imm=0 +#line 60 "sample/undocked/inner_map.c" r1 = POINTER(_maps[0].address); - // EBPF_OP_CALL pc=6 dst=r0 src=r0 offset=0 imm=1 -#line 41 "sample/undocked/inner_map.c" + // EBPF_OP_CALL pc=7 dst=r0 src=r0 offset=0 imm=1 +#line 60 "sample/undocked/inner_map.c" r0 = lookup_update_helpers[0].address -#line 41 "sample/undocked/inner_map.c" +#line 60 "sample/undocked/inner_map.c" (r1, r2, r3, r4, r5); -#line 41 "sample/undocked/inner_map.c" +#line 60 "sample/undocked/inner_map.c" if ((lookup_update_helpers[0].tail_call) && (r0 == 0)) -#line 41 "sample/undocked/inner_map.c" +#line 60 "sample/undocked/inner_map.c" return 0; - // EBPF_OP_MOV64_IMM pc=7 dst=r6 src=r0 offset=0 imm=1 -#line 41 "sample/undocked/inner_map.c" - r6 = IMMEDIATE(1); - // EBPF_OP_JEQ_IMM pc=8 dst=r0 src=r0 offset=9 imm=0 -#line 42 "sample/undocked/inner_map.c" - if (r0 == IMMEDIATE(0)) -#line 42 "sample/undocked/inner_map.c" - goto label_1; - // EBPF_OP_STXW pc=9 dst=r10 src=r7 offset=-8 imm=0 -#line 43 "sample/undocked/inner_map.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint32_t)r7; - // EBPF_OP_MOV64_REG pc=10 dst=r2 src=r10 offset=0 imm=0 -#line 43 "sample/undocked/inner_map.c" + // EBPF_OP_MOV64_REG pc=8 dst=r6 src=r0 offset=0 imm=0 +#line 60 "sample/undocked/inner_map.c" + r6 = r0; + // EBPF_OP_JEQ_IMM pc=9 dst=r6 src=r0 offset=11 imm=0 +#line 61 "sample/undocked/inner_map.c" + if (r6 == IMMEDIATE(0)) +#line 61 "sample/undocked/inner_map.c" + goto label_3; + // EBPF_OP_STXW pc=10 dst=r10 src=r7 offset=-12 imm=0 +#line 62 "sample/undocked/inner_map.c" + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-12)) = (uint32_t)r7; + // EBPF_OP_MOV64_REG pc=11 dst=r2 src=r10 offset=0 imm=0 +#line 62 "sample/undocked/inner_map.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=11 dst=r2 src=r0 offset=0 imm=-8 -#line 43 "sample/undocked/inner_map.c" - r2 += IMMEDIATE(-8); - // EBPF_OP_MOV64_REG pc=12 dst=r1 src=r0 offset=0 imm=0 -#line 44 "sample/undocked/inner_map.c" - r1 = r0; - // EBPF_OP_CALL pc=13 dst=r0 src=r0 offset=0 imm=1 -#line 44 "sample/undocked/inner_map.c" + // EBPF_OP_ADD64_IMM pc=12 dst=r2 src=r0 offset=0 imm=-12 +#line 62 "sample/undocked/inner_map.c" + r2 += IMMEDIATE(-12); + // EBPF_OP_MOV64_REG pc=13 dst=r1 src=r6 offset=0 imm=0 +#line 63 "sample/undocked/inner_map.c" + r1 = r6; + // EBPF_OP_CALL pc=14 dst=r0 src=r0 offset=0 imm=1 +#line 63 "sample/undocked/inner_map.c" r0 = lookup_update_helpers[0].address -#line 44 "sample/undocked/inner_map.c" +#line 63 "sample/undocked/inner_map.c" (r1, r2, r3, r4, r5); -#line 44 "sample/undocked/inner_map.c" +#line 63 "sample/undocked/inner_map.c" if ((lookup_update_helpers[0].tail_call) && (r0 == 0)) -#line 44 "sample/undocked/inner_map.c" +#line 63 "sample/undocked/inner_map.c" return 0; - // EBPF_OP_JEQ_IMM pc=14 dst=r0 src=r0 offset=3 imm=0 -#line 45 "sample/undocked/inner_map.c" + // EBPF_OP_JEQ_IMM pc=15 dst=r0 src=r0 offset=5 imm=0 +#line 64 "sample/undocked/inner_map.c" if (r0 == IMMEDIATE(0)) -#line 45 "sample/undocked/inner_map.c" - goto label_1; - // EBPF_OP_MOV64_IMM pc=15 dst=r1 src=r0 offset=0 imm=1 -#line 45 "sample/undocked/inner_map.c" +#line 64 "sample/undocked/inner_map.c" + goto label_3; +label_1: + // EBPF_OP_MOV64_IMM pc=16 dst=r1 src=r0 offset=0 imm=1 +#line 64 "sample/undocked/inner_map.c" r1 = IMMEDIATE(1); - // EBPF_OP_STXW pc=16 dst=r0 src=r1 offset=0 imm=0 -#line 47 "sample/undocked/inner_map.c" + // EBPF_OP_STXW pc=17 dst=r0 src=r1 offset=0 imm=0 +#line 64 "sample/undocked/inner_map.c" *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint32_t)r1; - // EBPF_OP_MOV64_IMM pc=17 dst=r6 src=r0 offset=0 imm=0 -#line 47 "sample/undocked/inner_map.c" - r6 = IMMEDIATE(0); -label_1: - // EBPF_OP_MOV64_REG pc=18 dst=r0 src=r6 offset=0 imm=0 -#line 52 "sample/undocked/inner_map.c" - r0 = r6; - // EBPF_OP_EXIT pc=19 dst=r0 src=r0 offset=0 imm=0 -#line 52 "sample/undocked/inner_map.c" + // EBPF_OP_MOV64_IMM pc=18 dst=r7 src=r0 offset=0 imm=0 +#line 64 "sample/undocked/inner_map.c" + r7 = IMMEDIATE(0); +label_2: + // EBPF_OP_MOV64_REG pc=19 dst=r0 src=r7 offset=0 imm=0 +#line 84 "sample/undocked/inner_map.c" + r0 = r7; + // EBPF_OP_EXIT pc=20 dst=r0 src=r0 offset=0 imm=0 +#line 84 "sample/undocked/inner_map.c" return r0; -#line 52 "sample/undocked/inner_map.c" +label_3: + // EBPF_OP_MOV64_REG pc=21 dst=r2 src=r10 offset=0 imm=0 +#line 84 "sample/undocked/inner_map.c" + r2 = r10; + // EBPF_OP_ADD64_IMM pc=22 dst=r2 src=r0 offset=0 imm=-6 +#line 84 "sample/undocked/inner_map.c" + r2 += IMMEDIATE(-6); + // EBPF_OP_LDDW pc=23 dst=r1 src=r0 offset=0 imm=0 +#line 72 "sample/undocked/inner_map.c" + r1 = POINTER(_maps[1].address); + // EBPF_OP_CALL pc=25 dst=r0 src=r0 offset=0 imm=1 +#line 72 "sample/undocked/inner_map.c" + r0 = lookup_update_helpers[0].address +#line 72 "sample/undocked/inner_map.c" + (r1, r2, r3, r4, r5); +#line 72 "sample/undocked/inner_map.c" + if ((lookup_update_helpers[0].tail_call) && (r0 == 0)) +#line 72 "sample/undocked/inner_map.c" + return 0; + // EBPF_OP_MOV64_IMM pc=26 dst=r7 src=r0 offset=0 imm=1 +#line 72 "sample/undocked/inner_map.c" + r7 = IMMEDIATE(1); + // EBPF_OP_JEQ_IMM pc=27 dst=r0 src=r0 offset=-9 imm=0 +#line 73 "sample/undocked/inner_map.c" + if (r0 == IMMEDIATE(0)) +#line 73 "sample/undocked/inner_map.c" + goto label_2; + // EBPF_OP_MOV64_IMM pc=28 dst=r1 src=r0 offset=0 imm=0 +#line 73 "sample/undocked/inner_map.c" + r1 = IMMEDIATE(0); + // EBPF_OP_STXW pc=29 dst=r10 src=r1 offset=-16 imm=0 +#line 74 "sample/undocked/inner_map.c" + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint32_t)r1; + // EBPF_OP_MOV64_REG pc=30 dst=r2 src=r10 offset=0 imm=0 +#line 74 "sample/undocked/inner_map.c" + r2 = r10; + // EBPF_OP_ADD64_IMM pc=31 dst=r2 src=r0 offset=0 imm=-16 +#line 74 "sample/undocked/inner_map.c" + r2 += IMMEDIATE(-16); + // EBPF_OP_MOV64_REG pc=32 dst=r1 src=r6 offset=0 imm=0 +#line 75 "sample/undocked/inner_map.c" + r1 = r6; + // EBPF_OP_CALL pc=33 dst=r0 src=r0 offset=0 imm=1 +#line 75 "sample/undocked/inner_map.c" + r0 = lookup_update_helpers[0].address +#line 75 "sample/undocked/inner_map.c" + (r1, r2, r3, r4, r5); +#line 75 "sample/undocked/inner_map.c" + if ((lookup_update_helpers[0].tail_call) && (r0 == 0)) +#line 75 "sample/undocked/inner_map.c" + return 0; + // EBPF_OP_JEQ_IMM pc=34 dst=r0 src=r0 offset=-16 imm=0 +#line 76 "sample/undocked/inner_map.c" + if (r0 == IMMEDIATE(0)) +#line 76 "sample/undocked/inner_map.c" + goto label_2; + // EBPF_OP_JA pc=35 dst=r0 src=r0 offset=-20 imm=0 +#line 76 "sample/undocked/inner_map.c" + goto label_1; +#line 76 "sample/undocked/inner_map.c" } #pragma code_seg(pop) #line __LINE__ __FILE__ @@ -181,10 +269,10 @@ static program_entry_t _programs[] = { "sample_ext", "lookup_update", lookup_update_maps, - 1, + 2, lookup_update_helpers, 1, - 20, + 36, &lookup_update_program_type_guid, &lookup_update_attach_type_guid, }, @@ -203,7 +291,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/inner_map_sys.c b/tests/bpf2c_tests/expected/inner_map_sys.c index 352197392f..0ddd30d29d 100644 --- a/tests/bpf2c_tests/expected/inner_map_sys.c +++ b/tests/bpf2c_tests/expected/inner_map_sys.c @@ -187,6 +187,30 @@ static map_entry_t _maps[] = { 11, // The id of the inner map template. }, "outer_map"}, + {NULL, + { + BPF_MAP_TYPE_HASH_OF_MAPS, // Type of map. + 2, // Size in bytes of a map key. + 4, // Size in bytes of a map value. + 1, // Maximum number of entries allowed in the map. + 0, // Inner map index. + LIBBPF_PIN_NONE, // Pinning type for the map. + 25, // Identifier for a map template. + 21, // The id of the inner map template. + }, + "outer_map2"}, + {NULL, + { + BPF_MAP_TYPE_ARRAY, // Type of map. + 4, // Size in bytes of a map key. + 4, // Size in bytes of a map value. + 1024, // Maximum number of entries allowed in the map. + 0, // Inner map index. + LIBBPF_PIN_NONE, // Pinning type for the map. + 21, // Identifier for a map template. + 0, // The id of the inner map template. + }, + "inner_map"}, {NULL, { BPF_MAP_TYPE_ARRAY, // Type of map. @@ -206,7 +230,7 @@ static void _get_maps(_Outptr_result_buffer_maybenull_(*count) map_entry_t** maps, _Out_ size_t* count) { *maps = _maps; - *count = 2; + *count = 4; } static helper_function_entry_t lookup_update_helpers[] = { @@ -219,116 +243,180 @@ static GUID lookup_update_attach_type_guid = { 0xf788ef4b, 0x207d, 0x4dc3, {0x85, 0xcf, 0x0f, 0x2e, 0xa1, 0x07, 0x21, 0x3c}}; static uint16_t lookup_update_maps[] = { 0, + 1, }; #pragma code_seg(push, "sample~1") static uint64_t lookup_update(void* context) -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" { -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" // Prologue -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" uint64_t stack[(UBPF_STACK_SIZE + 7) / 8]; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r0 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r1 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r2 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r3 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r4 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r5 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r6 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r7 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" register uint64_t r10 = 0; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" r1 = (uintptr_t)context; -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" r10 = (uintptr_t)((uint8_t*)stack + sizeof(stack)); // EBPF_OP_MOV64_IMM pc=0 dst=r7 src=r0 offset=0 imm=0 -#line 36 "sample/undocked/inner_map.c" +#line 52 "sample/undocked/inner_map.c" r7 = IMMEDIATE(0); // EBPF_OP_STXW pc=1 dst=r10 src=r7 offset=-4 imm=0 -#line 38 "sample/undocked/inner_map.c" +#line 54 "sample/undocked/inner_map.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-4)) = (uint32_t)r7; - // EBPF_OP_MOV64_REG pc=2 dst=r2 src=r10 offset=0 imm=0 -#line 38 "sample/undocked/inner_map.c" + // EBPF_OP_STXH pc=2 dst=r10 src=r7 offset=-6 imm=0 +#line 55 "sample/undocked/inner_map.c" + *(uint16_t*)(uintptr_t)(r10 + OFFSET(-6)) = (uint16_t)r7; + // EBPF_OP_MOV64_REG pc=3 dst=r2 src=r10 offset=0 imm=0 +#line 55 "sample/undocked/inner_map.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=3 dst=r2 src=r0 offset=0 imm=-4 -#line 38 "sample/undocked/inner_map.c" + // EBPF_OP_ADD64_IMM pc=4 dst=r2 src=r0 offset=0 imm=-4 +#line 55 "sample/undocked/inner_map.c" r2 += IMMEDIATE(-4); - // EBPF_OP_LDDW pc=4 dst=r1 src=r0 offset=0 imm=0 -#line 41 "sample/undocked/inner_map.c" + // EBPF_OP_LDDW pc=5 dst=r1 src=r0 offset=0 imm=0 +#line 60 "sample/undocked/inner_map.c" r1 = POINTER(_maps[0].address); - // EBPF_OP_CALL pc=6 dst=r0 src=r0 offset=0 imm=1 -#line 41 "sample/undocked/inner_map.c" + // EBPF_OP_CALL pc=7 dst=r0 src=r0 offset=0 imm=1 +#line 60 "sample/undocked/inner_map.c" r0 = lookup_update_helpers[0].address -#line 41 "sample/undocked/inner_map.c" +#line 60 "sample/undocked/inner_map.c" (r1, r2, r3, r4, r5); -#line 41 "sample/undocked/inner_map.c" +#line 60 "sample/undocked/inner_map.c" if ((lookup_update_helpers[0].tail_call) && (r0 == 0)) -#line 41 "sample/undocked/inner_map.c" +#line 60 "sample/undocked/inner_map.c" return 0; - // EBPF_OP_MOV64_IMM pc=7 dst=r6 src=r0 offset=0 imm=1 -#line 41 "sample/undocked/inner_map.c" - r6 = IMMEDIATE(1); - // EBPF_OP_JEQ_IMM pc=8 dst=r0 src=r0 offset=9 imm=0 -#line 42 "sample/undocked/inner_map.c" - if (r0 == IMMEDIATE(0)) -#line 42 "sample/undocked/inner_map.c" - goto label_1; - // EBPF_OP_STXW pc=9 dst=r10 src=r7 offset=-8 imm=0 -#line 43 "sample/undocked/inner_map.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint32_t)r7; - // EBPF_OP_MOV64_REG pc=10 dst=r2 src=r10 offset=0 imm=0 -#line 43 "sample/undocked/inner_map.c" + // EBPF_OP_MOV64_REG pc=8 dst=r6 src=r0 offset=0 imm=0 +#line 60 "sample/undocked/inner_map.c" + r6 = r0; + // EBPF_OP_JEQ_IMM pc=9 dst=r6 src=r0 offset=11 imm=0 +#line 61 "sample/undocked/inner_map.c" + if (r6 == IMMEDIATE(0)) +#line 61 "sample/undocked/inner_map.c" + goto label_3; + // EBPF_OP_STXW pc=10 dst=r10 src=r7 offset=-12 imm=0 +#line 62 "sample/undocked/inner_map.c" + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-12)) = (uint32_t)r7; + // EBPF_OP_MOV64_REG pc=11 dst=r2 src=r10 offset=0 imm=0 +#line 62 "sample/undocked/inner_map.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=11 dst=r2 src=r0 offset=0 imm=-8 -#line 43 "sample/undocked/inner_map.c" - r2 += IMMEDIATE(-8); - // EBPF_OP_MOV64_REG pc=12 dst=r1 src=r0 offset=0 imm=0 -#line 44 "sample/undocked/inner_map.c" - r1 = r0; - // EBPF_OP_CALL pc=13 dst=r0 src=r0 offset=0 imm=1 -#line 44 "sample/undocked/inner_map.c" + // EBPF_OP_ADD64_IMM pc=12 dst=r2 src=r0 offset=0 imm=-12 +#line 62 "sample/undocked/inner_map.c" + r2 += IMMEDIATE(-12); + // EBPF_OP_MOV64_REG pc=13 dst=r1 src=r6 offset=0 imm=0 +#line 63 "sample/undocked/inner_map.c" + r1 = r6; + // EBPF_OP_CALL pc=14 dst=r0 src=r0 offset=0 imm=1 +#line 63 "sample/undocked/inner_map.c" r0 = lookup_update_helpers[0].address -#line 44 "sample/undocked/inner_map.c" +#line 63 "sample/undocked/inner_map.c" (r1, r2, r3, r4, r5); -#line 44 "sample/undocked/inner_map.c" +#line 63 "sample/undocked/inner_map.c" if ((lookup_update_helpers[0].tail_call) && (r0 == 0)) -#line 44 "sample/undocked/inner_map.c" +#line 63 "sample/undocked/inner_map.c" return 0; - // EBPF_OP_JEQ_IMM pc=14 dst=r0 src=r0 offset=3 imm=0 -#line 45 "sample/undocked/inner_map.c" + // EBPF_OP_JEQ_IMM pc=15 dst=r0 src=r0 offset=5 imm=0 +#line 64 "sample/undocked/inner_map.c" if (r0 == IMMEDIATE(0)) -#line 45 "sample/undocked/inner_map.c" - goto label_1; - // EBPF_OP_MOV64_IMM pc=15 dst=r1 src=r0 offset=0 imm=1 -#line 45 "sample/undocked/inner_map.c" +#line 64 "sample/undocked/inner_map.c" + goto label_3; +label_1: + // EBPF_OP_MOV64_IMM pc=16 dst=r1 src=r0 offset=0 imm=1 +#line 64 "sample/undocked/inner_map.c" r1 = IMMEDIATE(1); - // EBPF_OP_STXW pc=16 dst=r0 src=r1 offset=0 imm=0 -#line 47 "sample/undocked/inner_map.c" + // EBPF_OP_STXW pc=17 dst=r0 src=r1 offset=0 imm=0 +#line 64 "sample/undocked/inner_map.c" *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint32_t)r1; - // EBPF_OP_MOV64_IMM pc=17 dst=r6 src=r0 offset=0 imm=0 -#line 47 "sample/undocked/inner_map.c" - r6 = IMMEDIATE(0); -label_1: - // EBPF_OP_MOV64_REG pc=18 dst=r0 src=r6 offset=0 imm=0 -#line 52 "sample/undocked/inner_map.c" - r0 = r6; - // EBPF_OP_EXIT pc=19 dst=r0 src=r0 offset=0 imm=0 -#line 52 "sample/undocked/inner_map.c" + // EBPF_OP_MOV64_IMM pc=18 dst=r7 src=r0 offset=0 imm=0 +#line 64 "sample/undocked/inner_map.c" + r7 = IMMEDIATE(0); +label_2: + // EBPF_OP_MOV64_REG pc=19 dst=r0 src=r7 offset=0 imm=0 +#line 84 "sample/undocked/inner_map.c" + r0 = r7; + // EBPF_OP_EXIT pc=20 dst=r0 src=r0 offset=0 imm=0 +#line 84 "sample/undocked/inner_map.c" return r0; -#line 52 "sample/undocked/inner_map.c" +label_3: + // EBPF_OP_MOV64_REG pc=21 dst=r2 src=r10 offset=0 imm=0 +#line 84 "sample/undocked/inner_map.c" + r2 = r10; + // EBPF_OP_ADD64_IMM pc=22 dst=r2 src=r0 offset=0 imm=-6 +#line 84 "sample/undocked/inner_map.c" + r2 += IMMEDIATE(-6); + // EBPF_OP_LDDW pc=23 dst=r1 src=r0 offset=0 imm=0 +#line 72 "sample/undocked/inner_map.c" + r1 = POINTER(_maps[1].address); + // EBPF_OP_CALL pc=25 dst=r0 src=r0 offset=0 imm=1 +#line 72 "sample/undocked/inner_map.c" + r0 = lookup_update_helpers[0].address +#line 72 "sample/undocked/inner_map.c" + (r1, r2, r3, r4, r5); +#line 72 "sample/undocked/inner_map.c" + if ((lookup_update_helpers[0].tail_call) && (r0 == 0)) +#line 72 "sample/undocked/inner_map.c" + return 0; + // EBPF_OP_MOV64_IMM pc=26 dst=r7 src=r0 offset=0 imm=1 +#line 72 "sample/undocked/inner_map.c" + r7 = IMMEDIATE(1); + // EBPF_OP_JEQ_IMM pc=27 dst=r0 src=r0 offset=-9 imm=0 +#line 73 "sample/undocked/inner_map.c" + if (r0 == IMMEDIATE(0)) +#line 73 "sample/undocked/inner_map.c" + goto label_2; + // EBPF_OP_MOV64_IMM pc=28 dst=r1 src=r0 offset=0 imm=0 +#line 73 "sample/undocked/inner_map.c" + r1 = IMMEDIATE(0); + // EBPF_OP_STXW pc=29 dst=r10 src=r1 offset=-16 imm=0 +#line 74 "sample/undocked/inner_map.c" + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint32_t)r1; + // EBPF_OP_MOV64_REG pc=30 dst=r2 src=r10 offset=0 imm=0 +#line 74 "sample/undocked/inner_map.c" + r2 = r10; + // EBPF_OP_ADD64_IMM pc=31 dst=r2 src=r0 offset=0 imm=-16 +#line 74 "sample/undocked/inner_map.c" + r2 += IMMEDIATE(-16); + // EBPF_OP_MOV64_REG pc=32 dst=r1 src=r6 offset=0 imm=0 +#line 75 "sample/undocked/inner_map.c" + r1 = r6; + // EBPF_OP_CALL pc=33 dst=r0 src=r0 offset=0 imm=1 +#line 75 "sample/undocked/inner_map.c" + r0 = lookup_update_helpers[0].address +#line 75 "sample/undocked/inner_map.c" + (r1, r2, r3, r4, r5); +#line 75 "sample/undocked/inner_map.c" + if ((lookup_update_helpers[0].tail_call) && (r0 == 0)) +#line 75 "sample/undocked/inner_map.c" + return 0; + // EBPF_OP_JEQ_IMM pc=34 dst=r0 src=r0 offset=-16 imm=0 +#line 76 "sample/undocked/inner_map.c" + if (r0 == IMMEDIATE(0)) +#line 76 "sample/undocked/inner_map.c" + goto label_2; + // EBPF_OP_JA pc=35 dst=r0 src=r0 offset=-20 imm=0 +#line 76 "sample/undocked/inner_map.c" + goto label_1; +#line 76 "sample/undocked/inner_map.c" } #pragma code_seg(pop) #line __LINE__ __FILE__ @@ -342,10 +430,10 @@ static program_entry_t _programs[] = { "sample_ext", "lookup_update", lookup_update_maps, - 1, + 2, lookup_update_helpers, 1, - 20, + 36, &lookup_update_program_type_guid, &lookup_update_attach_type_guid, }, @@ -364,7 +452,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/invalid_helpers_dll.c b/tests/bpf2c_tests/expected/invalid_helpers_dll.c index e129f3b209..de034e87ac 100644 --- a/tests/bpf2c_tests/expected/invalid_helpers_dll.c +++ b/tests/bpf2c_tests/expected/invalid_helpers_dll.c @@ -826,7 +826,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/invalid_helpers_raw.c b/tests/bpf2c_tests/expected/invalid_helpers_raw.c index 4e22d6372b..19c3fad12e 100644 --- a/tests/bpf2c_tests/expected/invalid_helpers_raw.c +++ b/tests/bpf2c_tests/expected/invalid_helpers_raw.c @@ -800,7 +800,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/invalid_helpers_sys.c b/tests/bpf2c_tests/expected/invalid_helpers_sys.c index 82a9dd5fbc..90d3d7d784 100644 --- a/tests/bpf2c_tests/expected/invalid_helpers_sys.c +++ b/tests/bpf2c_tests/expected/invalid_helpers_sys.c @@ -961,7 +961,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/invalid_maps1_dll.c b/tests/bpf2c_tests/expected/invalid_maps1_dll.c index aed7c33eb3..fd89b12505 100644 --- a/tests/bpf2c_tests/expected/invalid_maps1_dll.c +++ b/tests/bpf2c_tests/expected/invalid_maps1_dll.c @@ -810,7 +810,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/invalid_maps1_raw.c b/tests/bpf2c_tests/expected/invalid_maps1_raw.c index 422fe042f4..fbce7169a7 100644 --- a/tests/bpf2c_tests/expected/invalid_maps1_raw.c +++ b/tests/bpf2c_tests/expected/invalid_maps1_raw.c @@ -784,7 +784,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/invalid_maps1_sys.c b/tests/bpf2c_tests/expected/invalid_maps1_sys.c index c7f43860a1..1e7fdc3656 100644 --- a/tests/bpf2c_tests/expected/invalid_maps1_sys.c +++ b/tests/bpf2c_tests/expected/invalid_maps1_sys.c @@ -945,7 +945,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/invalid_maps2_dll.c b/tests/bpf2c_tests/expected/invalid_maps2_dll.c index 7bf9e2cd0d..e1602c4224 100644 --- a/tests/bpf2c_tests/expected/invalid_maps2_dll.c +++ b/tests/bpf2c_tests/expected/invalid_maps2_dll.c @@ -822,7 +822,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/invalid_maps2_raw.c b/tests/bpf2c_tests/expected/invalid_maps2_raw.c index 5114db88d6..9768072d0f 100644 --- a/tests/bpf2c_tests/expected/invalid_maps2_raw.c +++ b/tests/bpf2c_tests/expected/invalid_maps2_raw.c @@ -796,7 +796,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/invalid_maps2_sys.c b/tests/bpf2c_tests/expected/invalid_maps2_sys.c index e99a4b07e8..6c9015bc49 100644 --- a/tests/bpf2c_tests/expected/invalid_maps2_sys.c +++ b/tests/bpf2c_tests/expected/invalid_maps2_sys.c @@ -957,7 +957,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/invalid_maps3_dll.c b/tests/bpf2c_tests/expected/invalid_maps3_dll.c index 0209e81b79..8c80444da8 100644 --- a/tests/bpf2c_tests/expected/invalid_maps3_dll.c +++ b/tests/bpf2c_tests/expected/invalid_maps3_dll.c @@ -129,7 +129,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/invalid_maps3_raw.c b/tests/bpf2c_tests/expected/invalid_maps3_raw.c index b2ee554078..f6e975ed0a 100644 --- a/tests/bpf2c_tests/expected/invalid_maps3_raw.c +++ b/tests/bpf2c_tests/expected/invalid_maps3_raw.c @@ -103,7 +103,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/invalid_maps3_sys.c b/tests/bpf2c_tests/expected/invalid_maps3_sys.c index c576602c5f..6759dec9e7 100644 --- a/tests/bpf2c_tests/expected/invalid_maps3_sys.c +++ b/tests/bpf2c_tests/expected/invalid_maps3_sys.c @@ -264,7 +264,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/map_dll.c b/tests/bpf2c_tests/expected/map_dll.c index b4f4689bc0..de6ce32db5 100644 --- a/tests/bpf2c_tests/expected/map_dll.c +++ b/tests/bpf2c_tests/expected/map_dll.c @@ -9256,7 +9256,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/map_in_map_btf_dll.c b/tests/bpf2c_tests/expected/map_in_map_btf_dll.c index e2b00fe9cd..e13059da9c 100644 --- a/tests/bpf2c_tests/expected/map_in_map_btf_dll.c +++ b/tests/bpf2c_tests/expected/map_in_map_btf_dll.c @@ -223,7 +223,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } #pragma data_seg(push, "map_initial_values") diff --git a/tests/bpf2c_tests/expected/map_in_map_btf_raw.c b/tests/bpf2c_tests/expected/map_in_map_btf_raw.c index f40d31c24d..7ab9f2e7e5 100644 --- a/tests/bpf2c_tests/expected/map_in_map_btf_raw.c +++ b/tests/bpf2c_tests/expected/map_in_map_btf_raw.c @@ -197,7 +197,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } #pragma data_seg(push, "map_initial_values") diff --git a/tests/bpf2c_tests/expected/map_in_map_btf_sys.c b/tests/bpf2c_tests/expected/map_in_map_btf_sys.c index 3b2c6977a1..b3ac487ed3 100644 --- a/tests/bpf2c_tests/expected/map_in_map_btf_sys.c +++ b/tests/bpf2c_tests/expected/map_in_map_btf_sys.c @@ -358,7 +358,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } #pragma data_seg(push, "map_initial_values") diff --git a/tests/bpf2c_tests/expected/map_in_map_legacy_id_dll.c b/tests/bpf2c_tests/expected/map_in_map_legacy_id_dll.c index 40e94b0f03..82a9e1f5d9 100644 --- a/tests/bpf2c_tests/expected/map_in_map_legacy_id_dll.c +++ b/tests/bpf2c_tests/expected/map_in_map_legacy_id_dll.c @@ -223,7 +223,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/map_in_map_legacy_id_raw.c b/tests/bpf2c_tests/expected/map_in_map_legacy_id_raw.c index 0df19ada5f..1d4a5cfb17 100644 --- a/tests/bpf2c_tests/expected/map_in_map_legacy_id_raw.c +++ b/tests/bpf2c_tests/expected/map_in_map_legacy_id_raw.c @@ -197,7 +197,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/map_in_map_legacy_id_sys.c b/tests/bpf2c_tests/expected/map_in_map_legacy_id_sys.c index 24c91cf621..26155d801c 100644 --- a/tests/bpf2c_tests/expected/map_in_map_legacy_id_sys.c +++ b/tests/bpf2c_tests/expected/map_in_map_legacy_id_sys.c @@ -358,7 +358,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/map_in_map_legacy_idx_dll.c b/tests/bpf2c_tests/expected/map_in_map_legacy_idx_dll.c index 6fe6c567b3..b02733f5e0 100644 --- a/tests/bpf2c_tests/expected/map_in_map_legacy_idx_dll.c +++ b/tests/bpf2c_tests/expected/map_in_map_legacy_idx_dll.c @@ -223,7 +223,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/map_in_map_legacy_idx_raw.c b/tests/bpf2c_tests/expected/map_in_map_legacy_idx_raw.c index ad98e9954f..72eed57084 100644 --- a/tests/bpf2c_tests/expected/map_in_map_legacy_idx_raw.c +++ b/tests/bpf2c_tests/expected/map_in_map_legacy_idx_raw.c @@ -197,7 +197,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/map_in_map_legacy_idx_sys.c b/tests/bpf2c_tests/expected/map_in_map_legacy_idx_sys.c index 7802b3b1b0..cd51d738ed 100644 --- a/tests/bpf2c_tests/expected/map_in_map_legacy_idx_sys.c +++ b/tests/bpf2c_tests/expected/map_in_map_legacy_idx_sys.c @@ -358,7 +358,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/map_raw.c b/tests/bpf2c_tests/expected/map_raw.c index a10f33b40e..b60cedae28 100644 --- a/tests/bpf2c_tests/expected/map_raw.c +++ b/tests/bpf2c_tests/expected/map_raw.c @@ -9230,7 +9230,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/map_reuse_2_dll.c b/tests/bpf2c_tests/expected/map_reuse_2_dll.c index fc0e54e7da..87f0b17466 100644 --- a/tests/bpf2c_tests/expected/map_reuse_2_dll.c +++ b/tests/bpf2c_tests/expected/map_reuse_2_dll.c @@ -280,7 +280,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/map_reuse_2_raw.c b/tests/bpf2c_tests/expected/map_reuse_2_raw.c index d886b575cc..bbc668504a 100644 --- a/tests/bpf2c_tests/expected/map_reuse_2_raw.c +++ b/tests/bpf2c_tests/expected/map_reuse_2_raw.c @@ -254,7 +254,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/map_reuse_2_sys.c b/tests/bpf2c_tests/expected/map_reuse_2_sys.c index a78dddd718..a9192a124a 100644 --- a/tests/bpf2c_tests/expected/map_reuse_2_sys.c +++ b/tests/bpf2c_tests/expected/map_reuse_2_sys.c @@ -415,7 +415,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/map_reuse_dll.c b/tests/bpf2c_tests/expected/map_reuse_dll.c index e44b7a1e52..9cedcebded 100644 --- a/tests/bpf2c_tests/expected/map_reuse_dll.c +++ b/tests/bpf2c_tests/expected/map_reuse_dll.c @@ -280,7 +280,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/map_reuse_raw.c b/tests/bpf2c_tests/expected/map_reuse_raw.c index 9f58ea0b58..1f0a94c6ef 100644 --- a/tests/bpf2c_tests/expected/map_reuse_raw.c +++ b/tests/bpf2c_tests/expected/map_reuse_raw.c @@ -254,7 +254,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/map_reuse_sys.c b/tests/bpf2c_tests/expected/map_reuse_sys.c index 2b9d0e7f98..ce0c54ac7f 100644 --- a/tests/bpf2c_tests/expected/map_reuse_sys.c +++ b/tests/bpf2c_tests/expected/map_reuse_sys.c @@ -415,7 +415,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/map_sys.c b/tests/bpf2c_tests/expected/map_sys.c index d51eb17e79..4907ee1aa1 100644 --- a/tests/bpf2c_tests/expected/map_sys.c +++ b/tests/bpf2c_tests/expected/map_sys.c @@ -9391,7 +9391,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/pidtgid_dll.c b/tests/bpf2c_tests/expected/pidtgid_dll.c index 71092d5042..ceac2003a4 100644 --- a/tests/bpf2c_tests/expected/pidtgid_dll.c +++ b/tests/bpf2c_tests/expected/pidtgid_dll.c @@ -226,7 +226,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/pidtgid_raw.c b/tests/bpf2c_tests/expected/pidtgid_raw.c index 6740763af2..d03de065d2 100644 --- a/tests/bpf2c_tests/expected/pidtgid_raw.c +++ b/tests/bpf2c_tests/expected/pidtgid_raw.c @@ -200,7 +200,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/pidtgid_sys.c b/tests/bpf2c_tests/expected/pidtgid_sys.c index d4e8dd7458..7d39e10c74 100644 --- a/tests/bpf2c_tests/expected/pidtgid_sys.c +++ b/tests/bpf2c_tests/expected/pidtgid_sys.c @@ -361,7 +361,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/printk_dll.c b/tests/bpf2c_tests/expected/printk_dll.c index 017783a41a..298b4db24d 100644 --- a/tests/bpf2c_tests/expected/printk_dll.c +++ b/tests/bpf2c_tests/expected/printk_dll.c @@ -686,7 +686,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/printk_legacy_dll.c b/tests/bpf2c_tests/expected/printk_legacy_dll.c index 7b36334a82..d4498cbb76 100644 --- a/tests/bpf2c_tests/expected/printk_legacy_dll.c +++ b/tests/bpf2c_tests/expected/printk_legacy_dll.c @@ -571,7 +571,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/printk_legacy_raw.c b/tests/bpf2c_tests/expected/printk_legacy_raw.c index 613c5997d7..adda173e09 100644 --- a/tests/bpf2c_tests/expected/printk_legacy_raw.c +++ b/tests/bpf2c_tests/expected/printk_legacy_raw.c @@ -545,7 +545,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/printk_legacy_sys.c b/tests/bpf2c_tests/expected/printk_legacy_sys.c index bbb528afb1..f161756e22 100644 --- a/tests/bpf2c_tests/expected/printk_legacy_sys.c +++ b/tests/bpf2c_tests/expected/printk_legacy_sys.c @@ -706,7 +706,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/printk_raw.c b/tests/bpf2c_tests/expected/printk_raw.c index 11acbb55f5..eff313fd77 100644 --- a/tests/bpf2c_tests/expected/printk_raw.c +++ b/tests/bpf2c_tests/expected/printk_raw.c @@ -660,7 +660,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/printk_sys.c b/tests/bpf2c_tests/expected/printk_sys.c index 7c91d8c4d0..61e1d58ac2 100644 --- a/tests/bpf2c_tests/expected/printk_sys.c +++ b/tests/bpf2c_tests/expected/printk_sys.c @@ -821,7 +821,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/printk_unsafe_dll.c b/tests/bpf2c_tests/expected/printk_unsafe_dll.c index cd3167bc01..b543fd82df 100644 --- a/tests/bpf2c_tests/expected/printk_unsafe_dll.c +++ b/tests/bpf2c_tests/expected/printk_unsafe_dll.c @@ -149,7 +149,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/printk_unsafe_raw.c b/tests/bpf2c_tests/expected/printk_unsafe_raw.c index 419c8169e4..88be528923 100644 --- a/tests/bpf2c_tests/expected/printk_unsafe_raw.c +++ b/tests/bpf2c_tests/expected/printk_unsafe_raw.c @@ -123,7 +123,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/printk_unsafe_sys.c b/tests/bpf2c_tests/expected/printk_unsafe_sys.c index 4ed708bba3..5eca413024 100644 --- a/tests/bpf2c_tests/expected/printk_unsafe_sys.c +++ b/tests/bpf2c_tests/expected/printk_unsafe_sys.c @@ -284,7 +284,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/reflect_packet_dll.c b/tests/bpf2c_tests/expected/reflect_packet_dll.c index 55a54c78b2..2110d8e46f 100644 --- a/tests/bpf2c_tests/expected/reflect_packet_dll.c +++ b/tests/bpf2c_tests/expected/reflect_packet_dll.c @@ -793,7 +793,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/reflect_packet_raw.c b/tests/bpf2c_tests/expected/reflect_packet_raw.c index 2cc774461c..1f9ca109cf 100644 --- a/tests/bpf2c_tests/expected/reflect_packet_raw.c +++ b/tests/bpf2c_tests/expected/reflect_packet_raw.c @@ -767,7 +767,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/reflect_packet_sys.c b/tests/bpf2c_tests/expected/reflect_packet_sys.c index fe74480b21..6515b6a606 100644 --- a/tests/bpf2c_tests/expected/reflect_packet_sys.c +++ b/tests/bpf2c_tests/expected/reflect_packet_sys.c @@ -928,7 +928,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/sockops_dll.c b/tests/bpf2c_tests/expected/sockops_dll.c index 093cd83880..b8cd05ecc3 100644 --- a/tests/bpf2c_tests/expected/sockops_dll.c +++ b/tests/bpf2c_tests/expected/sockops_dll.c @@ -687,7 +687,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/sockops_raw.c b/tests/bpf2c_tests/expected/sockops_raw.c index 1f398f7f28..ea094c6052 100644 --- a/tests/bpf2c_tests/expected/sockops_raw.c +++ b/tests/bpf2c_tests/expected/sockops_raw.c @@ -661,7 +661,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/sockops_sys.c b/tests/bpf2c_tests/expected/sockops_sys.c index 089648d591..b74c092585 100644 --- a/tests/bpf2c_tests/expected/sockops_sys.c +++ b/tests/bpf2c_tests/expected/sockops_sys.c @@ -822,7 +822,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/tail_call_bad_dll.c b/tests/bpf2c_tests/expected/tail_call_bad_dll.c index fe57c93071..dbe3e243d2 100644 --- a/tests/bpf2c_tests/expected/tail_call_bad_dll.c +++ b/tests/bpf2c_tests/expected/tail_call_bad_dll.c @@ -261,7 +261,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/tail_call_bad_raw.c b/tests/bpf2c_tests/expected/tail_call_bad_raw.c index 56610e7a43..fcd589826a 100644 --- a/tests/bpf2c_tests/expected/tail_call_bad_raw.c +++ b/tests/bpf2c_tests/expected/tail_call_bad_raw.c @@ -235,7 +235,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/tail_call_bad_sys.c b/tests/bpf2c_tests/expected/tail_call_bad_sys.c index 1e27185446..44aa5fdf9c 100644 --- a/tests/bpf2c_tests/expected/tail_call_bad_sys.c +++ b/tests/bpf2c_tests/expected/tail_call_bad_sys.c @@ -396,7 +396,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/tail_call_dll.c b/tests/bpf2c_tests/expected/tail_call_dll.c index 94ab21951e..ceaa44f22d 100644 --- a/tests/bpf2c_tests/expected/tail_call_dll.c +++ b/tests/bpf2c_tests/expected/tail_call_dll.c @@ -256,7 +256,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/tail_call_map_dll.c b/tests/bpf2c_tests/expected/tail_call_map_dll.c index cea4b1d611..a5d5045128 100644 --- a/tests/bpf2c_tests/expected/tail_call_map_dll.c +++ b/tests/bpf2c_tests/expected/tail_call_map_dll.c @@ -251,7 +251,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } #pragma data_seg(push, "map_initial_values") diff --git a/tests/bpf2c_tests/expected/tail_call_map_raw.c b/tests/bpf2c_tests/expected/tail_call_map_raw.c index 78590af580..6a1ba8bb91 100644 --- a/tests/bpf2c_tests/expected/tail_call_map_raw.c +++ b/tests/bpf2c_tests/expected/tail_call_map_raw.c @@ -225,7 +225,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } #pragma data_seg(push, "map_initial_values") diff --git a/tests/bpf2c_tests/expected/tail_call_map_sys.c b/tests/bpf2c_tests/expected/tail_call_map_sys.c index 85f4fd8cf7..68d595501d 100644 --- a/tests/bpf2c_tests/expected/tail_call_map_sys.c +++ b/tests/bpf2c_tests/expected/tail_call_map_sys.c @@ -386,7 +386,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } #pragma data_seg(push, "map_initial_values") diff --git a/tests/bpf2c_tests/expected/tail_call_max_exceed_dll.c b/tests/bpf2c_tests/expected/tail_call_max_exceed_dll.c index 7e8774ba28..ef57d76956 100644 --- a/tests/bpf2c_tests/expected/tail_call_max_exceed_dll.c +++ b/tests/bpf2c_tests/expected/tail_call_max_exceed_dll.c @@ -7641,7 +7641,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } #pragma data_seg(push, "map_initial_values") diff --git a/tests/bpf2c_tests/expected/tail_call_max_exceed_raw.c b/tests/bpf2c_tests/expected/tail_call_max_exceed_raw.c index d3bf117016..68b38d722d 100644 --- a/tests/bpf2c_tests/expected/tail_call_max_exceed_raw.c +++ b/tests/bpf2c_tests/expected/tail_call_max_exceed_raw.c @@ -7615,7 +7615,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } #pragma data_seg(push, "map_initial_values") diff --git a/tests/bpf2c_tests/expected/tail_call_max_exceed_sys.c b/tests/bpf2c_tests/expected/tail_call_max_exceed_sys.c index 45a50cdd63..94ca80b8ad 100644 --- a/tests/bpf2c_tests/expected/tail_call_max_exceed_sys.c +++ b/tests/bpf2c_tests/expected/tail_call_max_exceed_sys.c @@ -7776,7 +7776,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } #pragma data_seg(push, "map_initial_values") diff --git a/tests/bpf2c_tests/expected/tail_call_multiple_dll.c b/tests/bpf2c_tests/expected/tail_call_multiple_dll.c index c795a49b71..4330ee6519 100644 --- a/tests/bpf2c_tests/expected/tail_call_multiple_dll.c +++ b/tests/bpf2c_tests/expected/tail_call_multiple_dll.c @@ -285,7 +285,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/tail_call_multiple_raw.c b/tests/bpf2c_tests/expected/tail_call_multiple_raw.c index 560bc43766..e435a7f2e7 100644 --- a/tests/bpf2c_tests/expected/tail_call_multiple_raw.c +++ b/tests/bpf2c_tests/expected/tail_call_multiple_raw.c @@ -259,7 +259,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/tail_call_multiple_sys.c b/tests/bpf2c_tests/expected/tail_call_multiple_sys.c index 3283db3517..0786ab6af5 100644 --- a/tests/bpf2c_tests/expected/tail_call_multiple_sys.c +++ b/tests/bpf2c_tests/expected/tail_call_multiple_sys.c @@ -420,7 +420,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/tail_call_raw.c b/tests/bpf2c_tests/expected/tail_call_raw.c index 6f69e31c58..9740a20bff 100644 --- a/tests/bpf2c_tests/expected/tail_call_raw.c +++ b/tests/bpf2c_tests/expected/tail_call_raw.c @@ -230,7 +230,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/tail_call_recursive_dll.c b/tests/bpf2c_tests/expected/tail_call_recursive_dll.c index 8cb48324ee..a66145c062 100644 --- a/tests/bpf2c_tests/expected/tail_call_recursive_dll.c +++ b/tests/bpf2c_tests/expected/tail_call_recursive_dll.c @@ -269,7 +269,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } #pragma data_seg(push, "map_initial_values") diff --git a/tests/bpf2c_tests/expected/tail_call_recursive_raw.c b/tests/bpf2c_tests/expected/tail_call_recursive_raw.c index c8556a2d01..c441e26eee 100644 --- a/tests/bpf2c_tests/expected/tail_call_recursive_raw.c +++ b/tests/bpf2c_tests/expected/tail_call_recursive_raw.c @@ -243,7 +243,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } #pragma data_seg(push, "map_initial_values") diff --git a/tests/bpf2c_tests/expected/tail_call_recursive_sys.c b/tests/bpf2c_tests/expected/tail_call_recursive_sys.c index 4eae39ba71..c5a68a80a6 100644 --- a/tests/bpf2c_tests/expected/tail_call_recursive_sys.c +++ b/tests/bpf2c_tests/expected/tail_call_recursive_sys.c @@ -404,7 +404,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } #pragma data_seg(push, "map_initial_values") diff --git a/tests/bpf2c_tests/expected/tail_call_sequential_dll.c b/tests/bpf2c_tests/expected/tail_call_sequential_dll.c index 3db42bd6a4..2466e72eb2 100644 --- a/tests/bpf2c_tests/expected/tail_call_sequential_dll.c +++ b/tests/bpf2c_tests/expected/tail_call_sequential_dll.c @@ -6796,7 +6796,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } #pragma data_seg(push, "map_initial_values") diff --git a/tests/bpf2c_tests/expected/tail_call_sequential_raw.c b/tests/bpf2c_tests/expected/tail_call_sequential_raw.c index 9f364740ef..398b217db2 100644 --- a/tests/bpf2c_tests/expected/tail_call_sequential_raw.c +++ b/tests/bpf2c_tests/expected/tail_call_sequential_raw.c @@ -6770,7 +6770,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } #pragma data_seg(push, "map_initial_values") diff --git a/tests/bpf2c_tests/expected/tail_call_sequential_sys.c b/tests/bpf2c_tests/expected/tail_call_sequential_sys.c index 64de9b2768..f6c836a68a 100644 --- a/tests/bpf2c_tests/expected/tail_call_sequential_sys.c +++ b/tests/bpf2c_tests/expected/tail_call_sequential_sys.c @@ -6931,7 +6931,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } #pragma data_seg(push, "map_initial_values") diff --git a/tests/bpf2c_tests/expected/tail_call_sys.c b/tests/bpf2c_tests/expected/tail_call_sys.c index 0cfc5b6276..5ef682ddf0 100644 --- a/tests/bpf2c_tests/expected/tail_call_sys.c +++ b/tests/bpf2c_tests/expected/tail_call_sys.c @@ -391,7 +391,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/test_sample_ebpf_dll.c b/tests/bpf2c_tests/expected/test_sample_ebpf_dll.c index c02a4ce603..29d7297121 100644 --- a/tests/bpf2c_tests/expected/test_sample_ebpf_dll.c +++ b/tests/bpf2c_tests/expected/test_sample_ebpf_dll.c @@ -301,7 +301,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/test_sample_ebpf_raw.c b/tests/bpf2c_tests/expected/test_sample_ebpf_raw.c index 5e4c377f64..70f6900d38 100644 --- a/tests/bpf2c_tests/expected/test_sample_ebpf_raw.c +++ b/tests/bpf2c_tests/expected/test_sample_ebpf_raw.c @@ -275,7 +275,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/test_sample_ebpf_sys.c b/tests/bpf2c_tests/expected/test_sample_ebpf_sys.c index 51765f272f..f880514ff7 100644 --- a/tests/bpf2c_tests/expected/test_sample_ebpf_sys.c +++ b/tests/bpf2c_tests/expected/test_sample_ebpf_sys.c @@ -436,7 +436,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/test_utility_helpers_dll.c b/tests/bpf2c_tests/expected/test_utility_helpers_dll.c index afbe9696ab..ad836dba55 100644 --- a/tests/bpf2c_tests/expected/test_utility_helpers_dll.c +++ b/tests/bpf2c_tests/expected/test_utility_helpers_dll.c @@ -335,7 +335,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/test_utility_helpers_raw.c b/tests/bpf2c_tests/expected/test_utility_helpers_raw.c index 4e43e676f5..1bce4af802 100644 --- a/tests/bpf2c_tests/expected/test_utility_helpers_raw.c +++ b/tests/bpf2c_tests/expected/test_utility_helpers_raw.c @@ -309,7 +309,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/bpf2c_tests/expected/test_utility_helpers_sys.c b/tests/bpf2c_tests/expected/test_utility_helpers_sys.c index 5e639e20b5..1d3a480b32 100644 --- a/tests/bpf2c_tests/expected/test_utility_helpers_sys.c +++ b/tests/bpf2c_tests/expected/test_utility_helpers_sys.c @@ -470,7 +470,7 @@ _get_version(_Out_ bpf2c_version_t* version) { version->major = 0; version->minor = 14; - version->revision = 0; + version->revision = 1; } static void diff --git a/tests/end_to_end/netsh_test.cpp b/tests/end_to_end/netsh_test.cpp index cc1c977aa5..d43dbfe5eb 100644 --- a/tests/end_to_end/netsh_test.cpp +++ b/tests/end_to_end/netsh_test.cpp @@ -206,7 +206,7 @@ TEST_CASE("show sections bpf.sys", "[netsh][sections]") " Section Type (bytes)\n" "==================== ========= =======\n" #if defined(NDEBUG) - " .text bind 1064\n" + " .text bind 1080\n" #else " .text bind 1768\n" #endif @@ -380,29 +380,6 @@ TEST_CASE("show verification droppacket_unsafe.o", "[netsh][verification]") "\n"); } -TEST_CASE("show verification xdp_adjust_head_unsafe.o", "[netsh][verification]") -{ - _test_helper_netsh test_helper; - test_helper.initialize(); - - int result; - std::string output = - _run_netsh_command(handle_ebpf_show_verification, L"xdp_adjust_head_unsafe.o", L"xdp", nullptr, &result); - REQUIRE(result == ERROR_SUPPRESS_OUTPUT); - output = strip_paths(output); - REQUIRE( - output == "Verification failed\n" - "\n" - "Verification report:\n" - "\n" - "; ./tests/sample/unsafe/xdp_adjust_head_unsafe.c:42\n" - "; ethernet_header->Type = 0x0800;\n" - "17: Upper bound must be at most packet_size (valid_access(r1.offset+12, width=2) for write)\n" - "\n" - "1 errors\n" - "\n"); -} - TEST_CASE("show verification printk_unsafe.o", "[netsh][verification]") { _test_helper_netsh test_helper; diff --git a/tests/sample/undocked/inner_map.c b/tests/sample/undocked/inner_map.c index 9b6a6f292b..25307ccc41 100644 --- a/tests/sample/undocked/inner_map.c +++ b/tests/sample/undocked/inner_map.c @@ -33,12 +33,31 @@ struct }); } outer_map SEC(".maps"); +struct +{ + __uint(type, BPF_MAP_TYPE_ARRAY); + __type(key, uint32_t); + __type(value, uint32_t); + __uint(max_entries, 1024); +} inner_map SEC(".maps"); + +struct +{ + __uint(type, BPF_MAP_TYPE_HASH_OF_MAPS); + __type(key, uint16_t); + __uint(max_entries, 1); + __array(values, inner_map); +} outer_map2 SEC(".maps"); + SEC("sample_ext") int lookup_update(sample_program_context_t* ctx) { uint32_t outer_key = 0; + uint16_t outer_key2 = 0; + void* inner_map = NULL; + void* inner_map2 = NULL; // Read value from inner map. - void* inner_map = bpf_map_lookup_elem(&outer_map, &outer_key); + inner_map = bpf_map_lookup_elem(&outer_map, &outer_key); if (inner_map) { uint32_t inner_key = 0; uint32_t* inner_value = (uint32_t*)bpf_map_lookup_elem(inner_map, &inner_key); @@ -48,5 +67,18 @@ SEC("sample_ext") int lookup_update(sample_program_context_t* ctx) return 0; } } + + // Read value from inner map. + inner_map2 = bpf_map_lookup_elem(&outer_map2, &outer_key2); + if (inner_map2) { + uint32_t inner_key = 0; + uint32_t* inner_value = (uint32_t*)bpf_map_lookup_elem(inner_map, &inner_key); + if (inner_value) { + // Update value in inner map. + *inner_value = 1; + return 0; + } + } + return 1; } diff --git a/tests/sample/unsafe/xdp_adjust_head_unsafe.c b/tests/sample/unsafe/xdp_adjust_head_unsafe.c deleted file mode 100644 index e4502a9156..0000000000 --- a/tests/sample/unsafe/xdp_adjust_head_unsafe.c +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation -// SPDX-License-Identifier: MIT - -// clang -O2 -Werror -c xdp_adjust_head_unsafe.c -o xdp_adjust_head_unsafe_jit.o -// -// For bpf code: clang -target bpf -O2 -Werror -c xdp_adjust_head_unsafe.c -o xdp_adjust_head_unsafe.o -// - -#include "bpf_endian.h" -#include "bpf_helpers.h" -#include "net/if_ether.h" -#include "net/ip.h" -#include "net/udp.h" - -SEC("xdp") -int -xdp_adjust_head_unsafe(xdp_md_t* ctx) -{ - int rc = XDP_PASS; - - ETHERNET_HEADER* ethernet_header = NULL; - char* next_header = (char*)ctx->data; - - // Access the Ethernet header fields after checking for safety. - // This will pass verifier test. - if (next_header + sizeof(ETHERNET_HEADER) > (char*)ctx->data_end) { - rc = XDP_DROP; - goto Done; - } - ethernet_header = (ETHERNET_HEADER*)next_header; - ethernet_header->Type = 0x0800; - - // Adjust the head of the packet by removing the Ethernet header. - if (bpf_xdp_adjust_head(ctx, sizeof(ETHERNET_HEADER)) < 0) { - rc = XDP_DROP; - goto Done; - } - - // Access the packet without checking for safety. - // This will fail verifier test. - ethernet_header = (ETHERNET_HEADER*)ctx->data; - ethernet_header->Type = 0x0800; - -Done: - return rc; -} diff --git a/tools/bpf2c/bpf2c.cpp b/tools/bpf2c/bpf2c.cpp index 3cf39848b4..1afc40b7f2 100644 --- a/tools/bpf2c/bpf2c.cpp +++ b/tools/bpf2c/bpf2c.cpp @@ -116,9 +116,6 @@ get_program_info_type_hash(const std::vector& actual_helper_ids, const hash_t::append_byte_range( byte_range, program_info->program_type_specific_helper_prototype[index].arguments[argument]); } - if (program_info->program_type_specific_helper_prototype[index].reallocate_packet) { - hash_t::append_byte_range(byte_range, reinterpret_cast("reallocate_packet")); - } } } hash_t hash(algorithm); diff --git a/tools/bpf2c/bpf2c.vcxproj b/tools/bpf2c/bpf2c.vcxproj index 48f51f4b45..e2854c3610 100644 --- a/tools/bpf2c/bpf2c.vcxproj +++ b/tools/bpf2c/bpf2c.vcxproj @@ -86,13 +86,13 @@ - false + true - false + true - false + true false @@ -108,7 +108,7 @@ Console - DebugFull + true $(FuzzerLibs);%(AdditionalDependencies) @@ -126,7 +126,7 @@ Console - DebugFull + true $(FuzzerLibs);%(AdditionalDependencies) @@ -141,7 +141,7 @@ Console - DebugFull + true $(FuzzerLibs);%(AdditionalDependencies) @@ -159,7 +159,7 @@ Console true true - DebugFull + true $(FuzzerLibs);%(AdditionalDependencies) @@ -177,7 +177,7 @@ Console true true - DebugFull + true $(FuzzerLibs);%(AdditionalDependencies) diff --git a/tools/bpf2c/bpf_code_generator.cpp b/tools/bpf2c/bpf_code_generator.cpp index 61ef448e15..4e2a36eb75 100644 --- a/tools/bpf2c/bpf_code_generator.cpp +++ b/tools/bpf2c/bpf_code_generator.cpp @@ -529,11 +529,6 @@ bpf_code_generator::parse_btf_maps_section(const unsafe_string& name) // Compute the offset of the values array and resize the vector // to hold the initial values. if (member.name == "values") { - // If the map is statically initialized, then the keys must be uint32_t. - if (map_definition.key_size != sizeof(uint32_t)) { - throw bpf_code_generator_exception("map keys must be uint32_t for static initialization"); - } - map_names_to_values_offset[unsafe_symbol_name] = member.offset_from_start_in_bits / 8; if (map_names_to_values_offset[unsafe_symbol_name] > (range.second - range.first)) { throw bpf_code_generator_exception("map values offset is outside of map range"); @@ -546,6 +541,10 @@ bpf_code_generator::parse_btf_maps_section(const unsafe_string& name) ((range.second - range.first) - map_names_to_values_offset[unsafe_symbol_name]) / sizeof(uintptr_t); if (value_count > 0) { + // If the map is statically initialized, then the keys must be uint32_t. + if (map_definition.key_size != sizeof(uint32_t)) { + throw bpf_code_generator_exception("map keys must be uint32_t for static initialization"); + } map_initial_values[unsafe_symbol_name].resize(value_count); } }