linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 00/21] ethtool, stats: introduce and use standard XDP stats
@ 2021-08-03 16:36 Alexander Lobakin
  2021-08-03 16:36 ` [PATCH net-next 01/21] ethtool, stats: use a shorthand pointer in stats_prepare_data() Alexander Lobakin
                   ` (21 more replies)
  0 siblings, 22 replies; 45+ messages in thread
From: Alexander Lobakin @ 2021-08-03 16:36 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: Alexander Lobakin, Jesse Brandeburg, Lukasz Czapnik,
	Marcin Kubiak, Michal Kubiak, Michal Swiatkowski,
	Jonathan Corbet, Netanel Belgazal, Arthur Kiyanovski, Guy Tzalik,
	Saeed Bishara, Ioana Ciornei, Claudiu Manoil, Thomas Petazzoni,
	Marcin Wojtas, Russell King, Edward Cree, Martin Habets,
	Michael S. Tsirkin, Jason Wang, Alexei Starovoitov,
	Daniel Borkmann, Jesper Dangaard Brouer, John Fastabend,
	Andrii Nakryiko, Martin KaFai Lau, Song Liu, Yonghong Song,
	KP Singh, Shay Agroskin, Sameeh Jubran, Alexander Duyck,
	Danielle Ratson, Ido Schimmel, Andrew Lunn, Vladyslav Tarasiuk,
	Arnd Bergmann, Andrew Morton, Jian Shen, Petr Vorel, Dan Murphy,
	Yangbo Lu, Michal Kubecek, Zheng Yongjun, Heiner Kallweit,
	YueHaibing, Johannes Berg, netdev, linux-doc, linux-kernel,
	virtualization, bpf

This series follows the Jakub's work on standard statistics and
unifies XDP statistics across [most of] the drivers.
The only driver left unconverted is mlx5 -- it has rather complex
statistics, so I believe it would be better to leave this up to
its developers.

The stats itself consists of 12 counters:
 - packets: number of frames passed to bpf_prog_run_xdp();
 - errors: number of general XDP errors, if driver has one unified counter;
 - aborted: number of XDP_ABORTED returns;
 - drop: number of XDP_DROP returns;
 - invalid: number of returns of unallowed values (i.e. not XDP_*);
 - pass: number of XDP_PASS returns;
 - redirect: number of successfully performed XDP_REDIRECT requests;
 - redirect_errors: number of failed XDP_REDIRECT requests;
 - tx: number of successfully performed XDP_TX requests;
 - tx_errors: number of failed XDP_TX requests;
 - xmit: number of xdp_frames successfully transmitted via .ndo_xdp_xmit();
 - xmit_drops: number of frames dropped from .ndo_xdp_xmit().

As most drivers stores them on a per-channel basis, Ethtool standard
stats infra has been expanded to support this. A new nested
attribute has been added which indicated that the fields enclosed
in this block are related to one particular channel. If Ethtool
utility is older than the kernel, those blocks will just be skipped
with no errors.
When the stats are not per-channel, Ethtool core treats them as
regular and so does Ethtool utility display them. Otherwise,
the example output looks like:

$ ./ethtool -S enp175s0f0 --all-groups
Standard stats for enp175s0f0:
[ snip ]
channel0-xdp-aborted: 1
channel0-xdp-drop: 2
channel0-xdp-illegal: 3
channel0-xdp-pass: 4
channel0-xdp-redirect: 5
[ snip ]

...and the JSON output looks like:

[ snip ]
        "xdp": {
            "per-channel": [
                "channel0": {
                    "aborted": 1,
                    "drop": 2,
                    "illegal": 3,
                    "pass": 4,
                    "redirect": 5,
[ snip ]
                } ]
        }
[ snip ]

Rouhly half of the commits are present to unify XDP stats logics
across the drivers, and the first two are preparatory/housekeeping.

This set is also available here: [0]

[0] https://github.com/alobakin/linux/tree/xdp_stats

Alexander Lobakin (21):
  ethtool, stats: use a shorthand pointer in stats_prepare_data()
  ethtool, stats: add compile-time checks for standard stats
  ethtool, stats: introduce standard XDP statistics
  ethernet, dpaa2: simplify per-channel Ethtool stats counting
  ethernet, dpaa2: convert to standard XDP stats
  ethernet, ena: constify src and syncp args of ena_safe_update_stat()
  ethernet, ena: convert to standard XDP stats
  ethernet, enetc: convert to standard XDP stats
  ethernet, mvneta: rename xdp_xmit_err to xdp_xmit_drops
  ethernet, mvneta: convert to standard XDP stats
  ethernet, mvpp2: rename xdp_xmit_err to xdp_xmit_drops
  ethernet, mvpp2: convert to standard XDP stats
  ethernet, sfc: convert to standard XDP stats
  veth: rename rx_drops to xdp_errors
  veth: rename xdp_xmit_errors to xdp_xmit_drops
  veth: rename drop xdp_ suffix from packets and bytes stats
  veth: convert to standard XDP stats
  virtio-net: rename xdp_tx{,__drops} SQ stats to xdp_xmit{,__drops}
  virtio-net: don't mix error-caused drops with XDP_DROP cases
  virtio-net: convert to standard XDP stats
  Documentation, ethtool-netlink: update standard statistics
    documentation

 Documentation/networking/ethtool-netlink.rst  |  45 +++--
 drivers/net/ethernet/amazon/ena/ena_ethtool.c |  50 +++++-
 .../net/ethernet/freescale/dpaa2/dpaa2-eth.h  |   7 +-
 .../ethernet/freescale/dpaa2/dpaa2-ethtool.c  |  38 +++-
 .../ethernet/freescale/enetc/enetc_ethtool.c  |  58 ++++--
 drivers/net/ethernet/marvell/mvneta.c         | 112 ++++++------
 drivers/net/ethernet/marvell/mvpp2/mvpp2.h    |   2 +-
 .../net/ethernet/marvell/mvpp2/mvpp2_main.c   |  96 +++-------
 drivers/net/ethernet/sfc/ef100_ethtool.c      |   2 +
 drivers/net/ethernet/sfc/ethtool.c            |   2 +
 drivers/net/ethernet/sfc/ethtool_common.c     |  35 +++-
 drivers/net/ethernet/sfc/ethtool_common.h     |   3 +
 drivers/net/veth.c                            | 167 ++++++++++--------
 drivers/net/virtio_net.c                      |  76 ++++++--
 include/linux/ethtool.h                       |  36 ++++
 include/uapi/linux/ethtool.h                  |   2 +
 include/uapi/linux/ethtool_netlink.h          |  34 ++++
 net/ethtool/netlink.h                         |   1 +
 net/ethtool/stats.c                           | 163 +++++++++++++++--
 net/ethtool/strset.c                          |   5 +
 20 files changed, 659 insertions(+), 275 deletions(-)

