summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-12-23 14:24:55 +0100
committerChristian Poessinger <christian@poessinger.com>2020-12-23 14:24:55 +0100
commit440ce3011e8718c917933026e68047fcfb008031 (patch)
tree67d71ba2555c9e4b9d1895ebb04406d5af92e7a9 /src
parent131b6ac0dfa0700820b2fe56adea2cad189b10ad (diff)
parent6f5eeaa22c32ab6e2c629a613fc5107d7b357b9d (diff)
downloadvyos-1x-440ce3011e8718c917933026e68047fcfb008031.tar.gz
vyos-1x-440ce3011e8718c917933026e68047fcfb008031.zip
Merge branch 'xdp' of github.com:c-po/vyos-1x into current
* 'xdp' of github.com:c-po/vyos-1x: bond: T2666: enable XDP support xml: include: accel: convert dos/unix line endings xdp: T2666: move CLI node to "interfaces ethernet <eth> xdp" xdp: T2666: require at least 2 TX queues
Diffstat (limited to 'src')
-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..b358e9725 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 'xdp' in ethernet:
+ 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))