From PCI Address Gateway Interface Feature¶
Overview¶
The "derive-from-mgmt-port" gateway interface feature is a new capability in OVN-Kubernetes that enables automatic gateway interface resolution in DPU (Data Processing Unit) host mode deployments. This feature automatically discovers and configures the appropriate Physical Function (PF) interface as the gateway interface based on the Virtual Function (VF) used for the management port.
Problem Statement¶
In DPU deployments, the host typically has access to Virtual Functions (VFs) for management purposes, while the Physical Functions (PFs) are used for external connectivity. Previously, administrators had to manually specify the gateway interface, which required:
- Knowledge of the hardware topology
- Manual mapping of VF to PF relationships
- Configuration updates when hardware changes
- Potential for misconfiguration
Solution¶
The "derive-from-mgmt-port" feature automates the gateway interface discovery process by:
- Automatic Discovery: Automatically finds the PF interface associated with the management port VF
- Hardware Abstraction: Eliminates the need for manual hardware topology knowledge
- Dynamic Configuration: Adapts to hardware changes automatically
- Reduced Configuration: Simplifies deployment configuration
Benefits¶
For Administrators¶
- Simplified Configuration: No need to manually specify gateway interfaces
- Reduced Errors: Eliminates manual mapping errors
- Hardware Agnostic: Works with any SR-IOV capable hardware
- Dynamic Adaptation: Automatically adapts to hardware changes
For Operations¶
- Faster Deployment: Reduced configuration time
- Consistent Setup: Standardized gateway interface selection
- Reduced Maintenance: Less manual intervention required
- Better Reliability: Fewer configuration-related issues
For Development¶
- Cleaner Code: Centralized gateway interface logic
- Better Testing: Comprehensive unit test coverage
- Extensible Design: Foundation for future enhancements
Technical Implementation¶
Always check the dependencies on the Requirements page
Code Changes¶
- New Constant: Added
DeriveFromMgmtPort = "derive-from-mgmt-port"constant ingo-controller/pkg/types/const.go - Enhanced Logic: Extended gateway initialization in
go-controller/pkg/node/default_node_network_controller.go - Comprehensive Testing: Added unit tests covering success and failure scenarios
Key Functions¶
getManagementPortNetDev(): Resolves management port device nameGetPciFromNetDevice(): Retrieves PCI address from network deviceGetPfPciFromVfPci(): Resolves PF PCI address from VF PCI addressGetNetDevicesFromPci(): Discovers network devices associated with PCI address
Error Handling¶
The implementation includes robust error handling for: - Missing network devices - PCI address resolution failures - SR-IOV operation failures - Hardware compatibility issues
Configuration Examples¶
Basic Configuration¶
--ovnkube-node-mode=dpu-host
--ovnkube-node-mgmt-port-dp-resource-name=example.com/sriov_pool
--gateway-interface=derive-from-mgmt-port
Alternatively, the management port VF can be specified directly by netdev name using --ovnkube-node-mgmt-port-netdev. Note that this approach does not support network segmentation (UDN); use --ovnkube-node-mgmt-port-dp-resource-name instead when network segmentation is enabled.
--ovnkube-node-mode=dpu-host
--ovnkube-node-mgmt-port-netdev=pf0vf0
--gateway-interface=derive-from-mgmt-port
Note: When both
--ovnkube-node-mgmt-port-dp-resource-nameand--ovnkube-node-mgmt-port-netdevare specified,--ovnkube-node-mgmt-port-dp-resource-nametakes priority and the netdev provided by--ovnkube-node-mgmt-port-netdevwill be overridden by the device chosen from the SR-IOV resource pool. Additionally, when network segmentation (UDN) is enabled in DPU-host mode,--ovnkube-node-mgmt-port-dp-resource-nameis mandatory and--ovnkube-node-mgmt-port-netdevis not supported.
Helm Configuration¶
ovnkube-node:
mode: dpu-host
mgmtPortVFResourceName: example.com/sriov_pool
gateway:
interface: derive-from-mgmt-port
Or using the netdev name directly (not supported with network segmentation / UDN):
ovnkube-node:
mode: dpu-host
mgmtPortNetdev: pf0vf0
gateway:
interface: derive-from-mgmt-port
Configuration File¶
[OvnKubeNode]
mode=dpu-host
mgmt-port-dp-resource-name=example.com/sriov_pool
[Gateway]
interface=derive-from-mgmt-port
Or using the netdev name directly (not supported with network segmentation / UDN):
[OvnKubeNode]
mode=dpu-host
mgmt-port-netdev=pf0vf0
[Gateway]
interface=derive-from-mgmt-port
Migration Guide¶
From Manual Configuration¶
Before:
--gateway-interface=eth0
After:
--gateway-interface=derive-from-mgmt-port
Verification Steps¶
- Verify SR-IOV configuration is correct
- Ensure management port device is properly configured
- Check that PF interfaces are available
- Monitor logs for successful gateway interface resolution
Testing¶
Unit Tests¶
Comprehensive unit tests cover: - Successful gateway interface resolution - Error handling for missing devices - PCI address resolution failures - Network device discovery failures
Integration Tests¶
The feature integrates with existing: - Gateway initialization - DPU host mode functionality - SR-IOV operations - Network configuration
Future Enhancements¶
Potential improvements include: - Support for multiple gateway interfaces - Enhanced device selection criteria - Integration with device plugins - Support for non-SR-IOV hardware - Advanced error reporting and diagnostics
Related Documentation¶
- DPU Gateway Interface Configuration
- DPU Support
- Gateway Accelerated Interface Configuration
- Configuration Guide
Support¶
For issues related to this feature: 1. Check the troubleshooting section in the DPU Gateway Interface Configuration guide 2. Verify SR-IOV hardware and driver support 3. Review error messages and logs 4. Consult the OVN-Kubernetes community for additional support