vdpa/mlx5: set default queue indices
authorAsaf Penso <asafp@mellanox.com>
Mon, 23 Mar 2020 17:50:13 +0000 (17:50 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 21 Apr 2020 11:57:08 +0000 (13:57 +0200)
commit6d6cd38f4586beeb40e25fb86c6bb441ede77797
treed7f44b224971dc97559ea4934a562abd514bacc8
parent2f3127321102b924d4e744b056188be458e3127c
vdpa/mlx5: set default queue indices

The rte_vhost_get_vring_base function is being called to get the values
of last_avail_idx and last_used_idx.
These fields will not have the correct values in case the function
returns an error.

Adding a check for the function return value, and in the case of an
error, set the fields to be zero and print a warning message.

Fixes: bff735011078 ("vdpa/mlx5: prepare virtio queues")
Cc: stable@dpdk.org
Signed-off-by: Asaf Penso <asafp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/vdpa/mlx5/mlx5_vdpa_virtq.c