Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net/mlx5: fix device removal event handling
[ upstream commit 22dc56cfbd39692eb74fad93ff5ecc3df5fd0633 ] On the device removal kernel notifies user space application with queueing the IBV_DEVICE_FATAL_EVENT and triggering appropriate file descriptor. Mellanox kernel driver stack emits this event twice from different layers (mlx5 and uverbs). The IB port index is not applicable in the event structure and should be ignored for IBV_DEVICE_FATAL_EVENT events. Also, on the older kernels (at least from OFED 4.9) there might be race conditions causing the event queue close before application fetches the IBV_DEVICE_FATAL_EVENT message with ibv_get_async_event() API. To provide the reliable device removal event detection the patch: - ignores the IB port index for the IBV_DEVICE_FATAL_EVENT - introduces the flag to notify PMD about removal only once - acks event with ibv_ack_async_event after actual handling - checks for EIO error, making sure queue is not closed yet Fixes: 40d9f90 ("net/mlx5: fix device removal handler for multiport") Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
- Loading branch information