search for: vdpa_driver

Displaying 17 results from an estimated 17 matches for "vdpa_driver".

2020 Jul 17
0
[PATCH V2 3/6] vDPA: implement IRQ offloading helpers in vDPA core
...ude/linux/vdpa.h | 13 +++++++++++++ > 2 files changed, 55 insertions(+) > > diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c > index ff6562f..cce4d91 100644 > --- a/drivers/vdpa/vdpa.c > +++ b/drivers/vdpa/vdpa.c > @@ -163,6 +163,48 @@ void vdpa_unregister_driver(struct vdpa_driver *drv) > } > EXPORT_SYMBOL_GPL(vdpa_unregister_driver); > > +static void vdpa_setup_irq(struct vdpa_device *vdev, int qid, int irq) > +{ > + struct vdpa_driver *drv = drv_to_vdpa(vdev->dev.driver); > + > + if (drv->setup_vq_irq) > + drv->setup_vq_irq(vdev,...
2020 Jul 13
0
[PATCH 4/7] vDPA: implement IRQ offloading helpers in vDPA core
...lude/linux/vdpa.h | 11 +++++++++++ > 4 files changed, 60 insertions(+) > > diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c > index ff6562f..d8eba01 100644 > --- a/drivers/vdpa/vdpa.c > +++ b/drivers/vdpa/vdpa.c > @@ -163,6 +163,52 @@ void vdpa_unregister_driver(struct vdpa_driver *drv) > } > EXPORT_SYMBOL_GPL(vdpa_unregister_driver); > > +static void vdpa_setup_irq(struct vdpa_device *vdev, int qid, int irq) > +{ > + struct vdpa_driver *drv = drv_to_vdpa(vdev->dev.driver); > + > +#ifdef CONFIG_HAVE_KVM_IRQ_BYPASS Let's don't do th...
2020 Feb 10
0
[PATCH V2 3/5] vDPA: introduce vDPA bus
...Author: Jason Wang <jasowang at redhat.com> + * + */ + +#include <linux/module.h> +#include <linux/idr.h> +#include <linux/vdpa.h> + +static DEFINE_IDA(vdpa_index_ida); + +static int vdpa_dev_probe(struct device *d) +{ + struct vdpa_device *vdev = dev_to_vdpa(d); + struct vdpa_driver *drv = drv_to_vdpa(vdev->dev.driver); + int ret = 0; + + if (drv && drv->probe) + ret = drv->probe(vdev); + + return ret; +} + +static int vdpa_dev_remove(struct device *d) +{ + struct vdpa_device *vdev = dev_to_vdpa(d); + struct vdpa_driver *drv = drv_to_vdpa(vdev->dev.driver)...
2020 Feb 20
0
[PATCH V3 3/5] vDPA: introduce vDPA bus
...ang at redhat.com> + * + */ + +#include <linux/module.h> +#include <linux/idr.h> +#include <linux/slab.h> +#include <linux/vdpa.h> + +static DEFINE_IDA(vdpa_index_ida); + +static int vdpa_dev_probe(struct device *d) +{ + struct vdpa_device *vdev = dev_to_vdpa(d); + struct vdpa_driver *drv = drv_to_vdpa(vdev->dev.driver); + int ret = 0; + + if (drv && drv->probe) + ret = drv->probe(vdev); + + return ret; +} + +static int vdpa_dev_remove(struct device *d) +{ + struct vdpa_device *vdev = dev_to_vdpa(d); + struct vdpa_driver *drv = drv_to_vdpa(vdev->dev.driver)...
2020 Feb 11
2
[PATCH V2 3/5] vDPA: introduce vDPA bus
...unwind The ida_simple_remove should probably be part of the class release function to make everything work right > +/** > + * vdpa_unregister_driver - unregister a vDPA device driver > + * @drv: the vdpa device driver to be unregistered > + */ > +void vdpa_unregister_driver(struct vdpa_driver *drv) > +{ > + driver_unregister(&drv->driver); > +} > +EXPORT_SYMBOL_GPL(vdpa_unregister_driver); > + > +static int vdpa_init(void) > +{ > + if (bus_register(&vdpa_bus) != 0) > + panic("virtio bus registration failed"); > + return 0; > +} Lin...
2020 Feb 11
2
[PATCH V2 3/5] vDPA: introduce vDPA bus
...unwind The ida_simple_remove should probably be part of the class release function to make everything work right > +/** > + * vdpa_unregister_driver - unregister a vDPA device driver > + * @drv: the vdpa device driver to be unregistered > + */ > +void vdpa_unregister_driver(struct vdpa_driver *drv) > +{ > + driver_unregister(&drv->driver); > +} > +EXPORT_SYMBOL_GPL(vdpa_unregister_driver); > + > +static int vdpa_init(void) > +{ > + if (bus_register(&vdpa_bus) != 0) > + panic("virtio bus registration failed"); > + return 0; > +} Lin...
2020 Feb 20
5
[PATCH V4 0/5] vDPA support
...allows intermediate step to be done (Jason) - warn on invalidate queue state when fail to creating virtqueue (Jason) - make to_virtio_vdpa_device() static (Jason) - use kmalloc/kfree instead of devres for virtio vdpa device (Jason) - avoid using cast in vdpa bus function (Jason) - introduce module_vdpa_driver and fix module refcnt (Jason) - fix returning freed address in vdapsim coherent DMA addr allocation (Dan) - various other fixes and tweaks V3: https://lkml.org/lkml/2020/2/19/1347 V2: https://lkml.org/lkml/2020/2/9/275 V1: https://lkml.org/lkml/2020/1/16/353 Jason Wang (5): vhost: factor out IO...
2020 Feb 12
0
[PATCH V2 3/5] vDPA: introduce vDPA bus
...set of programming interface but not the semantics. Or do you actually mean type here? > >> +/** >> + * vdpa_unregister_driver - unregister a vDPA device driver >> + * @drv: the vdpa device driver to be unregistered >> + */ >> +void vdpa_unregister_driver(struct vdpa_driver *drv) >> +{ >> + driver_unregister(&drv->driver); >> +} >> +EXPORT_SYMBOL_GPL(vdpa_unregister_driver); >> + >> +static int vdpa_init(void) >> +{ >> + if (bus_register(&vdpa_bus) != 0) >> + panic("virtio bus registration failed&q...
2020 Jul 20
0
[PATCH V2 3/6] vDPA: implement IRQ offloading helpers in vDPA core
On 2020/7/20 ??5:07, Zhu, Lingshan wrote: >>> >>> +} >>> + >>> +static void vdpa_unsetup_irq(struct vdpa_device *vdev, int qid) >>> +{ >>> +??? struct vdpa_driver *drv = drv_to_vdpa(vdev->dev.driver); >>> + >>> +??? if (drv->unsetup_vq_irq) >>> +??????? drv->unsetup_vq_irq(vdev, qid); >> >> >> Do you need to check the existence of drv before calling unset_vq_irq()? > Yes, we should check this when we t...
2020 Jul 21
0
[PATCH V2 3/6] vDPA: implement IRQ offloading helpers in vDPA core
...0 5:40 PM, Jason Wang wrote: >> >> On 2020/7/20 ??5:07, Zhu, Lingshan wrote: >>>>> >>>>> +} >>>>> + >>>>> +static void vdpa_unsetup_irq(struct vdpa_device *vdev, int qid) >>>>> +{ >>>>> +??? struct vdpa_driver *drv = drv_to_vdpa(vdev->dev.driver); >>>>> + >>>>> +??? if (drv->unsetup_vq_irq) >>>>> +??????? drv->unsetup_vq_irq(vdev, qid); >>>> >>>> >>>> Do you need to check the existence of drv before calling >&gt...
2020 Jul 23
0
[PATCH V3 3/6] vDPA: implement vq IRQ allocate/free helpers in vDPA core
...ER_OK and unregister producer when !DRIVER_OK in vhost-vDPA 3) deal with the synchronization with SET_VRING_CALL 4) document that irq is not expected to be changed during DRIVER_OK This can make sure the API works during driver probe, and we don't need the setup_irq and unsetup_irq method in vdpa_driver Thanks > + */ > +int vdpa_devm_request_irq(struct device *dev, struct vdpa_device *vdev, > + unsigned int irq, irq_handler_t handler, > + unsigned long irqflags, const char *devname, void *dev_id, > + int qid) > +{ > + int ret; > + > + ret = devm_request_ir...
2020 Feb 20
9
[PATCH V3 0/5] vDPA support
...allows intermediate step to be done (Jason) - warn on invalidate queue state when fail to creating virtqueue (Jason) - make to_virtio_vdpa_device() static (Jason) - use kmalloc/kfree instead of devres for virtio vdpa device (Jason) - avoid using cast in vdpa bus function (Jason) - introduce module_vdpa_driver and fix module refcnt (Jason) - fix returning freed address in vdapsim coherent DMA addr allocation (Dan) - various other fixes and tweaks V2: https://lkml.org/lkml/2020/2/9/275 V1: https://lkml.org/lkml/2020/1/16/353 Jason Wang (5): vhost: factor out IOTLB vringh: IOTLB support vDPA: intro...
2020 Feb 10
9
[PATCH V2 0/5] vDPA support
...allows intermediate step to be done (Jason) - warn on invalidate queue state when fail to creating virtqueue (Jason) - make to_virtio_vdpa_device() static (Jason) - use kmalloc/kfree instead of devres for virtio vdpa device (Jason) - avoid using cast in vdpa bus function (Jason) - introduce module_vdpa_driver and fix module refcnt (Jason) - fix returning freed address in vdapsim coherent DMA addr allocation (Dan) - various other fixes and tweaks V1: https://lkml.org/lkml/2020/1/16/353 Jason Wang (5): vhost: factor out IOTLB vringh: IOTLB support vDPA: introduce vDPA bus virtio: introduce a vDP...
2020 Feb 10
0
[PATCH V2 4/5] virtio: introduce a vDPA based transport
...goto err; + + vdpa_set_drvdata(vdpa, vd_dev); + + return 0; + +err: + kfree(vd_dev); + return ret; +} + +static void virtio_vdpa_remove(struct vdpa_device *vdpa) +{ + struct virtio_vdpa_device *vd_dev = vdpa_get_drvdata(vdpa); + + unregister_virtio_device(&vd_dev->vdev); +} + +static struct vdpa_driver virtio_vdpa_driver = { + .driver = { + .name = "virtio_vdpa", + }, + .probe = virtio_vdpa_probe, + .remove = virtio_vdpa_remove, +}; + +module_vdpa_driver(virtio_vdpa_driver); + +MODULE_VERSION(MOD_VERSION); +MODULE_LICENSE(MOD_LICENSE); +MODULE_AUTHOR(MOD_AUTHOR); +MODULE_DESCRIPTION(MO...
2020 Feb 20
0
[PATCH V3 4/5] virtio: introduce a vDPA based transport
...goto err; + + vdpa_set_drvdata(vdpa, vd_dev); + + return 0; + +err: + kfree(vd_dev); + return ret; +} + +static void virtio_vdpa_remove(struct vdpa_device *vdpa) +{ + struct virtio_vdpa_device *vd_dev = vdpa_get_drvdata(vdpa); + + unregister_virtio_device(&vd_dev->vdev); +} + +static struct vdpa_driver virtio_vdpa_driver = { + .driver = { + .name = "virtio_vdpa", + }, + .probe = virtio_vdpa_probe, + .remove = virtio_vdpa_remove, +}; + +module_vdpa_driver(virtio_vdpa_driver); + +MODULE_VERSION(MOD_VERSION); +MODULE_LICENSE(MOD_LICENSE); +MODULE_AUTHOR(MOD_AUTHOR); +MODULE_DESCRIPTION(MO...
2020 Feb 04
10
[PATCH] vhost: introduce vDPA based backend
...mutex_lock(&vhost_vdpa.mutex); > + device_destroy(vhost_vdpa.class, > + MKDEV(MAJOR(vhost_vdpa.devt), v->minor)); > + vhost_vdpa_free_minor(v->minor); > + mutex_unlock(&vhost_vdpa.mutex); > + kfree(v->vqs); > + kfree(v); > +} > + > +static struct vdpa_driver vhost_vdpa_driver = { > + .drv = { > + .name = "vhost_vdpa", > + }, > + .probe = vhost_vdpa_probe, > + .remove = vhost_vdpa_remove, > +}; > + > +static char *vhost_vdpa_devnode(struct device *dev, umode_t *mode) > +{ > + return kasprintf(GFP_KERNEL, "vh...
2020 Feb 04
10
[PATCH] vhost: introduce vDPA based backend
...mutex_lock(&vhost_vdpa.mutex); > + device_destroy(vhost_vdpa.class, > + MKDEV(MAJOR(vhost_vdpa.devt), v->minor)); > + vhost_vdpa_free_minor(v->minor); > + mutex_unlock(&vhost_vdpa.mutex); > + kfree(v->vqs); > + kfree(v); > +} > + > +static struct vdpa_driver vhost_vdpa_driver = { > + .drv = { > + .name = "vhost_vdpa", > + }, > + .probe = vhost_vdpa_probe, > + .remove = vhost_vdpa_remove, > +}; > + > +static char *vhost_vdpa_devnode(struct device *dev, umode_t *mode) > +{ > + return kasprintf(GFP_KERNEL, "vh...