The xskmap is yet another BPF map, very much inspired by dev/cpu/sockmap, and is a holder of AF_XDP sockets. A user application adds AF_XDP sockets into the map, and by using the bpf_redirect_map helper, an XDP program can redirect XDP frames to an AF_XDP socket. Note that a socket that is bound to certain ifindex/queue index will *only* accept XDP frames from that netdev/queue index. If an XDP program tries to redirect from a netdev/queue index other than what the socket is bound to, the frame will not be received on the socket. A socket can reside in multiple maps. v3: Fixed race and simplified code. v2: Removed one indirection in map lookup.
Showing the changes to include/uapi/linux (1 of 8 files). Show all
Unified · Split
| @@ -116,6 +116,7 @@ enum bpf_map_type { · 115 unmodified lines | |||
| 116 | BPF_MAP_TYPE_DEVMAP, | 116 | BPF_MAP_TYPE_DEVMAP, |
| 117 | BPF_MAP_TYPE_SOCKMAP, | 117 | BPF_MAP_TYPE_SOCKMAP, |
| 118 | BPF_MAP_TYPE_CPUMAP, | 118 | BPF_MAP_TYPE_CPUMAP, |
| 119 | BPF_MAP_TYPE_XSKMAP, | ||
| 119 | }; | 120 | }; |
| 120 | 121 | ||
| 121 | enum bpf_prog_type { | 122 | enum bpf_prog_type { |