diff options
author | Eli Cohen <eli@mellanox.com> | 2020-08-04 19:20:44 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2020-08-05 19:00:23 -0400 |
commit | 23750e39d57433d0e3d89658f0bc448f9c42ff49 (patch) | |
tree | 9f377ffa73d12ea6d7b8c8a9196f5250e923eb2b /drivers/vdpa/vdpa_sim | |
parent | aac50c0bd434794b9950181349099e709ca4edad (diff) |
vdpa: Modify get_vq_state() to return error code
Modify get_vq_state() so it returns an error code. In case of hardware
acceleration, the available index may be retrieved from the device, an
operation that can possibly fail.
Reviewed-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Eli Cohen <eli@mellanox.com>
Link: https://lore.kernel.org/r/20200804162048.22587-9-eli@mellanox.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'drivers/vdpa/vdpa_sim')
-rw-r--r-- | drivers/vdpa/vdpa_sim/vdpa_sim.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index c93126ad09d1..df3224b138ee 100644 --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c @@ -464,14 +464,15 @@ static int vdpasim_set_vq_state(struct vdpa_device *vdpa, u16 idx, return 0; } -static void vdpasim_get_vq_state(struct vdpa_device *vdpa, u16 idx, - struct vdpa_vq_state *state) +static int vdpasim_get_vq_state(struct vdpa_device *vdpa, u16 idx, + struct vdpa_vq_state *state) { struct vdpasim *vdpasim = vdpa_to_sim(vdpa); struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx]; struct vringh *vrh = &vq->vring; state->avail_index = vrh->last_avail_idx; + return 0; } static u32 vdpasim_get_vq_align(struct vdpa_device *vdpa) |