Re: Xdp or dpdk


Jesper Dangaard Brouer
 

On Thu, 20 Sep 2018 16:02:37 +0300 Иван Иванов <iwan12iwan12@...> wrote:

Hi. I need you advice.
I have to write app to filter and LB ethernet traffic from 100G to
10x10G. What is better to use? eBPF XDP or DPDK?
Interesting use-case of Load-Balancing 100G to 10x 10G.

I would obviously choose XDP, but I'm biased ;-)

I want to stress, that you have to handle, in _your_ BPF prog, how to
load-balance and handle _when_ the overload/overrun problem occurs. As
you have faster link feeds into slower links, you can overload those
links.

With XDP/BPF you should attach to the BPF tracepoint xdp_devmap_xmit,
which allows you to detect the TX overrun happens (see sample code [1]
and [2]). And then you need to communicate this info via a BPF-map, to
your Load-Balance decision XDP-prog, so it can take action.

With this tracepoint approach packets will get lost, before an event
happens. I am considering extending XDP to have another XDP-hook, at
XDP_REDIRECT transition to TX point, which would allow you to re-do a
load-balance decision, then a device TX-queue is full. But we need a
good use-case, before adding such infra-structure (maybe your
use-case?). This is something Toke and I will be taking about here:
[3] http://vger.kernel.org/lpc-networking.html#session-19


Sample code#1:
[1] https://github.com/torvalds/linux/blob/master/samples/bpf/xdp_monitor_kern.c#L213-L258

Sample code#2:
[2] https://github.com/torvalds/linux/blob/master/samples/bpf/xdp_redirect_cpu_kern.c#L572-L625

--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer

Join iovisor-dev@lists.iovisor.org to automatically receive all group messages.