search for: virtio_mdev_set_config_callback

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

2019 Sep 10
2
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...t; + irqreturn_t (*callback)(void *); > > > + void *private; > > > +}; > > > + > > > +#define VIRTIO_MDEV 0xAF > > > +#define VIRTIO_MDEV_SET_VQ_CALLBACK _IOW(VIRTIO_MDEV, 0x00, \ > > > + struct virtio_mdev_callback) > > > +#define VIRTIO_MDEV_SET_CONFIG_CALLBACK _IOW(VIRTIO_MDEV, 0x01, \ > > > + struct virtio_mdev_callback) > > Function pointer in an ioctl parameter? How does this ever make sense? > > > I admit this is hacky (casting). > > > > And can't we use a couple of registers for this, and avoid ioctls?...
2019 Sep 10
2
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...t; + irqreturn_t (*callback)(void *); > > > + void *private; > > > +}; > > > + > > > +#define VIRTIO_MDEV 0xAF > > > +#define VIRTIO_MDEV_SET_VQ_CALLBACK _IOW(VIRTIO_MDEV, 0x00, \ > > > + struct virtio_mdev_callback) > > > +#define VIRTIO_MDEV_SET_CONFIG_CALLBACK _IOW(VIRTIO_MDEV, 0x01, \ > > > + struct virtio_mdev_callback) > > Function pointer in an ioctl parameter? How does this ever make sense? > > > I admit this is hacky (casting). > > > > And can't we use a couple of registers for this, and avoid ioctls?...
2019 Sep 11
1
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...*private; > > > > > +}; > > > > > + > > > > > +#define VIRTIO_MDEV 0xAF > > > > > +#define VIRTIO_MDEV_SET_VQ_CALLBACK _IOW(VIRTIO_MDEV, 0x00, \ > > > > > + struct virtio_mdev_callback) > > > > > +#define VIRTIO_MDEV_SET_CONFIG_CALLBACK _IOW(VIRTIO_MDEV, 0x01, \ > > > > > + struct virtio_mdev_callback) > > > > Function pointer in an ioctl parameter? How does this ever make sense? > > > > > > I admit this is hacky (casting). > > > > > > > > > > And ca...
2019 Sep 10
2
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...callbacks[i], names[i], ctx ? > + ctx[i] : false); > + if (IS_ERR(vqs[i])) { > + err = PTR_ERR(vqs[i]); > + goto err_setup_vq; > + } > + } > + > + cb.callback = virtio_mdev_config_cb; > + cb.private = vm_dev; > + err = parent->ops->ioctl(mdev, VIRTIO_MDEV_SET_CONFIG_CALLBACK, > + (unsigned long)&cb); > + if (err) > + goto err_setup_vq; > + > + return 0; > + > +err_setup_vq: > + kfree(vm_dev->vqs); > + virtio_mdev_del_vqs(vdev); > + return err; > +} > + > +static u64 virtio_mdev_get_features(struct virtio_device *vdev)...
2019 Sep 10
2
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...callbacks[i], names[i], ctx ? > + ctx[i] : false); > + if (IS_ERR(vqs[i])) { > + err = PTR_ERR(vqs[i]); > + goto err_setup_vq; > + } > + } > + > + cb.callback = virtio_mdev_config_cb; > + cb.private = vm_dev; > + err = parent->ops->ioctl(mdev, VIRTIO_MDEV_SET_CONFIG_CALLBACK, > + (unsigned long)&cb); > + if (err) > + goto err_setup_vq; > + > + return 0; > + > +err_setup_vq: > + kfree(vm_dev->vqs); > + virtio_mdev_del_vqs(vdev); > + return err; > +} > + > +static u64 virtio_mdev_get_features(struct virtio_device *vdev)...
2019 Sep 10
0
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...> +struct virtio_mdev_callback { >> + irqreturn_t (*callback)(void *); >> + void *private; >> +}; >> + >> +#define VIRTIO_MDEV 0xAF >> +#define VIRTIO_MDEV_SET_VQ_CALLBACK _IOW(VIRTIO_MDEV, 0x00, \ >> + struct virtio_mdev_callback) >> +#define VIRTIO_MDEV_SET_CONFIG_CALLBACK _IOW(VIRTIO_MDEV, 0x01, \ >> + struct virtio_mdev_callback) > Function pointer in an ioctl parameter? How does this ever make sense? I admit this is hacky (casting). > And can't we use a couple of registers for this, and avoid ioctls? Yes, how about something like interrup...
2019 Sep 11
2
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...gt; + * Ioctls > + */ > + > +struct virtio_mdev_callback { > + irqreturn_t (*callback)(void *); > + void *private; > +}; > + > +#define VIRTIO_MDEV 0xAF > +#define VIRTIO_MDEV_SET_VQ_CALLBACK _IOW(VIRTIO_MDEV, 0x00, \ > + struct virtio_mdev_callback) > +#define VIRTIO_MDEV_SET_CONFIG_CALLBACK _IOW(VIRTIO_MDEV, 0x01, \ > + struct virtio_mdev_callback) > + > +#define VIRTIO_MDEV_DEVICE_API_STRING "virtio-mdev" > + > +/* > + * Control registers > + */ > + > +/* Magic value ("virt" string) - Read Only */ > +#define VIRTIO_MDEV_MAGIC_VAL...
2019 Sep 11
2
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...gt; + * Ioctls > + */ > + > +struct virtio_mdev_callback { > + irqreturn_t (*callback)(void *); > + void *private; > +}; > + > +#define VIRTIO_MDEV 0xAF > +#define VIRTIO_MDEV_SET_VQ_CALLBACK _IOW(VIRTIO_MDEV, 0x00, \ > + struct virtio_mdev_callback) > +#define VIRTIO_MDEV_SET_CONFIG_CALLBACK _IOW(VIRTIO_MDEV, 0x01, \ > + struct virtio_mdev_callback) > + > +#define VIRTIO_MDEV_DEVICE_API_STRING "virtio-mdev" > + > +/* > + * Control registers > + */ > + > +/* Magic value ("virt" string) - Read Only */ > +#define VIRTIO_MDEV_MAGIC_VAL...
2019 Sep 11
0
[RFC PATCH 3/4] virtio: introudce a mdev based transport
..._t (*callback)(void *); >>>> + void *private; >>>> +}; >>>> + >>>> +#define VIRTIO_MDEV 0xAF >>>> +#define VIRTIO_MDEV_SET_VQ_CALLBACK _IOW(VIRTIO_MDEV, 0x00, \ >>>> + struct virtio_mdev_callback) >>>> +#define VIRTIO_MDEV_SET_CONFIG_CALLBACK _IOW(VIRTIO_MDEV, 0x01, \ >>>> + struct virtio_mdev_callback) >>> Function pointer in an ioctl parameter? How does this ever make sense? >> >> I admit this is hacky (casting). >> >> >>> And can't we use a couple of registers for this, an...
2019 Sep 10
0
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...= virtio_mdev_setup_vq(vdev, queue_idx++, + callbacks[i], names[i], ctx ? + ctx[i] : false); + if (IS_ERR(vqs[i])) { + err = PTR_ERR(vqs[i]); + goto err_setup_vq; + } + } + + cb.callback = virtio_mdev_config_cb; + cb.private = vm_dev; + err = parent->ops->ioctl(mdev, VIRTIO_MDEV_SET_CONFIG_CALLBACK, + (unsigned long)&cb); + if (err) + goto err_setup_vq; + + return 0; + +err_setup_vq: + kfree(vm_dev->vqs); + virtio_mdev_del_vqs(vdev); + return err; +} + +static u64 virtio_mdev_get_features(struct virtio_device *vdev) +{ + struct virtio_mdev_device *vm_dev = to_virtio_mdev_device(vd...
2019 Sep 10
8
[RFC PATCH 0/4] mdev based hardware virtio offloading support
Hi all: There are hardware 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 to
2019 Sep 11
0
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...> +struct virtio_mdev_callback { >> + irqreturn_t (*callback)(void *); >> + void *private; >> +}; >> + >> +#define VIRTIO_MDEV 0xAF >> +#define VIRTIO_MDEV_SET_VQ_CALLBACK _IOW(VIRTIO_MDEV, 0x00, \ >> + struct virtio_mdev_callback) >> +#define VIRTIO_MDEV_SET_CONFIG_CALLBACK _IOW(VIRTIO_MDEV, 0x01, \ >> + struct virtio_mdev_callback) >> + >> +#define VIRTIO_MDEV_DEVICE_API_STRING "virtio-mdev" >> + >> +/* >> + * Control registers >> + */ >> + >> +/* Magic value ("virt" string) - Read Only */...
2019 Sep 10
1
[RFC PATCH 4/4] docs: Sample driver to demonstrate how to implement virtio-mdev framework
...mp;mvnet->lock); > + > + switch (cmd) { > + case VIRTIO_MDEV_SET_VQ_CALLBACK: > + cb = (struct virtio_mdev_callback *)arg; > + mvnet->vqs[mvnet->queue_sel].cb = cb->callback; > + mvnet->vqs[mvnet->queue_sel].private = cb->private; > + break; > + case VIRTIO_MDEV_SET_CONFIG_CALLBACK: > + break; success, but nothing happens. > + default: > + pr_err("Not supportted ioctl cmd 0x%x\n", cmd); > + ret = -ENOTTY; > + break; > + } > + > + spin_unlock(&mvnet->lock); > + > + return ret; > +} > + > +static int mvnet_open(struc...
2019 Sep 10
0
[RFC PATCH 4/4] docs: Sample driver to demonstrate how to implement virtio-mdev framework
...net) + return -ENODEV; + + spin_lock(&mvnet->lock); + + switch (cmd) { + case VIRTIO_MDEV_SET_VQ_CALLBACK: + cb = (struct virtio_mdev_callback *)arg; + mvnet->vqs[mvnet->queue_sel].cb = cb->callback; + mvnet->vqs[mvnet->queue_sel].private = cb->private; + break; + case VIRTIO_MDEV_SET_CONFIG_CALLBACK: + break; + default: + pr_err("Not supportted ioctl cmd 0x%x\n", cmd); + ret = -ENOTTY; + break; + } + + spin_unlock(&mvnet->lock); + + return ret; +} + +static int mvnet_open(struct mdev_device *mdev) +{ + pr_info("%s\n", __func__); + return 0; +} + +static void mvne...