Hacker News
Wireblast a 100 Gbps packet generator in Go using AF_XDP
m4r1k
|next
[-]
spaceywilly
|next
|previous
[-]
I wonder if something similar could be done using TC BPF instead of AF_XDP? My only reservation about AF XDP is that it requires a special NIC to support it, so it may not be useful for a “regular Joe” user. I wonder if TC BPF would also work since it similarly bypasses the Kernel networking stack, I believe you can put packets directly into the NIC TX queue for transmission
tptacek
|root
|parent
|next
[-]
adrian_b
|root
|parent
[-]
AF_XDP is also available in older kernels, but with recent enough kernels (zero-copy receive is a recent addition) and with a good NIC, liburing should provide a similar performance.
bgpdude
|next
|previous
[-]
barryvand
|previous
[-]
tptacek
|root
|parent
[-]
touisteur
|root
|parent
|next
[-]
I need to check about the af_xdp ecosystem around fragmentation/reassembly in UDP too, every time I needed something there DPDK had it, often with an offload path.
Some silly stuff in DPDK are very useful for testing too (in-memory devices).
Also I'm not clear on the virtualization story on af_xdp, with dpdk I got something working at full blast 400G in VMs with little (but finnicky) work.
tptacek
|root
|parent
[-]
touisteur
|root
|parent
[-]
A lot of the socket featureset of io_uring seems available in AF_XDP https://docs.kernel.org/networking/af_xdp.html which shows lots of progress since I looked last.
To get an idea of what DPDK gives low-level access to there is the overview https://doc.dpdk.org/guides/nics/features.html and my "favorite annual terabit read" https://doc.dpdk.org/guides/nics/mlx5.html#mlx5-net-features for NVIDIA NICs. Broadcom has some fun stuff too. The first time you hit top RX speed (2x400G my latest) with only one busy core (yay DMA engines) is always a thrill.
pstavirs
|root
|parent
|next
|previous
[-]
Disclosure: Ostinato creator here.
trevex
|root
|parent
|next
|previous
[-]
bgpdude
|root
|parent
|previous
[-]
tptacek
|root
|parent
[-]
bgpdude
|root
|parent
[-]
The difference I was getting at vs DPDK is that the kernel NIC driver/NAPI/XDP path is still involvd. With DPDK the userspace PMD is effectively driving the NIC and accessing the queues directly.
either way, it's great and everyone should use it :) that is assuming they have a use case for it. The use-cases are perhaps somewhat limited as it also bypasses the kernel tcp-ip stack, so you gotta do a lot yourself.