Skip to content

Commit 929f85d

Browse files
committed
T7999: VPP add support iavf driver
Add support the iavf driver (virtual function)
1 parent cfb2a5e commit 929f85d

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

interface-definitions/vpp.xml.in

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,18 @@
785785
</node>
786786
</children>
787787
</tagNode>
788+
<node name="interfaces">
789+
<properties>
790+
<help>Interfaces settings</help>
791+
</properties>
792+
<children>
793+
<leafNode name="allow-unsupported-nics">
794+
<properties>
795+
<help>Allow VPP to use untested NICs. This disables official support for this system</help>
796+
</properties>
797+
</leafNode>
798+
</children>
799+
</node>
788800
<node name="ipv6">
789801
<properties>
790802
<help>IPv6 settings</help>

python/vyos/vpp/config_verify.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
from vyos.vpp.utils import human_memory_to_bytes, bytes_to_human_memory
2929

3030

31+
# Community-tested DPDK drivers / not officially supported by VyOS
32+
community_drivers_dpdk: list[str] = [
33+
'iavf',
34+
]
35+
36+
3137
def verify_vpp_remove_kernel_interface(config: dict):
3238
"""Common verify for removed kernel-interfaces.
3339
Verify that removed kernel interface are not used in 'vpp kernel-interfaces'.
@@ -172,6 +178,12 @@ def verify_dev_driver(iface_name: str, driver_type: str) -> bool:
172178
if driver_type == 'dpdk':
173179
if driver in drivers_dpdk:
174180
return True
181+
if driver in community_drivers_dpdk:
182+
Warning(
183+
f"Driver '{driver}' on interface {iface_name} is community-supported and not tested by VyOS "
184+
f"This disables official support for this system."
185+
)
186+
return True
175187
elif driver_type == 'xdp':
176188
if driver in drivers_xdp:
177189
return True

src/conf_mode/vpp.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
from vyos.vpp import control_host
4545
from vyos.vpp.config_deps import deps_xconnect_dict
4646
from vyos.vpp.config_verify import (
47+
community_drivers_dpdk,
4748
verify_dev_driver,
4849
verify_vpp_minimum_cpus,
4950
verify_vpp_minimum_memory,
@@ -549,6 +550,16 @@ def verify(config):
549550
raise ConfigError(
550551
f'Driver {iface_config["driver"]} is not compatible with interface {iface}!'
551552
)
553+
is_community_dpdk_driver = (
554+
iface_config['kernel_module'] in community_drivers_dpdk
555+
)
556+
if is_community_dpdk_driver and 'allow-unsupported-nics' not in config.get(
557+
'settings', {}
558+
).get('interfaces', {}):
559+
raise ConfigError(
560+
f'Driver {iface_config["driver"]} is not compatible with interface {iface}!'
561+
)
562+
552563
if iface_config['driver'] == 'xdp' and 'xdp_options' in iface_config:
553564
if iface_config['xdp_options']['num_rx_queues'] != 'all':
554565
rx_queues = iface_config['xdp_api_params']['rxq_num']

0 commit comments

Comments
 (0)