From b5c80d310527223b93e4133ac2f4c8c063c70a98 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 18 Dec 2020 17:13:13 +0100 Subject: xdp: T2666: switch to example code provided by xdp-tutorial --- python/vyos/ifconfig/ethernet.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'python/vyos/ifconfig/ethernet.py') 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): -- cgit v1.2.3