Skip to content

Commit e95c5b9

Browse files
Tariq Toukankuba-moo
authored andcommitted
net/mlx5e: SHAMPO, Add header-only ethtool counters for header data split
Count the number of header-only packets and bytes from SHAMPO. Signed-off-by: Dragos Tatulea <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 16f448d commit e95c5b9

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,15 @@ the software port.
209209
headers that require additional memory to be allocated.
210210
- Informative
211211

212+
* - `rx[i]_hds_nodata_packets`
213+
- Number of header only packets in header/data split mode [#accel]_.
214+
- Informative
215+
216+
* - `rx[i]_hds_nodata_bytes`
217+
- Number of bytes for header only packets in header/data split mode
218+
[#accel]_.
219+
- Informative
220+
212221
* - `rx[i]_lro_packets`
213222
- The number of LRO packets received on ring i [#accel]_.
214223
- Acceleration

drivers/net/ethernet/mellanox/mlx5/core/en_rx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2331,6 +2331,9 @@ static void mlx5e_handle_rx_cqe_mpwrq_shampo(struct mlx5e_rq *rq, struct mlx5_cq
23312331

23322332
frag_page = &wi->alloc_units.frag_pages[page_idx];
23332333
mlx5e_shampo_fill_skb_data(*skb, rq, frag_page, data_bcnt, data_offset);
2334+
} else {
2335+
stats->hds_nodata_packets++;
2336+
stats->hds_nodata_bytes += head_size;
23342337
}
23352338
}
23362339

drivers/net/ethernet/mellanox/mlx5/core/en_stats.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,8 @@ static void mlx5e_stats_grp_sw_update_stats_rq_stats(struct mlx5e_sw_stats *s,
343343
s->rx_gro_bytes += rq_stats->gro_bytes;
344344
s->rx_gro_skbs += rq_stats->gro_skbs;
345345
s->rx_gro_large_hds += rq_stats->gro_large_hds;
346+
s->rx_hds_nodata_packets += rq_stats->hds_nodata_packets;
347+
s->rx_hds_nodata_bytes += rq_stats->hds_nodata_bytes;
346348
s->rx_ecn_mark += rq_stats->ecn_mark;
347349
s->rx_removed_vlan_packets += rq_stats->removed_vlan_packets;
348350
s->rx_csum_none += rq_stats->csum_none;
@@ -2056,6 +2058,8 @@ static const struct counter_desc rq_stats_desc[] = {
20562058
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, gro_bytes) },
20572059
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, gro_skbs) },
20582060
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, gro_large_hds) },
2061+
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, hds_nodata_packets) },
2062+
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, hds_nodata_bytes) },
20592063
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, ecn_mark) },
20602064
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, removed_vlan_packets) },
20612065
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, wqe_err) },

drivers/net/ethernet/mellanox/mlx5/core/en_stats.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ struct mlx5e_sw_stats {
154154
u64 rx_gro_bytes;
155155
u64 rx_gro_skbs;
156156
u64 rx_gro_large_hds;
157+
u64 rx_hds_nodata_packets;
158+
u64 rx_hds_nodata_bytes;
157159
u64 rx_mcast_packets;
158160
u64 rx_ecn_mark;
159161
u64 rx_removed_vlan_packets;
@@ -352,6 +354,8 @@ struct mlx5e_rq_stats {
352354
u64 gro_bytes;
353355
u64 gro_skbs;
354356
u64 gro_large_hds;
357+
u64 hds_nodata_packets;
358+
u64 hds_nodata_bytes;
355359
u64 mcast_packets;
356360
u64 ecn_mark;
357361
u64 removed_vlan_packets;

0 commit comments

Comments
 (0)