Skip to content

Commit

Permalink
smoketest: ethernet: rfs: T4689: also test default "0" case
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
c-po committed Sep 15, 2022
1 parent e976ee9 commit 3e24e67
Showing 1 changed file with 27 additions and 8 deletions.
35 changes: 27 additions & 8 deletions smoketest/scripts/cli/test_interfaces_ethernet.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,17 +192,36 @@ def test_offloading_rfs(self):

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']
Expand Down

0 comments on commit 3e24e67

Please sign in to comment.