search for: mdev_get_drvdata

Displaying 20 results from an estimated 73 matches for "mdev_get_drvdata".

Did you mean: dev_get_drvdata
2019 Oct 21
0
[RFC 2/2] vhost: IFC VF vdpa layer
...s. Ok, it should work but less flexible, we can change it in the future. > >> >> >>> +} >>> + >>> +static int ifcvf_mdev_set_features(struct mdev_device *mdev, u64 >>> features) >>> +{ >>> +??? struct ifcvf_adapter *adapter = mdev_get_drvdata(mdev); >>> +??? struct ifcvf_hw *vf = IFC_PRIVATE_TO_VF(adapter); >>> + >>> +??? vf->req_features = features; >>> + >>> +??? return 0; >>> +} >>> + >>> +static u64 ifcvf_mdev_get_vq_state(struct mdev_device *mdev, u16 qid) &...
2019 Oct 16
0
[RFC 2/2] vhost: IFC VF vdpa layer
...{ > + return IFC_SUPPORTED_FEATURES; I would expect this should be done by querying the hw. Or IFC VF can't get any update through its firmware? > +} > + > +static int ifcvf_mdev_set_features(struct mdev_device *mdev, u64 features) > +{ > + struct ifcvf_adapter *adapter = mdev_get_drvdata(mdev); > + struct ifcvf_hw *vf = IFC_PRIVATE_TO_VF(adapter); > + > + vf->req_features = features; > + > + return 0; > +} > + > +static u64 ifcvf_mdev_get_vq_state(struct mdev_device *mdev, u16 qid) > +{ > + struct ifcvf_adapter *adapter = mdev_get_drvdata(mdev); &gt...
2019 Jul 03
0
[RFC v2] vhost: introduce mdev based hardware vhost backend
...e); > + > +static ssize_t vdpa_handle_config_read(struct mdev_device *mdev, > + char __user *buf, size_t count, loff_t *ppos) > +{ > + struct vdpa_dev *vdpa; > + struct vhost_vfio_op *op = NULL; > + loff_t pos = *ppos; > + loff_t offset; > + int ret; > + > + vdpa = mdev_get_drvdata(mdev); > + if (!vdpa) { > + ret = -ENODEV; > + goto out; > + } > + > + offset = VDPA_VFIO_VHOST_REGION_OFFSET(pos); > + if (offset != 0) { > + ret = -EINVAL; > + goto out; > + } > + > + if (!vdpa->pending_reply) { > + ret = 0; > + goto out; > +...
2019 Jul 03
4
[RFC v2] vhost: introduce mdev based hardware vhost backend
...gt;ops_lock); + kfree(vdpa); +} +EXPORT_SYMBOL(vdpa_free); + +static ssize_t vdpa_handle_config_read(struct mdev_device *mdev, + char __user *buf, size_t count, loff_t *ppos) +{ + struct vdpa_dev *vdpa; + struct vhost_vfio_op *op = NULL; + loff_t pos = *ppos; + loff_t offset; + int ret; + + vdpa = mdev_get_drvdata(mdev); + if (!vdpa) { + ret = -ENODEV; + goto out; + } + + offset = VDPA_VFIO_VHOST_REGION_OFFSET(pos); + if (offset != 0) { + ret = -EINVAL; + goto out; + } + + if (!vdpa->pending_reply) { + ret = 0; + goto out; + } + + vdpa->pending_reply = false; + + op = kzalloc(VHOST_VFIO_OP_HDR_SI...
2019 Jul 03
4
[RFC v2] vhost: introduce mdev based hardware vhost backend
...gt;ops_lock); + kfree(vdpa); +} +EXPORT_SYMBOL(vdpa_free); + +static ssize_t vdpa_handle_config_read(struct mdev_device *mdev, + char __user *buf, size_t count, loff_t *ppos) +{ + struct vdpa_dev *vdpa; + struct vhost_vfio_op *op = NULL; + loff_t pos = *ppos; + loff_t offset; + int ret; + + vdpa = mdev_get_drvdata(mdev); + if (!vdpa) { + ret = -ENODEV; + goto out; + } + + offset = VDPA_VFIO_VHOST_REGION_OFFSET(pos); + if (offset != 0) { + ret = -EINVAL; + goto out; + } + + if (!vdpa->pending_reply) { + ret = 0; + goto out; + } + + vdpa->pending_reply = false; + + op = kzalloc(VHOST_VFIO_OP_HDR_SI...
2019 Nov 05
0
[PATCH V8 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework
...mdev_list_lock); + + dev->coherent_dma_mask = DMA_BIT_MASK(64); + set_dma_ops(dev, &mvnet_dma_ops); + + mdev_set_virtio_ops(mdev, &mdev_virtio_ops); + + return 0; +} + +static int mvnet_remove(struct mdev_device *mdev) +{ + struct mvnet_state *mds, *tmp_mds; + struct mvnet_state *mvnet = mdev_get_drvdata(mdev); + int ret = -EINVAL; + + mutex_lock(&mdev_list_lock); + list_for_each_entry_safe(mds, tmp_mds, &mdev_devices_list, next) { + if (mvnet == mds) { + list_del(&mvnet->next); + mdev_set_drvdata(mdev, NULL); + kfree(mvnet->buffer); + kfree(mvnet); + ret = 0; + break...
2019 Oct 30
0
[PATCH V6 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework
...mdev_list_lock); + + dev->coherent_dma_mask = DMA_BIT_MASK(64); + set_dma_ops(dev, &mvnet_dma_ops); + + mdev_set_virtio_ops(mdev, &virtio_mdev_ops); + + return 0; +} + +static int mvnet_remove(struct mdev_device *mdev) +{ + struct mvnet_state *mds, *tmp_mds; + struct mvnet_state *mvnet = mdev_get_drvdata(mdev); + int ret = -EINVAL; + + mutex_lock(&mdev_list_lock); + list_for_each_entry_safe(mds, tmp_mds, &mdev_devices_list, next) { + if (mvnet == mds) { + list_del(&mvnet->next); + mdev_set_drvdata(mdev, NULL); + kfree(mvnet->buffer); + kfree(mvnet); + ret = 0; + break...
2019 Nov 07
0
[PATCH V11 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework
...mdev_list_lock); + + dev->coherent_dma_mask = DMA_BIT_MASK(64); + set_dma_ops(dev, &mvnet_dma_ops); + + mdev_set_virtio_ops(mdev, &mdev_virtio_ops); + + return 0; +} + +static int mvnet_remove(struct mdev_device *mdev) +{ + struct mvnet_state *mds, *tmp_mds; + struct mvnet_state *mvnet = mdev_get_drvdata(mdev); + int ret = -EINVAL; + + mutex_lock(&mdev_list_lock); + list_for_each_entry_safe(mds, tmp_mds, &mdev_devices_list, next) { + if (mvnet == mds) { + list_del(&mvnet->next); + mdev_set_drvdata(mdev, NULL); + kfree(mvnet->buffer); + kfree(mvnet); + ret = 0; + break...
2019 Nov 06
0
[PATCH V9 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework
...mdev_list_lock); + + dev->coherent_dma_mask = DMA_BIT_MASK(64); + set_dma_ops(dev, &mvnet_dma_ops); + + mdev_set_virtio_ops(mdev, &mdev_virtio_ops); + + return 0; +} + +static int mvnet_remove(struct mdev_device *mdev) +{ + struct mvnet_state *mds, *tmp_mds; + struct mvnet_state *mvnet = mdev_get_drvdata(mdev); + int ret = -EINVAL; + + mutex_lock(&mdev_list_lock); + list_for_each_entry_safe(mds, tmp_mds, &mdev_devices_list, next) { + if (mvnet == mds) { + list_del(&mvnet->next); + mdev_set_drvdata(mdev, NULL); + kfree(mvnet->buffer); + kfree(mvnet); + ret = 0; + break...
2019 Nov 06
0
[PATCH V10 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework
...mdev_list_lock); + + dev->coherent_dma_mask = DMA_BIT_MASK(64); + set_dma_ops(dev, &mvnet_dma_ops); + + mdev_set_virtio_ops(mdev, &mdev_virtio_ops); + + return 0; +} + +static int mvnet_remove(struct mdev_device *mdev) +{ + struct mvnet_state *mds, *tmp_mds; + struct mvnet_state *mvnet = mdev_get_drvdata(mdev); + int ret = -EINVAL; + + mutex_lock(&mdev_list_lock); + list_for_each_entry_safe(mds, tmp_mds, &mdev_devices_list, next) { + if (mvnet == mds) { + list_del(&mvnet->next); + mdev_set_drvdata(mdev, NULL); + kfree(mvnet->buffer); + kfree(mvnet); + ret = 0; + break...
2018 Apr 10
0
[RFC] vhost: introduce mdev based hardware vhost backend
...> + kfree(vdpa); > +} > +EXPORT_SYMBOL(vdpa_free); > + > +static ssize_t vdpa_handle_pcicfg_read(struct mdev_device *mdev, > + char __user *buf, size_t count, loff_t *ppos) > +{ > + struct vdpa_dev *vdpa; > + loff_t pos = *ppos; > + loff_t offset; > + > + vdpa = mdev_get_drvdata(mdev); > + if (!vdpa) > + return -ENODEV; > + > + offset = VDPA_VFIO_PCI_BAR_OFFSET(pos); > + > + if (count + offset > VDPA_CONFIG_SIZE) > + return -EINVAL; > + > + if (copy_to_user(buf, (vdpa->vconfig + offset), count)) > + return -EFAULT; > + > + retur...
2019 Nov 07
2
[PATCH V10 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework
...T_MASK(64); > + set_dma_ops(dev, &mvnet_dma_ops); > + > + mdev_set_virtio_ops(mdev, &mdev_virtio_ops); > + > + return 0; > +} > + > +static int mvnet_remove(struct mdev_device *mdev) > +{ > + struct mvnet_state *mds, *tmp_mds; > + struct mvnet_state *mvnet = mdev_get_drvdata(mdev); > + int ret = -EINVAL; > + > + mutex_lock(&mdev_list_lock); > + list_for_each_entry_safe(mds, tmp_mds, &mdev_devices_list, next) { > + if (mvnet == mds) { > + list_del(&mvnet->next); > + mdev_set_drvdata(mdev, NULL); > + kfree(mvnet->buffer);...
2019 Nov 07
2
[PATCH V10 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework
...T_MASK(64); > + set_dma_ops(dev, &mvnet_dma_ops); > + > + mdev_set_virtio_ops(mdev, &mdev_virtio_ops); > + > + return 0; > +} > + > +static int mvnet_remove(struct mdev_device *mdev) > +{ > + struct mvnet_state *mds, *tmp_mds; > + struct mvnet_state *mvnet = mdev_get_drvdata(mdev); > + int ret = -EINVAL; > + > + mutex_lock(&mdev_list_lock); > + list_for_each_entry_safe(mds, tmp_mds, &mdev_devices_list, next) { > + if (mvnet == mds) { > + list_del(&mvnet->next); > + mdev_set_drvdata(mdev, NULL); > + kfree(mvnet->buffer);...
2018 Apr 02
2
[RFC] vhost: introduce mdev based hardware vhost backend
...roy(&vdpa->ops_lock); + + kfree(vdpa->mem_table); + kfree(vdpa); +} +EXPORT_SYMBOL(vdpa_free); + +static ssize_t vdpa_handle_pcicfg_read(struct mdev_device *mdev, + char __user *buf, size_t count, loff_t *ppos) +{ + struct vdpa_dev *vdpa; + loff_t pos = *ppos; + loff_t offset; + + vdpa = mdev_get_drvdata(mdev); + if (!vdpa) + return -ENODEV; + + offset = VDPA_VFIO_PCI_BAR_OFFSET(pos); + + if (count + offset > VDPA_CONFIG_SIZE) + return -EINVAL; + + if (copy_to_user(buf, (vdpa->vconfig + offset), count)) + return -EFAULT; + + return count; +} + +static ssize_t vdpa_handle_bar0_read(struct m...
2018 Apr 02
2
[RFC] vhost: introduce mdev based hardware vhost backend
...roy(&vdpa->ops_lock); + + kfree(vdpa->mem_table); + kfree(vdpa); +} +EXPORT_SYMBOL(vdpa_free); + +static ssize_t vdpa_handle_pcicfg_read(struct mdev_device *mdev, + char __user *buf, size_t count, loff_t *ppos) +{ + struct vdpa_dev *vdpa; + loff_t pos = *ppos; + loff_t offset; + + vdpa = mdev_get_drvdata(mdev); + if (!vdpa) + return -ENODEV; + + offset = VDPA_VFIO_PCI_BAR_OFFSET(pos); + + if (count + offset > VDPA_CONFIG_SIZE) + return -EINVAL; + + if (copy_to_user(buf, (vdpa->vconfig + offset), count)) + return -EFAULT; + + return count; +} + +static ssize_t vdpa_handle_bar0_read(struct m...
2019 Nov 06
9
[PATCH V10 0/6] mdev based hardware virtio offloading support
Hi all: There are hardwares that can do virtio datapath offloading while having its own control path. This path tries to implement a mdev based unified API to support using kernel virtio driver to drive those devices. This is done by introducing a new mdev transport for virtio (virtio_mdev) and register itself as a new kind of mdev driver. Then it provides a unified way for kernel virtio driver
2019 Sep 10
1
[RFC PATCH 4/4] docs: Sample driver to demonstrate how to implement virtio-mdev framework
...e_addr); > +} > + > +static ssize_t mvnet_read_config(struct mdev_device *mdev, > + u32 *val, loff_t pos) > +{ > + struct mvnet_state *mvnet; > + struct mvnet_virtqueue *vq; > + u32 queue_sel; > + > + if (!mdev || !val) > + return -EINVAL; > + > + mvnet = mdev_get_drvdata(mdev); > + if (!mvnet) { > + pr_err("%s mvnet not found\n", __func__); > + return -EINVAL; > + } > + > + queue_sel = mvnet->queue_sel; > + vq = &mvnet->vqs[queue_sel]; > + > + switch (pos) { > + case VIRTIO_MDEV_MAGIC_VALUE: > + *val = MVNET_M...
2019 Sep 10
0
[RFC PATCH 4/4] docs: Sample driver to demonstrate how to implement virtio-mdev framework
...)vq->driver_addr, + (struct vring_used *)vq->device_addr); +} + +static ssize_t mvnet_read_config(struct mdev_device *mdev, + u32 *val, loff_t pos) +{ + struct mvnet_state *mvnet; + struct mvnet_virtqueue *vq; + u32 queue_sel; + + if (!mdev || !val) + return -EINVAL; + + mvnet = mdev_get_drvdata(mdev); + if (!mvnet) { + pr_err("%s mvnet not found\n", __func__); + return -EINVAL; + } + + queue_sel = mvnet->queue_sel; + vq = &mvnet->vqs[queue_sel]; + + switch (pos) { + case VIRTIO_MDEV_MAGIC_VALUE: + *val = MVNET_MAGIC_VALUE; + break; + case VIRTIO_MDEV_VERSION: + *v...
2019 Oct 22
0
[RFC 2/2] vhost: IFC VF vdpa layer
...> >>> >>>> >>>> >>>>> +} >>>>> + >>>>> +static int ifcvf_mdev_set_features(struct mdev_device *mdev, u64 >>>>> features) >>>>> +{ >>>>> +??? struct ifcvf_adapter *adapter = mdev_get_drvdata(mdev); >>>>> +??? struct ifcvf_hw *vf = IFC_PRIVATE_TO_VF(adapter); >>>>> + >>>>> +??? vf->req_features = features; >>>>> + >>>>> +??? return 0; >>>>> +} >>>>> + >>>>> +static...
2019 Oct 23
0
[RFC 2/2] vhost: IFC VF vdpa layer
...gt; >>>>>>> +} >>>>>>> + >>>>>>> +static int ifcvf_mdev_set_features(struct mdev_device *mdev, >>>>>>> u64 features) >>>>>>> +{ >>>>>>> +??? struct ifcvf_adapter *adapter = mdev_get_drvdata(mdev); >>>>>>> +??? struct ifcvf_hw *vf = IFC_PRIVATE_TO_VF(adapter); >>>>>>> + >>>>>>> +??? vf->req_features = features; >>>>>>> + >>>>>>> +??? return 0; >>>>>>> +} >...