$ clang -O3 -Wall -c -target bpf hello_xdp.c -o hello_xdp.bpf
# ip link set dev eth0 xdp object hello_xdp.bpf
If you get an error about your driver (for example - Error: igb: The RX buffer size is too small for the frame size), you can use generic xdp implementation, but ONLY FOR TESTING, because xdpgeneric is slower than native implementation.
# ip link set dev eth0 xdpgeneric object hello_xdp.bpf