Skip to content

Commit f6bb26e

Browse files
author
Alan Jowett
committed
PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
1 parent 55a49d0 commit f6bb26e

File tree

1 file changed

+34
-33
lines changed

1 file changed

+34
-33
lines changed

docs/GlobalHelperFunctionsFromExternalDrivers.md

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,53 +8,50 @@ This document outlines the requirements for enabling drivers outside of `ebpfcor
88

99
The current eBPF for Windows global helper function system requires:
1010
- **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
1413

1514
This creates barriers for independent driver development and limits the extensibility of the eBPF ecosystem by preventing external drivers from contributing global helper functions.
1615

1716
## Requirements
1817

1918
### 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
2422

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
2725
- The system **MUST** reject registration attempts when multiple drivers try to register helper functions with the same name
2826
- 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
3028

3129
### 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
3532
- Programs **MUST** be able to access global helpers from both `ebpfcore.sys` and external drivers
3633

3734
### 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
3936
- Existing driver code **MUST NOT** require modification to continue functioning
40-
- The bpf2c contract **MUST** remain compatible with existing compiled programs
41-
- Mixed usage of named and numeric global helper functions **MUST** be supported within the same program
37+
- Existing compiled programs **MUST** remain compatible
38+
- Mixed usage of existing and new global helper functions **MUST** be supported within the same program
4239

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
4744

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
5148
- Provider lifecycle events (attach/detach) **MUST** be handled independently for each provider
5249
- Global helper function name conflicts between providers **MUST** be detected and rejected during registration
5350

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
5855

5956
## Success Criteria
6057

@@ -64,13 +61,13 @@ This creates barriers for independent driver development and limits the extensib
6461

6562
### SC2: Developer Experience
6663
- 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
6966

7067
### 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
7269
- 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
7471

7572
### SC4: Ecosystem Growth
7673
- 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
8784
## Implementation Constraints
8885

8986
- **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
9289
- **Maintain security model** for global helper function access and verification
9390

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+
9495
## Conclusion
9596

9697
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

Comments
 (0)