I was wondering if there's a difference between eBPF XDP and eBPF socket filter mode when parsing a packet header information.
Say I want to retrieve a destination IP address and a source IP address from a packet header using eBPF.
If there's no difference in doing so between XDP and socket filter mode, maybe it's better to implement packet monitoring functionality in XDP instead of implementing it in a socket filter program?
If so, wouldn't it be always better to monitor every incoming packet using XDP instead of using a socket buffer since XDP can offload its operations to a NIC when used with hardware offload mode?
Thanks!