summaryrefslogtreecommitdiffstats
path: root/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2017-08-03 14:12:23 +0000
committerhselasky <hselasky@FreeBSD.org>2017-08-03 14:12:23 +0000
commit49d44a4c7da3d59acf273f4cd73d3a16f1cebfbf (patch)
tree2662b962bcb0873d265a4f47902e5f866137c214 /sys/dev/mlx5/mlx5_en/mlx5_en_main.c
parent155436b66c4f67eda2db5e33d5dc408cf6f9b3bd (diff)
downloadFreeBSD-src-49d44a4c7da3d59acf273f4cd73d3a16f1cebfbf.zip
FreeBSD-src-49d44a4c7da3d59acf273f4cd73d3a16f1cebfbf.tar.gz
MFC r312872:
Add support for reading advanced diagnostic counters. By default reading the diagnostic counters is disabled. The firmware decides which counters are supported and only those supported show up in the dev.mce.X.diagnostics sysctl tree. To enable reading of diagnostic counters set one or more of the following sysctls to one: dev.mce.X.conf.diag_general_enable=1 dev.mce.X.conf.diag_pci_enable=1 Sponsored by: Mellanox Technologies
Diffstat (limited to 'sys/dev/mlx5/mlx5_en/mlx5_en_main.c')
-rw-r--r--sys/dev/mlx5/mlx5_en/mlx5_en_main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
index c354dce..2219f77 100644
--- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
+++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
@@ -573,6 +573,16 @@ mlx5e_update_stats_work(struct work_struct *work)
free_out:
kvfree(out);
+
+ /* Update diagnostics, if any */
+ if (priv->params_ethtool.diag_pci_enable ||
+ priv->params_ethtool.diag_general_enable) {
+ int error = mlx5_core_get_diagnostics_full(mdev,
+ priv->params_ethtool.diag_pci_enable ? &priv->params_pci : NULL,
+ priv->params_ethtool.diag_general_enable ? &priv->params_general : NULL);
+ if (error != 0)
+ if_printf(priv->ifp, "Failed reading diagnostics: %d\n", error);
+ }
PRIV_UNLOCK(priv);
}
OpenPOWER on IntegriCloud