[SRU][FOCAL][PATCH 0/1] net/mlx5: Fix a race when moving command interface to polling mode

William Breathitt Gray william.gray at canonical.com
Tue Jan 19 16:00:14 UTC 2021


[Impact]

As part of driver unload, it destroys the commands EQ (via FW command).
As the commands EQ is destroyed, FW will not generate EQEs for any command
that driver sends afterwards. Driver should poll for later commands status.

Driver commands mode metadata is updated before the commands EQ is
actually destroyed. This can lead for double completion handle by the
driver (polling and interrupt), if a command is executed and completed by
FW after the mode was changed, but before the EQ was destroyed.

[Fix]

Fix that by using the mlx5_cmd_allowed_opcode mechanism to guarantee
that only DESTROY_EQ command can be executed during this time period.

[Where problems could occur]

The scope of the changes in this patch is narrow: only the
destroy_async_eqs() function is touched. If a problem occurs, it will
occur during the small window when the driver unloads. Regression
potential is low however because only the DESTROY_EQ command should
execute during this time period.

Eran Ben Elisha (1):
  net/mlx5: Fix a race when moving command interface to polling mode

 drivers/net/ethernet/mellanox/mlx5/core/eq.c | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.27.0




More information about the kernel-team mailing list