[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANn89iKFXk2wTfZzSNhdd-BEwJ5vP84Jg+d4BFJ8Fde6_qKAHQ@mail.gmail.com>
Date: Thu, 10 Mar 2022 21:08:10 -0800
From: Eric Dumazet <edumazet@...gle.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Eric Dumazet <eric.dumazet@...il.com>,
"David S . Miller" <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>,
jeffreyji <jeffreyji@...gle.com>,
Brian Vazquez <brianvv@...gle.com>,
Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH v3 net-next] net: add per-cpu storage and net->core_stats
On Thu, Mar 10, 2022 at 9:01 PM Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Thu, 10 Mar 2022 08:52:43 -0800 Eric Dumazet wrote:
> > From: Eric Dumazet <edumazet@...gle.com>
> >
> > Before adding yet another possibly contended atomic_long_t,
> > it is time to add per-cpu storage for existing ones:
> > dev->tx_dropped, dev->rx_dropped, and dev->rx_nohandler
> >
> > Because many devices do not have to increment such counters,
> > allocate the per-cpu storage on demand, so that dev_get_stats()
> > does not have to spend considerable time folding zero counters.
> >
> > Note that some drivers have abused these counters which
> > were supposed to be only used by core networking stack.
> >
> > v3: added a READ_ONCE() in netdev_core_stats_alloc() (Paolo)
> >
> > v2: add a missing include (reported by kernel test robot <lkp@...el.com>)
> > Change in netdev_core_stats_alloc() (Jakub)
> >
> > Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> > Cc: jeffreyji <jeffreyji@...gle.com>
> > Reviewed-by: Brian Vazquez <brianvv@...gle.com>
> > Reviewed-by: Jakub Kicinski <kuba@...nel.org>
> > Cc: Paolo Abeni <pabeni@...hat.com>
>
> > + for_each_possible_cpu(i) {
> > + core_stats = per_cpu(p, i);
>
> IDK if this is just sparse being silly or an actual problem but
> apparently the right incantation is:
>
> core_stats = &per_cpu(*p, i);
Hmm,,, I think it is a typo, I would normally have used
core_stats = per_cpu_ptr(p, i);
Let me double check.
Powered by blists - more mailing lists