search for: vdpasim_release_dev

Displaying 4 results from an estimated 4 matches for "vdpasim_release_dev".

2020 Feb 11
1
[PATCH V2 5/5] vdpasim: vDPA device simulator
...gt; + config->mtu = 1500; > + config->status = VIRTIO_NET_S_LINK_UP; > + eth_random_addr(config->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...
2020 Feb 10
0
[PATCH V2 5/5] vdpasim: vDPA device simulator
...addr, + (u64)dma_addr + size - 1); + kfree(phys_to_virt((uintptr_t)dma_addr)); +} + +static const struct dma_map_ops vdpasim_dma_ops = { + .map_page = vdpasim_map_page, + .unmap_page = vdpasim_unmap_page, + .alloc = vdpasim_alloc_coherent, + .free = vdpasim_free_coherent, +}; + +static void vdpasim_release_dev(struct device *_d) +{ + struct vdpa_device *vdpa = dev_to_vdpa(_d); + struct vdpasim *vdpasim = vdpa_to_sim(vdpa); + + kfree(vdpasim->buffer); + kfree(vdpasim); +} + +static const struct vdpa_config_ops vdpasim_net_config_ops; + +static struct vdpasim *vdpasim_create(void) +{ + struct vdpasim *v...
2020 Feb 10
1
[PATCH V2 5/5] vdpasim: vDPA device simulator
...(phys_to_virt((uintptr_t)dma_addr)); > +} > + > +static const struct dma_map_ops vdpasim_dma_ops = { > + .map_page = vdpasim_map_page, > + .unmap_page = vdpasim_unmap_page, > + .alloc = vdpasim_alloc_coherent, > + .free = vdpasim_free_coherent, > +}; > + > +static void vdpasim_release_dev(struct device *_d) > +{ > + struct vdpa_device *vdpa = dev_to_vdpa(_d); > + struct vdpasim *vdpasim = vdpa_to_sim(vdpa); > + > + kfree(vdpasim->buffer); > + kfree(vdpasim); > +} > + > +static const struct vdpa_config_ops vdpasim_net_config_ops; > + > +static stru...
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