Skip to contentSkip to conversation

mlx5: use correct counter

PATCH In review Jonathan Lemon 2 participants 3 messages Aug 6, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

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
index 6eee3c7d4b06..1d16e03a987d 100644
@@ -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
#1 lore raw
Quoted 22 lines · Jonathan Lemon

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
index 6eee3c7d4b06..1d16e03a987d 100644
@@ -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.

#2 lore raw
Quoted 32 lines · Saeed Mahameed
Quoted 22 lines · Jonathan Lemon

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
index 6eee3c7d4b06..1d16e03a987d 100644
@@ -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_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..

Hmm, confusing, but okay. I'll send mail on an issue we're having separately.

Signature · 1 line
Jonathan