microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.53k stars 823 forks source link

Enable CONFIG_BPF_STREAM_PARSER to support SOCKMAP, SOCKHASH used by eBPF programs #8343

Open SikoJobs opened 2 years ago

SikoJobs commented 2 years ago

https://github.com/microsoft/WSL2-Linux-Kernel/blob/d489414/include/linux/bpf_types.h#L106-L109

#if defined(CONFIG_BPF_STREAM_PARSER)
BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKMAP, sock_map_ops)
BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKHASH, sock_hash_ops)
#endif

https://github.com/microsoft/WSL2-Linux-Kernel/blob/d489414/Microsoft/config-wsl#L1433

# CONFIG_BPF_STREAM_PARSER is not set

https://github.com/microsoft/WSL2-Linux-Kernel/blob/d489414/Microsoft/config-wsl-arm64#L1418

# CONFIG_BPF_STREAM_PARSER is not set

BPF_MAP_TYPE_SOCKMAP and BPF_MAP_TYPE_SOCKHASH are very important & useful to eBPF programs, let's make them work! :blush:

tea commented 2 years ago

I'd like to request CONFIG_XDP_SOCKETS in addition to CONFIG_BPF_STREAM_PARSER. That'll allow (generic) AF_XDP usage and development using WSL2. I'm running a custom 5.10 kernel with these options enabled and it seems to be working just fine.

tea commented 4 months ago

CONFIG_XDP_SOCKETS is ON in latest 6.6 release! CONFIG_BPF_STREAM_PARSER is still not, though.