search for: vdpa_alloc_device

Displaying 20 results from an estimated 39 matches for "vdpa_alloc_device".

2020 Feb 11
1
[PATCH V2 5/5] vdpasim: vDPA device simulator
...g->mac); > + > + INIT_WORK(&vdpasim->work, vdpasim_work); > + spin_lock_init(&vdpasim->lock); > + > + vdpa = &vdpasim->vdpa; > + vdpa->dev.release = vdpasim_release_dev; The driver should not provide the release function. Again the safest model is 'vdpa_alloc_device' which combines the kzalloc and the vdpa_init_device() and returns something that is error unwound with put_device() The subsystem owns the release and does the kfree and other cleanup like releasing the IDA. > + vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu); > + vr...
2023 Mar 23
2
[PATCH v3 8/8] vdpa_sim: add support for user VA
On Thu, Mar 23, 2023 at 11:42:07AM +0800, Jason Wang wrote: >On Tue, Mar 21, 2023 at 11:48?PM Stefano Garzarella <sgarzare at redhat.com> wrote: >> >> The new "use_va" module parameter (default: true) is used in >> vdpa_alloc_device() to inform the vDPA framework that the device >> supports VA. >> >> vringh is initialized to use VA only when "use_va" is true and the >> user's mm has been bound. So, only when the bus supports user VA >> (e.g. vhost-vdpa). >> >> vdpasim_mm_...
2020 Mar 04
1
[PATCH V5 3/5] vDPA: introduce vDPA bus
On Wed, Feb 26, 2020 at 02:04:54PM +0800, Jason Wang wrote: > +struct vdpa_device *vdpa_alloc_device(struct device *parent, > + struct device *dma_dev, > + const struct vdpa_config_ops *config) > +{ > + struct vdpa_device *vdev; > + int err = -ENOMEM; > + > + if (!parent || !dma_dev || !config) > + goto err; > + > + vdev = kzalloc(sizeof(*vdev), GFP...
2020 Apr 13
0
[PATCH] vdpa: fix comment of vdpa_register_device()
The function should be called only after a success calling for vdpa_alloc_device(). Reported-by: Eli Cohen <eli at mellanox.com> Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/vdpa/vdpa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c index e9ed6a2b635b..ff6562f602e0 100644 --- a/driver...
2023 Mar 24
1
[PATCH v3 8/8] vdpa_sim: add support for user VA
...t; >> On Thu, Mar 23, 2023 at 11:42:07AM +0800, Jason Wang wrote: >> >On Tue, Mar 21, 2023 at 11:48?PM Stefano Garzarella <sgarzare at redhat.com> wrote: >> >> >> >> The new "use_va" module parameter (default: true) is used in >> >> vdpa_alloc_device() to inform the vDPA framework that the device >> >> supports VA. >> >> >> >> vringh is initialized to use VA only when "use_va" is true and the >> >> user's mm has been bound. So, only when the bus supports user VA >> >> (e....
2020 Feb 20
0
[PATCH V3 3/5] vDPA: introduce vDPA bus
...t bus_type vdpa_bus = { + .name = "vdpa", + .probe = vdpa_dev_probe, + .remove = vdpa_dev_remove, +}; + +static void vdpa_release_dev(struct device *d) +{ + struct vdpa_device *vdev = dev_to_vdpa(d); + + ida_simple_remove(&vdpa_index_ida, vdev->index); + kfree(vdev); +} + +/** + * vdpa_alloc_device - allocate and initilaize a vDPA device + * This allows driver to some prepartion after device is + * initialized but before registered. + * @parent: the parent device + * @dma_dev: the actual device that is performing DMA + * @config: the bus operations that is supported by this device + * + * Ret...
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
2023 Mar 23
1
[PATCH v3 8/8] vdpa_sim: add support for user VA
On Tue, Mar 21, 2023 at 11:48?PM Stefano Garzarella <sgarzare at redhat.com> wrote: > > The new "use_va" module parameter (default: true) is used in > vdpa_alloc_device() to inform the vDPA framework that the device > supports VA. > > vringh is initialized to use VA only when "use_va" is true and the > user's mm has been bound. So, only when the bus supports user VA > (e.g. vhost-vdpa). > > vdpasim_mm_work_fn work is used to seri...
2023 Mar 14
1
[PATCH v2 8/8] vdpa_sim: add support for user VA
On Thu, Mar 2, 2023 at 7:35?PM Stefano Garzarella <sgarzare at redhat.com> wrote: > > The new "use_va" module parameter (default: false) is used in > vdpa_alloc_device() to inform the vDPA framework that the device > supports VA. > > vringh is initialized to use VA only when "use_va" is true and the > user's mm has been bound. So, only when the bus supports user VA > (e.g. vhost-vdpa). > > vdpasim_mm_work_fn work is used to atta...
2023 Mar 24
1
[PATCH v3 8/8] vdpa_sim: add support for user VA
? 2023/3/21 23:48, Stefano Garzarella ??: > The new "use_va" module parameter (default: true) is used in > vdpa_alloc_device() to inform the vDPA framework that the device > supports VA. > > vringh is initialized to use VA only when "use_va" is true and the > user's mm has been bound. So, only when the bus supports user VA > (e.g. vhost-vdpa). > > vdpasim_mm_work_fn work is used to seri...
2020 May 27
0
[PATCH] vdpa: fix typos in the comments for __vdpa_alloc_device()
Fix two typos in the comments for __vdpa_alloc_device(). Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/vdpa/vdpa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c index ff6562f602e0..de211ef3738c 100644 --- a/drivers/vdpa/vdpa.c +++ b/drivers/vdpa/vdpa.c @@ -63,7 +6...
2023 Jun 07
0
[PATCH] vp_vdpa: Check queue number of vdpa device from add_config
...char *name, > > > struct device *dev = &pdev->dev; > > > struct vp_vdpa *vp_vdpa = NULL; > > > u64 device_features; > > > - int ret, i; > > > + int ret, i, queues; > > > > > > vp_vdpa = vdpa_alloc_device(struct vp_vdpa, vdpa, > > > dev, &vp_vdpa_ops, 1, 1, name, > > false); > > > @@ -491,7 +491,14 @@ static int vp_vdpa_dev_add(struct vdpa_mgmt_dev > > *v_mdev, const char *name, > > > vp_vdpa_mgtdev->vp_vdpa =...
2020 Jul 01
5
[PATCH 0/5]
Hi all: This series tries to support batched IOTLB updating vhost-vdpa. Currently vhost-vdpa accepts userspace mapping via IOTLB API, and it can only forward one mapping to IOMMU or device through IOMMU API or dma_map(). Though set_map() is designed to have the capability to pass an rbtree based mapping to vDPA device, it's still be called at least once for each VHOST_IOTLB_UPDATE or
2020 Jun 18
6
[PATCH RFC 0/5] support batched IOTLB updating in vhost-vdpa
Hi all: This series tries to support batched IOTLB updating vhost-vdpa. Currently vhost-vdpa accepts userspace mapping via IOTLB API, and it can only forward one mapping to IOMMU or device through IOMMU API or dma_map(). Though set_map() is deisgend to have the capability to pass an rbtree based mapping to vDPA device, it's still be called at least once for each VHOST_IOTLB_UPDATE or
2020 Jul 11
0
[vhost:config-endian 33/36] drivers/vdpa/vdpa_sim/vdpa_sim.c:335:21: sparse: sparse: incorrect type in assignment (different base types)
...truct device *dev; 2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26 312 int ret = -ENOMEM; 2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26 313 2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26 314 vdpasim = vdpa_alloc_device(struct vdpasim, vdpa, NULL, 2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26 315 &vdpasim_net_config_ops); 2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26 316 if (!vdpasim) 2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim...
2020 Jun 10
2
[PATCH V3] vdpa: introduce virtio pci driver
...0x1040; >> + } >> + virtio_id.vendor = pdev->subsystem_vendor; >> + >> + ret = pcim_enable_device(pdev); >> + if (ret) { >> + dev_err(dev, "vp_vdpa: Fail to enable PCI device\n"); >> + return ret; >> + } >> + >> + vp_vdpa = vdpa_alloc_device(struct vp_vdpa, vdpa, >> + dev, &vp_vdpa_ops); >> + if (vp_vdpa == NULL) { >> + dev_err(dev, "vp_vdpa: Failed to allocate vDPA structure\n"); >> + return -ENOMEM; >> + } >> + >> + pci_set_master(pdev); >> + pci_set_drvdata(pdev,...
2020 Jun 10
2
[PATCH V3] vdpa: introduce virtio pci driver
...0x1040; >> + } >> + virtio_id.vendor = pdev->subsystem_vendor; >> + >> + ret = pcim_enable_device(pdev); >> + if (ret) { >> + dev_err(dev, "vp_vdpa: Fail to enable PCI device\n"); >> + return ret; >> + } >> + >> + vp_vdpa = vdpa_alloc_device(struct vp_vdpa, vdpa, >> + dev, &vp_vdpa_ops); >> + if (vp_vdpa == NULL) { >> + dev_err(dev, "vp_vdpa: Failed to allocate vDPA structure\n"); >> + return -ENOMEM; >> + } >> + >> + pci_set_master(pdev); >> + pci_set_drvdata(pdev,...
2020 Jun 10
2
[PATCH V3] vdpa: introduce virtio pci driver
...PCI device id, + * but start from 0x1040. + */ + virtio_id.device = pdev->device - 0x1040; + } + virtio_id.vendor = pdev->subsystem_vendor; + + ret = pcim_enable_device(pdev); + if (ret) { + dev_err(dev, "vp_vdpa: Fail to enable PCI device\n"); + return ret; + } + + vp_vdpa = vdpa_alloc_device(struct vp_vdpa, vdpa, + dev, &vp_vdpa_ops); + if (vp_vdpa == NULL) { + dev_err(dev, "vp_vdpa: Failed to allocate vDPA structure\n"); + return -ENOMEM; + } + + pci_set_master(pdev); + pci_set_drvdata(pdev, vp_vdpa); + + vp_vdpa->pdev = pdev; + vp_vdpa->vdpa.dma_dev = &am...
2020 Jun 10
2
[PATCH V3] vdpa: introduce virtio pci driver
...PCI device id, + * but start from 0x1040. + */ + virtio_id.device = pdev->device - 0x1040; + } + virtio_id.vendor = pdev->subsystem_vendor; + + ret = pcim_enable_device(pdev); + if (ret) { + dev_err(dev, "vp_vdpa: Fail to enable PCI device\n"); + return ret; + } + + vp_vdpa = vdpa_alloc_device(struct vp_vdpa, vdpa, + dev, &vp_vdpa_ops); + if (vp_vdpa == NULL) { + dev_err(dev, "vp_vdpa: Failed to allocate vDPA structure\n"); + return -ENOMEM; + } + + pci_set_master(pdev); + pci_set_drvdata(pdev, vp_vdpa); + + vp_vdpa->pdev = pdev; + vp_vdpa->vdpa.dma_dev = &am...