-
Notifications
You must be signed in to change notification settings - Fork 268
[doc] Proposal doc for extensible maps #4566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
bd051c8
acdf04c
e38c4ee
79b91dd
25e2774
e7680de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,79 @@ | ||||||||||||||||||
| # Introduction | ||||||||||||||||||
|
|
||||||||||||||||||
| Extensible maps are program type specific maps that will be implemented by the extension that is implementing the program type (program info provider). This document contains the proposal for implementing support for extensible / program type specific maps in eBPF-for-Windows. The below sections describe all the scenarios / areas that will need to be updated or tested for this new map type. | ||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are all maps extensible maps? Or specific map types? If BPF_MAP_TYPE_XSKMAP is an example of one, say so and point to https://docs.kernel.org/bpf/map_xskmap.html |
||||||||||||||||||
|
|
||||||||||||||||||
| ## Map Id partitioning | ||||||||||||||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update text and replace "Map ID" by "map type enum" |
||||||||||||||||||
| Global maps get an ID for their map types from a global namespace. There are two possible options for how we can allocate IDs for map types for extensible maps. | ||||||||||||||||||
|
|
||||||||||||||||||
| **Option 1: Global Map IDs** | ||||||||||||||||||
| - The map type IDs are allocated from a global namespace. This will be disjoint from the namespace for global maps. Global maps will use IDs from 1 to 4095. Extensible maps will use IDs 4096 onwards. | ||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Elaborate... I don't follow why you need a separate ID range instead of just using normal IDs.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Answer: this is about map type IDs (which makes sense) not map IDs per se. Please update all uses of the term :) |
||||||||||||||||||
| - Each program info provider that implements a extensible map will need to register / reserve the MAP ID / enum in the eBPF repo by creating a PR. | ||||||||||||||||||
|
||||||||||||||||||
| - Each program info provider that implements a extensible map will need to register / reserve the MAP ID / enum in the eBPF repo by creating a PR. | |
| - Each program info provider that implements an extensible map will need to register / reserve the MAP ID / enum in the eBPF repo by creating a PR. |
Copilot
AI
Aug 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a grammatical error: 'will extended' should be 'will be extended'.
| The NMR interface for program info provider will extended (non-breaking) and extensions will provide below information: | |
| The NMR interface for program info provider will be extended (non-breaking) and extensions will provide below information: |
saxena-anurag marked this conversation as resolved.
Show resolved
Hide resolved
Copilot
AI
Aug 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a spelling error: 'Verfication' should be 'Verification'.
| ## Verfication | |
| - No impact on verfication (online or offline), as the verifier only cares about the actual map definitions. | |
| ## Verification | |
| - No impact on verification (online or offline), as the verifier only cares about the actual map definitions. |
Copilot
AI
Aug 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a spelling error: 'verfication' should be 'verification'.
| ## Verfication | |
| - No impact on verfication (online or offline), as the verifier only cares about the actual map definitions. | |
| ## Verification | |
| - No impact on verification (online or offline), as the verifier only cares about the actual map definitions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Map lifetime will also be maintained by eBPFcore, and it will invoke extension's map delete API when the map needs to be finally deleted. | |
| Map lifetime will also be maintained by eBPFcore, and it will invoke the extension's map delete API when the map needs to be finally deleted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explore if the map memory can come from ebpfcore so that it survives extension restart.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting aside the extension behavior, what happens on Linux if an XSK map contains an entry for an XSK and:
- The XSK file handle is closed?
- The process that created the XSK terminates? [Can an XSK map be pinned such that it persists across process lifetime?]
I vaguely recall reading somewhere that the XSK map may have entries automatically removed - let me try to find that old context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this blurb on the man page, but it refers to user mode automatically cleaning up the XSK entry, and not a kernel implementation:
When libxdp deletes an XSK it also removes the associated socket entry from the XSKMAP.
As long as our observable behavior matches Linux (e.g., if adding an XSK to a map keeps the entry around indefinitely) then I agree the simplest extension model is best. If the Linux kernel does support implicit XSK entry deletion, then I'd lean towards having the map itself also be implicitly deleted by the extension if it initiates NMR teardown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Implicit map creation flow will also be similar. ebpf runtime will have similar flow for map creation, automatic map pinning, and map reuse. | |
| Implicit map creation flow will also be similar. The ebpf runtime will have a similar flow for map creation, automatic map pinning, and map reuse. |
Also by "ebpf runtime" do you mean ebpfcore?
Copilot
AI
Aug 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a spelling error: 'wheenver' should be 'whenever'.
| - Does not require new release from extensions wheenver there is a bugfix in RCU logic. | |
| - Does not require new release from extensions whenever there is a bugfix in RCU logic. |
Alan-Jowett marked this conversation as resolved.
Show resolved
Hide resolved
Copilot
AI
Aug 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a spelling error: 'logner' should be 'longer'.
| Since map APIs for extensible maps will have logner path length, we should measure perf for extensible map operations. | |
| Since map APIs for extensible maps will have longer path length, we should measure perf for extensible map operations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend splitting into shorter source lines.