Skip to content

Commit daae577

Browse files
committed
T7897: VPP: fix rx-mode interrupt for XDP driver with workers
Remove no-syscall-lock from CLI and enable this option if interrupt/adaptive mode is enabled and workers are configured. Also forbid interrupt mode for ixgbevf driver
1 parent fc178aa commit daae577

File tree

7 files changed

+45
-12
lines changed

7 files changed

+45
-12
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<!-- include start from include/version/vpp-version.xml.i -->
2-
<syntaxVersion component='vpp' version='1'></syntaxVersion>
2+
<syntaxVersion component='vpp' version='2'></syntaxVersion>
33
<!-- include end -->

interface-definitions/vpp.xml.in

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -561,12 +561,6 @@
561561
<help>XDP settings</help>
562562
</properties>
563563
<children>
564-
<leafNode name="no-syscall-lock">
565-
<properties>
566-
<help>Unlock multithreading in interrupt and adaptive modes</help>
567-
<valueless/>
568-
</properties>
569-
</leafNode>
570564
<leafNode name="num-rx-queues">
571565
<properties>
572566
<help>Number of receive queues</help>

python/vyos/vpp/control_vpp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ def xdp_iface_create(
378378
if mode != 'auto':
379379
mode_resolve: dict[str, int] = {'auto': 0, 'copy': 1, 'zero-copy': 2}
380380
api_call_args['mode'] = mode_resolve[mode]
381-
if flags == 'no_systcall_lock':
381+
if flags == 'no_syscall_lock':
382382
api_call_args['flags'] = 1
383383
return self.__vpp_api_client.api.af_xdp_create_v3(**api_call_args)
384384

smoketest/configs/vpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ vpp {
112112
driver "dpdk"
113113
}
114114
interface eth3 {
115-
driver "dpdk"
115+
driver "xdp"
116+
xdp-options {
117+
no-syscall-lock
118+
}
116119
}
117120
interface eth4 {
118121
driver "dpdk"

smoketest/scripts/cli/test_vpp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ def test_10_vpp_driver_options(self):
11011101

11021102
# DPDK driver expect only dpdk-options and not xdp-options to be set
11031103
# expect raise ConfigError
1104-
self.cli_set(base_interface_path + ['xdp-options', 'no-syscall-lock'])
1104+
self.cli_set(base_interface_path + ['xdp-options', 'zero-copy'])
11051105

11061106
with self.assertRaises(ConfigSessionError):
11071107
self.cli_commit()

src/conf_mode/vpp.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@
107107
'igb': ['xdp'],
108108
'igc': ['dpdk', 'xdp'],
109109
'ixgbe': ['dpdk', 'xdp'],
110-
'ixgbevf': ['dpdk'],
111110
'qede': ['dpdk', 'xdp'],
112111
'vmxnet3': ['xdp'],
113112
'virtio_net': ['xdp'],
@@ -338,7 +337,10 @@ def get_config(config=None):
338337
)
339338
if 'zero-copy' in iface_config['xdp_options']:
340339
xdp_api_params['mode'] = 'zero-copy'
341-
if 'zero-copy' in iface_config['xdp_options']:
340+
if iface_config.get('rx_mode') in ('interrupt', 'adaptive') and any(
341+
key in config['settings'].get('cpu', {})
342+
for key in ('workers', 'corelist_workers')
343+
):
342344
xdp_api_params['flags'] = 'no_syscall_lock'
343345
iface_config['xdp_api_params'] = xdp_api_params
344346

src/migration-scripts/vpp/1-to-2

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright VyOS maintainers and contributors <[email protected]>
2+
#
3+
# This library is free software; you can redistribute it and/or
4+
# modify it under the terms of the GNU Lesser General Public
5+
# License as published by the Free Software Foundation; either
6+
# version 2.1 of the License, or (at your option) any later version.
7+
#
8+
# This library is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11+
# Lesser General Public License for more details.
12+
#
13+
# You should have received a copy of the GNU Lesser General Public License
14+
# along with this library. If not, see <http://www.gnu.org/licenses/>.
15+
16+
# Delete 'vpp settings interface ethX xdp-options no-syscall-lock'
17+
# since it is set automatically
18+
19+
from vyos.configtree import ConfigTree
20+
21+
base = ['vpp', 'settings', 'interface']
22+
23+
def migrate(config: ConfigTree) -> None:
24+
if not config.exists(base):
25+
# Nothing to do
26+
return
27+
28+
for iface_name in config.list_nodes(base):
29+
xdp_options_base = base + [iface_name, 'xdp-options']
30+
if config.exists(xdp_options_base + ['no-syscall-lock']):
31+
# Delete no-syscall-lock option from configuration
32+
config.delete(xdp_options_base + ['no-syscall-lock'])
33+
if config.exists(xdp_options_base) and len(config.list_nodes(xdp_options_base)) == 0:
34+
config.delete(xdp_options_base)

0 commit comments

Comments
 (0)