Enable XDP on eth0 and eth1 failed (vyos latest version 1.4)

I set up a two interfaces router on google cloud engine. The instance setup command as following:
gcloud compute instances create instance-1 --project=integral-helper-355206 --zone=us-central1-a --machine-type=e2-standard-4 --network-interface=network-tier=PREMIUM,private-network-ip=10.129.0.10,subnet=v1 --network-interface=network-tier=PREMIUM,private-network-ip=10.130.0.10,subnet=v2 --can-ip-forward --maintenance-policy=MIGRATE --provisioning-model=STANDARD --service-account=443841611561–disk=boot=yes,device-name=disk-vyos-1v4,mode=rw,name=disk-vyos-1v4 --reservation-affinity=any

When I tried to enable XDP feature on eth0 and eth1, I got the following error message:
vyos@vyos:~$ configure
[edit]
vyos@vyos# set interfaces ethernet eth0 xdp
[edit]
vyos@vyos# set interfaces ethernet eth1 xdp
[edit]
vyos@vyos# commit
[ interfaces ethernet eth0 ]
VyOS had an issue completing a command.

We are sorry that you encountered a problem while using VyOS.
There are a few things you can do to help us (and yourself):

  • Contact us using the online help desk if you have a subscription:
  • Make sure you are running the latest version of VyOS available at:
  • Consult the community forum to see how to handle this issue:
  • Join us on Slack where our users exchange help and advice:

When reporting problems, please include as much information as possible:

  • do not obfuscate any data (feel free to contact us privately if your
    business policy requires it)
  • and include all the information presented below

Report time: 2022-07-07 02:10:53
Image version: VyOS 1.4-rolling-202207030217
Release train: sagitta

Built by: [email protected]
Built on: Sun 03 Jul 2022 02:17 UTC
Build UUID: 1a424faa-4295-4d60-bd4d-c2a2216bd61f
Build commit ID: 18a5f453459c92

Architecture: x86_64
Boot via: installed image
System type: KVM guest

Hardware vendor: Google
Hardware model: Google Compute Engine
Hardware S/N: GoogleCloud-2D9F672189F53CAD049A232863DE9BDF
Hardware UUID: 2d9f6721-89f5-3cad-049a-232863de9bdf

Traceback (most recent call last):
File “/usr/libexec/vyos/conf_mode/interfaces-ethernet.py”, line 213, in
apply(c)
File “/usr/libexec/vyos/conf_mode/interfaces-ethernet.py”, line 202, in apply
e.update(ethernet)
File “/usr/lib/python3/dist-packages/vyos/ifconfig/ethernet.py”, line 363, in update
super().update(config)
File “/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py”, line 1562, in update
self.set_xdp(‘xdp’ in config)
File “/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py”, line 1367, in set_xdp
return self._cmd(cmd)
File “/usr/lib/python3/dist-packages/vyos/ifconfig/control.py”, line 52, in _cmd
return cmd(command, self.debug)
File “/usr/lib/python3/dist-packages/vyos/util.py”, line 161, in cmd
raise OSError(code, feedback)
OSError: [Errno 30] failed to run command: xdp_loader -d eth0 --auto-mode -F --progsec xdp_router --filename /usr/share/vyos/xdp/xdp_prog_kern.o && xdp_prog_user -d eth0
returned:
exit code: 30

noteworthy:
cmd ‘ethtool --show-pause eth0’
returned (out):

returned (err):
netlink error: Operation not supported
cmd ‘ethtool --show-pause eth0’
returned (out):

returned (err):
netlink error: Operation not supported
cmd ‘nft -c delete element inet vrf_zones ct_iface_map { “eth0” }’
returned (out):

returned (err):
Error: No such file or directory
delete element inet vrf_zones ct_iface_map { eth0 }
^^^^^^^^^
cmd ‘xdp_loader -d eth0 --auto-mode -F --progsec xdp_router --filename /usr/share/vyos/xdp/xdp_prog_kern.o && xdp_prog_user -d eth0’
returned (out):

returned (err):
libbpf: Kernel error message: virtio_net: XDP expects header/data in single page, any_header_sg required
ERR: ifindex(2) link set xdp fd failed (22): Invalid argument

[[interfaces ethernet eth0]] failed
[ interfaces ethernet eth1 ]
VyOS had an issue completing a command.

We are sorry that you encountered a problem while using VyOS.
There are a few things you can do to help us (and yourself):

  • Contact us using the online help desk if you have a subscription:
  • Make sure you are running the latest version of VyOS available at:
  • Consult the community forum to see how to handle this issue:
  • Join us on Slack where our users exchange help and advice:

