From 9fb9e5cade4ceccd98aefb854a12a2a42db7c672 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 1 Jan 2021 18:27:23 +0100 Subject: ethernet: T3171: add CLI option to enable RPS (Receive Packet Steering) set interfaces ethernet offload rps --- src/conf_mode/interfaces-ethernet.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/conf_mode') 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!') -- cgit v1.2.3