diff options
| author | Oleksandr Kuchmystyi <o.kuchmystyi@vyos.io> | 2026-03-10 17:08:48 +0300 |
|---|---|---|
| committer | Oleksandr Kuchmystyi <o.kuchmystyi@vyos.io> | 2026-03-18 15:13:02 +0300 |
| commit | 3722268b0859831ae96c9cb3f634382713139f6d (patch) | |
| tree | 2b9401f6ef9ab7f0ab19359d08d6d30a1c79572b /src | |
| parent | 124304285eef883069303773093ed76f6d593c16 (diff) | |
| download | vyos-1x-3722268b0859831ae96c9cb3f634382713139f6d.tar.gz vyos-1x-3722268b0859831ae96c9cb3f634382713139f6d.zip | |
vpp: T8315: Add support for configuring unsupported NICs and update compatible list
Introduce `set vpp settings unsupported nics <pci-id>` and
`set vpp settings unsupported drivers <driver>` to permit VPP activation
on hardware not present in the validated NIC list. Update current compatible list.
Diffstat (limited to 'src')
| -rwxr-xr-x | src/conf_mode/vpp.py | 47 |
1 files changed, 44 insertions, 3 deletions
diff --git a/src/conf_mode/vpp.py b/src/conf_mode/vpp.py index d39eadac1..f357fcc68 100755 --- a/src/conf_mode/vpp.py +++ b/src/conf_mode/vpp.py @@ -48,7 +48,6 @@ from vyos.vpp import VppNotRunningError from vyos.vpp.config_deps import deps_bridge_dict from vyos.vpp.config_deps import deps_xconnect_dict from vyos.vpp.config_verify import ( - verify_dev_driver, verify_vpp_minimum_cpus, verify_vpp_minimum_memory, verify_vpp_cpu_cores, @@ -112,6 +111,21 @@ drivers_support_interrupt: dict[str, list] = { # drivers that require changing channels (half the maximum number of RX/TX queues) ethtool_channels_change_drv: list[str] = ['ena', 'gve'] +# List of NICs where VPP activation is supported +SUPPORTED_PCI_IDS = ( + '15b3:1019', # Mellanox Technologies MT28800 Family [ConnectX-5 Ex] + '15b3:101d', # Mellanox Technologies MT2892 Family [ConnectX-6 Dx] + '15b3:101e', # Mellanox Technologies ConnectX Family mlx5Gen Virtual Function + '8086:1592', # Intel Corporation Ethernet Controller E810-C for QSFP + '1ae0:0042', # Google, Inc. Compute Engine Virtual Ethernet [gVNIC] + '1af4:1000', # Red Hat, Inc. Virtio network device (legacy ID) + '1af4:1041', # Red Hat, Inc. Virtio network device (modern ID) + '1d0f:ec20', # Amazon.com, Inc. Elastic Network Adapter (ENA) +) +SUPPORTED_DRIVERS = ( + 'hv_netvsc', # Microsoft Hyper-V network interface card +) + def _load_module(module_name: str): """ @@ -225,6 +239,29 @@ def _check_removed_interfaces(config: dict, feature_name: str, interfaces_config ) +def _is_device_allowed(config: dict, iface: str): + """ + Determines if a network interface device is allowed to be used + with VPP based on its PCI ID or driver. + """ + if 'allow_unsupported_nics' in config['settings']: + return True + + persist_config = config['persist_config'][iface] + + pci_id = persist_config.get('pci_id') + # PCI ID is sufficient by itself, if presented + if pci_id is not None and pci_id in SUPPORTED_PCI_IDS: + return True + + # If the PCI ID did not match or does not exist, fall back to a driver + original_driver = persist_config.get('original_driver') + if original_driver is not None and original_driver in SUPPORTED_DRIVERS: + return True + + return False + + def get_config(config=None): # use persistent config to store interfaces data between executions # this is required because some interfaces after they are connected @@ -344,6 +381,7 @@ def get_config(config=None): } eth_ifaces_persist[iface]['bus_id'] = control_host.get_bus_name(iface) eth_ifaces_persist[iface]['dev_id'] = control_host.get_dev_id(iface) + eth_ifaces_persist[iface]['pci_id'] = control_host.get_pci_id(iface) eth_ifaces_persist[iface]['channels'] = control_host.get_eth_channels(iface) # Return to config dictionary @@ -554,10 +592,13 @@ def verify(config): not in config.get('effective', {}).get('settings', {}).get('interface', {}) or 'driver_changed' in iface_config ): - if not verify_dev_driver(iface_config['driver'], original_driver): + if not _is_device_allowed(config, iface): raise ConfigError( - f'Driver {iface_config["driver"]} is not compatible with interface {iface}!' + f'NIC used by "{iface}" is not validated for VPP on VyOS. ' + 'Using it is unsafe and unsupported and will void support for the entire system. ' + 'To proceed at your own risk, enable: "set vpp settings allow-unsupported-nics".' ) + if iface_config['driver'] == 'xdp' and 'xdp_options' in iface_config: if iface_config['xdp_options']['num_rx_queues'] != 'all': rx_queues = iface_config['xdp_api_params']['rxq_num'] |
