diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-09-15 14:06:11 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-09-15 14:06:11 +0200 |
commit | e976ee9ed5d18c62fb3cfc6980ac1dc485b9fa20 (patch) | |
tree | 3e2e48df33e3e6a3c31c2f3f241e86a8ccae1774 /python/vyos | |
parent | 87ee858f14839624e14cfc7df11fa265159bcbf3 (diff) | |
download | vyos-1x-e976ee9ed5d18c62fb3cfc6980ac1dc485b9fa20.tar.gz vyos-1x-e976ee9ed5d18c62fb3cfc6980ac1dc485b9fa20.zip |
ethernet: rfs: T4689: remove redundant code
Diffstat (limited to 'python/vyos')
-rw-r--r-- | python/vyos/ifconfig/ethernet.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/python/vyos/ifconfig/ethernet.py b/python/vyos/ifconfig/ethernet.py index eac72ab8c..32e667038 100644 --- a/python/vyos/ifconfig/ethernet.py +++ b/python/vyos/ifconfig/ethernet.py @@ -266,18 +266,16 @@ class EthernetIf(Interface): def set_rfs(self, state): rfs_flow = 0 global_rfs_flow = 0 - ifname = self.config['ifname'] - queues = glob(f'/sys/class/net/{ifname}/queues/rx-*') + queues = len(glob(f'/sys/class/net/{self.ifname}/queues/rx-*')) if state: global_rfs_flow = 32768 - rfs_flow = global_rfs_flow/len(queues) - - self.set_interface('rfs', str(int(global_rfs_flow))) + rfs_flow = int(global_rfs_flow/queues) - for i in range(0,len(queues)): - self._write_sysfs(f'/sys/class/net/{ifname}/queues/rx-{i}/rps_flow_cnt',str(int(rfs_flow))) + 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) - return state + return True def set_sg(self, state): """ |