netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/4] net: Convert some UDP tunnel drivers to NETDEV_PCPU_STAT_DSTATS.
@ 2024-12-04 12:11 Guillaume Nault
  2024-12-04 12:11 ` [PATCH net-next v2 1/4] vrf: Make pcpu_dstats update functions available to other modules Guillaume Nault
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Guillaume Nault @ 2024-12-04 12:11 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
  Cc: netdev, Simon Horman, David Ahern, Andrew Lunn

VXLAN, Geneve and Bareudp use various device counters for managing
RX and TX statistics:

  * VXLAN uses the device core_stats for RX and TX drops, tstats for
    regular RX/TX counters and DEV_STATS_INC() for various types of
    RX/TX errors.

  * Geneve uses tstats for regular RX/TX counters and DEV_STATS_INC()
    for everything else, include RX/TX drops.

  * Bareudp, was recently converted to follow VXLAN behaviour, that is,
    device core_stats for RX and TX drops, tstats for regular RX/TX
    counters and DEV_STATS_INC() for other counter types.

Let's consolidate statistics management around the dstats counters
instead. This avoids using core_stats in VXLAN and Bareudp, as
core_stats is supposed to be used by core networking code only (and not
in drivers).  This also allows Geneve to avoid using atomic increments
when updating RX and TX drop counters, as dstats is per-cpu. Finally,
this also simplifies the code as all three modules now handle stats in
the same way and with only two different sets of counters (the per-cpu
dstats and the atomic DEV_STATS_INC()).

Patch 1 creates dstats helper functions that can be used outside of VRF
(until then, dstats was VRF-specific).
Then patches 2 to 4, convert VXLAN, Geneve and Bareudp, one by one.

v2:
  * Copy skb->len before calling is_ip_tx_frame() in vrf_xmit() (Jakub).


Guillaume Nault (4):
  vrf: Make pcpu_dstats update functions available to other modules.
  vxlan: Handle stats using NETDEV_PCPU_STAT_DSTATS.
  geneve: Handle stats using NETDEV_PCPU_STAT_DSTATS.
  bareudp: Handle stats using NETDEV_PCPU_STAT_DSTATS.

 drivers/net/bareudp.c          | 16 +++++------
 drivers/net/geneve.c           | 12 ++++-----
 drivers/net/vrf.c              | 49 ++++++++++------------------------
 drivers/net/vxlan/vxlan_core.c | 28 +++++++++----------
 include/linux/netdevice.h      | 40 +++++++++++++++++++++++++++
 5 files changed, 82 insertions(+), 63 deletions(-)

-- 
2.39.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-12-07  2:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-04 12:11 [PATCH net-next v2 0/4] net: Convert some UDP tunnel drivers to NETDEV_PCPU_STAT_DSTATS Guillaume Nault
2024-12-04 12:11 ` [PATCH net-next v2 1/4] vrf: Make pcpu_dstats update functions available to other modules Guillaume Nault
2024-12-04 12:11 ` [PATCH net-next v2 2/4] vxlan: Handle stats using NETDEV_PCPU_STAT_DSTATS Guillaume Nault
2024-12-04 12:11 ` [PATCH net-next v2 3/4] geneve: " Guillaume Nault
2024-12-04 12:11 ` [PATCH net-next v2 4/4] bareudp: " Guillaume Nault
2024-12-07  2:20 ` [PATCH net-next v2 0/4] net: Convert some UDP tunnel drivers to NETDEV_PCPU_STAT_DSTATS patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).