From c0ffb8ba4e6639254a853c18f1433d1677d7703d Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Thu, 12 Jan 2023 21:11:38 +0100 Subject: 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. --- python/vyos/ifconfig/ethernet.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'python') 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 -- cgit v1.2.3