drivers/net/ethernet/intel/ice/devlink/health.c

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/ice/devlink/health.c

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/intel/ice/devlink/health.c
Extension
.c
Size
18741 bytes
Lines
552
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct ice_health_status {
	enum ice_aqc_health_status code;
	const char *description;
	const char *solution;
	const char *data_label[ICE_HEALTH_STATUS_DATA_SIZE];
};

/*
 * In addition to the health status codes provided below, the firmware might
 * generate Health Status Codes that are not pertinent to the end-user.
 * For instance, Health Code 0x1002 is triggered when the command fails.
 * Such codes should be disregarded by the end-user.
 * The below lookup requires to be sorted by code.
 */

static const char ice_common_port_solutions[] =
	"Check your cable connection. Change or replace the module or cable. Manually set speed and duplex.";
static const char ice_port_number_label[] = "Port Number";
static const char ice_update_nvm_solution[] = "Update to the latest NVM image.";

static const struct ice_health_status ice_health_status_lookup[] = {
	{ICE_AQC_HEALTH_STATUS_ERR_UNKNOWN_MOD_STRICT, "An unsupported module was detected.",
		ice_common_port_solutions, {ice_port_number_label}},
	{ICE_AQC_HEALTH_STATUS_ERR_MOD_TYPE, "Module type is not supported.",
		"Change or replace the module or cable.", {ice_port_number_label}},
	{ICE_AQC_HEALTH_STATUS_ERR_MOD_QUAL, "Module is not qualified.",
		ice_common_port_solutions, {ice_port_number_label}},
	{ICE_AQC_HEALTH_STATUS_ERR_MOD_COMM,
		"Device cannot communicate with the module.",
		"Check your cable connection. Change or replace the module or cable. Manually set speed and duplex.",
		{ice_port_number_label}},
	{ICE_AQC_HEALTH_STATUS_ERR_MOD_CONFLICT, "Unresolved module conflict.",
		"Manually set speed/duplex or change the port option. If the problem persists, use a cable/module that is found in the supported modules and cables list for this device.",
		{ice_port_number_label}},
	{ICE_AQC_HEALTH_STATUS_ERR_MOD_NOT_PRESENT, "Module is not present.",
		"Check that the module is inserted correctly. If the problem persists, use a cable/module that is found in the supported modules and cables list for this device.",
		{ice_port_number_label}},
	{ICE_AQC_HEALTH_STATUS_INFO_MOD_UNDERUTILIZED, "Underutilized module.",
		"Change or replace the module or cable. Change the port option.",
		{ice_port_number_label}},
	{ICE_AQC_HEALTH_STATUS_ERR_UNKNOWN_MOD_LENIENT, "An unsupported module was detected.",
		ice_common_port_solutions, {ice_port_number_label}},
	{ICE_AQC_HEALTH_STATUS_ERR_INVALID_LINK_CFG, "Invalid link configuration.",
		NULL, {ice_port_number_label}},
	{ICE_AQC_HEALTH_STATUS_ERR_PORT_ACCESS, "Port hardware access error.",
		ice_update_nvm_solution, {ice_port_number_label}},
	{ICE_AQC_HEALTH_STATUS_ERR_PORT_UNREACHABLE, "A port is unreachable.",
		"Change the port option. Update to the latest NVM image."},
	{ICE_AQC_HEALTH_STATUS_INFO_PORT_SPEED_MOD_LIMITED, "Port speed is limited due to module.",
		"Change the module or configure the port option to match the current module speed. Change the port option.",
		{ice_port_number_label}},
	{ICE_AQC_HEALTH_STATUS_ERR_PARALLEL_FAULT,
		"All configured link modes were attempted but failed to establish link. The device will restart the process to establish link.",
		"Check link partner connection and configuration.",
		{ice_port_number_label}},
	{ICE_AQC_HEALTH_STATUS_INFO_PORT_SPEED_PHY_LIMITED,
		"Port speed is limited by PHY capabilities.",
		"Change the module to align to port option.", {ice_port_number_label}},
	{ICE_AQC_HEALTH_STATUS_ERR_NETLIST_TOPO, "LOM topology netlist is corrupted.",
		ice_update_nvm_solution, {ice_port_number_label}},
	{ICE_AQC_HEALTH_STATUS_ERR_NETLIST, "Unrecoverable netlist error.",
		ice_update_nvm_solution, {ice_port_number_label}},
	{ICE_AQC_HEALTH_STATUS_ERR_TOPO_CONFLICT, "Port topology conflict.",
		"Change the port option. Update to the latest NVM image."},
	{ICE_AQC_HEALTH_STATUS_ERR_LINK_HW_ACCESS, "Unrecoverable hardware access error.",
		ice_update_nvm_solution, {ice_port_number_label}},
	{ICE_AQC_HEALTH_STATUS_ERR_LINK_RUNTIME, "Unrecoverable runtime error.",
		ice_update_nvm_solution, {ice_port_number_label}},
	{ICE_AQC_HEALTH_STATUS_ERR_DNL_INIT, "Link management engine failed to initialize.",
		ice_update_nvm_solution, {ice_port_number_label}},
	{ICE_AQC_HEALTH_STATUS_ERR_PHY_FW_LOAD,
		"Failed to load the firmware image in the external PHY.",
		ice_update_nvm_solution, {ice_port_number_label}},
	{ICE_AQC_HEALTH_STATUS_INFO_RECOVERY, "The device is in firmware recovery mode.",
		ice_update_nvm_solution, {"Extended Error"}},
	{ICE_AQC_HEALTH_STATUS_ERR_FLASH_ACCESS, "The flash chip cannot be accessed.",
		"If issue persists, call customer support.", {"Access Type"}},
	{ICE_AQC_HEALTH_STATUS_ERR_NVM_AUTH, "NVM authentication failed.",
		ice_update_nvm_solution},
	{ICE_AQC_HEALTH_STATUS_ERR_OROM_AUTH, "Option ROM authentication failed.",
		ice_update_nvm_solution},
	{ICE_AQC_HEALTH_STATUS_ERR_DDP_AUTH, "DDP package authentication failed.",
		"Update to latest base driver and DDP package."},
	{ICE_AQC_HEALTH_STATUS_ERR_NVM_COMPAT, "NVM image is incompatible.",
		ice_update_nvm_solution},
	{ICE_AQC_HEALTH_STATUS_ERR_OROM_COMPAT, "Option ROM is incompatible.",
		ice_update_nvm_solution, {"Expected PCI Device ID", "Expected Module ID"}},
	{ICE_AQC_HEALTH_STATUS_ERR_DCB_MIB,
		"Supplied MIB file is invalid. DCB reverted to default configuration.",
		"Disable FW-LLDP and check DCBx system configuration.",

Annotation

Implementation Notes