lkml.org 
[lkml]   [2022]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 net-next] net-core: add rx_otherhost_dropped counter
On Tue, 8 Mar 2022 15:18:25 -0800 Eric Dumazet wrote:
> > that's an expensive packet counter for a common path (e.g., hosting
> > environments).
>
> This was the reason for the initial patch, using SNMP stat, being per cpu.
>
> Adding per-device per-cpu data for this counter will increase cost of
> netdevice dismantle phase,
> and increase time for ndo_get_stats64(), especially on hosts with 256
> or 512 cpus.

Two ways to solve this:
- make dev->pcpu_refcnt point to a structure which holds both
refcnt and whatever stats
- combine these stats into lstats, assuming the netdevs we care
about spawning / destroying fast are sw devices anyway;
struct rtnl_link_ops can indicate to the core if the driver
wants lstats (or just put how many bytes it wants), otherwise
we'd only allocate enough mem for core's stats

Option three - both.

\
 
 \ /
  Last update: 2022-03-09 02:14    [W:0.176 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site