net/mlx5: close tools socket with last device
authorDmitry Kozlyuk <dkozlyuk@nvidia.com>
Thu, 14 Oct 2021 08:55:28 +0000 (11:55 +0300)
committerRaslan Darawsheh <rasland@nvidia.com>
Thu, 21 Oct 2021 08:31:53 +0000 (10:31 +0200)
commitea823b2c511d6e4a4e51fa5e4aabc30e5a30cdb7
tree78731d86465569bd88cf08eb51ed38a637f7c0da
parent9ec1ceab76a82bc7c95343ed99312893a66ce217
net/mlx5: close tools socket with last device

MLX5 PMD exposes a socket for external tools to dump port state.
Socket events are listened using an interrupt source of EXT type.
The socket was closed and the interrupt callback was unregistered
at program exit, which is incorrect because DPDK could be already
shut down at this point. Move actions performed at program exit
to the moment the last MLX5 port is closed. The socket will be opened
again if later a new MLX5 device is plugged in and probed.
Also fix comments that were decisively talking
about secondary processes instead of external tools.

Fixes: e6cdc54cc0ef ("net/mlx5: add socket server for external tools")
Cc: stable@dpdk.org
Reported-by: Harman Kalra <hkalra@marvell.com>
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
drivers/net/mlx5/linux/mlx5_os.c
drivers/net/mlx5/linux/mlx5_socket.c
drivers/net/mlx5/mlx5.c
drivers/net/mlx5/mlx5.h
drivers/net/mlx5/windows/mlx5_os.c