Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20240911201757.1505453-15-saeed@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Dragos Tatulea and committed by
Jakub Kicinski
909fc8d1 5bd87709

+29
+16
Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst
··· 218 218 [#accel]_. 219 219 - Informative 220 220 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 + 221 237 * - `rx[i]_lro_packets` 222 238 - The number of LRO packets received on ring i [#accel]_. 223 239 - Acceleration
+3
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
··· 2346 2346 stats->hds_nodata_packets++; 2347 2347 stats->hds_nodata_bytes += head_size; 2348 2348 } 2349 + } else { 2350 + stats->hds_nosplit_packets++; 2351 + stats->hds_nosplit_bytes += data_bcnt; 2349 2352 } 2350 2353 2351 2354 mlx5e_shampo_complete_rx_cqe(rq, cqe, cqe_bcnt, *skb);
+6
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
··· 144 144 { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_gro_large_hds) }, 145 145 { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_hds_nodata_packets) }, 146 146 { 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) }, 147 149 { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_ecn_mark) }, 148 150 { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_removed_vlan_packets) }, 149 151 { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_csum_unnecessary) }, ··· 349 347 s->rx_gro_large_hds += rq_stats->gro_large_hds; 350 348 s->rx_hds_nodata_packets += rq_stats->hds_nodata_packets; 351 349 s->rx_hds_nodata_bytes += rq_stats->hds_nodata_bytes; 350 + s->rx_hds_nosplit_packets += rq_stats->hds_nosplit_packets; 351 + s->rx_hds_nosplit_bytes += rq_stats->hds_nosplit_bytes; 352 352 s->rx_ecn_mark += rq_stats->ecn_mark; 353 353 s->rx_removed_vlan_packets += rq_stats->removed_vlan_packets; 354 354 s->rx_csum_none += rq_stats->csum_none; ··· 2066 2062 { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, gro_large_hds) }, 2067 2063 { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, hds_nodata_packets) }, 2068 2064 { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, hds_nodata_bytes) }, 2065 + { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, hds_nosplit_packets) }, 2066 + { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, hds_nosplit_bytes) }, 2069 2067 { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, ecn_mark) }, 2070 2068 { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, removed_vlan_packets) }, 2071 2069 { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, wqe_err) },
+4
drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
··· 156 156 u64 rx_gro_large_hds; 157 157 u64 rx_hds_nodata_packets; 158 158 u64 rx_hds_nodata_bytes; 159 + u64 rx_hds_nosplit_packets; 160 + u64 rx_hds_nosplit_bytes; 159 161 u64 rx_mcast_packets; 160 162 u64 rx_ecn_mark; 161 163 u64 rx_removed_vlan_packets; ··· 358 356 u64 gro_large_hds; 359 357 u64 hds_nodata_packets; 360 358 u64 hds_nodata_bytes; 359 + u64 hds_nosplit_packets; 360 + u64 hds_nosplit_bytes; 361 361 u64 mcast_packets; 362 362 u64 ecn_mark; 363 363 u64 removed_vlan_packets;