summaryrefslogtreecommitdiff
path: root/python/vyos/ifconfig
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-12-18 17:13:13 +0100
committerChristian Poessinger <christian@poessinger.com>2020-12-19 21:56:19 +0100
commitb5c80d310527223b93e4133ac2f4c8c063c70a98 (patch)
tree48ae9e2752b4b94c07f767a019c99a8c2460c014 /python/vyos/ifconfig
parent22308b05dfbcd8da0230bbd8ba3bbc2a55da7786 (diff)
downloadvyos-1x-b5c80d310527223b93e4133ac2f4c8c063c70a98.tar.gz
vyos-1x-b5c80d310527223b93e4133ac2f4c8c063c70a98.zip
xdp: T2666: switch to example code provided by xdp-tutorial
Diffstat (limited to 'python/vyos/ifconfig')
-rw-r--r--python/vyos/ifconfig/ethernet.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/python/vyos/ifconfig/ethernet.py b/python/vyos/ifconfig/ethernet.py
index 96165b333..b2dd54587 100644
--- a/python/vyos/ifconfig/ethernet.py
+++ b/python/vyos/ifconfig/ethernet.py
@@ -255,12 +255,15 @@ class EthernetIf(Interface):
"""
"""
ifname = self.config['ifname']
- cmd = f'ip link set dev {ifname} xdp off'
+ cmd = f'xdp_loader -d {ifname} -U --auto-mode'
if enabled:
# Using 'xdp' will automatically decide if the driver supports
# 'xdpdrv' or only 'xdpgeneric'. A user later sees which driver is
# actually in use by calling 'ip a' or 'show interfaces ethernet'
- cmd = f'ip -force link set dev {ifname} xdp obj /usr/share/vyos/ebpf/xdp_router.o'
+ cmd = f'xdp_loader -d {ifname} --auto-mode -F --progsec xdp_router ' \
+ f'--filename /usr/share/vyos/xdp/xdp_prog_kern.o && ' \
+ f'xdp_prog_user -d {ifname}'
+
return self._cmd(cmd)
def set_ring_buffer(self, b_type, b_size):