aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKamal Heib <kamalh@mellanox.com>2017-11-28 16:18:13 -0500
committerSaeed Mahameed <saeedm@mellanox.com>2018-01-19 15:41:33 -0500
commita89842811ea98a0452893d83aac07d0b46854636 (patch)
tree87e0098b06a7e6731837915216bca4b50f97e492
parent57d689a8ca7b360f902328da95e8b441c24823ca (diff)
net/mlx5e: Merge per priority stats groups
Merge the per priority traffic and pfc groups into one group, because both groups share the same update_stats() callback which will be introduced in the upcoming patch. Signed-off-by: Kamal Heib <kamalh@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_stats.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
index a4d787208d60..545150d4de9f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
@@ -657,6 +657,28 @@ static int mlx5e_grp_per_prio_pfc_fill_stats(struct mlx5e_priv *priv,
657 return idx; 657 return idx;
658} 658}
659 659
660static int mlx5e_grp_per_prio_get_num_stats(struct mlx5e_priv *priv)
661{
662 return mlx5e_grp_per_prio_traffic_get_num_stats(priv) +
663 mlx5e_grp_per_prio_pfc_get_num_stats(priv);
664}
665
666static int mlx5e_grp_per_prio_fill_strings(struct mlx5e_priv *priv, u8 *data,
667 int idx)
668{
669 idx = mlx5e_grp_per_prio_traffic_fill_strings(priv, data, idx);
670 idx = mlx5e_grp_per_prio_pfc_fill_strings(priv, data, idx);
671 return idx;
672}
673
674static int mlx5e_grp_per_prio_fill_stats(struct mlx5e_priv *priv, u64 *data,
675 int idx)
676{
677 idx = mlx5e_grp_per_prio_traffic_fill_stats(priv, data, idx);
678 idx = mlx5e_grp_per_prio_pfc_fill_stats(priv, data, idx);
679 return idx;
680}
681
660static const struct counter_desc mlx5e_pme_status_desc[] = { 682static const struct counter_desc mlx5e_pme_status_desc[] = {
661 { "module_unplug", 8 }, 683 { "module_unplug", 8 },
662}; 684};
@@ -888,14 +910,9 @@ const struct mlx5e_stats_grp mlx5e_stats_grps[] = {
888 .fill_stats = mlx5e_grp_pcie_fill_stats, 910 .fill_stats = mlx5e_grp_pcie_fill_stats,
889 }, 911 },
890 { 912 {
891 .get_num_stats = mlx5e_grp_per_prio_traffic_get_num_stats, 913 .get_num_stats = mlx5e_grp_per_prio_get_num_stats,
892 .fill_strings = mlx5e_grp_per_prio_traffic_fill_strings, 914 .fill_strings = mlx5e_grp_per_prio_fill_strings,
893 .fill_stats = mlx5e_grp_per_prio_traffic_fill_stats, 915 .fill_stats = mlx5e_grp_per_prio_fill_stats,
894 },
895 {
896 .get_num_stats = mlx5e_grp_per_prio_pfc_get_num_stats,
897 .fill_strings = mlx5e_grp_per_prio_pfc_fill_strings,
898 .fill_stats = mlx5e_grp_per_prio_pfc_fill_stats,
899 }, 916 },
900 { 917 {
901 .get_num_stats = mlx5e_grp_pme_get_num_stats, 918 .get_num_stats = mlx5e_grp_pme_get_num_stats,