* [PATCH net-next] mlx5: use correct counter
@ 2019-08-06 18:28 Jonathan Lemon
2019-08-06 19:03 ` Saeed Mahameed
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Lemon @ 2019-08-06 18:28 UTC (permalink / raw)
To: saeedm; +Cc: kernel-team, netdev
mlx5e_grp_q_update_stats seems to be using the wrong counter
for if_down_packets.
Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
index 6eee3c7d4b06..1d16e03a987d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
@@ -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)
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] mlx5: use correct counter
2019-08-06 18:28 [PATCH net-next] mlx5: use correct counter Jonathan Lemon
@ 2019-08-06 19:03 ` Saeed Mahameed
2019-08-06 20:16 ` Jonathan Lemon
0 siblings, 1 reply; 3+ messages in thread
From: Saeed Mahameed @ 2019-08-06 19:03 UTC (permalink / raw)
To: jonathan.lemon@gmail.com; +Cc: kernel-team@fb.com, netdev@vger.kernel.org
On Tue, 2019-08-06 at 11:28 -0700, Jonathan Lemon wrote:
> mlx5e_grp_q_update_stats seems to be using the wrong counter
> for if_down_packets.
>
> Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
> b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
> index 6eee3c7d4b06..1d16e03a987d 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
> @@ -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)
> ;
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] mlx5: use correct counter
2019-08-06 19:03 ` Saeed Mahameed
@ 2019-08-06 20:16 ` Jonathan Lemon
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Lemon @ 2019-08-06 20:16 UTC (permalink / raw)
To: Saeed Mahameed; +Cc: kernel-team, netdev
On 6 Aug 2019, at 12:03, Saeed Mahameed wrote:
> On Tue, 2019-08-06 at 11:28 -0700, Jonathan Lemon wrote:
>> mlx5e_grp_q_update_stats seems to be using the wrong counter
>> for if_down_packets.
>>
>> Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
>> ---
>> drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
>> b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
>> index 6eee3c7d4b06..1d16e03a987d 100644
>> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
>> @@ -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)
>> ;
>
> 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..
Hmm, confusing, but okay. I'll send mail on an issue we're having
separately.
--
Jonathan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-08-06 20:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-06 18:28 [PATCH net-next] mlx5: use correct counter Jonathan Lemon
2019-08-06 19:03 ` Saeed Mahameed
2019-08-06 20:16 ` Jonathan Lemon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).