net/mlx5e: SHAMPO, Add header-only ethtool counters for header data split
authorTariq Toukan <tariqt@nvidia.com>
Mon, 3 Jun 2024 21:22:16 +0000 (00:22 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 6 Jun 2024 03:20:46 +0000 (20:20 -0700)
Count the number of header-only packets and bytes from SHAMPO.

Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://lore.kernel.org/r/20240603212219.1037656-12-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
drivers/net/ethernet/mellanox/mlx5/core/en_stats.h

index 18638a8..3bd7257 100644 (file)
@@ -209,6 +209,15 @@ the software port.
        headers that require additional memory to be allocated.
      - Informative
 
+   * - `rx[i]_hds_nodata_packets`
+     - Number of header only packets in header/data split mode [#accel]_.
+     - Informative
+
+   * - `rx[i]_hds_nodata_bytes`
+     - Number of bytes for header only packets in header/data split mode
+       [#accel]_.
+     - Informative
+
    * - `rx[i]_lro_packets`
      - The number of LRO packets received on ring i [#accel]_.
      - Acceleration
index 7ab7215..3af4f70 100644 (file)
@@ -2331,6 +2331,9 @@ static void mlx5e_handle_rx_cqe_mpwrq_shampo(struct mlx5e_rq *rq, struct mlx5_cq
 
                        frag_page = &wi->alloc_units.frag_pages[page_idx];
                        mlx5e_shampo_fill_skb_data(*skb, rq, frag_page, data_bcnt, data_offset);
+               } else {
+                       stats->hds_nodata_packets++;
+                       stats->hds_nodata_bytes += head_size;
                }
        }
 
index a3c79da..db1cac6 100644 (file)
@@ -343,6 +343,8 @@ static void mlx5e_stats_grp_sw_update_stats_rq_stats(struct mlx5e_sw_stats *s,
        s->rx_gro_bytes               += rq_stats->gro_bytes;
        s->rx_gro_skbs                += rq_stats->gro_skbs;
        s->rx_gro_large_hds           += rq_stats->gro_large_hds;
+       s->rx_hds_nodata_packets      += rq_stats->hds_nodata_packets;
+       s->rx_hds_nodata_bytes        += rq_stats->hds_nodata_bytes;
        s->rx_ecn_mark                += rq_stats->ecn_mark;
        s->rx_removed_vlan_packets    += rq_stats->removed_vlan_packets;
        s->rx_csum_none               += rq_stats->csum_none;
@@ -2056,6 +2058,8 @@ static const struct counter_desc rq_stats_desc[] = {
        { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, gro_bytes) },
        { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, gro_skbs) },
        { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, gro_large_hds) },
+       { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, hds_nodata_packets) },
+       { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, hds_nodata_bytes) },
        { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, ecn_mark) },
        { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, removed_vlan_packets) },
        { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, wqe_err) },
index 25daae5..4c5858c 100644 (file)
@@ -154,6 +154,8 @@ struct mlx5e_sw_stats {
        u64 rx_gro_bytes;
        u64 rx_gro_skbs;
        u64 rx_gro_large_hds;
+       u64 rx_hds_nodata_packets;
+       u64 rx_hds_nodata_bytes;
        u64 rx_mcast_packets;
        u64 rx_ecn_mark;
        u64 rx_removed_vlan_packets;
@@ -352,6 +354,8 @@ struct mlx5e_rq_stats {
        u64 gro_bytes;
        u64 gro_skbs;
        u64 gro_large_hds;
+       u64 hds_nodata_packets;
+       u64 hds_nodata_bytes;
        u64 mcast_packets;
        u64 ecn_mark;
        u64 removed_vlan_packets;