net/mlx5: fix secondary process resources release
authorSuanming Mou <suanmingm@mellanox.com>
Thu, 28 May 2020 06:59:49 +0000 (14:59 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 2 Jun 2020 14:06:24 +0000 (16:06 +0200)
commit2786b7bf9084b32dde9a346d92ab1c27f0ffc476
tree3fb81197980a1b8113832339186eb5a0db4e338f
parent01de93f2451730d480db8db18921e1bca7cb1f3e
net/mlx5: fix secondary process resources release

When secondary process starts, it will allocate its own process private
data, and also does remap to UAR register of the Tx queue. Once the
secondary process exits, these resources should be released accordingly.
And the shared resources owned by primary should not be touched.

Currently, once one port in the secondary process spawn failed, all the
other spawned ports will also be released during process exits. However,
the mlx5_dev_close() function does not add the cases for secondary
process, it means call the mlx5_dev_close() function directly in
secondary process releases the resources it should not touch.

Add the case for secondary process release to its own resources in
mlx5_dev_close() function to help it quits gracefully.

Fixes: 942d13e6e7d1 ("net/mlx5: fix sharing context destroy order")
Fixes: 3a8207423a0f ("net/mlx5: close all ports on remove")
Cc: stable@dpdk.org
Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
drivers/net/mlx5/mlx5.c
drivers/net/mlx5/mlx5_rxtx.h
drivers/net/mlx5/mlx5_txq.c