diff options
| author | Huy Nguyen <huyn@mellanox.com> | 2016-11-17 06:45:57 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2016-11-18 12:08:57 -0500 |
| commit | d4eb4cd78b0774c7061db56844ed2ea7790cc77c (patch) | |
| tree | 362c6ad8416698cbc6c4e4ad21f2d5b1500920c0 /include/linux/mlx5 | |
| parent | 4ce3bf2fa8ba309b5ca19539fcc8671a0fc084f9 (diff) | |
net/mlx5: Add handling for port module event
For each asynchronous port module event:
1. print with ratelimit to the dmesg log
2. increment the corresponding event counter
Signed-off-by: Huy Nguyen <huyn@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/mlx5')
| -rw-r--r-- | include/linux/mlx5/driver.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index 5e7dbbcf47f0..7336c8e529d7 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h | |||
| @@ -498,6 +498,31 @@ struct mlx5_rl_table { | |||
| 498 | struct mlx5_rl_entry *rl_entry; | 498 | struct mlx5_rl_entry *rl_entry; |
| 499 | }; | 499 | }; |
| 500 | 500 | ||
| 501 | enum port_module_event_status_type { | ||
| 502 | MLX5_MODULE_STATUS_PLUGGED = 0x1, | ||
| 503 | MLX5_MODULE_STATUS_UNPLUGGED = 0x2, | ||
| 504 | MLX5_MODULE_STATUS_ERROR = 0x3, | ||
| 505 | MLX5_MODULE_STATUS_NUM = 0x3, | ||
| 506 | }; | ||
| 507 | |||
| 508 | enum port_module_event_error_type { | ||
| 509 | MLX5_MODULE_EVENT_ERROR_POWER_BUDGET_EXCEEDED, | ||
| 510 | MLX5_MODULE_EVENT_ERROR_LONG_RANGE_FOR_NON_MLNX_CABLE_MODULE, | ||
| 511 | MLX5_MODULE_EVENT_ERROR_BUS_STUCK, | ||
| 512 | MLX5_MODULE_EVENT_ERROR_NO_EEPROM_RETRY_TIMEOUT, | ||
| 513 | MLX5_MODULE_EVENT_ERROR_ENFORCE_PART_NUMBER_LIST, | ||
| 514 | MLX5_MODULE_EVENT_ERROR_UNKNOWN_IDENTIFIER, | ||
| 515 | MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE, | ||
| 516 | MLX5_MODULE_EVENT_ERROR_BAD_CABLE, | ||
| 517 | MLX5_MODULE_EVENT_ERROR_UNKNOWN, | ||
| 518 | MLX5_MODULE_EVENT_ERROR_NUM, | ||
| 519 | }; | ||
| 520 | |||
| 521 | struct mlx5_port_module_event_stats { | ||
| 522 | u64 status_counters[MLX5_MODULE_STATUS_NUM]; | ||
| 523 | u64 error_counters[MLX5_MODULE_EVENT_ERROR_NUM]; | ||
| 524 | }; | ||
| 525 | |||
| 501 | struct mlx5_priv { | 526 | struct mlx5_priv { |
| 502 | char name[MLX5_MAX_NAME_LEN]; | 527 | char name[MLX5_MAX_NAME_LEN]; |
| 503 | struct mlx5_eq_table eq_table; | 528 | struct mlx5_eq_table eq_table; |
| @@ -559,6 +584,8 @@ struct mlx5_priv { | |||
| 559 | unsigned long pci_dev_data; | 584 | unsigned long pci_dev_data; |
| 560 | struct mlx5_fc_stats fc_stats; | 585 | struct mlx5_fc_stats fc_stats; |
| 561 | struct mlx5_rl_table rl_table; | 586 | struct mlx5_rl_table rl_table; |
| 587 | |||
| 588 | struct mlx5_port_module_event_stats pme_stats; | ||
| 562 | }; | 589 | }; |
| 563 | 590 | ||
| 564 | enum mlx5_device_state { | 591 | enum mlx5_device_state { |
