diff options
author | Christian Breunig <christian@breunig.cc> | 2023-01-12 21:11:38 +0100 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2023-01-12 21:13:44 +0100 |
commit | c0ffb8ba4e6639254a853c18f1433d1677d7703d (patch) | |
tree | 34d83820ce211a96b75ec795770f3baa310aa022 /python/vyos/ifconfig | |
parent | 3045b327585660d66093008833d75a6064c559ea (diff) | |
download | vyos-1x-c0ffb8ba4e6639254a853c18f1433d1677d7703d.tar.gz vyos-1x-c0ffb8ba4e6639254a853c18f1433d1677d7703d.zip |
ethernet: rps: T4928: adjust to Kernel ABI changes
In the past we could simply set all bits for all CPUs even if they did not
exist. With 6.1.y Kernel series this is no longer possible and the input data
is validated against the available number of CPUs.
Diffstat (limited to 'python/vyos/ifconfig')
-rw-r--r-- | python/vyos/ifconfig/ethernet.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/python/vyos/ifconfig/ethernet.py b/python/vyos/ifconfig/ethernet.py index 519cfc58c..b45d8ea28 100644 --- a/python/vyos/ifconfig/ethernet.py +++ b/python/vyos/ifconfig/ethernet.py @@ -248,10 +248,12 @@ class EthernetIf(Interface): # representation of the CPUs which should participate on RPS, we # can enable more CPUs that are physically present on the system, # Linux will clip that internally! - rps_cpus = 'ffffffff,ffffffff,ffffffff,fffffffe' + rps_cpus = os.cpu_count() + if rps_cpus > 1: + rps_cpus -= 1 for i in range(0, queues): - self._write_sysfs(f'/sys/class/net/{self.ifname}/queues/rx-{i}/rps_cpus', rps_cpus) + self._write_sysfs(f'/sys/class/net/{self.ifname}/queues/rx-{i}/rps_cpus', f'{rps_cpus:x}') # send bitmask representation as hex string without leading '0x' return True |