summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2025-10-16 15:04:28 +0300
committerGitHub <noreply@github.com>2025-10-16 15:04:28 +0300
commitd8dc670cd3eb7c9d0e41d8211284e1469657cc42 (patch)
treec799075502db2f43530a4ac94e285661aa5f0825
parent4f46ade201e49d78a376d76f3dfd541c41f8636d (diff)
parent5e2e4a8f183f9723d4967ce47045f8789b58e924 (diff)
downloadvyos-1x-d8dc670cd3eb7c9d0e41d8211284e1469657cc42.tar.gz
vyos-1x-d8dc670cd3eb7c9d0e41d8211284e1469657cc42.zip
Merge pull request #4781 from natali-rs1985/T7897
T7897: VPP: fix rx-mode interrupt for XDP driver with workers
-rw-r--r--interface-definitions/include/version/vpp-version.xml.i2
-rw-r--r--interface-definitions/vpp.xml.in6
-rw-r--r--python/vyos/vpp/control_vpp.py2
-rw-r--r--smoketest/config-tests/vpp2
-rw-r--r--smoketest/configs/vpp5
-rwxr-xr-xsmoketest/scripts/cli/test_vpp.py2
-rwxr-xr-xsrc/conf_mode/vpp.py6
-rw-r--r--src/migration-scripts/vpp/1-to-234
8 files changed, 46 insertions, 13 deletions
diff --git a/interface-definitions/include/version/vpp-version.xml.i b/interface-definitions/include/version/vpp-version.xml.i
index 96a69c92f..205e87916 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='1'></syntaxVersion>
+<syntaxVersion component='vpp' version='2'></syntaxVersion>
<!-- include end --> \ No newline at end of file
diff --git a/interface-definitions/vpp.xml.in b/interface-definitions/vpp.xml.in
index c45d89b94..911c6f668 100644
--- a/interface-definitions/vpp.xml.in
+++ b/interface-definitions/vpp.xml.in
@@ -561,12 +561,6 @@
<help>XDP settings</help>
</properties>
<children>
- <leafNode name="no-syscall-lock">
- <properties>
- <help>Unlock multithreading in interrupt and adaptive modes</help>
- <valueless/>
- </properties>
- </leafNode>
<leafNode name="num-rx-queues">
<properties>
<help>Number of receive queues</help>
diff --git a/python/vyos/vpp/control_vpp.py b/python/vyos/vpp/control_vpp.py
index 42e7bf6c1..41b4573a5 100644
--- a/python/vyos/vpp/control_vpp.py
+++ b/python/vyos/vpp/control_vpp.py
@@ -378,7 +378,7 @@ class VPPControl:
if mode != 'auto':
mode_resolve: dict[str, int] = {'auto': 0, 'copy': 1, 'zero-copy': 2}
api_call_args['mode'] = mode_resolve[mode]
- if flags == 'no_systcall_lock':
+ if flags == 'no_syscall_lock':
api_call_args['flags'] = 1
return self.__vpp_api_client.api.af_xdp_create_v3(**api_call_args)
diff --git a/smoketest/config-tests/vpp b/smoketest/config-tests/vpp
index 12ea24884..aa8cd8978 100644
--- a/smoketest/config-tests/vpp
+++ b/smoketest/config-tests/vpp
@@ -44,6 +44,6 @@ 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 'dpdk'
+set vpp settings interface eth3 driver 'xdp'
set vpp settings interface eth4 driver 'dpdk'
set vpp settings unix poll-sleep-usec '12'
diff --git a/smoketest/configs/vpp b/smoketest/configs/vpp
index 7e82d04ee..82519da9d 100644
--- a/smoketest/configs/vpp
+++ b/smoketest/configs/vpp
@@ -112,7 +112,10 @@ vpp {
driver "dpdk"
}
interface eth3 {
- driver "dpdk"
+ driver "xdp"
+ xdp-options {
+ no-syscall-lock
+ }
}
interface eth4 {
driver "dpdk"
diff --git a/smoketest/scripts/cli/test_vpp.py b/smoketest/scripts/cli/test_vpp.py
index 19e24e7f4..6b8f3061d 100755
--- a/smoketest/scripts/cli/test_vpp.py
+++ b/smoketest/scripts/cli/test_vpp.py
@@ -1101,7 +1101,7 @@ class TestVPP(VyOSUnitTestSHIM.TestCase):
# DPDK driver expect only dpdk-options and not xdp-options to be set
# expect raise ConfigError
- self.cli_set(base_interface_path + ['xdp-options', 'no-syscall-lock'])
+ self.cli_set(base_interface_path + ['xdp-options', 'zero-copy'])
with self.assertRaises(ConfigSessionError):
self.cli_commit()
diff --git a/src/conf_mode/vpp.py b/src/conf_mode/vpp.py
index 204d8c6b7..7124c738a 100755
--- a/src/conf_mode/vpp.py
+++ b/src/conf_mode/vpp.py
@@ -107,7 +107,6 @@ drivers_support_interrupt: dict[str, list] = {
'igb': ['xdp'],
'igc': ['dpdk', 'xdp'],
'ixgbe': ['dpdk', 'xdp'],
- 'ixgbevf': ['dpdk'],
'qede': ['dpdk', 'xdp'],
'vmxnet3': ['xdp'],
'virtio_net': ['xdp'],
@@ -338,7 +337,10 @@ def get_config(config=None):
)
if 'zero-copy' in iface_config['xdp_options']:
xdp_api_params['mode'] = 'zero-copy'
- if 'zero-copy' in iface_config['xdp_options']:
+ if iface_config.get('rx_mode') in ('interrupt', 'adaptive') and any(
+ key in config['settings'].get('cpu', {})
+ for key in ('workers', 'corelist_workers')
+ ):
xdp_api_params['flags'] = 'no_syscall_lock'
iface_config['xdp_api_params'] = xdp_api_params
diff --git a/src/migration-scripts/vpp/1-to-2 b/src/migration-scripts/vpp/1-to-2
new file mode 100644
index 000000000..822799cc6
--- /dev/null
+++ b/src/migration-scripts/vpp/1-to-2
@@ -0,0 +1,34 @@
+# 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 'vpp settings interface ethX xdp-options no-syscall-lock'
+# since it is set automatically
+
+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):
+ xdp_options_base = base + [iface_name, 'xdp-options']
+ if config.exists(xdp_options_base + ['no-syscall-lock']):
+ # Delete no-syscall-lock option from configuration
+ config.delete(xdp_options_base + ['no-syscall-lock'])
+ if config.exists(xdp_options_base) and len(config.list_nodes(xdp_options_base)) == 0:
+ config.delete(xdp_options_base)