search for: dev_to_vdpa

Displaying 14 results from an estimated 14 matches for "dev_to_vdpa".

2020 Feb 10
0
[PATCH V2 5/5] vdpasim: vDPA device simulator
...L: + perm = VHOST_MAP_RW; + break; + default: + break; + } + + return perm; +} + +static dma_addr_t vdpasim_map_page(struct device *dev, struct page *page, + unsigned long offset, size_t size, + enum dma_data_direction dir, + unsigned long attrs) +{ + struct vdpa_device *vdpa = dev_to_vdpa(dev); + struct vdpasim *vdpasim = vdpa_to_sim(vdpa); + struct vhost_iotlb *iommu = vdpasim->iommu; + u64 pa = (page_to_pfn(page) << PAGE_SHIFT) + offset; + int ret, perm = dir_to_perm(dir); + + if (perm < 0) + return DMA_MAPPING_ERROR; + + /* For simplicity, use identical mapping to av...
2020 Feb 10
1
[PATCH V2 5/5] vdpasim: vDPA device simulator
...k; > + } > + > + return perm; > +} > + > +static dma_addr_t vdpasim_map_page(struct device *dev, struct page *page, > + unsigned long offset, size_t size, > + enum dma_data_direction dir, > + unsigned long attrs) > +{ > + struct vdpa_device *vdpa = dev_to_vdpa(dev); > + struct vdpasim *vdpasim = vdpa_to_sim(vdpa); > + struct vhost_iotlb *iommu = vdpasim->iommu; > + u64 pa = (page_to_pfn(page) << PAGE_SHIFT) + offset; > + int ret, perm = dir_to_perm(dir); > + > + if (perm < 0) > + return DMA_MAPPING_ERROR; > + > + /...
2020 Feb 20
0
[PATCH V3 3/5] vDPA: introduce vDPA bus
...hor: Jason Wang <jasowang 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_...
2020 Feb 10
0
[PATCH V2 3/5] vDPA: introduce vDPA bus
...ll rights reserved. + * 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_...
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 18
2
[PATCH] vhost: introduce vDPA based backend
...vdpa_alloc_minor(struct vhost_vdpa *v) > +{ > + return idr_alloc(&vhost_vdpa.idr, v, 0, MINORMASK + 1, > + GFP_KERNEL); > +} Please don't use idr in new code, use xarray directly > +static int vhost_vdpa_probe(struct device *dev) > +{ > + struct vdpa_device *vdpa = dev_to_vdpa(dev); > + const struct vdpa_config_ops *ops = vdpa->config; > + struct vhost_vdpa *v; > + struct device *d; > + int minor, nvqs; > + int r; > + > + /* Currently, we only accept the network devices. */ > + if (ops->get_device_id(vdpa) != VIRTIO_ID_NET) { > + r = -EN...
2020 Feb 18
2
[PATCH] vhost: introduce vDPA based backend
...vdpa_alloc_minor(struct vhost_vdpa *v) > +{ > + return idr_alloc(&vhost_vdpa.idr, v, 0, MINORMASK + 1, > + GFP_KERNEL); > +} Please don't use idr in new code, use xarray directly > +static int vhost_vdpa_probe(struct device *dev) > +{ > + struct vdpa_device *vdpa = dev_to_vdpa(dev); > + const struct vdpa_config_ops *ops = vdpa->config; > + struct vhost_vdpa *v; > + struct device *d; > + int minor, nvqs; > + int r; > + > + /* Currently, we only accept the network devices. */ > + if (ops->get_device_id(vdpa) != VIRTIO_ID_NET) { > + r = -EN...
2020 Feb 04
0
[PATCH 5/5] vdpasim: vDPA device simulator
...size, > 55047769b3e974 Jason Wang 2020-01-16 264 dma_addr_t *dma_addr, gfp_t flag, > 55047769b3e974 Jason Wang 2020-01-16 265 unsigned long attrs) > 55047769b3e974 Jason Wang 2020-01-16 266 { > 55047769b3e974 Jason Wang 2020-01-16 267 struct vdpa_device *vdpa = dev_to_vdpa(dev); > 55047769b3e974 Jason Wang 2020-01-16 268 struct vdpasim *vdpasim = vdpa_to_sim(vdpa); > 55047769b3e974 Jason Wang 2020-01-16 269 struct vhost_iotlb *iommu = vdpasim->iommu; > 55047769b3e974 Jason Wang 2020-01-16 270 void *addr = kmalloc(size, flag); > 55047769b3e974...
2020 Feb 19
0
[PATCH] vhost: introduce vDPA based backend
...{ > > + return idr_alloc(&vhost_vdpa.idr, v, 0, MINORMASK + 1, > > + GFP_KERNEL); > > +} > > Please don't use idr in new code, use xarray directly > > > +static int vhost_vdpa_probe(struct device *dev) > > +{ > > + struct vdpa_device *vdpa = dev_to_vdpa(dev); > > + const struct vdpa_config_ops *ops = vdpa->config; > > + struct vhost_vdpa *v; > > + struct device *d; > > + int minor, nvqs; > > + int r; > > + > > + /* Currently, we only accept the network devices. */ > > + if (ops->get_device_id(v...
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 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 Feb 20
0
[PATCH V3 5/5] vdpasim: vDPA device simulator
...= vdpasim_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(vdpas...
2020 Feb 04
10
[PATCH] vhost: introduce vDPA based backend
....owner = THIS_MODULE, > + .open = vhost_vdpa_open, > + .release = vhost_vdpa_release, > + .unlocked_ioctl = vhost_vdpa_unlocked_ioctl, > + .compat_ioctl = compat_ptr_ioctl, > +}; > + > +static int vhost_vdpa_probe(struct device *dev) > +{ > + struct vdpa_device *vdpa = dev_to_vdpa(dev); > + const struct vdpa_config_ops *ops = vdpa->config; > + struct vhost_vdpa *v; > + struct device *d; > + int minor, nvqs; > + int r; > + > + /* Currently, we only accept the network devices. */ > + if (ops->get_device_id(vdpa) != VIRTIO_ID_NET) { > + r = -EN...
2020 Feb 04
10
[PATCH] vhost: introduce vDPA based backend
....owner = THIS_MODULE, > + .open = vhost_vdpa_open, > + .release = vhost_vdpa_release, > + .unlocked_ioctl = vhost_vdpa_unlocked_ioctl, > + .compat_ioctl = compat_ptr_ioctl, > +}; > + > +static int vhost_vdpa_probe(struct device *dev) > +{ > + struct vdpa_device *vdpa = dev_to_vdpa(dev); > + const struct vdpa_config_ops *ops = vdpa->config; > + struct vhost_vdpa *v; > + struct device *d; > + int minor, nvqs; > + int r; > + > + /* Currently, we only accept the network devices. */ > + if (ops->get_device_id(vdpa) != VIRTIO_ID_NET) { > + r = -EN...