mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
mlx5: Fix handling of port_module_event
(cherry picked from commit 253a1fa16b)
This commit is contained in:
parent
0f6a6b2e42
commit
b0b932804b
2 changed files with 7 additions and 6 deletions
|
|
@ -721,7 +721,8 @@ struct mlx5_core_dev {
|
|||
u32 vsc_addr;
|
||||
u32 issi;
|
||||
struct mlx5_special_contexts special_contexts;
|
||||
unsigned int module_status[MLX5_MAX_PORTS];
|
||||
unsigned int module_status;
|
||||
unsigned int module_num;
|
||||
struct mlx5_flow_root_namespace *root_ns;
|
||||
struct mlx5_flow_root_namespace *fdb_root_ns;
|
||||
struct mlx5_flow_root_namespace *esw_egress_root_ns;
|
||||
|
|
|
|||
|
|
@ -679,9 +679,9 @@ static const char *mlx5_port_module_event_error_type_to_string(u8 error_type)
|
|||
|
||||
unsigned int mlx5_query_module_status(struct mlx5_core_dev *dev, int module_num)
|
||||
{
|
||||
if (module_num < 0 || module_num >= MLX5_MAX_PORTS)
|
||||
return 0; /* undefined */
|
||||
return dev->module_status[module_num];
|
||||
if (module_num != dev->module_num)
|
||||
return 0; /* module num doesn't equal to what FW reported */
|
||||
return dev->module_status;
|
||||
}
|
||||
|
||||
static void mlx5_port_module_event(struct mlx5_core_dev *dev,
|
||||
|
|
@ -729,8 +729,8 @@ static void mlx5_port_module_event(struct mlx5_core_dev *dev,
|
|||
"Module %u, unknown status %d\n", module_num, module_status);
|
||||
}
|
||||
/* store module status */
|
||||
if (module_num < MLX5_MAX_PORTS)
|
||||
dev->module_status[module_num] = module_status;
|
||||
dev->module_status = module_status;
|
||||
dev->module_num = module_num;
|
||||
}
|
||||
|
||||
static void mlx5_port_general_notification_event(struct mlx5_core_dev *dev,
|
||||
|
|
|
|||
Loading…
Reference in a new issue