diff options
author | jack9603301 <jack9603301@163.com> | 2022-09-12 00:14:59 +0800 |
---|---|---|
committer | jack9603301 <jack9603301@163.com> | 2022-09-12 02:57:37 +0800 |
commit | 53355271a2864d844daca89a064c21e514e10adb (patch) | |
tree | 2d5a18bded2ef2f3d13bb15a069827756cc640d9 /smoketest | |
parent | 1a2a1591cc7382bd0b484ea4e564e704a14f42d4 (diff) | |
download | vyos-1x-53355271a2864d844daca89a064c21e514e10adb.tar.gz vyos-1x-53355271a2864d844daca89a064c21e514e10adb.zip |
rfs: T4689: Support RFS(Receive Flow Steering)
Diffstat (limited to 'smoketest')
-rwxr-xr-x | smoketest/scripts/cli/test_interfaces_ethernet.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_ethernet.py b/smoketest/scripts/cli/test_interfaces_ethernet.py index 05d2ae5f5..fa6ba46a5 100755 --- a/smoketest/scripts/cli/test_interfaces_ethernet.py +++ b/smoketest/scripts/cli/test_interfaces_ethernet.py @@ -18,6 +18,7 @@ import os import re import unittest +from glob import glob from netifaces import AF_INET from netifaces import AF_INET6 from netifaces import ifaddresses @@ -185,6 +186,24 @@ class EthernetInterfaceTest(BasicInterfaceTest.TestCase): self.assertEqual(f'{cpus:x}', f'{rps_cpus:x}') + def test_offloading_rfs(self): + global_rfs_flow = 32768 + rfs_flow = global_rfs_flow + + 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/queues + for i in range(0,queues): + flows = read_file(f'/sys/class/net/{interface}/queues/rx-{i}/rps_cpus') + self.assertEqual(int(flows), rfs_flow) + + global_flows = read_file(f'/proc/sys/net/core/rps_sock_flow_entries') + self.assertEqual(int(global_flows), global_rfs_flow) + def test_non_existing_interface(self): unknonw_interface = self._base_path + ['eth667'] self.cli_set(unknonw_interface) |