Skip to content

Comments

Custom maps implementation#4895

Open
saxena-anurag wants to merge 94 commits intomicrosoft:mainfrom
saxena-anurag:user/anusa/custom_map_implementation
Open

Custom maps implementation#4895
saxena-anurag wants to merge 94 commits intomicrosoft:mainfrom
saxena-anurag:user/anusa/custom_map_implementation

Conversation

@saxena-anurag
Copy link
Contributor

@saxena-anurag saxena-anurag commented Jan 9, 2026

Fixes #4375

This pull request introduces support for custom map types in eBPF extensions for Windows. It updates both the documentation and the extension API to describe and enable how extensions can implement and register new map types, alongside hooks and helper functions. The changes define new NPI contracts, data structures, and dispatch tables for map providers, and clarify how helper functions interact with custom maps.

Key changes:

Documentation updates for custom maps

  • Expanded the definition of an "eBPF extension" to include the ability to implement custom maps, not just hooks and helper functions. The documentation now details the requirements and process for registering new map types, including the new "Map Information NPI" contract and the steps for authoring and registering custom maps. It also explains the required data structures and the importance of using reserved map IDs. [1] [2] [3] [4] [5] [6]

New API and data structures for custom map providers

  • Added new constants, function pointer typedefs, and data structures in ebpf_extension.h to support custom map operations (create, delete, find, add, associate with program types, etc.) and epoch-based memory management. This includes the ebpf_map_provider_data_t, ebpf_base_map_provider_dispatch_table_t, and related client-side structures and macros. [1] [2]

NPI contract and GUID for map extensions

  • Introduced a new GUID (EBPF_MAP_INFO_EXTENSION_IID) in ebpf_extension_uuids.h to uniquely identify the NPI contract for map information providers.

These changes collectively enable eBPF extensions to define and register new map types, provide the necessary interfaces for the eBPF core to interact with custom maps, and document the requirements and procedures for extension authors.##

Testing

This PR adds tests.

Documentation

PR updates documentation.

Installation

NA.

Copy link
Collaborator

@dthaler dthaler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just some nits in comments and SAL annotations.

dthaler
dthaler previously approved these changes Feb 21, 2026
Copy link
Collaborator

@dthaler dthaler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good modulo a few more nits.

Co-authored-by: Dave Thaler <dthaler1968@gmail.com>
saxena-anurag and others added 6 commits February 21, 2026 21:37
Co-authored-by: Dave Thaler <dthaler1968@gmail.com>
Co-authored-by: Dave Thaler <dthaler1968@gmail.com>
Co-authored-by: Dave Thaler <dthaler1968@gmail.com>
Co-authored-by: Dave Thaler <dthaler1968@gmail.com>
Co-authored-by: Dave Thaler <dthaler1968@gmail.com>
Co-authored-by: Dave Thaler <dthaler1968@gmail.com>
dthaler
dthaler previously approved these changes Feb 22, 2026
bool
_sample_validate_client_map_data(_In_ const ebpf_map_client_data_t* client_data)
{
if (client_data->header.version != EBPF_MAP_CLIENT_DATA_CURRENT_VERSION &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible logic bug? Should this be || not &&?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Add extensible map types

3 participants