Kresd XDP bind error
I hope to start kresd with XDP running systemctl start kresd@1.service
.
My systemd file is:
[Unit]
Description=Knot Resolver daemon instance %i
After=network.target
[Service]
User=root
Group=root
Environment=LD_LIBRARY_PATH=/usr/local/lib
CapabilityBoundingSet=CAP_NET_RAW CAP_NET_ADMIN CAP_SYS_ADMIN CAP_IPC_LOCK CAP_SYS_RESOURCE
AmbientCapabilities=CAP_NET_RAW CAP_NET_ADMIN CAP_SYS_ADMIN CAP_IPC_LOCK CAP_SYS_RESOURCE
ExecStart=/usr/sbin/kresd -n -c /etc/knot-resolver/kresd.conf
Restart=on-failure
[Install]
WantedBy=multi-user.target
My configure file "kresd.conf" is quite simple, like:
-- Load Useful modules
modules = { 'stats' }
cache.size = 512 * MB
net.listen('ens1f1', 1053, { kind = 'xdp' })
policy.add(policy.all(policy.STUB('10.62.27.2')))
But kresd failed to start. The detail logs are:
kresd[86218]: Knot Resolver 5.7.0
kresd[86218]: [net ] failed to initialize XDP for 'ens1f1@1053' (nic_queue = ): file descriptor error
kresd[86218]: [system] error while loading config: error occurred here (config filename:lineno is at the bottom, if config is involved):
kresd[86218]: stack traceback:
kresd[86218]: [C]: in function 'listen'
kresd[86218]: /etc/knot-resolver/kresd.conf:15: in main chunk
kresd[86218]: ERROR: net.listen() failed to bind (workdir '/')
I want to know how to fix that. Is there anything i miss in "kresd.conf" configure file? Or do i need to configure my NIC?