mlx5: use correct counter
PATCH 1/1 mlx5: use correct counter
mlx5e_grp_q_update_stats seems to be using the wrong counter for if_down_packets.
--- drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +1 -1
@@ -363,7 +363,7 @@ static void mlx5e_grp_q_update_stats(struct mlx5e_priv *priv) !mlx5_core_query_q_counter (priv->mdev, priv->drop_rq_q_counter,0 , out, sizeof(out))) qcnt->rx_if_down_packets = MLX5_GET(query_q_counter_out, out, - out_of_buffer); + rx_if_down_packets); }#define VNIC_ENV_OFF (c) MLX5_BYTE_OFF(query_vnic_env_out, c)
Signature · 1 line
2.17.1
Quoted 22 lines · Jonathan Lemon
mlx5e_grp_q_update_statsseems to be using the wrong counter forif_down_packets.Signed-off-by Jonathan Lemon <[email protected]>--- drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +1
-1@@ -363,7 +363,7 @@ static void mlx5e_grp_q_update_stats(struct mlx5e_priv *priv) !mlx5_core_query_q_counter(priv->mdev, priv- >drop_rq_q_counter, 0, out, sizeof(out))) qcnt->rx_if_down_packets =MLX5_GET (query_q_counter_out, out, - out_of_buffer); + rx_if_down_packets)
Quoted 1 line
;
Hi Jonathan,
This patch in not applicable (won't compile and there is no issue with current code).
Although it is confusing but the code is correct as is.
1) your patch won't compile since there is no rx_if_down_packets field in query_q_counter_out hw definition struct: please check include/linux/mlx5/mlx5_ifc.h mlx5_ifc_query_q_counter_out_bits
2) the code works as is since when interface is down and port is up, technically from hw perspective there is "no buffer available" so the out_of_buffer counter of the drop_rq_q_counter will count packets dropped due to interface down..
Thanks,
Saeed.
Quoted 32 lines · Saeed Mahameed
Quoted 22 lines · Jonathan Lemon
mlx5e_grp_q_update_statsseems to be using the wrong counter forif_down_packets.Signed-off-by Jonathan Lemon <[email protected]>--- drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +1
-1@@ -363,7 +363,7 @@ static void mlx5e_grp_q_update_stats(struct mlx5e_priv *priv) !mlx5_core_query_q_counter(priv->mdev, priv- > drop_rq_q_counter, 0, out, sizeof(out))) qcnt->rx_if_down_packets =MLX5_GET (query_q_counter_out, out, - out_of_buffer); + rx_if_down_packets)Quoted 1 line
;
Hi Jonathan,
This patch in not applicable (won't compile and there is no issue with current code).
Although it is confusing but the code is correct as is.
Quoted 8 lines
1) your patch won't compile since there is no
rx_if_down_packetsfield inquery_q_counter_outhw definition struct: please checkinclude/linux/mlx5/mlx5_ifc.hmlx5_ifc_query_q_counter_out_bits
2) the code works as is since when interface is down and port is up, technically from hw perspective there is "no buffer available" so theout_of_buffercounter of thedrop_rq_q_counterwill count packets dropped due to interface down..
Hmm, confusing, but okay. I'll send mail on an issue we're having separately.
Signature · 1 line
Jonathan