I am trying to understand the difference between how DPDK passes packet data to userspace, versus Linux raw sockets?
The Man page for raw sockets implies the Kernel does no packet processing:
Packet sockets are used to receive or send raw packets at the device driver (OSI Layer 2) level. They allow the user to implement protocol modules in user space on top of the physical layer.
SOCK_RAW packets are passed to and from the device driver without any changes in the packet data.
https://man7.org/linux/man-pages/man7/packet.7.html
which at first glance might appear the same as 'Kernel bypass'. However, I presume this is incorrect, otherwise there would be no point to DPDK, OpenOnload, AF_XDP etc?
So, what is the difference between how DPDK passes frame/packet data to userspace, versus using raw sockets?
Is the answer raw socket packets still go through the kernel, still incurs context switches and copying etc, but userspace (eventually) sees the entire packet unmodified? And in contrast DPDK passes the (unmodified) data directly to userspace without copying and context switches (from the kernel)?
So both provide the same data to userspace, just via different paths?
You are close to the answer. SOCK_RAW still needs kernel context switch and most importantly, packet copy to/from kernel memory. But DPDK does not need them and packet directly goes to or comes from userspace memory.