[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <p22efbdqaaypgp7wu4csohhtzowpgrzrtelev7waumidabryty@lq4txzalfbfl>
Date: Fri, 11 Jul 2025 09:29:38 -0700
From: Breno Leitao <leitao@...ian.org>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-team@...a.com, dw@...idwei.uk
Subject: Re: [PATCH net-next v2] netdevsim: implement peer queue flow control
On Wed, Jul 09, 2025 at 02:36:27PM -0700, Jakub Kicinski wrote:
> On Wed, 9 Jul 2025 03:34:20 -0700 Breno Leitao wrote:
> > +
> > + synchronize_net();
> > + netif_tx_wake_all_queues(dev);
> > + rcu_read_lock();
> > + peer = rcu_dereference(ns->peer);
> > + if (peer)
> > + netif_tx_wake_all_queues(peer->netdev);
> > + rcu_read_unlock();
>
> That's sufficiently orthogonal to warrant a dedicated function / helper.
>
> In terms of code I think we can skip the whole dance if peer is NULL?
Sure. We can use rcu_access_pointer() to check if the value is set, and
then get into the slow path.
if (rcu_access_pointer(ns->peer))
nsim_wake_queues(dev);
> > Also, with this patch, we will eventually get the following critical
> > message:
> >
> > net_crit_ratelimited("Virtual device %s asks to queue packet!\n", dev->name);
> >
> > I am wondering if that alert is not valid anymore, and I can simply
> > remove it.
>
> Ah. In nsim_setup() we should remove IFF_NO_QUEUE and stop setting
> tx_queue_len to 0
That makes sense, thanks!
--breno
Powered by blists - more mailing lists