search for: avail_index

Displaying 18 results from an estimated 18 matches for "avail_index".

Did you mean: avail_idx
2020 Oct 01
0
[PATCH] vdpa/mlx5: should keep avail_index despite device status
A VM with mlx5 vDPA has below warnings while being reset: vhost VQ 0 ring restore failed: -1: Resource temporarily unavailable (11) vhost VQ 1 ring restore failed: -1: Resource temporarily unavailable (11) We should allow userspace emulating the virtio device be able to get to vq's avail_index, regardless of vDPA device status. Save the index that was last seen when virtq was stopped, so that userspace doesn't complain. Signed-off-by: Si-Wei Liu <si-wei.liu at oracle.com> --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 dele...
2020 Jul 16
0
[PATCH vhost next 06/10] vdpa: Add means to communicate vq status on get_vq_state
.../drivers/vdpa/ifcvf/ifcvf_main.c > @@ -240,6 +240,7 @@ static void ifcvf_vdpa_get_vq_state(struct vdpa_device *vdpa_dev, u16 qid, > { > struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); > > + state->state = vf->vring[qid].ready ? 0 : BIT(VQ_STATE_NOT_READY); > state->avail_index = ifcvf_get_vq_state(vf, qid); > } > > diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c > index 599519039f8d..06d974b4bd7b 100644 > --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c > +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c > @@ -434,6 +434,7 @@ static...
2020 Jul 21
0
[PATCH V2 vhost next 06/10] vdpa: Modify get_vq_state() to return error code
...vq_state(struct vdpa_device *vdpa_dev, u16 qid, > - struct vdpa_vq_state *state) > +static int ifcvf_vdpa_get_vq_state(struct vdpa_device *vdpa_dev, u16 qid, > + struct vdpa_vq_state *state) > { > struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); > > state->avail_index = ifcvf_get_vq_state(vf, qid); > + return 0; > } > > static int ifcvf_vdpa_set_vq_state(struct vdpa_device *vdpa_dev, u16 qid, > diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c > index 599519039f8d..ddf6086d43c2 100644 > --- a/drivers/vdp...
2020 Aug 05
0
[PATCH V4 linux-next 08/12] vdpa: Modify get_vq_state() to return error code
...vq_state(struct vdpa_device *vdpa_dev, u16 qid, > - struct vdpa_vq_state *state) > +static int ifcvf_vdpa_get_vq_state(struct vdpa_device *vdpa_dev, u16 qid, > + struct vdpa_vq_state *state) > { > struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); > > state->avail_index = ifcvf_get_vq_state(vf, qid); > + return 0; > } > > static int ifcvf_vdpa_set_vq_state(struct vdpa_device *vdpa_dev, u16 qid, > diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c > index f1c351d5959b..c68741363643 100644 > --- a/drivers/vdp...
2023 Mar 02
1
[PATCH v2 7/8] vdpa_sim: replace the spinlock with a mutex to protect the state
...9 +299,9 @@ static int vdpasim_set_vq_state(struct vdpa_device *vdpa, u16 idx, struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx]; struct vringh *vrh = &vq->vring; - spin_lock(&vdpasim->lock); + mutex_lock(&vdpasim->mutex); vrh->last_avail_idx = state->split.avail_index; - spin_unlock(&vdpasim->lock); + mutex_unlock(&vdpasim->mutex); return 0; } @@ -398,9 +398,9 @@ static u8 vdpasim_get_status(struct vdpa_device *vdpa) struct vdpasim *vdpasim = vdpa_to_sim(vdpa); u8 status; - spin_lock(&vdpasim->lock); + mutex_lock(&vdpasim->...
2020 Sep 07
0
[PATCH] vhost-vdpa: fix backend feature ioctls
...int cmd, struct vdpa_callback cb; struct vhost_virtqueue *vq; struct vhost_vring_state s; - u64 __user *featurep = argp; - u64 features; u32 idx; long r; @@ -381,18 +379,6 @@ static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsigned int cmd, vq->last_avail_idx = vq_state.avail_index; break; - case VHOST_GET_BACKEND_FEATURES: - features = VHOST_VDPA_BACKEND_FEATURES; - if (copy_to_user(featurep, &features, sizeof(features))) - return -EFAULT; - return 0; - case VHOST_SET_BACKEND_FEATURES: - if (copy_from_user(&features, featurep, sizeof(features))) - return -...
2020 Sep 24
0
[RFC PATCH 01/24] vhost-vdpa: fix backend feature ioctls
...int cmd, struct vdpa_callback cb; struct vhost_virtqueue *vq; struct vhost_vring_state s; - u64 __user *featurep = argp; - u64 features; u32 idx; long r; @@ -381,18 +379,6 @@ static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsigned int cmd, vq->last_avail_idx = vq_state.avail_index; break; - case VHOST_GET_BACKEND_FEATURES: - features = VHOST_VDPA_BACKEND_FEATURES; - if (copy_to_user(featurep, &features, sizeof(features))) - return -EFAULT; - return 0; - case VHOST_SET_BACKEND_FEATURES: - if (copy_from_user(&features, featurep, sizeof(features))) - return -...
2023 Jan 29
0
[PATCH 1/2] vdpa_sim: not reset state in vdpasim_queue_ready
...ice_addr); >>> >>> + vq->vring.last_avail_idx = last_avail_idx; >> Does this need to be serialized with the datapath? >> >> E.g in set_vq_state() we do: >> >> spin_lock(&vdpasim->lock); >> vrh->last_avail_idx = state->split.avail_index; >> spin_unlock(&vdpasim->lock); >> > vdpasim_queue_ready is called from vdpasim_set_vq_ready, which holds > these locks. > > Maybe it's too much indirection and to embed vdpasim_queue_ready in > vdpasim_set_vq_ready would be clearer for the future? Nope, I m...
2020 Sep 24
1
[RFC PATCH 01/24] vhost-vdpa: fix backend feature ioctls
...vhost_virtqueue *vq; > struct vhost_vring_state s; > - u64 __user *featurep = argp; > - u64 features; > u32 idx; > long r; > > @@ -381,18 +379,6 @@ static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsigned int cmd, > > vq->last_avail_idx = vq_state.avail_index; > break; > - case VHOST_GET_BACKEND_FEATURES: > - features = VHOST_VDPA_BACKEND_FEATURES; > - if (copy_to_user(featurep, &features, sizeof(features))) > - return -EFAULT; > - return 0; > - case VHOST_SET_BACKEND_FEATURES: > - if (copy_from_user(&features, f...
2020 Sep 09
0
[PATCH] vhost: new vhost_vdpa SET/GET_BACKEND_FEATURES handlers
..._virtqueue *vq; > struct vhost_vring_state s; > - u64 __user *featurep = argp; > - u64 features; > u32 idx; > long r; > > @@ -381,18 +406,6 @@ static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, > unsigned int cmd, > > vq->last_avail_idx = vq_state.avail_index; > break; > - case VHOST_GET_BACKEND_FEATURES: > - features = VHOST_VDPA_BACKEND_FEATURES; > - if (copy_to_user(featurep, &features, sizeof(features))) > - return -EFAULT; > - return 0; > - case VHOST_SET_BACKEND_FEATURES: > - if (copy_from_user(&features, f...
2020 Jul 16
0
[PATCH vhost next 10/10] vdpa/mlx5: Add VDPA driver for supported mlx5 devices
...ct mlx5_vdpa_qp { > + struct mlx5_core_qp mqp; > + struct mlx5_frag_buf frag_buf; > + struct mlx5_db db; > + u16 head; > + bool fw; > +}; > + > +struct mlx5_vq_restore_info { > + u32 num_ent; > + u64 desc_addr; > + u64 device_addr; > + u64 driver_addr; > + u16 avail_index; > + bool ready; > + struct vdpa_callback cb; > + bool restore; > +}; > + > +struct mlx5_vdpa_virtqueue { > + bool ready; > + u64 desc_addr; > + u64 device_addr; > + u64 driver_addr; > + u32 num_ent; > + struct vdpa_callback event_cb; > + > + /* Resources f...
2023 Mar 21
3
[PATCH v3 5/8] vdpa_sim: make devices agnostic for work management
Let's move work management inside the vdpa_sim core. This way we can easily change how we manage the works, without having to change the devices each time. Acked-by: Eugenio P??rez Martin <eperezma at redhat.com> Acked-by: Jason Wang <jasowang at redhat.com> Signed-off-by: Stefano Garzarella <sgarzare at redhat.com> --- drivers/vdpa/vdpa_sim/vdpa_sim.h | 3 ++-
2023 Mar 20
3
[PATCH 0/2] vdpa/snet: support [s/g]et_vq_state and suspend
Add more vDPA callbacks. [s/g]et_vq_state is added in patch 1, including a new control mechanism to read data from the DPU. suspend is added in patch 2. Alvaro Karsz (2): vdpa/snet: support getting and setting VQ state vdpa/snet: support the suspend vDPA callback drivers/vdpa/solidrun/Makefile | 1 + drivers/vdpa/solidrun/snet_ctrl.c | 324 +++++++++++++++++++++++++++++
2023 Apr 02
2
[PATCH resend 0/2] vdpa/snet: support [s/g]et_vq_state and suspend
Add more vDPA callbacks. [s/g]et_vq_state is added in patch 1, including a new control mechanism to read data from the DPU. suspend is added in patch 2. Alvaro Karsz (2): vdpa/snet: support getting and setting VQ state vdpa/snet: support the suspend vDPA callback drivers/vdpa/solidrun/Makefile | 1 + drivers/vdpa/solidrun/snet_ctrl.c | 324 +++++++++++++++++++++++++++++
2023 Mar 02
8
[PATCH v2 0/8] vdpa_sim: add support for user VA
v2: - rebased on Linus' tree, commit ae3419fbac84 ("vc_screen: don't clobber return value in vcs_read") - removed `struct task_struct *owner` param (unused for now, maybe ?useful to support cgroups) [Jason] - add unbind_mm callback [Jason] - call the new unbind_mm callback during the release [Jason] - avoid to call bind_mm callback after the reset, since the device ?is not
2023 Apr 04
9
[PATCH v5 0/9] vdpa_sim: add support for user VA
This series adds support for the use of user virtual addresses in the vDPA simulator devices. The main reason for this change is to lift the pinning of all guest memory. Especially with virtio devices implemented in software. The next step would be to generalize the code in vdpa-sim to allow the implementation of in-kernel software devices. Similar to vhost, but using vDPA so we can reuse the
2020 Sep 24
30
[RFC PATCH 00/24] Control VQ support in vDPA
Hi All: This series tries to add the support for control virtqueue in vDPA. Control virtqueue is used by networking device for accepting various commands from the driver. It's a must to support multiqueue and other configurations. When used by vhost-vDPA bus driver for VM, the control virtqueue should be shadowed via userspace VMM (Qemu) instead of being assigned directly to Guest. This is
2020 Sep 24
30
[RFC PATCH 00/24] Control VQ support in vDPA
Hi All: This series tries to add the support for control virtqueue in vDPA. Control virtqueue is used by networking device for accepting various commands from the driver. It's a must to support multiqueue and other configurations. When used by vhost-vDPA bus driver for VM, the control virtqueue should be shadowed via userspace VMM (Qemu) instead of being assigned directly to Guest. This is