search for: vdpa_unregister_device

Displaying 20 results from an estimated 27 matches for "vdpa_unregister_device".

2020 Feb 10
0
[PATCH V2 3/5] vDPA: introduce vDPA bus
...to vDPA bus + */ +int vdpa_register_device(struct vdpa_device *vdev) +{ + int err = device_add(&vdev->dev); + + if (err) { + put_device(&vdev->dev); + ida_simple_remove(&vdpa_index_ida, vdev->index); + } + + return err; +} +EXPORT_SYMBOL_GPL(vdpa_register_device); + +/** + * vdpa_unregister_device - unregister a vDPA device + * @vdev: the vdpa device to be unregisted from vDPA bus + */ +void vdpa_unregister_device(struct vdpa_device *vdev) +{ + int index = vdev->index; + + device_unregister(&vdev->dev); + ida_simple_remove(&vdpa_index_ida, index); +} +EXPORT_SYMBOL_GPL(vdpa_unr...
2020 Feb 20
0
[PATCH V3 3/5] vDPA: introduce vDPA bus
...all of vdpa_init_device() before. + * @vdev: the vdpa device to be registered to vDPA bus + * + * Returns an error when fail to add to vDPA bus + */ +int vdpa_register_device(struct vdpa_device *vdev) +{ + return device_add(&vdev->dev); +} +EXPORT_SYMBOL_GPL(vdpa_register_device); + +/** + * vdpa_unregister_device - unregister a vDPA device + * @vdev: the vdpa device to be unregisted from vDPA bus + */ +void vdpa_unregister_device(struct vdpa_device *vdev) +{ + device_unregister(&vdev->dev); +} +EXPORT_SYMBOL_GPL(vdpa_unregister_device); + +/** + * __vdpa_register_driver - register a vDPA device drive...
2020 Jul 17
0
[PATCH V2 3/6] vDPA: implement IRQ offloading helpers in vDPA core
...x/vdpa.h b/include/linux/vdpa.h > index 239db79..7d64d83 100644 > --- a/include/linux/vdpa.h > +++ b/include/linux/vdpa.h > @@ -220,17 +220,30 @@ struct vdpa_device *__vdpa_alloc_device(struct device *parent, > > int vdpa_register_device(struct vdpa_device *vdev); > void vdpa_unregister_device(struct vdpa_device *vdev); > +/* request irq for a vq, setup irq offloading if its a vhost_vdpa vq */ Let's do the documentation in vdpa.c, and again, document the devres implications or j_xxxust name it as vdpa_devm_xxx. > +int vdpa_alloc_vq_irq(struct device *dev, struct vdpa_devic...
2020 Jul 13
0
[PATCH 4/7] vDPA: implement IRQ offloading helpers in vDPA core
...x/vdpa.h b/include/linux/vdpa.h > index 239db79..9f9b245 100644 > --- a/include/linux/vdpa.h > +++ b/include/linux/vdpa.h > @@ -220,17 +220,28 @@ struct vdpa_device *__vdpa_alloc_device(struct device *parent, > > int vdpa_register_device(struct vdpa_device *vdev); > void vdpa_unregister_device(struct vdpa_device *vdev); > +int vdpa_alloc_vq_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); > +void vdpa_free_vq_irq(struct device *dev...
2020 Jun 10
2
[PATCH V3] vdpa: introduce virtio pci driver
...; + >> + return 0; >> + >> +err: >> + put_device(&vp_vdpa->vdpa.dev); >> + return ret; >> +} >> + >> +static void vp_vdpa_remove(struct pci_dev *pdev) >> +{ >> + struct vp_vdpa *vp_vdpa = pci_get_drvdata(pdev); >> + >> + vdpa_unregister_device(&vp_vdpa->vdpa); >> +} >> + >> +static struct pci_driver vp_vdpa_driver = { >> + .name = "vp-vdpa", >> + .id_table = NULL, /* only dynamic ids */ >> + .probe = vp_vdpa_probe, >> + .remove = vp_vdpa_remove, >> +}; >> + >&gt...
2020 Jun 10
2
[PATCH V3] vdpa: introduce virtio pci driver
...; + >> + return 0; >> + >> +err: >> + put_device(&vp_vdpa->vdpa.dev); >> + return ret; >> +} >> + >> +static void vp_vdpa_remove(struct pci_dev *pdev) >> +{ >> + struct vp_vdpa *vp_vdpa = pci_get_drvdata(pdev); >> + >> + vdpa_unregister_device(&vp_vdpa->vdpa); >> +} >> + >> +static struct pci_driver vp_vdpa_driver = { >> + .name = "vp-vdpa", >> + .id_table = NULL, /* only dynamic ids */ >> + .probe = vp_vdpa_probe, >> + .remove = vp_vdpa_remove, >> +}; >> + >&gt...
2020 Jun 10
2
[PATCH V3] vdpa: introduce virtio pci driver
...lier; + vp_vdpa->vring[i].notify_pa = notify_pa + + notify_off * vp_vdpa->notify_off_multiplier; + } + + return 0; + +err: + put_device(&vp_vdpa->vdpa.dev); + return ret; +} + +static void vp_vdpa_remove(struct pci_dev *pdev) +{ + struct vp_vdpa *vp_vdpa = pci_get_drvdata(pdev); + + vdpa_unregister_device(&vp_vdpa->vdpa); +} + +static struct pci_driver vp_vdpa_driver = { + .name = "vp-vdpa", + .id_table = NULL, /* only dynamic ids */ + .probe = vp_vdpa_probe, + .remove = vp_vdpa_remove, +}; + +module_pci_driver(vp_vdpa_driver); + +MODULE_AUTHOR("Jason Wang <jasowang at re...
2020 Jun 10
2
[PATCH V3] vdpa: introduce virtio pci driver
...lier; + vp_vdpa->vring[i].notify_pa = notify_pa + + notify_off * vp_vdpa->notify_off_multiplier; + } + + return 0; + +err: + put_device(&vp_vdpa->vdpa.dev); + return ret; +} + +static void vp_vdpa_remove(struct pci_dev *pdev) +{ + struct vp_vdpa *vp_vdpa = pci_get_drvdata(pdev); + + vdpa_unregister_device(&vp_vdpa->vdpa); +} + +static struct pci_driver vp_vdpa_driver = { + .name = "vp-vdpa", + .id_table = NULL, /* only dynamic ids */ + .probe = vp_vdpa_probe, + .remove = vp_vdpa_remove, +}; + +module_pci_driver(vp_vdpa_driver); + +MODULE_AUTHOR("Jason Wang <jasowang at re...
2020 Feb 10
9
[PATCH V2 0/5] vDPA support
Hi all: This is an updated version of kernel support for vDPA device. Various changes were made based on the feedback since last verion. One major change is to drop the sysfs API and leave the management interface for future development, and introudce the incremental DMA bus operations. Please see changelog for more information. The work on vhost, IFCVF (intel VF driver for vDPA) and qemu is
2020 Feb 20
5
[PATCH V4 0/5] vDPA support
Hi all: This is an update version of vDPA support in kernel. vDPA device is a device that uses a datapath which complies with the virtio specifications with vendor specific control path. vDPA devices can be both physically located on the hardware or emulated by software. vDPA hardware devices are usually implemented through PCIE with the following types: - PF (Physical Function) - A single
2020 Jun 10
2
[PATCH RESEND V2] vdpa: introduce virtio pci driver
...lier; + vp_vdpa->vring[i].notify_pa = notify_pa + + notify_off * vp_vdpa->notify_off_multiplier; + } + + return 0; + +err: + put_device(&vp_vdpa->vdpa.dev); + return ret; +} + +static void vp_vdpa_remove(struct pci_dev *pdev) +{ + struct vp_vdpa *vp_vdpa = pci_get_drvdata(pdev); + + vdpa_unregister_device(&vp_vdpa->vdpa); +} + +static struct pci_driver vp_vdpa_driver = { + .name = "vp-vdpa", + .id_table = NULL, /* only dynamic ids */ + .probe = vp_vdpa_probe, + .remove = vp_vdpa_remove, +}; + +module_pci_driver(vp_vdpa_driver); + +MODULE_AUTHOR("Jason Wang <jasowang at re...
2020 Jun 10
2
[PATCH RESEND V2] vdpa: introduce virtio pci driver
...lier; + vp_vdpa->vring[i].notify_pa = notify_pa + + notify_off * vp_vdpa->notify_off_multiplier; + } + + return 0; + +err: + put_device(&vp_vdpa->vdpa.dev); + return ret; +} + +static void vp_vdpa_remove(struct pci_dev *pdev) +{ + struct vp_vdpa *vp_vdpa = pci_get_drvdata(pdev); + + vdpa_unregister_device(&vp_vdpa->vdpa); +} + +static struct pci_driver vp_vdpa_driver = { + .name = "vp-vdpa", + .id_table = NULL, /* only dynamic ids */ + .probe = vp_vdpa_probe, + .remove = vp_vdpa_remove, +}; + +module_pci_driver(vp_vdpa_driver); + +MODULE_AUTHOR("Jason Wang <jasowang at re...
2020 Jun 10
0
[PATCH V3] vdpa: introduce virtio pci driver
...; > > + put_device(&vp_vdpa->vdpa.dev); > > > + return ret; > > > +} > > > + > > > +static void vp_vdpa_remove(struct pci_dev *pdev) > > > +{ > > > + struct vp_vdpa *vp_vdpa = pci_get_drvdata(pdev); > > > + > > > + vdpa_unregister_device(&vp_vdpa->vdpa); > > > +} > > > + > > > +static struct pci_driver vp_vdpa_driver = { > > > + .name = "vp-vdpa", > > > + .id_table = NULL, /* only dynamic ids */ > > > + .probe = vp_vdpa_probe, > > > + .remove = vp_vd...
2020 Feb 20
9
[PATCH V3 0/5] vDPA support
Hi all: This is an update version of vDPA support in kernel. vDPA device is a device that uses a datapath which complies with the virtio specifications with vendor specific control path. vDPA devices can be both physically located on the hardware or emulated by software. vDPA hardware devices are usually implemented through PCIE with the following types: - PF (Physical Function) - A single
2020 May 29
0
[PATCH 5/6] vdpa: introduce virtio pci driver
...+ vp_vdpa->vring[i].notify = vp_vdpa->notify + + notify_off * vp_vdpa->notify_off_multiplier; + } + + return 0; + +err: + put_device(&vp_vdpa->vdpa.dev); + return ret; +} + +static void vp_vdpa_remove(struct pci_dev *pdev) +{ + struct vp_vdpa *vp_vdpa = pci_get_drvdata(pdev); + + vdpa_unregister_device(&vp_vdpa->vdpa); +} + +static const struct pci_device_id vp_vdpa_id_table[] = { + { PCI_DEVICE(PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_ANY_ID) }, + { 0 } +}; + +MODULE_DEVICE_TABLE(pci, vp_vdpa_id_table); + +static struct pci_driver vp_vdpa_driver = { + .name = "vp-vdpa", + .id_table =...
2020 Jun 10
0
[PATCH RESEND V2] vdpa: introduce virtio pci driver
...vp_vdpa->notify_off_multiplier; > + } > + > + return 0; > + > +err: > + put_device(&vp_vdpa->vdpa.dev); > + return ret; > +} > + > +static void vp_vdpa_remove(struct pci_dev *pdev) > +{ > + struct vp_vdpa *vp_vdpa = pci_get_drvdata(pdev); > + > + vdpa_unregister_device(&vp_vdpa->vdpa); > +} > + > +static struct pci_driver vp_vdpa_driver = { > + .name = "vp-vdpa", > + .id_table = NULL, /* only dynamic ids */ > + .probe = vp_vdpa_probe, > + .remove = vp_vdpa_remove, > +}; > + > +module_pci_driver(vp_vdpa_driver); &g...
2020 Feb 10
0
[PATCH V2 5/5] vdpasim: vDPA device simulator
...+ if (ret) + goto err_register; + + if (!vdpasim_create()) + goto err_register; + + return 0; + +err_register: + kfree(vdpasim_dev); + vdpasim_dev = NULL; + return ret; +} + +static int vdpasim_device_remove_cb(struct device *dev, void *data) +{ + struct vdpa_device *vdpa = dev_to_vdpa(dev); + + vdpa_unregister_device(vdpa); + + return 0; +} + +static void __exit vdpasim_dev_exit(void) +{ + device_for_each_child(&vdpasim_dev->dev, NULL, + vdpasim_device_remove_cb); + device_unregister(&vdpasim_dev->dev); +} + +module_init(vdpasim_dev_init) +module_exit(vdpasim_dev_exit) + +MODULE_VERSION(DR...
2020 Feb 20
0
[PATCH V3 5/5] vdpasim: vDPA device simulator
...dma_unmap, +}; + +static int __init vdpasim_dev_init(void) +{ + vdpasim_dev = vdpasim_create(); + + if (!IS_ERR(vdpasim_dev)) + return 0; + + return PTR_ERR(vdpasim_dev); +} + +static int vdpasim_device_remove_cb(struct device *dev, void *data) +{ + struct vdpa_device *vdpa = dev_to_vdpa(dev); + + vdpa_unregister_device(vdpa); + + return 0; +} + +static void __exit vdpasim_dev_exit(void) +{ + device_for_each_child(&vdpasim_dev->dev, NULL, + vdpasim_device_remove_cb); + device_unregister(&vdpasim_dev->dev); +} + +module_init(vdpasim_dev_init) +module_exit(vdpasim_dev_exit) + +MODULE_VERSION(DR...
2020 Jun 10
0
[PATCH V3] vdpa: introduce virtio pci driver
...vp_vdpa->notify_off_multiplier; > + } > + > + return 0; > + > +err: > + put_device(&vp_vdpa->vdpa.dev); > + return ret; > +} > + > +static void vp_vdpa_remove(struct pci_dev *pdev) > +{ > + struct vp_vdpa *vp_vdpa = pci_get_drvdata(pdev); > + > + vdpa_unregister_device(&vp_vdpa->vdpa); > +} > + > +static struct pci_driver vp_vdpa_driver = { > + .name = "vp-vdpa", > + .id_table = NULL, /* only dynamic ids */ > + .probe = vp_vdpa_probe, > + .remove = vp_vdpa_remove, > +}; > + > +module_pci_driver(vp_vdpa_driver); &g...
2020 Jun 10
2
[PATCH V2] vdpa: introduce virtio pci driver
...lier; + vp_vdpa->vring[i].notify_pa = notify_pa + + notify_off * vp_vdpa->notify_off_multiplier; + } + + return 0; + +err: + put_device(&vp_vdpa->vdpa.dev); + return ret; +} + +static void vp_vdpa_remove(struct pci_dev *pdev) +{ + struct vp_vdpa *vp_vdpa = pci_get_drvdata(pdev); + + vdpa_unregister_device(&vp_vdpa->vdpa); +} + +static struct pci_driver vp_vdpa_driver = { + .name = "vp-vdpa", + .id_table = NULL, /* only dynamic ids */ + .probe = vp_vdpa_probe, + .remove = vp_vdpa_remove, +}; + +module_pci_driver(vp_vdpa_driver); + +MODULE_AUTHOR("Jason Wang <jasowang at re...