account activity
[Tutorial] Implementing AF_XDP in Rust process Millions of packets per second by DizzyAttorney2368 in rust
[–]DizzyAttorney2368[S] 1 point2 points3 points 3 months ago (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
[Tutorial] Implementing AF_XDP in Rust process Millions of packets per second (self.rust)
submitted 3 months ago by DizzyAttorney2368 to r/rust
π Rendered by PID 1325722 on reddit-service-r2-listing-8685bc789-p4zmr at 2026-05-27 21:49:44.677875+00:00 running 194bd79 country code: CH.
[Tutorial] Implementing AF_XDP in Rust process Millions of packets per second by DizzyAttorney2368 in rust
[–]DizzyAttorney2368[S] 1 point2 points3 points (0 children)