google / gvisor

Application Kernel for Containers
https://gvisor.dev
Apache License 2.0
15.31k stars 1.27k forks source link

AF_XDP memory corruption TODO #8943

Open leoluk opened 1 year ago

leoluk commented 1 year ago

My team is interested in potentially playing with/contributing to gVisor's work-in-progress AF_XDP network backend and we're curious about this internal TODO:

https://github.com/google/gvisor/blob/a7e1fe92f5885543ad65b6a195b907940f859ffe/pkg/xdp/umem.go#L27-L28

Are there more details in the internal issue?

Would the gVisor team be interested in accepting patches for the AF_XDP backend? I saw there's a relevant internal CL that has been sitting for a while (https://github.com/google/gvisor/pull/7917).

kevinGC commented 1 year ago

We would absolutely accept patches for AF_XDP! Have you had a chance to try it? We put in the work for initial support, but it's not regularly used like most the other link endpoint types. Would love to have more users and eyeballs on it since it should be very fast.

WRT to the TODO: it's been a few months, but IIRC I was seeing occasional retransmits in packet logs and suspected a bug in our implementation was misusing the shared memory region (UMEM). It's also possible there was a (possibly now fixed) kernel bug -- Linux's XDP and AF_XDP paths seem pretty active based on the mailing list.

And that PR (#7917) was for testing XDP performance, but has been sitting because we haven't had the chance to use AF_XDP endpoints much.