xdp-project / xdp-tutorial

XDP tutorial
2.44k stars 576 forks source link

Is possible the umem frame leak in some place? #403

Closed ZENOTME closed 6 months ago

ZENOTME commented 6 months ago

Hi, I'm curious when we submit the frame to the fill ring or tx ring, is it possible a frame leak(not occurring in the RX ring or complete ring) due to the RX ring or the complete ring being full, or another reason?

Recently I've been doing an experiment, that uses two xdp sockets and redirects the packet to the other. Ideally, the lifecycle of a umem frame is:

  1. alloc and put in the fill ring
  2. receive in rx ring
  3. put it in tx ring of another socket
  4. receive in a complete ring
  5. free it

But I find that the umem frame leak in this process. I'm not sure whether it is caused by my program and I'm debugging it. But I want to know whether the xdp interface guarantees that the frame will not be leaked.

ZENOTME commented 6 months ago

Sorry for my bother, I found it was caused by my program.🥵 I find that the kernel will guarantee that not consume the frame if there is no enough space.