Displaying 20 results from an estimated 26 matches for "vdpasim_queue_ready".
2023 Jan 29
0
[PATCH 1/2] vdpa_sim: not reset state in vdpasim_queue_ready
? 2023/1/19 17:14, Eugenio Perez Martin ??:
> On Thu, Jan 19, 2023 at 4:16 AM Jason Wang <jasowang at redhat.com> wrote:
>> On Thu, Jan 19, 2023 at 12:44 AM Eugenio P?rez <eperezma at redhat.com> wrote:
>>> vdpasim_queue_ready calls vringh_init_iotlb, which resets split indexes.
>>> But it can be called after setting a ring base with
>>> vdpasim_set_vq_state.
>>>
>>> Fix it by stashing them. They're still resetted in vdpasim_vq_reset.
>>>
>>> This was discovered a...
2023 Feb 28
0
[PATCH v2] vdpa_sim: set last_used_idx as last_avail_idx in vdpasim_queue_ready
...inflight descriptors as a
>destination of a migration, let's set both avail_idx and used_idx the
>same at vq start. This is how vhost-user works in a
>VHOST_SET_VRING_BASE call.
>
>Although the simple fix is to set last_used_idx at vdpasim_set_vq_state,
>it would be reset at vdpasim_queue_ready. The last_avail_idx case is
>fixed with commit a09f493c ("vdpa_sim: not reset state in
>vdpasim_queue_ready"). Since the only option is to make it equal to
>last_avail_idx, adding the only change needed here.
>
>This was discovered and tested live migrating the vdpa_sim_n...
2020 Apr 10
2
[PATCH -next] vdpasim: remove unused variable 'ret'
...deletions(-)
diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c
index 7957d2d41fc4..01c456f7c1f7 100644
--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
@@ -89,15 +89,14 @@ static struct vdpasim *dev_to_sim(struct device *dev)
static void vdpasim_queue_ready(struct vdpasim *vdpasim, unsigned int idx)
{
struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx];
- int ret;
- ret = vringh_init_iotlb(&vq->vring, vdpasim_features,
- VDPASIM_QUEUE_MAX, false,
- (struct vring_desc *)(uintptr_t)vq->desc_addr,
- (struct vring_avail *)
-...
2020 Apr 10
2
[PATCH -next] vdpasim: remove unused variable 'ret'
...deletions(-)
diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c
index 7957d2d41fc4..01c456f7c1f7 100644
--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
@@ -89,15 +89,14 @@ static struct vdpasim *dev_to_sim(struct device *dev)
static void vdpasim_queue_ready(struct vdpasim *vdpasim, unsigned int idx)
{
struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx];
- int ret;
- ret = vringh_init_iotlb(&vq->vring, vdpasim_features,
- VDPASIM_QUEUE_MAX, false,
- (struct vring_desc *)(uintptr_t)vq->desc_addr,
- (struct vring_avail *)
-...
2023 Jan 27
0
[PATCH 0/2] Fix expected set_vq_state behavior on vdpa_sim
..., Jan 18, 2023 at 05:43:57PM +0100, Eugenio P?rez wrote:
> The use of set_vq_state is to indicate vdpa device the state of a virtqueue.
> In the case of split, it means the avail_idx. This is mandatory for use
> cases like live migration.
>
> However, vdpa_sim reset the vq state at vdpasim_queue_ready since it calls
> vringh_init_iotlb.
>
> Also, to starting from an used_idx different than 0 is needed in use cases like
> virtual machine migration. Not doing so and letting the caller set an avail
> idx different than 0 causes destination device to try to use old buffers that
>...
2023 Mar 24
1
[PATCH v3 8/8] vdpa_sim: add support for user VA
...vdpasim_mm_work_fn);
> + kthread_queue_work(vdpasim->worker, work);
> +
> + kthread_flush_work(work);
> +}
> +
> static struct vdpasim *vdpa_to_sim(struct vdpa_device *vdpa)
> {
> return container_of(vdpa, struct vdpasim, vdpa);
> @@ -59,8 +93,10 @@ static void vdpasim_queue_ready(struct vdpasim *vdpasim, unsigned int idx)
> {
> struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx];
> uint16_t last_avail_idx = vq->vring.last_avail_idx;
> + bool va_enabled = use_va && vdpasim->mm_bound;
>
> - vringh_init_iotlb(&vq->vring, v...
2023 Mar 02
1
[PATCH v2 7/8] vdpa_sim: replace the spinlock with a mutex to protect the state
...struct vdpa_device *vdpa, u16 idx, bool ready)
struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx];
bool old_ready;
- spin_lock(&vdpasim->lock);
+ mutex_lock(&vdpasim->mutex);
old_ready = vq->ready;
vq->ready = ready;
if (vq->ready && !old_ready) {
vdpasim_queue_ready(vdpasim, idx);
}
- spin_unlock(&vdpasim->lock);
+ mutex_unlock(&vdpasim->mutex);
}
static bool vdpasim_get_vq_ready(struct vdpa_device *vdpa, u16 idx)
@@ -299,9 +299,9 @@ static int vdpasim_set_vq_state(struct vdpa_device *vdpa, u16 idx,
struct vdpasim_virtqueue *vq = &vdp...
2020 May 06
0
[PATCH -next] vdpasim: remove unused variable 'ret'
...a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c
> index 7957d2d41fc4..01c456f7c1f7 100644
> --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
> +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
> @@ -89,15 +89,14 @@ static struct vdpasim *dev_to_sim(struct device *dev)
> static void vdpasim_queue_ready(struct vdpasim *vdpasim, unsigned int idx)
> {
> struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx];
> - int ret;
>
> - ret = vringh_init_iotlb(&vq->vring, vdpasim_features,
> - VDPASIM_QUEUE_MAX, false,
> - (struct vring_desc *)(uintptr_t)vq->desc_ad...
2023 Mar 13
1
[GIT PULL] virtio,vhost,vdpa: bugfixes
...e fixes accumulated so far.
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
----------------------------------------------------------------
Cindy Lu (1):
vp_vdpa: fix the crash in hot unplug with vp_vdpa
Eugenio P?rez (1):
vdpa_sim: set last_used_idx as last_avail_idx in vdpasim_queue_ready
Gautam Dawar (1):
vhost-vdpa: free iommu domain after last use during cleanup
Rong Tao (1):
tools/virtio: Ignore virtio-trace/trace-agent
Si-Wei Liu (1):
vdpa/mlx5: should not activate virtq object when suspended
drivers/vdpa/mlx5/core/mlx5_vdpa.h | 1 +
drivers/vdpa/mlx5/ne...
2020 Feb 10
0
[PATCH V2 5/5] vdpasim: vDPA device simulator
...a;
+ struct virtio_net_config config;
+ struct vhost_iotlb *iommu;
+ void *buffer;
+ u32 status;
+ u32 generation;
+ u64 features;
+};
+
+struct vdpasim *vdpa_sim;
+
+static struct vdpasim *vdpa_to_sim(struct vdpa_device *vdpa)
+{
+ return container_of(vdpa, struct vdpasim, vdpa);
+}
+
+static void vdpasim_queue_ready(struct vdpasim *vdpasim, unsigned int idx)
+{
+ struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx];
+ int ret;
+
+ ret = vringh_init_iotlb(&vq->vring, vdpasim_features,
+ VDPASIM_QUEUE_MAX, false,
+ (struct vring_desc *)(uintptr_t)vq->desc_addr,
+ (struct vring_avail *)
+...
2020 Feb 20
0
[PATCH V3 5/5] vdpasim: vDPA device simulator
...uct vdpasim *vdpasim_dev;
+
+static struct vdpasim *dev_to_sim(struct device *dev)
+{
+ return container_of(dev, struct vdpasim, dev);
+}
+
+static struct vdpasim *vdpa_to_sim(struct vdpa_device *vdpa)
+{
+ struct device *d = &vdpa->dev;
+
+ return dev_to_sim(d->parent);
+}
+
+static void vdpasim_queue_ready(struct vdpasim *vdpasim, unsigned int idx)
+{
+ struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx];
+ int ret;
+
+ ret = vringh_init_iotlb(&vq->vring, vdpasim_features,
+ VDPASIM_QUEUE_MAX, false,
+ (struct vring_desc *)(uintptr_t)vq->desc_addr,
+ (struct vring_avail *)
+...
2023 Feb 21
2
[GIT PULL] virtio,vhost,vdpa: features, fixes
...new header file
vdpa/mlx5: Add debugfs subtree
vdpa/mlx5: Add RX counters to debugfs
vdpa/mlx5: Directly assign memory key
vdpa/mlx5: Don't clear mr struct on destroy MR
vdpa/mlx5: Initialize CVQ iotlb spinlock
Eugenio P?rez (2):
vdpa_sim: not reset state in vdpasim_queue_ready
vdpa_sim_net: Offer VIRTIO_NET_F_STATUS
Jason Wang (11):
vdpa_sim: use weak barriers
vdpa_sim: switch to use __vdpa_alloc_device()
vdpasim: customize allocation size
vdpa_sim: support vendor statistics
vdpa_sim_net: vendor satistics
vdpa_sim: get rid of DM...
2020 Apr 02
0
[vhost:vhost 22/22] drivers/vdpa/vdpa_sim/vdpa_sim.c:94:8: error: implicit declaration of function 'vringh_init_iotlb'; did you mean 'vringh_init_kern'?
...# save the attached .config to linux build tree
GCC_VERSION=9.3.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp at intel.com>
All errors (new ones prefixed by >>):
drivers/vdpa/vdpa_sim/vdpa_sim.c: In function 'vdpasim_queue_ready':
>> drivers/vdpa/vdpa_sim/vdpa_sim.c:94:8: error: implicit declaration of function 'vringh_init_iotlb'; did you mean 'vringh_init_kern'? [-Werror=implicit-function-declaration]
94 | ret = vringh_init_iotlb(&vq->vring, vdpasim_features,
| ^~~~...
2023 Mar 23
1
[PATCH v3 4/8] vringh: support VA with iotlb
...vring_used *)(uintptr_t)cvq->device_addr);
> diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c
> index eea23c630f7c..47cdf2a1f5b8 100644
> --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
> +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
> @@ -60,7 +60,7 @@ static void vdpasim_queue_ready(struct vdpasim *vdpasim, unsigned int idx)
> struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx];
> uint16_t last_avail_idx = vq->vring.last_avail_idx;
>
> - vringh_init_iotlb(&vq->vring, vdpasim->features, vq->num, true,
> + vringh_in...
2020 Feb 10
1
[PATCH V2 5/5] vdpasim: vDPA device simulator
...; + void *buffer;
> + u32 status;
> + u32 generation;
> + u64 features;
> +};
> +
> +struct vdpasim *vdpa_sim;
> +
> +static struct vdpasim *vdpa_to_sim(struct vdpa_device *vdpa)
> +{
> + return container_of(vdpa, struct vdpasim, vdpa);
> +}
> +
> +static void vdpasim_queue_ready(struct vdpasim *vdpasim, unsigned int idx)
> +{
> + struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx];
> + int ret;
> +
> + ret = vringh_init_iotlb(&vq->vring, vdpasim_features,
> + VDPASIM_QUEUE_MAX, false,
> + (struct vring_desc *)(uintptr_t)vq->desc_ad...
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 21
1
[PATCH v3 4/8] vringh: support VA with iotlb
...iver_addr,
(struct vring_used *)(uintptr_t)cvq->device_addr);
diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c
index eea23c630f7c..47cdf2a1f5b8 100644
--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
@@ -60,7 +60,7 @@ static void vdpasim_queue_ready(struct vdpasim *vdpasim, unsigned int idx)
struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx];
uint16_t last_avail_idx = vq->vring.last_avail_idx;
- vringh_init_iotlb(&vq->vring, vdpasim->features, vq->num, true,
+ vringh_init_iotlb(&vq->vring, vdpasim->feature...
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 Mar 23
1
[PATCH v3 8/8] vdpa_sim: add support for user VA
...k_fn);
> + kthread_queue_work(vdpasim->worker, work);
> +
> + kthread_flush_work(work);
> +}
> +
> static struct vdpasim *vdpa_to_sim(struct vdpa_device *vdpa)
> {
> return container_of(vdpa, struct vdpasim, vdpa);
> @@ -59,8 +93,10 @@ static void vdpasim_queue_ready(struct vdpasim *vdpasim, unsigned int idx)
> {
> struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx];
> uint16_t last_avail_idx = vq->vring.last_avail_idx;
> + bool va_enabled = use_va && vdpasim->mm_bound;
>
> - vringh_init_iotlb(&a...
2023 Feb 23
1
[GIT PULL] virtio,vhost,vdpa: features, fixes
...d debugfs subtree
> vdpa/mlx5: Add RX counters to debugfs
> vdpa/mlx5: Directly assign memory key
> vdpa/mlx5: Don't clear mr struct on destroy MR
> vdpa/mlx5: Initialize CVQ iotlb spinlock
>
> Eugenio P?rez (2):
> vdpa_sim: not reset state in vdpasim_queue_ready
> vdpa_sim_net: Offer VIRTIO_NET_F_STATUS
>
> Jason Wang (11):
> vdpa_sim: use weak barriers
> vdpa_sim: switch to use __vdpa_alloc_device()
> vdpasim: customize allocation size
> vdpa_sim: support vendor statistics
> vdpa_sim_net: vendor...