summaryrefslogtreecommitdiff
path: root/smoketest/scripts
diff options
context:
space:
mode:
authorjack9603301 <jack9603301@163.com>2022-09-13 16:03:49 +0800
committerjack9603301 <jack9603301@163.com>2022-09-15 16:09:11 +0800
commitac4e07f96ae329bab51c3da8596a2b975a0f3f17 (patch)
tree579ccb9a943306df74bd06ae3f7fc7c38029aab0 /smoketest/scripts
parentd283048d3858e95b37df96f0a8acb5fc4223aa43 (diff)
downloadvyos-1x-ac4e07f96ae329bab51c3da8596a2b975a0f3f17.tar.gz
vyos-1x-ac4e07f96ae329bab51c3da8596a2b975a0f3f17.zip
rfs: T4689: Support RFS(Receive Flow Steering)
Diffstat (limited to 'smoketest/scripts')
-rwxr-xr-xsmoketest/scripts/cli/test_interfaces_ethernet.py19
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..529655f6a 100755
--- a/smoketest/scripts/cli/test_interfaces_ethernet.py
+++ b/smoketest/scripts/cli/test_interfaces_ethernet.py
@@ -17,6 +17,7 @@
import os
import re
import unittest
+from glob import glob
from netifaces import AF_INET
from netifaces import AF_INET6
@@ -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/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))
+
def test_non_existing_interface(self):
unknonw_interface = self._base_path + ['eth667']
self.cli_set(unknonw_interface)