search for: vringh_need_notify_kern

Displaying 20 results from an estimated 30 matches for "vringh_need_notify_kern".

2020 Apr 01
2
[PATCH] virtio/test: fix up after IOTLB changes
...clude <linux/export.h> +#ifdef VHOST_IOTLB #include <linux/bvec.h> #include <linux/highmem.h> #include <linux/vhost_iotlb.h> +#endif #include <uapi/linux/virtio_config.h> static __printf(1,2) __cold void vringh_bad(const char *fmt, ...) @@ -1059,6 +1061,8 @@ int vringh_need_notify_kern(struct vringh *vrh) } EXPORT_SYMBOL(vringh_need_notify_kern); +#ifdef VHOST_IOTLB + static int iotlb_translate(const struct vringh *vrh, u64 addr, u64 len, struct bio_vec iov[], int iov_size, u32 perm) @@ -1416,5 +1420,6 @@ int vringh_need_notify_iotlb(struct vringh *vrh) } EXP...
2020 Apr 01
2
[PATCH] virtio/test: fix up after IOTLB changes
...clude <linux/export.h> +#ifdef VHOST_IOTLB #include <linux/bvec.h> #include <linux/highmem.h> #include <linux/vhost_iotlb.h> +#endif #include <uapi/linux/virtio_config.h> static __printf(1,2) __cold void vringh_bad(const char *fmt, ...) @@ -1059,6 +1061,8 @@ int vringh_need_notify_kern(struct vringh *vrh) } EXPORT_SYMBOL(vringh_need_notify_kern); +#ifdef VHOST_IOTLB + static int iotlb_translate(const struct vringh *vrh, u64 addr, u64 len, struct bio_vec iov[], int iov_size, u32 perm) @@ -1416,5 +1420,6 @@ int vringh_need_notify_iotlb(struct vringh *vrh) } EXP...
2020 Apr 02
1
[PATCH] virtio/test: fix up after IOTLB changes
...;linux/bvec.h> > > #include <linux/highmem.h> > > #include <linux/vhost_iotlb.h> > > +#endif > > #include <uapi/linux/virtio_config.h> > > static __printf(1,2) __cold void vringh_bad(const char *fmt, ...) > > @@ -1059,6 +1061,8 @@ int vringh_need_notify_kern(struct vringh *vrh) > > } > > EXPORT_SYMBOL(vringh_need_notify_kern); > > +#ifdef VHOST_IOTLB > > + > > static int iotlb_translate(const struct vringh *vrh, > > u64 addr, u64 len, struct bio_vec iov[], > > int iov_size, u32 perm) >...
2020 Apr 02
1
[PATCH v2] virtio/test: fix up after IOTLB changes
...port.h> +#if IS_REACHABLE(CONFIG_VHOST_IOTLB) #include <linux/bvec.h> #include <linux/highmem.h> #include <linux/vhost_iotlb.h> +#endif #include <uapi/linux/virtio_config.h> static __printf(1,2) __cold void vringh_bad(const char *fmt, ...) @@ -1059,6 +1061,8 @@ int vringh_need_notify_kern(struct vringh *vrh) } EXPORT_SYMBOL(vringh_need_notify_kern); +#if IS_REACHABLE(CONFIG_VHOST_IOTLB) + static int iotlb_translate(const struct vringh *vrh, u64 addr, u64 len, struct bio_vec iov[], int iov_size, u32 perm) @@ -1416,5 +1420,6 @@ int vringh_need_notify_iotlb(struct vr...
2020 Apr 02
0
[PATCH] virtio/test: fix up after IOTLB changes
...> #include <linux/bvec.h> > #include <linux/highmem.h> > #include <linux/vhost_iotlb.h> > +#endif > #include <uapi/linux/virtio_config.h> > > static __printf(1,2) __cold void vringh_bad(const char *fmt, ...) > @@ -1059,6 +1061,8 @@ int vringh_need_notify_kern(struct vringh *vrh) > } > EXPORT_SYMBOL(vringh_need_notify_kern); > > +#ifdef VHOST_IOTLB > + > static int iotlb_translate(const struct vringh *vrh, > u64 addr, u64 len, struct bio_vec iov[], > int iov_size, u32 perm) > @@ -1416,5 +1420,6 @@ int v...
2020 Apr 03
0
[PATCH v3 1/2] virtio/test: fix up after IOTLB changes
...port.h> +#if IS_REACHABLE(CONFIG_VHOST_IOTLB) #include <linux/bvec.h> #include <linux/highmem.h> #include <linux/vhost_iotlb.h> +#endif #include <uapi/linux/virtio_config.h> static __printf(1,2) __cold void vringh_bad(const char *fmt, ...) @@ -1059,6 +1061,8 @@ int vringh_need_notify_kern(struct vringh *vrh) } EXPORT_SYMBOL(vringh_need_notify_kern); +#if IS_REACHABLE(CONFIG_VHOST_IOTLB) + static int iotlb_translate(const struct vringh *vrh, u64 addr, u64 len, struct bio_vec iov[], int iov_size, u32 perm) @@ -1416,5 +1420,6 @@ int vringh_need_notify_iotlb(struct vr...
2023 Mar 23
1
[PATCH v3 4/8] vringh: support VA with iotlb
...lse, NULL, NULL, NULL); > > vq->vring.notify = NULL; > } > diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c > index 0ba3ef809e48..72c88519329a 100644 > --- a/drivers/vhost/vringh.c > +++ b/drivers/vhost/vringh.c > @@ -1094,10 +1094,18 @@ EXPORT_SYMBOL(vringh_need_notify_kern); > > #if IS_REACHABLE(CONFIG_VHOST_IOTLB) > > +struct iotlb_vec { > + union { > + struct iovec *iovec; > + struct bio_vec *bvec; > + } iov; > + size_t count; > + bool is_iovec; I wonder if this is needed (if vringh...
2013 Mar 08
1
[PATCHv2] virtio: Introduce vringh wrappers in virtio_config
...uct virtio_device *vdev, unsigned nhvrs, + struct vringh *vrhs[], vrh_callback_t *callbacks[]); + void (*del_vrhs)(struct virtio_device *vdev); }; /* The memory the vring can access, and what offset to apply. */ @@ -182,4 +204,11 @@ void vringh_notify_disable_kern(struct vringh *vrh); int vringh_need_notify_kern(struct vringh *vrh); +/* Notify the guest about buffers added to the used ring */ +static inline void vringh_notify(struct vringh *vrh) +{ + if (vrh->notify) + vrh->notify(vrh); +} + #endif /* _LINUX_VRINGH_H */ -- 1.7.5.4
2013 Mar 08
1
[PATCHv2] virtio: Introduce vringh wrappers in virtio_config
...uct virtio_device *vdev, unsigned nhvrs, + struct vringh *vrhs[], vrh_callback_t *callbacks[]); + void (*del_vrhs)(struct virtio_device *vdev); }; /* The memory the vring can access, and what offset to apply. */ @@ -182,4 +204,11 @@ void vringh_notify_disable_kern(struct vringh *vrh); int vringh_need_notify_kern(struct vringh *vrh); +/* Notify the guest about buffers added to the used ring */ +static inline void vringh_notify(struct vringh *vrh) +{ + if (vrh->notify) + vrh->notify(vrh); +} + #endif /* _LINUX_VRINGH_H */ -- 1.7.5.4
2013 Mar 05
2
[PATCH vringh] virtio: Introduce vringh wrappers in virtio_config
...function to call when buffers are available */ + void (*notify)(struct vringh *); + + /* A pointer for the vringh clients to use. */ + void *priv; }; /* The memory the vring can access, and what offset to apply. */ @@ -182,4 +188,11 @@ void vringh_notify_disable_kern(struct vringh *vrh); int vringh_need_notify_kern(struct vringh *vrh); +/* Notify the guest about buffers added to the used ring */ +static inline void vringh_notify(struct vringh *vrh) +{ + if (vrh->notify) + vrh->notify(vrh); +} + #endif /* _LINUX_VRINGH_H */ -- 1.7.5.4
2013 Mar 05
2
[PATCH vringh] virtio: Introduce vringh wrappers in virtio_config
...function to call when buffers are available */ + void (*notify)(struct vringh *); + + /* A pointer for the vringh clients to use. */ + void *priv; }; /* The memory the vring can access, and what offset to apply. */ @@ -182,4 +188,11 @@ void vringh_notify_disable_kern(struct vringh *vrh); int vringh_need_notify_kern(struct vringh *vrh); +/* Notify the guest about buffers added to the used ring */ +static inline void vringh_notify(struct vringh *vrh) +{ + if (vrh->notify) + vrh->notify(vrh); +} + #endif /* _LINUX_VRINGH_H */ -- 1.7.5.4
2023 Mar 21
1
[PATCH v3 4/8] vringh: support VA with iotlb
...L, NULL); + VDPASIM_QUEUE_MAX, false, false, NULL, NULL, NULL); vq->vring.notify = NULL; } diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c index 0ba3ef809e48..72c88519329a 100644 --- a/drivers/vhost/vringh.c +++ b/drivers/vhost/vringh.c @@ -1094,10 +1094,18 @@ EXPORT_SYMBOL(vringh_need_notify_kern); #if IS_REACHABLE(CONFIG_VHOST_IOTLB) +struct iotlb_vec { + union { + struct iovec *iovec; + struct bio_vec *bvec; + } iov; + size_t count; + bool is_iovec; +}; + static int iotlb_translate(const struct vringh *vrh, u64 addr, u64 len, u64 *translated, - struct bio_vec iov[], -...
2013 Feb 18
9
[PATCH 0/5] vringh
This introduces vringh, which are generic accessors for virtio rings (host side). There's a host-side implementation in vhost, but it assumes that the rings are in userspace, and is tied to the vhost implementation. I have patches to adapt it to use vringh, but I'm pushing this in the next merge window for Sjur, who has CAIF patches which need it. This also includes a test program in
2013 Feb 18
9
[PATCH 0/5] vringh
This introduces vringh, which are generic accessors for virtio rings (host side). There's a host-side implementation in vhost, but it assumes that the rings are in userspace, and is tied to the vhost implementation. I have patches to adapt it to use vringh, but I'm pushing this in the next merge window for Sjur, who has CAIF patches which need it. This also includes a test program in
2023 Mar 21
5
[PATCH v3 0/8] 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
2013 Mar 15
4
[PATCHv3 vringh] caif_virtio: Introduce caif over virtio
...t is fatal */ + netdev_warn(cfv->ndev, "Bad ring, disable device\n"); + cfv->ndev->stats.rx_dropped = riov->used - riov->i; + napi_complete(napi); + vringh_notify_disable_kern(cfv->vr_rx); + netif_carrier_off(cfv->ndev); + break; + } +out: + if (rxcnt && vringh_need_notify_kern(cfv->vr_rx) > 0) + vringh_notify(cfv->vr_rx); + return rxcnt; +} + +static void cfv_recv(struct virtio_device *vdev, struct vringh *vr_rx) +{ + struct cfv_info *cfv = vdev->priv; + + ++cfv->stats.rx_kicks; + vringh_notify_disable_kern(cfv->vr_rx); + napi_schedule(&cfv->nap...
2013 Mar 15
4
[PATCHv3 vringh] caif_virtio: Introduce caif over virtio
...t is fatal */ + netdev_warn(cfv->ndev, "Bad ring, disable device\n"); + cfv->ndev->stats.rx_dropped = riov->used - riov->i; + napi_complete(napi); + vringh_notify_disable_kern(cfv->vr_rx); + netif_carrier_off(cfv->ndev); + break; + } +out: + if (rxcnt && vringh_need_notify_kern(cfv->vr_rx) > 0) + vringh_notify(cfv->vr_rx); + return rxcnt; +} + +static void cfv_recv(struct virtio_device *vdev, struct vringh *vr_rx) +{ + struct cfv_info *cfv = vdev->priv; + + ++cfv->stats.rx_kicks; + vringh_notify_disable_kern(cfv->vr_rx); + napi_schedule(&cfv->nap...
2013 Jan 17
8
[PATCH 1/6] virtio_host: host-side implementation of virtio rings.
Getting use of virtio rings correct is tricky, and a recent patch saw an implementation of in-kernel rings (as separate from userspace). This patch attempts to abstract the business of dealing with the virtio ring layout from the access (userspace or direct); to do this, we use function pointers, which gcc inlines correctly. Signed-off-by: Rusty Russell <rusty at rustcorp.com.au> ---
2013 Jan 17
8
[PATCH 1/6] virtio_host: host-side implementation of virtio rings.
Getting use of virtio rings correct is tricky, and a recent patch saw an implementation of in-kernel rings (as separate from userspace). This patch attempts to abstract the business of dealing with the virtio ring layout from the access (userspace or direct); to do this, we use function pointers, which gcc inlines correctly. Signed-off-by: Rusty Russell <rusty at rustcorp.com.au> ---
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