[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iLmC8Wd6PcBeN899c_pp0VKNP2S=gctBS8cP8+spknL1A@mail.gmail.com>
Date: Tue, 21 Mar 2023 04:08:27 -0700
From: Eric Dumazet <edumazet@...gle.com>
To: Praveen Kannoju <praveen.kannoju@...cle.com>
Cc: "jhs@...atatu.com" <jhs@...atatu.com>,
"xiyou.wangcong@...il.com" <xiyou.wangcong@...il.com>,
"jiri@...nulli.us" <jiri@...nulli.us>,
"davem@...emloft.net" <davem@...emloft.net>,
"kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Rajesh Sivaramasubramaniom
<rajesh.sivaramasubramaniom@...cle.com>,
Rama Nichanamatlu <rama.nichanamatlu@...cle.com>,
Manjunath Patil <manjunath.b.patil@...cle.com>
Subject: Re: [PATCH RFC] net/sched: use real_num_tx_queues in dev_watchdog()
On Tue, Mar 21, 2023 at 3:05 AM Praveen Kannoju
<praveen.kannoju@...cle.com> wrote:
>
> Ping.
>
I do not think dev_watchdog() needs to be efficient ?
In any case, reading dev->real_num_tx_queues from a timer handler
could be racy vs RTNL.
While reading dev->num_tx_queues is not racy.
I think you should describe what problem you are trying to solve.
> > -----Original Message-----
> > From: Praveen Kumar Kannoju <praveen.kannoju@...cle.com>
> > Sent: 16 March 2023 12:04 AM
> > To: jhs@...atatu.com; xiyou.wangcong@...il.com; jiri@...nulli.us; davem@...emloft.net; edumazet@...gle.com;
> > kuba@...nel.org; pabeni@...hat.com; netdev@...r.kernel.org; linux-kernel@...r.kernel.org
> > Cc: Rajesh Sivaramasubramaniom <rajesh.sivaramasubramaniom@...cle.com>; Rama Nichanamatlu
> > <rama.nichanamatlu@...cle.com>; Manjunath Patil <manjunath.b.patil@...cle.com>; Praveen Kannoju
> > <praveen.kannoju@...cle.com>
> > Subject: [PATCH RFC] net/sched: use real_num_tx_queues in dev_watchdog()
> >
> > Currently dev_watchdog() loops through num_tx_queues[Number of TX queues allocated at alloc_netdev_mq() time] instead of
> > real_num_tx_queues [Number of TX queues currently active in device] to detect transmit queue time out. Make this efficient by
> > using real_num_tx_queues.
> >
> > Signed-off-by: Praveen Kumar Kannoju <praveen.kannoju@...cle.com>
> > ---
> > PS: Please let me know if I am missing something obvious here.
> > net/sched/sch_generic.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index a9aadc4e6858..e7d41a25f0e8 100644
> > --- a/net/sched/sch_generic.c
> > +++ b/net/sched/sch_generic.c
> > @@ -506,7 +506,7 @@ static void dev_watchdog(struct timer_list *t)
> > unsigned int i;
> > unsigned long trans_start;
> >
> > - for (i = 0; i < dev->num_tx_queues; i++) {
> > + for (i = 0; i < dev->real_num_tx_queues; i++) {
> > struct netdev_queue *txq;
> >
> > txq = netdev_get_tx_queue(dev, i);
> > --
> > 2.31.1
>
Powered by blists - more mailing lists