vdpa/mlx5: Re-create HW VQs under certain conditions
authorDragos Tatulea <dtatulea@nvidia.com>
Wed, 26 Jun 2024 10:26:58 +0000 (13:26 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 9 Jul 2024 12:42:50 +0000 (08:42 -0400)
commit0fe963d6fc162cd8c9b6c82205ea62e69088c063
treed7e22eb844f01fb956c990cf16140b2ebed6e526
parentffb1aae43ed5078598318042bac1ae1057e57e2d
vdpa/mlx5: Re-create HW VQs under certain conditions

There are a few conditions under which the hardware VQs need a full
teardown and setup:

- VQ size changed to something else than default value. Hardware VQ size
  modification is not supported.

- User turns off certain device features: mergeable buffers, checksum
  virtio 1.0 compliance. In these cases, the TIR and RQT need to be
  re-created.

Add a needs_teardown configuration variable and set it when detecting
the above scenarios. On next DRIVER_OK, the resources will be torn down
first.

Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
Acked-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
Message-Id: <20240626-stage-vdpa-vq-precreate-v2-22-560c491078df@nvidia.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vdpa/mlx5/net/mlx5_vnet.c
drivers/vdpa/mlx5/net/mlx5_vnet.h