# \[PATCH 2/4\] netdev queue flow control for TUN

- From: Simon Schippers \<hidden\>
- Date: 2025-09-03 18:49:55 
- List: netdev
- Page: https://ratatoskr.run/netdev/2025/09/3199578
- Thread: https://ratatoskr.run/netdev/2025/09/3196216/t.md

```text
Michael S. Tsirkin wrote:
> On Tue, Sep 02, 2025 at 10:09:55AM +0200, Simon Schippers wrote:
>> The netdev queue is stopped in tun_net_xmit after inserting an SKB into
>> the ring buffer if the ring buffer became full because of that. If the
>> insertion into the ptr_ring fails, the netdev queue is also stopped and
>> the SKB is dropped. However, this never happened in my testing. To ensure
>> that the ptr_ring change is available to the consumer before the netdev
>> queue stop, an smp_wmb() is used.
> 
> I think the stop -> wake bounce involves enough barriers already,
> no need for us to get cute.
>

Yes, you and Jason are correct, it seems to be unnecessary. I just removed
the barriers, and it tests fine!
```