When reporting problems, please include as much information as possible:

  • do not obfuscate any data (feel free to contact us privately if your
    business policy requires it)
  • and include all the information presented below

Report time: 2022-07-07 02:10:54
Image version: VyOS 1.4-rolling-202207030217
Release train: sagitta

Built by: [email protected]
Built on: Sun 03 Jul 2022 02:17 UTC
Build UUID: 1a424faa-4295-4d60-bd4d-c2a2216bd61f
Build commit ID: 18a5f453459c92

Architecture: x86_64
Boot via: installed image
System type: KVM guest

Hardware vendor: Google
Hardware model: Google Compute Engine
Hardware S/N: GoogleCloud-2D9F672189F53CAD049A232863DE9BDF
Hardware UUID: 2d9f6721-89f5-3cad-049a-232863de9bdf

Traceback (most recent call last):
File “/usr/libexec/vyos/conf_mode/interfaces-ethernet.py”, line 213, in
apply(c)
File “/usr/libexec/vyos/conf_mode/interfaces-ethernet.py”, line 202, in apply
e.update(ethernet)
File “/usr/lib/python3/dist-packages/vyos/ifconfig/ethernet.py”, line 363, in update
super().update(config)
File “/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py”, line 1562, in update
self.set_xdp(‘xdp’ in config)
File “/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py”, line 1367, in set_xdp
return self._cmd(cmd)
File “/usr/lib/python3/dist-packages/vyos/ifconfig/control.py”, line 52, in _cmd
return cmd(command, self.debug)
File “/usr/lib/python3/dist-packages/vyos/util.py”, line 161, in cmd
raise OSError(code, feedback)
OSError: [Errno 30] failed to run command: xdp_loader -d eth1 --auto-mode -F --progsec xdp_router --filename /usr/share/vyos/xdp/xdp_prog_kern.o && xdp_prog_user -d eth1
returned:
exit code: 30

noteworthy:
cmd ‘ethtool --show-pause eth1’
returned (out):

returned (err):
netlink error: Operation not supported
cmd ‘ethtool --show-pause eth1’
returned (out):

returned (err):
netlink error: Operation not supported
cmd ‘nft -c delete element inet vrf_zones ct_iface_map { “eth1” }’
returned (out):

returned (err):
Error: No such file or directory
delete element inet vrf_zones ct_iface_map { eth1 }
^^^^^^^^^
cmd ‘xdp_loader -d eth1 --auto-mode -F --progsec xdp_router --filename /usr/share/vyos/xdp/xdp_prog_kern.o && xdp_prog_user -d eth1’
returned (out):

returned (err):
libbpf: Kernel error message: virtio_net: XDP expects header/data in single page, any_header_sg required
ERR: ifindex(3) link set xdp fd failed (22): Invalid argument

[[interfaces ethernet eth1]] failed
Commit failed
[edit]
vyos@vyos#

Hi @beyond2002,

XDP is in an alpha stage and does not support VLANs. Looks like XDP and nftables are fighting about a resource. Any chance you can help us debug?


CP

Sure, I would be glad to. But I am a new user, I don’t know how to debug XDP. Would you please provide some guidance? Thanks!

Can you share your VyOS configuration? Maybe there is a GCP incompatibility with the used NIC, as this loads perfectly in VMWare.

my configuration as the following:
vyos@vyos:~$ show configuration commands
set interfaces ethernet eth0 address ‘dhcp’
set interfaces ethernet eth0 offload gro
set interfaces ethernet eth0 offload gso
set interfaces ethernet eth0 offload sg
set interfaces ethernet eth0 offload tso
set interfaces ethernet eth1 address ‘dhcp’
set interfaces loopback lo
set service ssh
set system config-management commit-revisions ‘100’
set system conntrack modules ftp
set system conntrack modules h323
set system conntrack modules nfs
set system conntrack modules pptp
set system conntrack modules sip
set system conntrack modules sqlnet
set system conntrack modules tftp
set system host-name ‘vyos’
set system login user vyos authentication encrypted-password
set system login user vyos authentication plaintext-password ‘’
set system login user vyos authentication public-keys vyos key
set system login user vyos authentication public-keys vyos type ‘ssh-rsa’
set system name-server ‘eth0’
set system ntp server time1.vyos.net
set system ntp server time2.vyos.net
set system syslog global facility all level ‘notice’
set system syslog global facility protocols level ‘debug’
vyos@vyos:~$