Re: [PATCH net-next] netdevsim: implement peer queue flow control
From: Breno Leitao
Date: Wed Jul 02 2025 - 04:12:25 EST
Hello David,
On Tue, Jul 01, 2025 at 03:26:07PM -0700, David Wei wrote:
> On 2025-07-01 11:10, Breno Leitao wrote:
> [...]> diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c
> > index e36d3e846c2dc..43f31bc134b0a 100644
> > --- a/drivers/net/netdevsim/netdev.c
> > +++ b/drivers/net/netdevsim/netdev.c
> > @@ -351,6 +406,9 @@ static int nsim_rcv(struct nsim_rq *rq, int budget)
> > dev_dstats_rx_dropped(dev);
> > }
> > + rcu_read_lock();
> > + nsim_start_peer_tx_queue(dev, rq);
> > + rcu_read_unlock();
>
> Could the rcu_read_{un}lock() be moved into the
> nsim_start/stop_peer_tx_queue() functions to keep it together with
> rcu_dereference()?
Yes, for sure. In fact, I will update and move the locking primitives to
inside the functions.
Thanks for the feedback,
--breno