summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-ethernet.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-12-23 14:00:05 +0100
committerChristian Poessinger <christian@poessinger.com>2020-12-23 14:00:05 +0100
commit24cce893acf0a5f62230c7f12f07e569b9233db0 (patch)
tree05515d13465c1ceb5928686b1bdeca910114537f /src/conf_mode/interfaces-ethernet.py
parentb95e5d120fb13b7ade66db7523b56e3f55bf6439 (diff)
downloadvyos-1x-24cce893acf0a5f62230c7f12f07e569b9233db0.tar.gz
vyos-1x-24cce893acf0a5f62230c7f12f07e569b9233db0.zip
xdp: T2666: require at least 2 TX queues
Diffstat (limited to 'src/conf_mode/interfaces-ethernet.py')
-rwxr-xr-xsrc/conf_mode/interfaces-ethernet.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/conf_mode/interfaces-ethernet.py b/src/conf_mode/interfaces-ethernet.py
index 1f622c003..18ee85178 100755
--- a/src/conf_mode/interfaces-ethernet.py
+++ b/src/conf_mode/interfaces-ethernet.py
@@ -16,6 +16,7 @@
import os
+from glob import glob
from sys import exit
from vyos.config import Config
@@ -28,6 +29,7 @@ from vyos.configverify import verify_mtu_ipv6
from vyos.configverify import verify_vlan_config
from vyos.configverify import verify_vrf
from vyos.ifconfig import EthernetIf
+from vyos.util import dict_search
from vyos import ConfigError
from vyos import airbag
airbag.enable()
@@ -66,6 +68,12 @@ def verify(ethernet):
verify_address(ethernet)
verify_vrf(ethernet)
+ # XDP requires multiple TX queues
+ if dict_search('offload.xdp', ethernet) != None:
+ queues = glob('/sys/class/net/{ifname}/queues/tx-*'.format(**ethernet))
+ if len(queues) < 2:
+ raise ConfigError('XDP requires additional TX queues, too few available!')
+
if {'is_bond_member', 'mac'} <= set(ethernet):
print(f'WARNING: changing mac address "{mac}" will be ignored as "{ifname}" '
f'is a member of bond "{is_bond_member}"'.format(**ethernet))