netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Chapman <jchapman@katalix.com>
To: Guillaume Nault <gnault@redhat.com>,
	David Miller <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>
Cc: netdev@vger.kernel.org, Simon Horman <horms@kernel.org>,
	David Ahern <dsahern@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>
Subject: Re: [PATCH net-next 0/4] net: Convert some UDP tunnel drivers to NETDEV_PCPU_STAT_DSTATS.
Date: Tue, 3 Dec 2024 08:12:29 +0000	[thread overview]
Message-ID: <bb2cd5e8-39c3-4fc4-e02e-2c2d6bf01f64@katalix.com> (raw)
In-Reply-To: <cover.1733175419.git.gnault@redhat.com>

Hi Guillaume,

I can work on similar changes to l2tp if you haven't already started 
work on it.

James

On 02/12/2024 21:48, Guillaume Nault wrote:
> 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
> (before that, dstats was VRF-specific).
> Patches 2 to 4 convert VXLAN, Geneve and Bareudp, one by one.
> 
> 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              | 46 +++++++++-------------------------
>   drivers/net/vxlan/vxlan_core.c | 28 ++++++++++-----------
>   include/linux/netdevice.h      | 40 +++++++++++++++++++++++++++++
>   5 files changed, 80 insertions(+), 62 deletions(-)
> 

-- 
James Chapman
Katalix Systems Ltd
https://katalix.com
Catalysts for your Embedded Linux software development


  parent reply	other threads:[~2024-12-03  8:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-02 21:48 [PATCH net-next 0/4] net: Convert some UDP tunnel drivers to NETDEV_PCPU_STAT_DSTATS Guillaume Nault
2024-12-02 21:48 ` [PATCH net-next 1/4] vrf: Make pcpu_dstats update functions available to other modules Guillaume Nault
2024-12-03  3:59   ` Jakub Kicinski
2024-12-03 11:32     ` Guillaume Nault
2024-12-02 21:48 ` [PATCH net-next 2/4] vxlan: Handle stats using NETDEV_PCPU_STAT_DSTATS Guillaume Nault
2024-12-02 21:48 ` [PATCH net-next 3/4] geneve: " Guillaume Nault
2024-12-02 21:48 ` [PATCH net-next 4/4] bareudp: " Guillaume Nault
2024-12-03  8:12 ` James Chapman [this message]
2024-12-03 11:39   ` [PATCH net-next 0/4] net: Convert some UDP tunnel drivers to NETDEV_PCPU_STAT_DSTATS Guillaume Nault

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bb2cd5e8-39c3-4fc4-e02e-2c2d6bf01f64@katalix.com \
    --to=jchapman@katalix.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=gnault@redhat.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).