diff options
| author | Oleksandr Kuchmystyi <o.kuchmystyi@vyos.io> | 2026-02-13 11:04:37 +0300 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2026-02-15 13:12:49 +0100 |
| commit | c536954a6a666f59185669cffa9efa79a601673c (patch) | |
| tree | 917eb28ab3f34a0abe4a6bf9c4bf7cd0902934fb | |
| parent | 4cc7959877a75bf01231aeec6dfd8c3b93660ba1 (diff) | |
| download | vyos-1x-c536954a6a666f59185669cffa9efa79a601673c.tar.gz vyos-1x-c536954a6a666f59185669cffa9efa79a601673c.zip | |
vpp: T8258: Move `poll-sleep-usec` out of `unix` section
Instead of `vpp settings unix poll-sleep-usec`
use `vpp settings poll-sleep-usec`.
| -rw-r--r-- | data/templates/vpp/startup.conf.j2 | 6 | ||||
| -rw-r--r-- | interface-definitions/vpp.xml.in | 29 | ||||
| -rw-r--r-- | smoketest/configs/assert/vpp | 2 | ||||
| -rwxr-xr-x | smoketest/scripts/cli/test_vpp.py | 8 | ||||
| -rw-r--r-- | src/migration-scripts/vpp/7-to-8 | 13 |
5 files changed, 29 insertions, 29 deletions
diff --git a/data/templates/vpp/startup.conf.j2 b/data/templates/vpp/startup.conf.j2 index e4c42c5b0..218e399d4 100644 --- a/data/templates/vpp/startup.conf.j2 +++ b/data/templates/vpp/startup.conf.j2 @@ -8,10 +8,8 @@ unix { gid vpp systemd-notify # exec /etc/vpp/bootstrap.vpp -{% if unix is vyos_defined %} -{% if unix.poll_sleep_usec is vyos_defined %} - poll-sleep-usec {{ unix.poll_sleep_usec }} -{% endif %} +{% if poll_sleep_usec is vyos_defined %} + poll-sleep-usec {{ poll_sleep_usec }} {% endif %} } diff --git a/interface-definitions/vpp.xml.in b/interface-definitions/vpp.xml.in index b431560d6..70e3e102c 100644 --- a/interface-definitions/vpp.xml.in +++ b/interface-definitions/vpp.xml.in @@ -891,26 +891,19 @@ </leafNode> </children> </node> - <node name="unix"> + <leafNode name="poll-sleep-usec"> <properties> - <help>Unix settings</help> + <help>Add a fixed-sleep between main loop poll</help> + <valueHelp> + <format>u32:0-500000</format> + <description>Sleep interval in microseconds</description> + </valueHelp> + <constraint> + <validator name="numeric" argument="--range 0-500000"/> + </constraint> </properties> - <children> - <leafNode name="poll-sleep-usec"> - <properties> - <help>Add a fixed-sleep between main loop poll</help> - <valueHelp> - <format>u32:0-500000</format> - <description>Sleep interval in microseconds</description> - </valueHelp> - <constraint> - <validator name="numeric" argument="--range 0-500000"/> - </constraint> - </properties> - <defaultValue>0</defaultValue> - </leafNode> - </children> - </node> + <defaultValue>0</defaultValue> + </leafNode> </children> </node> <node name="sflow" owner="${vyos_conf_scripts_dir}/vpp_sflow.py"> diff --git a/smoketest/configs/assert/vpp b/smoketest/configs/assert/vpp index 9ca3028fc..c75ab8aa9 100644 --- a/smoketest/configs/assert/vpp +++ b/smoketest/configs/assert/vpp @@ -46,5 +46,5 @@ 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' +set vpp settings poll-sleep-usec '12' set vpp settings logging default-level 'debug' diff --git a/smoketest/scripts/cli/test_vpp.py b/smoketest/scripts/cli/test_vpp.py index 3fb23fe6c..6cc70a4ac 100755 --- a/smoketest/scripts/cli/test_vpp.py +++ b/smoketest/scripts/cli/test_vpp.py @@ -95,7 +95,7 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): super().setUp() self.cli_set(base_path + ['settings', 'interface', interface]) - self.cli_set(base_path + ['settings', 'unix', 'poll-sleep-usec', '10']) + self.cli_set(base_path + ['settings', 'poll-sleep-usec', '10']) def tearDown(self): try: @@ -128,7 +128,7 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): self.cli_commit() self.cli_set(base_path + ['settings', 'cpu', 'main-core', main_core]) - self.cli_set(base_path + ['settings', 'unix', 'poll-sleep-usec', poll_sleep]) + self.cli_set(base_path + ['settings', 'poll-sleep-usec', poll_sleep]) # commit changes self.cli_commit() @@ -302,7 +302,7 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): self.assertEqual(kernel_address, current_address) # change vpp settings - self.cli_set(base_path + ['settings', 'unix', 'poll-sleep-usec', '5']) + self.cli_set(base_path + ['settings', 'poll-sleep-usec', '5']) self.cli_commit() config = read_file(VPP_CONF) @@ -1662,7 +1662,7 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): self.cli_commit() # Change VPP configuration - self.cli_set(base_path + ['settings', 'unix', 'poll-sleep-usec', '50']) + self.cli_set(base_path + ['settings', 'poll-sleep-usec', '50']) # Ensure arp entry is not disappeared _, neighbors = rc_cmd('sudo ip neighbor') diff --git a/src/migration-scripts/vpp/7-to-8 b/src/migration-scripts/vpp/7-to-8 index 1e95bb43e..fa105a6b5 100644 --- a/src/migration-scripts/vpp/7-to-8 +++ b/src/migration-scripts/vpp/7-to-8 @@ -21,16 +21,24 @@ # # Delete 'ipsec' node and all settings and replace it with single 'ipsec-acceleration' flag (T8262) - from vyos.configtree import ConfigTree +def _migrate_vpp_unix_settings(config: ConfigTree) -> None: + base_path = ['vpp', 'settings'] + old_base_path = base_path + ['unix'] + old_path = old_base_path + ['poll-sleep-usec'] + new_path = base_path + ['poll-sleep-usec'] + + if config.exists(old_path): + poll_sleep_usec = config.return_value(old_path) + config.set(new_path, value=poll_sleep_usec) + config.delete(old_base_path) def _migrate_vpp_log(config: ConfigTree) -> None: base = ['vpp', 'settings', 'logging'] if config.exists(base + ['default-log-level']): config.rename(base + ['default-log-level'], 'default-level') - def _migrate_vpp_nat44(config: ConfigTree) -> None: base_path = ['vpp', 'nat44'] new_base_path = ['vpp', 'nat', 'nat44'] @@ -69,6 +77,7 @@ def migrate(config: ConfigTree) -> None: # Nothing to do return + _migrate_vpp_unix_settings(config) _migrate_vpp_log(config) _migrate_vpp_nat44(config) _migrate_vpp_ipsec(config) |
