Is driver mode available for an interface on a VM? On Virtualbox I could only load my XDP program in generic mode. Is this the case in general for all VMs? Since XDP driver mode support depends on whether the driver supports it, I'm wondering if it's possible for an interface on a VM to support driver mode. If so, are there any VM interfaces that support XDP driver mode?
Asked
Active
Viewed 313 times
1 Answers
1
Yes, XDP support for virt_io(paravirtualized network adapters) has been supported since kernel v4.10. I believe virtual box will default to emulation of actual hardware instead of using virt_io, so you might need to do some tweaking in your VM settings to get everything to work.
Sources/further reading:
- https://github.com/torvalds/linux/commit/f600b690501550b94e83e07295d9c8b9c4c39f4e
https://patchwork.kernel.org/project/kvm/cover/20191126100744.5083-1-prashantbhole.linux@gmail.com/(Different update, disregard for this question)- https://lwn.net/Articles/708380/

Dylan Reimerink
- 5,874
- 2
- 15
- 21
-
Thanks. From the second link, what does it mean that "Currently BPF_MAP_TYPE_ARRAY and BPF_MAP_TYPE_HASH are supported"? – user2233706 Oct 08 '22 at 13:29
-
Sorry, I confused 2 different updates. It appears that virt_io also support h/w offload, but only with limited maps(second link). This is different from driver support. Driver support was added in 2016, offload in 2019 – Dylan Reimerink Oct 08 '22 at 14:17