Re: [PATCH net-next v7 3/9] tun/tap: add ptr_ring consume helper with netdev queue wakeup

From: Michael S. Tsirkin

Date: Sat Feb 14 2026 - 13:19:14 EST


On Sat, Feb 14, 2026 at 06:13:14PM +0100, Simon Schippers wrote:

...

> Patched: Waking on __ptr_ring_produce_created_space() is too early. The
> stop/wake cycle occurs too frequently which slows down
> performance as can be seen for TAP.
>
> Wake on empty variant: Waking on __ptr_ring_empty() is (slightly) too
> late. The consumer starves because the producer
> first has to produce packets again. This slows
> down performance aswell as can be seen for TAP
> and TAP+vhost-net (both down ~30-40Kpps).
>
> I think something inbetween should be used.
> The wake should be done as late as possible to have as few
> NET_TX_SOFTIRQs as possible but early enough that there are still
> consumable packets remaining to not starve the consumer.
>
> However, I can not think of a proper way to implement this right now.
>
> Thanks!

What is the difficulty?

Your patches check __ptr_ring_consume_created_space(..., 1).

How about __ptr_ring_consume_created_space(..., 8) then? 16?

--
MST