summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-09-24 19:27:16 +0200
committerChristian Poessinger <christian@poessinger.com>2022-09-24 19:27:16 +0200
commit13645bc2cfd31f1525078469f23e89491987e0ea (patch)
treec11dbcf3abd038d9259bffea5d11000afce08e57 /python
parent35d8141575c3677b7e70e053c416634fc55b3bf4 (diff)
downloadvyos-1x-13645bc2cfd31f1525078469f23e89491987e0ea.tar.gz
vyos-1x-13645bc2cfd31f1525078469f23e89491987e0ea.zip
ethernet: T3171: enable RPS (Receive Packet Steering) for all RX queues
The initial implementation in commit 9fb9e5cade ("ethernet: T3171: add CLI option to enable RPS (Receive Packet Steering)" only changed the CPU affinity for RX queue 0. This commit takes all RX queues into account.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig/ethernet.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/python/vyos/ifconfig/ethernet.py b/python/vyos/ifconfig/ethernet.py
index 32e667038..b260a00ef 100644
--- a/python/vyos/ifconfig/ethernet.py
+++ b/python/vyos/ifconfig/ethernet.py
@@ -71,10 +71,6 @@ class EthernetIf(Interface):
}}
_sysfs_set = {**Interface._sysfs_set, **{
- 'rps': {
- 'convert': lambda cpus: cpus if cpus else '0',
- 'location': '/sys/class/net/{ifname}/queues/rx-0/rps_cpus',
- },
'rfs': {
'convert': lambda num: num if num else '0',
'location': '/proc/sys/net/core/rps_sock_flow_entries',
@@ -251,6 +247,7 @@ class EthernetIf(Interface):
raise ValueError('Value out of range')
rps_cpus = '0'
+ queues = len(glob(f'/sys/class/net/{self.ifname}/queues/rx-*'))
if state:
# Enable RPS on all available CPUs except CPU0 which we will not
# utilize so the system has one spare core when it's under high
@@ -260,8 +257,11 @@ class EthernetIf(Interface):
# Linux will clip that internally!
rps_cpus = 'ffffffff,ffffffff,ffffffff,fffffffe'
+ for i in range(0, queues):
+ self._write_sysfs(f'/sys/class/net/{self.ifname}/queues/rx-{i}/rps_cpus', rps_cpus)
+
# send bitmask representation as hex string without leading '0x'
- return self.set_interface('rps', rps_cpus)
+ return True
def set_rfs(self, state):
rfs_flow = 0