search for: mlx5_virtq_attr

Displaying 2 results from an estimated 2 matches for "mlx5_virtq_attr".

2020 Oct 01
0
[PATCH] vdpa/mlx5: should keep avail_index despite device status
...a_warn(&ndev->mvdev, "failed to query virtqueue\n"); + return; + } + mvq->avail_idx = attr.available_index; } static void suspend_vqs(struct mlx5_vdpa_net *ndev) @@ -1411,8 +1413,14 @@ static int mlx5_vdpa_get_vq_state(struct vdpa_device *vdev, u16 idx, struct vdpa struct mlx5_virtq_attr attr; int err; - if (!mvq->initialized) - return -EAGAIN; + /* If the virtq object was destroyed, use the value saved at + * the last minute of suspend_vq. This caters for userspace + * that cares about emulating the index after vq is stopped. + */ + if (!mvq->initialized) { + state-...
2020 Jul 16
0
[PATCH vhost next 10/10] vdpa/mlx5: Add VDPA driver for supported mlx5 devices
...modify_qp(ndev, mvq, true, MLX5_CMD_OP_INIT2RTR_QP); > + if (err) > + return err; > + > + err = modify_qp(ndev, mvq, false, MLX5_CMD_OP_INIT2RTR_QP); > + if (err) > + return err; > + > + return modify_qp(ndev, mvq, true, MLX5_CMD_OP_RTR2RTS_QP); > +} > + > +struct mlx5_virtq_attr { > + u8 state; > + u16 available_index; > +}; > + > +static int query_virtqueue(struct mlx5_vdpa_net *ndev, struct mlx5_vdpa_virtqueue *mvq, > + struct mlx5_virtq_attr *attr) > +{ > + int outlen = MLX5_ST_SZ_BYTES(query_virtio_net_q_out); > + u32 in[MLX5_ST_SZ_DW(qu...