diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-09-26 20:10:02 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-09-26 20:31:14 +0200 |
commit | 5fe0e9c163ee2f8229e298fc20dbfe6746c2cdcc (patch) | |
tree | bf1b410c0595f1509ed7d449c567c1d049dfbc0e /python/vyos/ifconfig/ethernet.py | |
parent | 2cf6275eac10d7f7bfed70e374d2fb34eaf4a7c2 (diff) | |
download | vyos-1x-5fe0e9c163ee2f8229e298fc20dbfe6746c2cdcc.tar.gz vyos-1x-5fe0e9c163ee2f8229e298fc20dbfe6746c2cdcc.zip |
ethernet: T4689: support asymetric RFS configuration on multiple interfaces
The initial implementation from commit ac4e07f9 ("rfs: T4689: Support RFS
(Receive Flow Steering)") always adjusted the global rps_sock_flow_entries
configuration. So if RFS was enabled for one NIC but not the other - it did not
work.
According to the documentation:
RFS is only available if the kconfig symbol CONFIG_RPS is enabled (on by
default for SMP). The functionality remains disabled until explicitly
configured. The number of entries in the global flow table is set through:
/proc/sys/net/core/rps_sock_flow_entries
The number of entries in the per-queue flow table are set through:
/sys/class/net/<dev>/queues/rx-<n>/rps_flow_cnt
Both of these need to be set before RFS is enabled for a receive queue. Values
for both are rounded up to the nearest power of two. The suggested flow count
depends on the expected number of active connections at any given time, which
may be significantly less than the number of open connections. We have found
that a value of 32768 for rps_sock_flow_entries works fairly well on a
moderately loaded server.
This commit sets rps_sock_flow_entries via sysctl on bootup leafing the RFS
configuration to the interface level.
Diffstat (limited to 'python/vyos/ifconfig/ethernet.py')
-rw-r--r-- | python/vyos/ifconfig/ethernet.py | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/python/vyos/ifconfig/ethernet.py b/python/vyos/ifconfig/ethernet.py index b260a00ef..519cfc58c 100644 --- a/python/vyos/ifconfig/ethernet.py +++ b/python/vyos/ifconfig/ethernet.py @@ -70,13 +70,6 @@ class EthernetIf(Interface): }, }} - _sysfs_set = {**Interface._sysfs_set, **{ - 'rfs': { - 'convert': lambda num: num if num else '0', - 'location': '/proc/sys/net/core/rps_sock_flow_entries', - }, - }} - def __init__(self, ifname, **kargs): super().__init__(ifname, **kargs) self.ethtool = Ethtool(ifname) @@ -265,13 +258,11 @@ class EthernetIf(Interface): def set_rfs(self, state): rfs_flow = 0 - global_rfs_flow = 0 queues = len(glob(f'/sys/class/net/{self.ifname}/queues/rx-*')) if state: global_rfs_flow = 32768 rfs_flow = int(global_rfs_flow/queues) - self.set_interface('rfs', global_rfs_flow) for i in range(0, queues): self._write_sysfs(f'/sys/class/net/{self.ifname}/queues/rx-{i}/rps_flow_cnt', rfs_flow) |