vdpa/mlx5: fix virtq cleaning
authorMatan Azrad <matan@nvidia.com>
Mon, 1 Mar 2021 10:41:31 +0000 (10:41 +0000)
committerChenbo Xia <chenbo.xia@intel.com>
Wed, 31 Mar 2021 08:37:10 +0000 (10:37 +0200)
commit846ec2ea75adc6ce00ad79485fca5d9943ebecaa
tree69481b97c0bf242a342d5d70b3261c04652d8963
parent6564ddcd0cbfcc3bb0acacbbc0f1247eb52ad218
vdpa/mlx5: fix virtq cleaning

The HW virtq object can be destroyed either when the device is closed or
when the state of the virtq becomes disabled.

Some parameters of the virtq should continue to be managed when the
virtq state is changed but all of them must be initialized when the
device is closed.

Wrongly, the enable parameter stayed on when the device is closed what
might cause creation of invalid virtq in the next time a device is
assigned to the driver.

Clean all the virtqs memory when the device is closed.

Fixes: c47d6e83334e ("vdpa/mlx5: support queue update")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@nvidia.com>
Acked-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/vdpa/mlx5/mlx5_vdpa_virtq.c