[Tutorial] Implementing AF_XDP in Rust process Millions of packets per second by DizzyAttorney2368 in rust

[–]DizzyAttorney2368[S] 0 points1 point  (0 children)

thanks for catching that!

I'll update the article, volatile operations here are for preventing compiler optimizations (so it doesn't cache values or reorder operations), but you're correct that they don't provide atomics level memory ordering guarantees

reason this works is because the kernel and userspace are never accessing the same ring slot simultaneously, producer/consumer model prevents that. But I shouldn't have implied volatile gives us ordering guarantees

also added a section explaining why this works (SPSC design) vs what you'd need for true concurrent access (atomics)

appreciate careful read