Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions interface-definitions/vpp.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,19 @@
</node>
</children>
</tagNode>
<node name="interfaces">
<properties>
<help>Interfaces settings</help>
</properties>
<children>
<leafNode name="allow-unsupported-nics">
<properties>
<help>Allow VPP to use untested NICs. This disables official support for this system</help>
<valueless/>
</properties>
</leafNode>
</children>
</node>
<node name="ipv6">
<properties>
<help>IPv6 settings</help>
Expand Down
12 changes: 12 additions & 0 deletions python/vyos/vpp/config_verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
from vyos.vpp.utils import human_memory_to_bytes, bytes_to_human_memory


# Community-tested DPDK drivers / not officially supported by VyOS
community_drivers_dpdk: list[str] = [
'iavf',
]


def verify_vpp_remove_kernel_interface(config: dict):
"""Common verify for removed kernel-interfaces.
Verify that removed kernel interface are not used in 'vpp kernel-interfaces'.
Expand Down Expand Up @@ -172,6 +178,12 @@ def verify_dev_driver(iface_name: str, driver_type: str) -> bool:
if driver_type == 'dpdk':
if driver in drivers_dpdk:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Driver iavf would not pass this check because it is not in drivers_dpdk. You should add it to drivers_dpdk list too

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done some refactoring of my PR

return True
if driver in community_drivers_dpdk:
Warning(
f"Driver '{driver}' on interface {iface_name} is community-supported and not tested by VyOS. "
f"This disables official support for this system."
)
return True
elif driver_type == 'xdp':
if driver in drivers_xdp:
return True
Expand Down
12 changes: 12 additions & 0 deletions src/conf_mode/vpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
from vyos.vpp import control_host
from vyos.vpp.config_deps import deps_xconnect_dict
from vyos.vpp.config_verify import (
community_drivers_dpdk,
verify_dev_driver,
verify_vpp_minimum_cpus,
verify_vpp_minimum_memory,
Expand Down Expand Up @@ -549,6 +550,17 @@ def verify(config):
raise ConfigError(
f'Driver {iface_config["driver"]} is not compatible with interface {iface}!'
)
is_community_dpdk_driver = (
iface_config['kernel_module'] in community_drivers_dpdk
)
if is_community_dpdk_driver and 'allow-unsupported-nics' not in config.get(
'settings', {}
).get('interfaces', {}):
raise ConfigError(
f"Driver {iface_config['driver']} on interface {iface} is community-supported and could be enabled "
f"by configuring 'set vpp settings interfaces 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']
Expand Down
Loading