diff options
| author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2026-01-30 15:21:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-30 15:21:10 +0200 |
| commit | ff57a67e853272f14c7c3bc5e086b915d00b3511 (patch) | |
| tree | 4791a7357712603bf5b5421cd87ffd1cc84e6da9 | |
| parent | 1af4e423a17064e3e6d87b0c5df1c01688b6551a (diff) | |
| parent | 04962c8683000d293aad5460144f3c10111beeb8 (diff) | |
| download | vyos-1x-ff57a67e853272f14c7c3bc5e086b915d00b3511.tar.gz vyos-1x-ff57a67e853272f14c7c3bc5e086b915d00b3511.zip | |
Merge pull request #4955 from natali-rs1985/T8202
vpp: T8202: Remove XDP driver and options from CLI and config
| -rw-r--r-- | data/templates/vpp/startup.conf.j2 | 1 | ||||
| -rw-r--r-- | interface-definitions/include/version/vpp-version.xml.i | 2 | ||||
| -rw-r--r-- | interface-definitions/vpp.xml.in | 70 | ||||
| -rw-r--r-- | python/vyos/vpp/config_verify.py | 11 | ||||
| -rw-r--r-- | smoketest/configs/assert/vpp | 8 | ||||
| -rwxr-xr-x | smoketest/scripts/cli/test_vpp.py | 26 | ||||
| -rwxr-xr-x | src/conf_mode/interfaces_ethernet.py | 15 | ||||
| -rwxr-xr-x | src/conf_mode/vpp.py | 59 | ||||
| -rw-r--r-- | src/migration-scripts/vpp/4-to-5 | 35 |
9 files changed, 97 insertions, 130 deletions
diff --git a/data/templates/vpp/startup.conf.j2 b/data/templates/vpp/startup.conf.j2 index b5b4853ce..a78f45cde 100644 --- a/data/templates/vpp/startup.conf.j2 +++ b/data/templates/vpp/startup.conf.j2 @@ -84,7 +84,6 @@ physmem { plugins { plugin default { disable } - plugin af_xdp_plugin.so { enable } plugin avf_plugin.so { enable } plugin dpdk_plugin.so { enable } plugin vmxnet3_plugin.so { enable } diff --git a/interface-definitions/include/version/vpp-version.xml.i b/interface-definitions/include/version/vpp-version.xml.i index 416125dc7..f5301f056 100644 --- a/interface-definitions/include/version/vpp-version.xml.i +++ b/interface-definitions/include/version/vpp-version.xml.i @@ -1,3 +1,3 @@ <!-- include start from include/version/vpp-version.xml.i --> -<syntaxVersion component='vpp' version='4'></syntaxVersion> +<syntaxVersion component='vpp' version='5'></syntaxVersion> <!-- include end -->
\ No newline at end of file diff --git a/interface-definitions/vpp.xml.in b/interface-definitions/vpp.xml.in index e32841f9e..c49488b68 100644 --- a/interface-definitions/vpp.xml.in +++ b/interface-definitions/vpp.xml.in @@ -649,25 +649,6 @@ <constraintErrorMessage>Invalid interface name</constraintErrorMessage> </properties> <children> - <leafNode name="driver"> - <properties> - <help>Driver mode</help> - <completionHelp> - <list>dpdk xdp</list> - </completionHelp> - <valueHelp> - <format>dpdk</format> - <description>Data Plane Development Kit (DPDK)</description> - </valueHelp> - <valueHelp> - <format>xdp</format> - <description>eXpress Data Path (XDP)</description> - </valueHelp> - <constraint> - <regex>(dpdk|xdp)</regex> - </constraint> - </properties> - </leafNode> #include <include/vpp/iface_rx_mode.xml.i> <node name="dpdk-options"> <properties> @@ -732,57 +713,6 @@ </leafNode> </children> </node> - <node name="xdp-options"> - <properties> - <help>XDP settings</help> - </properties> - <children> - <leafNode name="num-rx-queues"> - <properties> - <help>Number of receive queues</help> - <valueHelp> - <format>u32:1-65535</format> - <description>Number of receive queues to connect to</description> - </valueHelp> - <valueHelp> - <format>all</format> - <description>All</description> - </valueHelp> - <constraint> - <regex>(all)</regex> - <validator name="numeric" argument="--range 1-65535"/> - </constraint> - </properties> - <defaultValue>all</defaultValue> - </leafNode> - <leafNode name="promisc"> - <properties> - <help>Enable promisc mode on a real interface</help> - <valueless/> - </properties> - </leafNode> - <leafNode name="rx-queue-size"> - <properties> - <help>Receive queue size</help> - #include <include/vpp/queue_size.xml.i> - </properties> - <defaultValue>0</defaultValue> - </leafNode> - <leafNode name="tx-queue-size"> - <properties> - <help>Tranceive queue size</help> - #include <include/vpp/queue_size.xml.i> - </properties> - <defaultValue>0</defaultValue> - </leafNode> - <leafNode name="zero-copy"> - <properties> - <help>Enable zero-copy mode</help> - <valueless/> - </properties> - </leafNode> - </children> - </node> </children> </tagNode> <node name="ipv6"> diff --git a/python/vyos/vpp/config_verify.py b/python/vyos/vpp/config_verify.py index d051ef359..823443be5 100644 --- a/python/vyos/vpp/config_verify.py +++ b/python/vyos/vpp/config_verify.py @@ -169,9 +169,14 @@ def verify_dev_driver(driver_type: str, driver: str) -> bool: if driver_type == 'dpdk': if driver in drivers_dpdk: return True - elif driver_type == 'xdp': - if driver in drivers_xdp: - return True + # XDP support is intentionally disabled (T8202). + # XDP is no longer configurable via the CLI. + # This logic is kept commented out to make it easy + # to reintroduce XDP if there is a clear need in the future. + # + # elif driver_type == 'xdp': + # if driver in drivers_xdp: + # return True else: raise ConfigError(f'"Driver type {driver_type} is wrong') diff --git a/smoketest/configs/assert/vpp b/smoketest/configs/assert/vpp index aa8cd8978..9d8c0a8e7 100644 --- a/smoketest/configs/assert/vpp +++ b/smoketest/configs/assert/vpp @@ -42,8 +42,8 @@ set vpp interfaces loopback lo12 description 'Loop12' set vpp interfaces vxlan vxlan10 remote '192.0.2.2' set vpp interfaces vxlan vxlan10 source-address '192.0.2.1' set vpp interfaces vxlan vxlan10 vni '10' -set vpp settings interface eth1 driver 'dpdk' -set vpp settings interface eth2 driver 'dpdk' -set vpp settings interface eth3 driver 'xdp' -set vpp settings interface eth4 driver 'dpdk' +set vpp settings interface eth1 +set vpp settings interface eth2 +set vpp settings interface eth3 +set vpp settings interface eth4 set vpp settings unix poll-sleep-usec '12' diff --git a/smoketest/scripts/cli/test_vpp.py b/smoketest/scripts/cli/test_vpp.py index 9723a79cd..7ca259ab2 100755 --- a/smoketest/scripts/cli/test_vpp.py +++ b/smoketest/scripts/cli/test_vpp.py @@ -37,7 +37,6 @@ from vyos.vpp.utils import vpp_iface_name_transform PROCESS_NAME = 'vpp_main' VPP_CONF = '/run/vpp/vpp.conf' base_path = ['vpp'] -driver = 'dpdk' interface = 'eth1' @@ -95,7 +94,7 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): # always forward to base class super().setUp() - self.cli_set(base_path + ['settings', 'interface', interface, 'driver', driver]) + self.cli_set(base_path + ['settings', 'interface', interface]) self.cli_set(base_path + ['settings', 'unix', 'poll-sleep-usec', '10']) def tearDown(self): @@ -1128,15 +1127,16 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): self.cli_set(base_path + ['settings', 'cpu', 'main-core', main_core]) self.cli_set(base_path + ['settings', 'cpu', 'workers', workers]) - # DPDK driver expect only dpdk-options and not xdp-options to be set - # expect raise ConfigError - self.cli_set(base_interface_path + ['xdp-options', 'zero-copy']) - - with self.assertRaises(ConfigSessionError): - self.cli_commit() + # # DPDK driver expect only dpdk-options and not xdp-options to be set + # # expect raise ConfigError + # self.cli_set(base_interface_path + ['xdp-options', 'zero-copy']) + # + # with self.assertRaises(ConfigSessionError): + # self.cli_commit() + # + # # delete xdp-options and apply commit + # self.cli_delete(base_interface_path + ['xdp-options']) - # delete xdp-options and apply commit - self.cli_delete(base_interface_path + ['xdp-options']) self.cli_commit() # check dpdk options in config file @@ -1296,7 +1296,7 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): inside_prefix = '100.64.0.0/24' outside_prefix = '192.0.2.1/32' - self.cli_set(base_path + ['settings', 'interface', iface_out, 'driver', driver]) + self.cli_set(base_path + ['settings', 'interface', iface_out]) self.cli_set(base_cgnat + ['interface', 'inside', iface_inside]) self.cli_set(base_cgnat + ['interface', 'outside', iface_out]) self.cli_set(base_cgnat + ['rule', '100', 'inside-prefix', inside_prefix]) @@ -1384,7 +1384,7 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): static_local_addr = '100.64.0.55' sess_limit = '64000' - self.cli_set(base_path + ['settings', 'interface', iface_out, 'driver', driver]) + self.cli_set(base_path + ['settings', 'interface', iface_out]) self.cli_set(base_nat + ['interface', 'inside', iface_inside]) self.cli_set(base_nat + ['interface', 'outside', iface_out]) self.cli_set( @@ -1501,7 +1501,7 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): for expected_entry in expected_entries: self.assertIn(expected_entry, out) - self.cli_set(base_path + ['settings', 'interface', iface_2, 'driver', driver]) + self.cli_set(base_path + ['settings', 'interface', iface_2]) self.cli_set(base_path + ['sflow', 'interface', iface_2]) self.cli_commit() diff --git a/src/conf_mode/interfaces_ethernet.py b/src/conf_mode/interfaces_ethernet.py index ffb59c89e..f01de48a1 100755 --- a/src/conf_mode/interfaces_ethernet.py +++ b/src/conf_mode/interfaces_ethernet.py @@ -448,7 +448,7 @@ def apply(ethernet): call_dependents() vpp_iface_config = dict_search(f'vpp.settings.interface.{ifname}', ethernet) - if vpp_iface_config and is_systemd_service_running('vpp.service'): + if vpp_iface_config is not None and is_systemd_service_running('vpp.service'): vpp_api = VPPControl() # Enable ip4-dhcp-client-detect feature for DHCP-configured interfaces. @@ -460,14 +460,13 @@ def apply(ethernet): # If the interface is managed by the VPP DPDK driver, synchronize runtime # parameters between Linux and the corresponding VPP LCP interface - if vpp_iface_config.get('driver') == 'dpdk': - # Find LCP pair - lcp_pair = vpp_api.lcp_pair_find(vpp_name_hw=ifname) + # Find LCP pair + lcp_pair = vpp_api.lcp_pair_find(vpp_name_hw=ifname) + # Sync MTU to VPP LCP pair interface + if lcp_pair: lcp_name = lcp_pair.get('vpp_name_kernel') - # Sync MTU to VPP LCP pair interface - if lcp_name: - mtu = e.get_mtu() - vpp_api.set_iface_mtu(lcp_name, mtu) + mtu = e.get_mtu() + vpp_api.set_iface_mtu(lcp_name, mtu) return None diff --git a/src/conf_mode/vpp.py b/src/conf_mode/vpp.py index 274cd1da5..79c46bde8 100755 --- a/src/conf_mode/vpp.py +++ b/src/conf_mode/vpp.py @@ -30,7 +30,7 @@ from vyos import airbag from vyos.base import Warning from vyos.config import Config, config_dict_merge from vyos.configdep import set_dependents, call_dependents -from vyos.configdict import node_changed, leaf_node_changed +from vyos.configdict import node_changed from vyos.ifconfig import Section from vyos.logger import getLogger from vyos.template import render @@ -256,9 +256,7 @@ def get_config(config=None): for removed_iface in tmp: to_append = { 'iface_name': removed_iface, - 'driver': effective_config['settings']['interface'][removed_iface][ - 'driver' - ], + 'driver': 'dpdk', } removed_ifaces.append(to_append) # add an interface to a list of interfaces that need @@ -296,12 +294,15 @@ def get_config(config=None): # dictionary retrieved. default_values = conf.get_config_defaults(**config.kwargs, recursive=True) - # delete driver-incompatible defaults - for iface, iface_config in config.get('settings', {}).get('interface', {}).items(): - if iface_config.get('driver') == 'dpdk': - del default_values['settings']['interface'][iface]['xdp_options'] - elif iface_config.get('driver') == 'xdp': - del default_values['settings']['interface'][iface]['dpdk_options'] + # Since XDP is no longer configurable via the CLI (T8202), + # this code is kept commented out to simplify reintroducing XDP in the future. + # + # # delete driver-incompatible defaults + # for iface, iface_config in config.get('settings', {}).get('interface', {}).items(): + # if iface_config.get('driver') == 'dpdk': + # del default_values['settings']['interface'][iface]['xdp_options'] + # elif iface_config.get('driver') == 'xdp': + # del default_values['settings']['interface'][iface]['dpdk_options'] config = config_dict_merge(default_values, config) @@ -317,6 +318,8 @@ def get_config(config=None): effective_config = config_dict_merge(default_values_effective, effective_config) # Buffer normalization (auto → computed) _normalize_buffers(effective_config) + for iface_config in effective_config['settings']['interface'].values(): + iface_config['driver'] = 'dpdk' config['effective'] = effective_config # Save important info about all interfaces that cannot be retrieved later @@ -336,18 +339,14 @@ def get_config(config=None): if 'settings' in config: if 'interface' in config['settings']: for iface, iface_config in config['settings']['interface'].items(): - # Driver must be configured to continue - if 'driver' not in iface_config: - raise ConfigError( - f'"driver" must be configured for {iface} interface!' - ) + iface_config['driver'] = 'dpdk' - old_driver = leaf_node_changed( - conf, base_settings + ['interface', iface, 'driver'] - ) - - if old_driver: - config['settings']['interface'][iface]['driver_changed'] = {} + # old_driver = leaf_node_changed( + # conf, base_settings + ['interface', iface, 'driver'] + # ) + # + # if old_driver: + # config['settings']['interface'][iface]['driver_changed'] = {} # Get current kernel module, required for extra verification and # logic for VMBus interfaces @@ -359,13 +358,13 @@ def get_config(config=None): iface_filter_eth(conf, iface) set_dependents('ethernet', conf, iface) # Interfaces with changed driver should be removed/readded - if old_driver and old_driver[0] == 'dpdk': - removed_ifaces.append( - { - 'iface_name': iface, - 'driver': 'dpdk', - } - ) + # if old_driver and old_driver[0] == 'dpdk': + # removed_ifaces.append( + # { + # 'iface_name': iface, + # 'driver': 'dpdk', + # } + # ) # Get PCI address or device ID if iface_config['driver'] == 'dpdk': @@ -380,8 +379,8 @@ def get_config(config=None): else: try: iface_to_search = iface - if old_driver and old_driver[0] == 'xdp': - iface_to_search = f'defunct_{iface}' + # if old_driver and old_driver[0] == 'xdp': + # iface_to_search = f'defunct_{iface}' iface_config['dpdk_options']['dev_id'] = ( control_host.get_dev_id(iface_to_search) ) diff --git a/src/migration-scripts/vpp/4-to-5 b/src/migration-scripts/vpp/4-to-5 new file mode 100644 index 000000000..4eaedc9a1 --- /dev/null +++ b/src/migration-scripts/vpp/4-to-5 @@ -0,0 +1,35 @@ +# Copyright VyOS maintainers and contributors <maintainers@vyos.io> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library. If not, see <http://www.gnu.org/licenses/>. + +# Delete node 'driver' and 'xdp-options' from CLI (T8202) + + +from vyos.configtree import ConfigTree + +base = ['vpp', 'settings', 'interface'] + +def migrate(config: ConfigTree) -> None: + if not config.exists(base): + # Nothing to do + return + + for iface_name in config.list_nodes(base): + base_driver = base + [iface_name, 'driver'] + base_xdp_options = base + [iface_name, 'xdp-options'] + if config.exists(base_driver): + # Delete 'driver' node + config.delete(base_driver) + if config.exists(base_xdp_options): + config.delete(base_xdp_options) |
