Pavel Popa <pashinho1990@xxxxxxxxx> writes: > Hi all, > > Is there any way to perform routing in user-space with AF_XDP without > too much hassle? The only way I see at the moment is to replicate in > user-space the kernel's FIB state via RTNL events, and performing > afterwards the IP routing lookup using some LPM algorithm > implementation. Is there an "easier" way for doing this? Not in user space, but there's an XDP helper that allows you to do FIB lookups directly from an XDP program running in the kernel. See the xdp_fwd_kern.c sample: https://elixir.bootlin.com/linux/latest/source/samples/bpf/xdp_fwd_kern.c You could conceivably do this lookup in the kernel before forwarding the packet to userspace, and store the result in the XDP metadata field. But if you're "just" forwarding packets it's probably easier to do the redirect directly from the XDP program. -Toke