-- 
2.31.1


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

end of thread, other threads:[~2021-11-08 18:09 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03 16:36 [PATCH net-next 00/21] ethtool, stats: introduce and use standard XDP stats Alexander Lobakin
2021-08-03 16:36 ` [PATCH net-next 01/21] ethtool, stats: use a shorthand pointer in stats_prepare_data() Alexander Lobakin
2021-08-03 16:36 ` [PATCH net-next 02/21] ethtool, stats: add compile-time checks for standard stats Alexander Lobakin
2021-08-03 16:36 ` [PATCH net-next 03/21] ethtool, stats: introduce standard XDP statistics Alexander Lobakin
2021-08-03 20:49   ` Jakub Kicinski
2021-08-03 23:57     ` Saeed Mahameed
2021-08-04 12:36       ` Jakub Kicinski
2021-08-04 15:53         ` Alexander Lobakin
2021-08-04 16:57           ` Jakub Kicinski
2021-08-05 11:18             ` Alexander Lobakin
2021-08-05 13:31               ` Jakub Kicinski
2021-08-04 16:17         ` David Ahern
2021-08-04 16:44           ` Jakub Kicinski
2021-08-04 17:28             ` David Ahern
2021-08-04 18:27               ` Saeed Mahameed
2021-08-05  0:43                 ` David Ahern
2021-08-05  2:14                   ` Saeed Mahameed
2021-08-12 12:19             ` Jesper Dangaard Brouer
2021-10-26  9:23       ` Alexander Lobakin
2021-11-05 16:44         ` Alexander Lobakin
2021-11-08 11:37           ` Toke Høiland-Jørgensen
2021-11-08 13:21             ` Alexander Lobakin
2021-11-08 18:09               ` Toke Høiland-Jørgensen
2021-08-03 16:36 ` [PATCH net-next 04/21] ethernet, dpaa2: simplify per-channel Ethtool stats counting Alexander Lobakin
2021-08-03 16:36 ` [PATCH net-next 05/21] ethernet, dpaa2: convert to standard XDP stats Alexander Lobakin
2021-08-03 16:36 ` [PATCH net-next 06/21] ethernet, ena: constify src and syncp args of ena_safe_update_stat() Alexander Lobakin
2021-08-03 16:36 ` [PATCH net-next 07/21] ethernet, ena: convert to standard XDP stats Alexander Lobakin
2021-08-04 13:04   ` Shay Agroskin
2021-08-04 15:24     ` Alexander Lobakin
2021-08-03 16:36 ` [PATCH net-next 08/21] ethernet, enetc: " Alexander Lobakin
2021-08-03 16:36 ` [PATCH net-next 09/21] ethernet, mvneta: rename xdp_xmit_err to xdp_xmit_drops Alexander Lobakin
2021-08-03 16:36 ` [PATCH net-next 10/21] ethernet, mvneta: convert to standard XDP stats Alexander Lobakin
2021-08-03 16:36 ` [PATCH net-next 11/21] ethernet, mvpp2: rename xdp_xmit_err to xdp_xmit_drops Alexander Lobakin
2021-08-03 16:36 ` [PATCH net-next 12/21] ethernet, mvpp2: convert to standard XDP stats Alexander Lobakin
2021-08-03 16:36 ` [PATCH net-next 13/21] ethernet, sfc: " Alexander Lobakin
2021-08-03 17:59   ` Edward Cree
2021-08-03 16:36 ` [PATCH net-next 14/21] veth: rename rx_drops to xdp_errors Alexander Lobakin
2021-08-03 16:36 ` [PATCH net-next 15/21] veth: rename xdp_xmit_errors to xdp_xmit_drops Alexander Lobakin
2021-08-03 16:36 ` [PATCH net-next 16/21] veth: rename drop xdp_ suffix from packets and bytes stats Alexander Lobakin
2021-08-03 16:36 ` [PATCH net-next 17/21] veth: convert to standard XDP stats Alexander Lobakin
2021-08-03 16:36 ` [PATCH net-next 18/21] virtio-net: rename xdp_tx{,__drops} SQ stats to xdp_xmit{,__drops} Alexander Lobakin
2021-08-03 16:42 ` Alexander Lobakin
2021-08-03 16:42 ` [PATCH net-next 19/21] virtio-net: don't mix error-caused drops with XDP_DROP cases Alexander Lobakin
2021-08-03 16:42 ` [PATCH net-next 20/21] virtio-net: convert to standard XDP stats Alexander Lobakin
2021-08-03 16:42 ` [PATCH net-next 21/21] Documentation, ethtool-netlink: update standard statistics documentation Alexander Lobakin

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).