Skip to content

Commit 909fc8d

Browse files
dtatuleakuba-moo
authored andcommitted
net/mlx5e: SHAMPO, Add no-split ethtool counters for header/data split
When SHAMPO can't identify the protocol/header of a packet, it will yield a packet that is not split - all the packet is in the data part. Count this value in packets and bytes. Signed-off-by: Dragos Tatulea <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 5bd8770 commit 909fc8d

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,22 @@ the software port.
218218
[#accel]_.
219219
- Informative
220220

221+
* - `rx[i]_hds_nosplit_packets`
222+
- Number of packets that were not split in header/data split mode. A
223+
packet will not get split when the hardware does not support its
224+
protocol splitting. An example such a protocol is ICMPv4/v6. Currently
225+
TCP and UDP with IPv4/IPv6 are supported for header/data split
226+
[#accel]_.
227+
- Informative
228+
229+
* - `rx[i]_hds_nosplit_bytes`
230+
- Number of bytes for packets that were not split in header/data split
231+
mode. A packet will not get split when the hardware does not support its
232+
protocol splitting. An example such a protocol is ICMPv4/v6. Currently
233+
TCP and UDP with IPv4/IPv6 are supported for header/data split
234+
[#accel]_.
235+
- Informative
236+
221237
* - `rx[i]_lro_packets`
222238
- The number of LRO packets received on ring i [#accel]_.
223239
- Acceleration

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2346,6 +2346,9 @@ static void mlx5e_handle_rx_cqe_mpwrq_shampo(struct mlx5e_rq *rq, struct mlx5_cq
23462346
stats->hds_nodata_packets++;
23472347
stats->hds_nodata_bytes += head_size;
23482348
}
2349+
} else {
2350+
stats->hds_nosplit_packets++;
2351+
stats->hds_nosplit_bytes += data_bcnt;
23492352
}
23502353

23512354
mlx5e_shampo_complete_rx_cqe(rq, cqe, cqe_bcnt, *skb);

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ static const struct counter_desc sw_stats_desc[] = {
144144
{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_gro_large_hds) },
145145
{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_hds_nodata_packets) },
146146
{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_hds_nodata_bytes) },
147+
{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_hds_nosplit_packets) },
148+
{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_hds_nosplit_bytes) },
147149
{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_ecn_mark) },
148150
{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_removed_vlan_packets) },
149151
{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_csum_unnecessary) },
@@ -347,6 +349,8 @@ static void mlx5e_stats_grp_sw_update_stats_rq_stats(struct mlx5e_sw_stats *s,
347349
s->rx_gro_large_hds += rq_stats->gro_large_hds;
348350
s->rx_hds_nodata_packets += rq_stats->hds_nodata_packets;
349351
s->rx_hds_nodata_bytes += rq_stats->hds_nodata_bytes;
352+
s->rx_hds_nosplit_packets += rq_stats->hds_nosplit_packets;
353+
s->rx_hds_nosplit_bytes += rq_stats->hds_nosplit_bytes;
350354
s->rx_ecn_mark += rq_stats->ecn_mark;
351355
s->rx_removed_vlan_packets += rq_stats->removed_vlan_packets;
352356
s->rx_csum_none += rq_stats->csum_none;
@@ -2062,6 +2066,8 @@ static const struct counter_desc rq_stats_desc[] = {
20622066
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, gro_large_hds) },
20632067
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, hds_nodata_packets) },
20642068
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, hds_nodata_bytes) },
2069+
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, hds_nosplit_packets) },
2070+
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, hds_nosplit_bytes) },
20652071
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, ecn_mark) },
20662072
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, removed_vlan_packets) },
20672073
{ 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
@@ -156,6 +156,8 @@ struct mlx5e_sw_stats {
156156
u64 rx_gro_large_hds;
157157
u64 rx_hds_nodata_packets;
158158
u64 rx_hds_nodata_bytes;
159+
u64 rx_hds_nosplit_packets;
160+
u64 rx_hds_nosplit_bytes;
159161
u64 rx_mcast_packets;
160162
u64 rx_ecn_mark;
161163
u64 rx_removed_vlan_packets;
@@ -356,6 +358,8 @@ struct mlx5e_rq_stats {
356358
u64 gro_large_hds;
357359
u64 hds_nodata_packets;
358360
u64 hds_nodata_bytes;
361+
u64 hds_nosplit_packets;
362+
u64 hds_nosplit_bytes;
359363
u64 mcast_packets;
360364
u64 ecn_mark;
361365
u64 removed_vlan_packets;

0 commit comments

Comments
 (0)