You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/GlobalHelperFunctionsFromExternalDrivers.md
+34-33Lines changed: 34 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,53 +8,50 @@ This document outlines the requirements for enabling drivers outside of `ebpfcor
8
8
9
9
The current eBPF for Windows global helper function system requires:
10
10
-**Global helpers hosted only in `ebpfcore.sys`** limiting extensibility by third-party drivers
11
-
-**Pre-assigned numeric IDs** for all helper functions
12
-
-**Centralized coordination** of helper ID assignments to prevent conflicts
13
-
-**Static ID management** making it difficult for external drivers to expose custom global helper functions
11
+
-**Pre-coordination of helper function registration** to prevent conflicts
12
+
-**Static management** making it difficult for external drivers to expose custom global helper functions
14
13
15
14
This creates barriers for independent driver development and limits the extensibility of the eBPF ecosystem by preventing external drivers from contributing global helper functions.
16
15
17
16
## Requirements
18
17
19
18
### R1: External Driver Global Helper Registration
20
-
- Drivers outside of `ebpfcore.sys`**MUST** be able to register global helper functions as general program information providers
21
-
- The system **MUST** support global helper function registration using descriptive names instead of pre-assigned numeric IDs
22
-
- Registration **MUST** use existing NMR (Network Module Registrar) interfaces without modification
23
-
- External drivers **MUST** be able to register global helpers with `helper_id = -1` to indicate name-based registration
19
+
- Drivers outside of `ebpfcore.sys`**MUST** be able to register global helper functions
20
+
- The system **MUST** support global helper function registration without requiring pre-coordination
21
+
- Registration **MUST** use existing interfaces without requiring new APIs
24
22
25
-
### R2: Elimination of Central ID Coordination
26
-
- Driver developers **MUST NOT** be required to coordinate helper function ID assignments with other drivers
23
+
### R2: Elimination of Central Coordination
24
+
- Driver developers **MUST NOT** be required to coordinate helper function registration with other drivers
27
25
- The system **MUST** reject registration attempts when multiple drivers try to register helper functions with the same name
28
26
- Helper function names **MUST** be globally unique across all registered providers
29
-
- Helper function ID assignment **MUST** be managed automatically by the runtime
27
+
- Helper function registration **MUST** be managed automatically by the system
30
28
31
29
### R3: Per-Program Global Helper Resolution
32
-
- Each eBPF program **MUST** maintain its own stable mapping of global helper function names to IDs
33
-
- Global helper function IDs **MUST** remain consistent for the lifetime of each program
34
-
- The system **MUST** resolve global helper function names to program-specific IDs during program loading
30
+
- Each eBPF program **MUST** have access to a consistent set of global helper functions for its lifetime
31
+
- The system **MUST** resolve global helper function references during program loading
35
32
- Programs **MUST** be able to access global helpers from both `ebpfcore.sys` and external drivers
36
33
37
34
### R4: Backward Compatibility
38
-
- Existing global helper functions using numeric IDs **MUST** continue to work unchanged
35
+
- Existing global helper functions **MUST** continue to work unchanged
- Mixed usage of existing and new global helper functions **MUST** be supported within the same program
42
39
43
-
### R5: External Function Call Support
44
-
- eBPF programs compiled from C **MUST** be able to use external function calls that resolve to global helper functions by name
45
-
- The bpf2c compiler**MUST**detect external function calls and mark them for name-based resolution
46
-
- Generated native code **MUST** support both traditional helper IDs and name-based resolution for global helpers
40
+
### R5: C Program Support
41
+
- eBPF programs written in C **MUST** be able to call global helper functions using standard function call syntax
42
+
- The compilation process**MUST**handle global helper function resolution transparently
43
+
- Generated code **MUST** support global helper function calls from external drivers
47
44
48
-
### R6: Multiple General Program Information Provider Support
49
-
- eBPF programs **MUST** be able to utilize global helper functions from multiple general program information providers simultaneously
50
-
- The system **MUST**search across all registered providers (including external drivers) when resolving global helper function names
45
+
### R6: Multiple Provider Support
46
+
- eBPF programs **MUST** be able to utilize global helper functions from multiple providers simultaneously
47
+
- The system **MUST**support discovery and resolution of global helper functions across all registered providers
51
48
- Provider lifecycle events (attach/detach) **MUST** be handled independently for each provider
52
49
- Global helper function name conflicts between providers **MUST** be detected and rejected during registration
53
50
54
-
### R7: Metadata Integrity
55
-
-Program metadata hashing **MUST**remain consistent between compile-time and runtime for name-based global helpers
56
-
-Hash computation**MUST**exclude helper IDs for name-based global helpers while including all other prototype information
57
-
-Verification **MUST**ensure programs execute with the same global helper function information used during compilation
51
+
### R7: Program Integrity
52
+
-Programs **MUST**execute with the same global helper function information that was available during compilation
53
+
-The system**MUST**ensure consistency between compile-time and runtime global helper function availability
54
+
-Program verification **MUST**account for global helper functions from external drivers
58
55
59
56
## Success Criteria
60
57
@@ -64,13 +61,13 @@ This creates barriers for independent driver development and limits the extensib
64
61
65
62
### SC2: Developer Experience
66
63
- eBPF program developers can use descriptive global helper function names in their C code
67
-
- Compilation and loading processes handle name resolution transparently
68
-
- Error messages provide clear diagnostics for unresolvable global helper function names
64
+
- Compilation and loading processes handle global helper function resolution transparently
65
+
- Error messages provide clear diagnostics for unavailable global helper functions
69
66
70
67
### SC3: System Stability
71
-
- Global helper function ID assignments remain stable throughout each program's lifetime
68
+
- Global helper function availability remains stable throughout each program's lifetime
72
69
- Provider lifecycle events do not disrupt running programs
73
-
- System performance is not significantly impacted by name resolution overhead
70
+
- System performance is not significantly impacted by global helper function resolution
74
71
75
72
### SC4: Ecosystem Growth
76
73
- Independent software vendors can develop eBPF extensions with custom global helper functions without platform dependencies
@@ -87,10 +84,14 @@ This creates barriers for independent driver development and limits the extensib
87
84
## Implementation Constraints
88
85
89
86
-**Zero breaking changes** to existing APIs or driver interfaces
90
-
-**Minimal code modifications** to core eBPF subsystems
91
-
-**Preserve existing performance** characteristics for traditional numeric global helpers
87
+
-**Minimal modifications** to core eBPF subsystems
88
+
-**Preserve existing performance** characteristics for current global helpers
92
89
-**Maintain security model** for global helper function access and verification
93
90
91
+
## Implementation Notes
92
+
93
+
While this document focuses on requirements rather than implementation details, it should be noted that BTF (BPF Type Format) IDs represent one possible mechanism that could be leveraged to implement helper function identification and resolution without requiring pre-coordination between drivers.
94
+
94
95
## Conclusion
95
96
96
97
This requirements document establishes the foundation for enabling external drivers to expose global helper functions to eBPF programs, creating a more flexible and developer-friendly eBPF helper function ecosystem while maintaining complete backward compatibility and system integrity. The solution must eliminate coordination barriers for independent driver development while preserving the reliability and security of the existing eBPF platform.
0 commit comments