microsoft / xdp-for-windows

XDP speeds up networking on Windows
MIT License
372 stars 41 forks source link

Cross-Platform AF_XDP API #13

Open nibanks opened 2 years ago

nibanks commented 2 years ago

Currently, the FAQ makes the following statement:

It is not directly source-compatible with the Linux API, though it is possible to build a thin shim layer to abstract any differences.

This begs the following questions:

How important is cross-platform AF_XDP API usage?

Do we expect that a single application, built for multiple platforms, would want to support XDP on both? My personal take is Yes, applications that support XDP on one platform will most likely want to leverage it on another if possible.

If cross-platform support is important, should XDP for Windows have exactly the same API as on Linux?

Assuming cross-platform support is an eventual goal, should XDP for Windows be constrained to what Linux has/does or should we instead propose a shim on top of both? I'm not sure.

Should XDP for Windows have the sole responsibility for driving this cross-platform support?

Whether it is decided to match APIs exactly (or perhaps close enough that only minimal differences exist) or a separate shim layer is written, I believe more input will be needed from the community. If the shim approach is taken, it doesn't really make sense for either platform to explicitly own the shim, but should be a combined ownership, or completely separate.

williamtu commented 2 years ago

Thanks for sharing and open source this project! I've been thinking about using AF_XDP for both Windows and Linux on OvS (Open vSwitch). My 2 cents are: AF_XDP is socket interface, so it should be OK to expect people writing Windows-specific code to create/send/receive packets from XSK. So the AF_XDP part is platform-specific. I'm hoping the XDP API in Windows kernel could be as compatible as Linux, so that when we offload XDP program into Linux/WIndows kernel, we don't need to recompile the eBPF binary or introduce feature detections on version and OSes. Thank you

dthaler commented 2 years ago

The BSD sockets API is cross-plat and so a key sockets scenario is cross-plat. Hence this should not be a question, it should simply be a feature request.