xdp-project / xdp-tutorial

XDP tutorial
2.43k stars 574 forks source link

advanced03-AF_XDP Assignment 1 and Assignment 3 #68

Closed hi-glenn closed 5 years ago

hi-glenn commented 5 years ago

Hello , I don't understand why _./af_xdpuser -d veth-adv03 without _--filename af_xdpkern.o also can load a xdp program and eat all pings.

After _./af_xdpuser -d veth-adv03, using cmd ip a show veth-adv03, the result shows that it have loaded a xdp program truly.

If _./af_xdpuser -d veth-adv03 has loaded a xdp program truly, which xxx.o has been loaded ?

chaudron commented 5 years ago

Libbpf takes care of this, see the following:

https://github.com/libbpf/libbpf/blob/476e158b07ea5f36f4475735330c1152ffe15acc/src/xsk.c#L241

It will load a default XDP program.