diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-12-17 20:29:38 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-12-17 20:29:44 +0100 |
commit | 44fd19cf28709abf9a8db49170eb06910bee69e9 (patch) | |
tree | f02b17a153970686db3c112e6908cd6d2c6ab786 /python | |
parent | bd3ff678b733964c689b52ff1b0d2c838edeb8b8 (diff) | |
download | vyos-1x-44fd19cf28709abf9a8db49170eb06910bee69e9.tar.gz vyos-1x-44fd19cf28709abf9a8db49170eb06910bee69e9.zip |
xdp: T2666: use generic "xdp" option when loading
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'.
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/ifconfig/ethernet.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/python/vyos/ifconfig/ethernet.py b/python/vyos/ifconfig/ethernet.py index 1bc63eec2..6578fc6dc 100644 --- a/python/vyos/ifconfig/ethernet.py +++ b/python/vyos/ifconfig/ethernet.py @@ -257,16 +257,11 @@ class EthernetIf(Interface): ifname = self.config['ifname'] cmd = f'ip link set dev {ifname} xdp off' if enabled: - # use 'xdpgeneric' for the time beeing until we can detect supported - # drivers or have a lookup table of whatever kind. This then can be - # replaced by xdpdrv - cmd = f'ip -force link set dev {ifname} xdpgeneric obj /usr/share/vyos/ebpf/xdp_router.o' - try: - return self._cmd(cmd) - except: - from vyos import ConfigError - raise ConfigError('Error: Device does not allow enslaving to a bridge.') - + # 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' + return self._cmd(cmd) def set_ring_buffer(self, b_type, b_size): """ |