summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-09-15 14:11:37 +0200
committerChristian Poessinger <christian@poessinger.com>2022-09-15 14:11:41 +0200
commit3e24e673537c0ae59a1d1012f9b70920294caba2 (patch)
tree41420b6c3b38a4a8328ebf8451c45d74a0ab5f17 /smoketest
parente976ee9ed5d18c62fb3cfc6980ac1dc485b9fa20 (diff)
downloadvyos-1x-3e24e673537c0ae59a1d1012f9b70920294caba2.tar.gz
vyos-1x-3e24e673537c0ae59a1d1012f9b70920294caba2.zip
smoketest: ethernet: rfs: T4689: also test default "0" case
In addition to verify the queue lengths when CLI option is set, we also need to verify that all values are resetted back to "0" which is the Kernel default.
Diffstat (limited to 'smoketest')
-rwxr-xr-xsmoketest/scripts/cli/test_interfaces_ethernet.py35
1 files changed, 27 insertions, 8 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_ethernet.py b/smoketest/scripts/cli/test_interfaces_ethernet.py
index 529655f6a..5049bd5b0 100755
--- a/smoketest/scripts/cli/test_interfaces_ethernet.py
+++ b/smoketest/scripts/cli/test_interfaces_ethernet.py
@@ -192,17 +192,36 @@ class EthernetInterfaceTest(BasicInterfaceTest.TestCase):
for interface in self._interfaces:
self.cli_set(self._base_path + [interface, 'offload', 'rfs'])
+
self.cli_commit()
for interface in self._interfaces:
- queues = glob(f'/sys/class/net/{interface}/queues/rx-*')
- rfs_flow = global_rfs_flow/len(queues)
- for i in range(0,len(queues)):
- flows = read_file(f'/sys/class/net/{interface}/queues/rx-{i}/rps_flow_cnt')
- self.assertEqual(int(flows), int(rfs_flow))
-
- global_flows = read_file(f'/proc/sys/net/core/rps_sock_flow_entries')
- self.assertEqual(int(global_flows), int(global_rfs_flow))
+ queues = len(glob(f'/sys/class/net/{interface}/queues/rx-*'))
+ rfs_flow = int(global_rfs_flow/queues)
+ for i in range(0, queues):
+ tmp = read_file(f'/sys/class/net/{interface}/queues/rx-{i}/rps_flow_cnt')
+ self.assertEqual(int(tmp), rfs_flow)
+
+ tmp = read_file(f'/proc/sys/net/core/rps_sock_flow_entries')
+ self.assertEqual(int(tmp), global_rfs_flow)
+
+
+ # delete configuration of RFS and check all values returned to default "0"
+ for interface in self._interfaces:
+ self.cli_delete(self._base_path + [interface, 'offload', 'rfs'])
+
+ self.cli_commit()
+
+ for interface in self._interfaces:
+ queues = len(glob(f'/sys/class/net/{interface}/queues/rx-*'))
+ rfs_flow = int(global_rfs_flow/queues)
+ for i in range(0, queues):
+ tmp = read_file(f'/sys/class/net/{interface}/queues/rx-{i}/rps_flow_cnt')
+ self.assertEqual(int(tmp), 0)
+
+ tmp = read_file(f'/proc/sys/net/core/rps_sock_flow_entries')
+ self.assertEqual(int(tmp), 0)
+
def test_non_existing_interface(self):
unknonw_interface = self._base_path + ['eth667']