net/mlx5: fix Tx queue release
authorMatan Azrad <matan@nvidia.com>
Thu, 15 Oct 2020 06:38:11 +0000 (06:38 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 3 Nov 2020 21:29:24 +0000 (22:29 +0100)
commit9ab9d46ab982dc7b4a45cb0d941518b3104ebc98
tree4ef3fb6bb772ee43565ac2c75903fd1ebf76b172
parent015d2cb6289b6f893e1c95bb1ec8017c22ce16ba
net/mlx5: fix Tx queue release

The HW objects of the Tx queue is created/destroyed in the device
start\stop stage while the ethdev configurations for the Tx queue
starts from the tx_queue_setup stage.
The PMD should save all the last configurations it got from the ethdev
and to apply them to the device in the dev_start operation.

Wrongly, last code added to mitigate the reference counters didn't take
into account the above rule and combined the configurations and HW
objects to be created\destroyed together.

This causes to memory leak and other memory issues.

Make sure the HW object is released in stop operation when there is no
any reference to it while the configurations stay saved.

Fixes: 17a57183c0eb ("net/mlx5: mitigate Tx queue reference counters")

Signed-off-by: Matan Azrad <matan@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
drivers/net/mlx5/mlx5_rxtx.h
drivers/net/mlx5/mlx5_txq.c