summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2026-01-30 15:21:10 +0200
committerGitHub <noreply@github.com>2026-01-30 15:21:10 +0200
commitff57a67e853272f14c7c3bc5e086b915d00b3511 (patch)
tree4791a7357712603bf5b5421cd87ffd1cc84e6da9 /src
parent1af4e423a17064e3e6d87b0c5df1c01688b6551a (diff)
parent04962c8683000d293aad5460144f3c10111beeb8 (diff)
downloadvyos-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
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/interfaces_ethernet.py15
-rwxr-xr-xsrc/conf_mode/vpp.py59
-rw-r--r--src/migration-scripts/vpp/4-to-535
3 files changed, 71 insertions, 38 deletions
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)