vdpa/mlx5: move virtual doorbell alloc to probe
authorMatan Azrad <matan@mellanox.com>
Tue, 24 Mar 2020 14:24:34 +0000 (14:24 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 21 Apr 2020 11:57:08 +0000 (13:57 +0200)
commit4cae722c1b06916251fc4f8ed1f838089b567820
tree974936249c186ad94d71fe011d53ad57894b48c1
parent6d6cd38f4586beeb40e25fb86c6bb441ede77797
vdpa/mlx5: move virtual doorbell alloc to probe

The configure and close operations may be called a lot of time by vhost
library according to the virtio connections in the guest.

VAR is the device memory space for the virtio queues doorbells.
Each VAR page can be shared for more than one queue while its owner must
synchronize the writes to it.

The mlx5 driver allocates single VAR page for all its queues.

Therefore, it is better to allocate it in probe device level instead of
creating and destroying it per new connection.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/vdpa/mlx5/mlx5_vdpa.c
drivers/vdpa/mlx5/mlx5_vdpa_virtq.c