xdp-project / xdp-tutorial

XDP tutorial
2.5k stars 580 forks source link

Af_xdp and ring #256

Open Adarsh97 opened 3 years ago

Adarsh97 commented 3 years ago

What is the purpose of having 4 rings including rx,tx, completion and fill ring? Two rings are not sufficient ?

Adarsh97 commented 3 years ago

@magnus-karlsson @tohojo @netoptimizer @davem330 @dmitris please explain about it.

magnus-karlsson commented 3 years ago

It is for out-of-order completions for the Tx path (Tx and completion rings) and to be able to be able to disassociate providing buffers to the kernel with receiving packets. For an app where everything is in order and every buffer received is sent directly back to the kernel, two rings would have been sufficient.