From 0c79f82cf03ab03d024e1ff5e5b25871f6edf929 Mon Sep 17 00:00:00 2001 From: Slava Shwartsman Date: Mon, 22 Oct 2018 10:38:38 +0000 Subject: [PATCH] mlx5: Notify user that the ConnectX-6 shutdown its port due to power limitation If power exceed the slot limit, or slot limit is unknown the ConnectX-6 firmware will shutdown its port. Inform the user via debug message. MFC after: 3 days Approved by: hselasky (mentor), kib (mentor) Sponsored by: Mellanox Technologies --- sys/dev/mlx5/device.h | 1 + sys/dev/mlx5/mlx5_core/mlx5_eq.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/sys/dev/mlx5/device.h b/sys/dev/mlx5/device.h index 904b6d7c0a8..07d753cea19 100644 --- a/sys/dev/mlx5/device.h +++ b/sys/dev/mlx5/device.h @@ -549,6 +549,7 @@ enum { MLX5_MODULE_EVENT_ERROR_UNSUPPORTED_CABLE = 0x5, MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6, MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED = 0x7, + MLX5_MODULE_EVENT_ERROR_PCIE_SYSTEM_POWER_SLOT_EXCEEDED = 0xc, }; struct mlx5_eqe_port_module_event { diff --git a/sys/dev/mlx5/mlx5_core/mlx5_eq.c b/sys/dev/mlx5/mlx5_core/mlx5_eq.c index c972d27e8dd..faa56515d49 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_eq.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_eq.c @@ -615,6 +615,12 @@ static const char *mlx5_port_module_event_error_type_to_string(u8 error_type) return "High Temperature"; case MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED: return "Cable is shorted"; + case MLX5_MODULE_EVENT_ERROR_PCIE_SYSTEM_POWER_SLOT_EXCEEDED: + return "One or more network ports have been powered " + "down due to insufficient/unadvertised power on " + "the PCIe slot. Please refer to the card's user " + "manual for power specifications or contact " + "Mellanox support."; default: return "Unknown error type";