diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-01-01 18:40:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-01 18:40:21 +0100 |
commit | b13235d2b2a186be059690af88b243b33b37d60f (patch) | |
tree | f08b577494673b0c553025b344e3a640de7e6242 /src | |
parent | 215ddbe0bc51417b7ba66298764810754b204082 (diff) | |
parent | 9fb9e5cade4ceccd98aefb854a12a2a42db7c672 (diff) | |
download | vyos-1x-b13235d2b2a186be059690af88b243b33b37d60f.tar.gz vyos-1x-b13235d2b2a186be059690af88b243b33b37d60f.zip |
Merge pull request #666 from c-po/t3171-rps
T3171: Ethernet RPS support
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/interfaces-ethernet.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/conf_mode/interfaces-ethernet.py b/src/conf_mode/interfaces-ethernet.py index d8b637dd7..ed6396acf 100755 --- a/src/conf_mode/interfaces-ethernet.py +++ b/src/conf_mode/interfaces-ethernet.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2019-2020 VyOS maintainers and contributors +# Copyright (C) 2019-2021 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -75,9 +75,15 @@ def verify(ethernet): verify_vrf(ethernet) verify_eapol(ethernet) + ifname = ethernet['ifname'] + # verify offloading capabilities + if 'offload' in ethernet and 'rps' in ethernet['offload']: + if not os.path.exists(f'/sys/class/net/{ifname}/queues/rx-0/rps_cpus'): + raise ConfigError('Interface does not suport RPS!') + # XDP requires multiple TX queues if 'xdp' in ethernet: - queues = glob('/sys/class/net/{ifname}/queues/tx-*'.format(**ethernet)) + queues = glob(f'/sys/class/net/{ifname}/queues/tx-*') if len(queues) < 2: raise ConfigError('XDP requires additional TX queues, too few available!') |