]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net/mlx5e: Expose TIS via devlink tx reporter diagnose
authorFeng Liu <feliu@nvidia.com>
Tue, 22 Jul 2025 14:23:48 +0000 (17:23 +0300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 25 Jul 2025 22:27:54 +0000 (15:27 -0700)
Underneath "TIS Config" tag expose TIS diagnostic information.
Expose the tisn of each TC under each lag port.

$ sudo devlink health diagnose auxiliary/mlx5_core.eth.2/131072 reporter tx
......
  TIS Config:
      lag port: 0 tc: 0 tisn: 0
      lag port: 1 tc: 0 tisn: 8
......

Signed-off-by: Feng Liu <feliu@nvidia.com>
Reviewed-by: Aya Levin <ayal@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Link: https://patch.msgid.link/1753194228-333722-3-git-send-email-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c

index bd96988e102c33c8394ed62836ad70a992cce985..85d5cb39b10799c68391e982d62648c20ca2d292 100644 (file)
@@ -311,6 +311,30 @@ out:
        mlx5e_health_fmsg_named_obj_nest_end(fmsg);
 }
 
+static void
+mlx5e_tx_reporter_diagnose_tis_config(struct devlink_health_reporter *reporter,
+                                     struct devlink_fmsg *fmsg)
+{
+       struct mlx5e_priv *priv = devlink_health_reporter_priv(reporter);
+       u8 num_tc = mlx5e_get_dcb_num_tc(&priv->channels.params);
+       u32 tc, i, tisn;
+
+       devlink_fmsg_arr_pair_nest_start(fmsg, "TIS Config");
+       for (i = 0; i < mlx5e_get_num_lag_ports(priv->mdev); i++) {
+               for (tc = 0; tc < num_tc; tc++) {
+                       tisn = mlx5e_profile_get_tisn(priv->mdev, priv,
+                                                     priv->profile, i, tc);
+
+                       devlink_fmsg_obj_nest_start(fmsg);
+                       devlink_fmsg_u32_pair_put(fmsg, "lag port", i);
+                       devlink_fmsg_u32_pair_put(fmsg, "tc", tc);
+                       devlink_fmsg_u32_pair_put(fmsg, "tisn", tisn);
+                       devlink_fmsg_obj_nest_end(fmsg);
+               }
+       }
+       devlink_fmsg_arr_pair_nest_end(fmsg);
+}
+
 static int mlx5e_tx_reporter_diagnose(struct devlink_health_reporter *reporter,
                                      struct devlink_fmsg *fmsg,
                                      struct netlink_ext_ack *extack)
@@ -326,6 +350,7 @@ static int mlx5e_tx_reporter_diagnose(struct devlink_health_reporter *reporter,
                goto unlock;
 
        mlx5e_tx_reporter_diagnose_common_config(reporter, fmsg);
+       mlx5e_tx_reporter_diagnose_tis_config(reporter, fmsg);
        devlink_fmsg_arr_pair_nest_start(fmsg, "SQs");
 
        for (i = 0; i < priv->channels.num; i++) {