From 3e24e673537c0ae59a1d1012f9b70920294caba2 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 15 Sep 2022 14:11:37 +0200 Subject: 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. --- smoketest/scripts/cli/test_interfaces_ethernet.py | 35 +++++++++++++++++------ 1 file changed, 27 insertions(+), 8 deletions(-) (limited to 'smoketest/scripts') 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'] -- cgit v1.2.3