possibility to fill completion queue from user space?

JĂșlius Milan <[email protected]> Wed, 28 Jun 2023 20:06:20 +0200
Newsgroups org.kernel.vger.xdp-newbies
Message-ID <CANaGk7snu9tuzq=WxkUX48hpK-q2p_d=oLq-7Q6BcK_i4EiEPA@mail.gmail.com>
Hi all

I am writing an AF_XDP based user space application.
However in my use case, packets payload get fragmented while
processing, basically new packets are constructed inside and sent
further.
I probably cannot avoid mempcy anyway.

So I plan to solve it simply - one umem per port, no locking, no
keeping track of umem frames presence (kernel / user space) . Just
usage of the rings, one half of the frames to circulate between the RX
 <-> fill queue, the other half TX <-> completion queue.

Is it actually possible to initialize the rings in such a way that at
the very beginning I would fill the completion queue by some frames?
This is to avoid multithreaded access to the free frames without
locking (initial TX would take a look for free frames inside the
completion queue).

If it's a bad idea, what else would you suggest?

Thank you
Julius