summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-02-20 20:51:43 +0100
committerChristian Poessinger <christian@poessinger.com>2021-02-21 20:07:28 +0100
commit20e500b8a4f62fe1f2603ba5daebad3ee49db39a (patch)
tree60e5f1d6e7b362fc4548532325be622afa361317 /src/conf_mode
parentd14d2f30ef592db14777228cb9d8f592f9d87d98 (diff)
downloadvyos-1x-20e500b8a4f62fe1f2603ba5daebad3ee49db39a.tar.gz
vyos-1x-20e500b8a4f62fe1f2603ba5daebad3ee49db39a.zip
ethernet: T3342: Xen vif driver requires sg offloading for MTU > 1500 bytes
(cherry picked from commit 3c64c79d7977869da3ca4dc70eb97ff9c6682e52)
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/interfaces-ethernet.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/conf_mode/interfaces-ethernet.py b/src/conf_mode/interfaces-ethernet.py
index e92c16eb6..e82a3e0f1 100755
--- a/src/conf_mode/interfaces-ethernet.py
+++ b/src/conf_mode/interfaces-ethernet.py
@@ -77,10 +77,17 @@ def verify(ethernet):
verify_mirror(ethernet)
# verify offloading capabilities
- if 'offload' in ethernet and 'rps' in ethernet['offload']:
+ if dict_search('offload.rps', ethernet) != None:
if not os.path.exists(f'/sys/class/net/{ifname}/queues/rx-0/rps_cpus'):
raise ConfigError('Interface does not suport RPS!')
+ driver = EthernetIf(ifname).get_driver_name()
+ # T3342 - Xen driver requires special treatment
+ if driver == 'vif':
+ if int(ethernet['mtu']) > 1500 and dict_search('offload.sg', ethernet) == None:
+ raise ConfigError('Xen netback drivers requires scatter-gatter offloading '\
+ 'for MTU size larger then 1500 bytes')
+
ethtool = Ethtool(ifname)
if 'ring_buffer' in ethernet:
max_rx = ethtool.get_rx_buffer()