diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-01-01 18:27:23 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-01-01 18:35:14 +0100 |
commit | 9fb9e5cade4ceccd98aefb854a12a2a42db7c672 (patch) | |
tree | f08b577494673b0c553025b344e3a640de7e6242 /src | |
parent | 09bc3cdff7d7c70885e232f4ada8b1db7e0026ed (diff) | |
download | vyos-1x-9fb9e5cade4ceccd98aefb854a12a2a42db7c672.tar.gz vyos-1x-9fb9e5cade4ceccd98aefb854a12a2a42db7c672.zip |
ethernet: T3171: add CLI option to enable RPS (Receive Packet Steering)
set interfaces ethernet <interface> offload rps
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!') |