Skip to content
Merged
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
2 changes: 1 addition & 1 deletion interface-definitions/include/version/vpp-version.xml.i
Original file line number Diff line number Diff line change
@@ -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 -->
6 changes: 0 additions & 6 deletions interface-definitions/vpp.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion python/vyos/vpp/control_vpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def xdp_iface_create(
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)

Expand Down
2 changes: 1 addition & 1 deletion smoketest/config-tests/vpp
Original file line number Diff line number Diff line change
Expand Up @@ -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'
5 changes: 4 additions & 1 deletion smoketest/configs/vpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ vpp {
driver "dpdk"
}
interface eth3 {
driver "dpdk"
driver "xdp"
xdp-options {
no-syscall-lock
}
}
interface eth4 {
driver "dpdk"
Expand Down
2 changes: 1 addition & 1 deletion smoketest/scripts/cli/test_vpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ def test_10_vpp_driver_options(self):

# 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()
Expand Down
6 changes: 4 additions & 2 deletions src/conf_mode/vpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
'igb': ['xdp'],
'igc': ['dpdk', 'xdp'],
'ixgbe': ['dpdk', 'xdp'],
'ixgbevf': ['dpdk'],
'qede': ['dpdk', 'xdp'],
'vmxnet3': ['xdp'],
'virtio_net': ['xdp'],
Expand Down Expand Up @@ -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

Expand Down
34 changes: 34 additions & 0 deletions src/migration-scripts/vpp/1-to-2
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright VyOS maintainers and contributors <[email protected]>
#
# 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)
Loading