search for: virtio_mdev_set_vq_callback

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

2019 Sep 10
2
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...h one do. > > > Ok. > > > > > > > + > > > +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? > &gt...
2019 Sep 10
2
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...h one do. > > > Ok. > > > > > > > + > > > +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? > &gt...
2019 Sep 11
1
[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?...
2019 Sep 10
2
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...x, > + virtio_mdev_notify, callback, name); > + if (!vq) { > + err = -ENOMEM; > + goto error_new_virtqueue; > + } > + > + /* Setup virtqueue callback */ > + cb.callback = virtio_mdev_virtqueue_cb; > + cb.private = info; > + err = parent->ops->ioctl(mdev, VIRTIO_MDEV_SET_VQ_CALLBACK, > + (unsigned long)&cb); > + if (err) { > + err = -EINVAL; > + goto error_callback; > + } > + > + virtio_mdev_writel(vm_dev->mdev, VIRTIO_MDEV_QUEUE_NUM, > + virtqueue_get_vring_size(vq)); > + addr = virtqueue_get_desc_addr(vq); > + virtio_mdev_write...
2019 Sep 10
2
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...x, > + virtio_mdev_notify, callback, name); > + if (!vq) { > + err = -ENOMEM; > + goto error_new_virtqueue; > + } > + > + /* Setup virtqueue callback */ > + cb.callback = virtio_mdev_virtqueue_cb; > + cb.private = info; > + err = parent->ops->ioctl(mdev, VIRTIO_MDEV_SET_VQ_CALLBACK, > + (unsigned long)&cb); > + if (err) { > + err = -EINVAL; > + goto error_callback; > + } > + > + virtio_mdev_writel(vm_dev->mdev, VIRTIO_MDEV_QUEUE_NUM, > + virtqueue_get_vring_size(vq)); > + addr = virtqueue_get_desc_addr(vq); > + virtio_mdev_write...
2019 Sep 10
0
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...redundant to state these > are ioctls. Much better to document what does each one do. Ok. > >> + >> +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...
2019 Sep 11
2
[RFC PATCH 3/4] virtio: introudce a mdev based transport
....h> > +#include <linux/vringh.h> > +#include <uapi/linux/virtio_net.h> > + > +/* > + * 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 &...
2019 Sep 11
2
[RFC PATCH 3/4] virtio: introudce a mdev based transport
....h> > +#include <linux/vringh.h> > +#include <uapi/linux/virtio_net.h> > + > +/* > + * 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 &...
2019 Sep 11
0
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...t;> >> Ok. >> >> >>>> + >>>> +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?...
2019 Sep 10
0
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...e(index, num, align, vdev, + true, true, ctx, + virtio_mdev_notify, callback, name); + if (!vq) { + err = -ENOMEM; + goto error_new_virtqueue; + } + + /* Setup virtqueue callback */ + cb.callback = virtio_mdev_virtqueue_cb; + cb.private = info; + err = parent->ops->ioctl(mdev, VIRTIO_MDEV_SET_VQ_CALLBACK, + (unsigned long)&cb); + if (err) { + err = -EINVAL; + goto error_callback; + } + + virtio_mdev_writel(vm_dev->mdev, VIRTIO_MDEV_QUEUE_NUM, + virtqueue_get_vring_size(vq)); + addr = virtqueue_get_desc_addr(vq); + virtio_mdev_writel(vm_dev->mdev, VIRTIO_MDEV_QUEUE_DESC_LOW, (u3...
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
...; +#include <uapi/linux/virtio_net.h> >> + >> +/* >> + * 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" >> + >> +/*...
2019 Sep 10
1
[RFC PATCH 4/4] docs: Sample driver to demonstrate how to implement virtio-mdev framework
...> + struct mvnet_state *mvnet; > + struct virtio_mdev_callback *cb; > + > + if (!mdev) > + return -EINVAL; > + > + mvnet = mdev_get_drvdata(mdev); > + if (!mvnet) > + 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; success, but nothing happens. > + d...
2019 Sep 10
0
[RFC PATCH 4/4] docs: Sample driver to demonstrate how to implement virtio-mdev framework
...vice *mdev, unsigned int cmd, + unsigned long arg) +{ + int ret = 0; + struct mvnet_state *mvnet; + struct virtio_mdev_callback *cb; + + if (!mdev) + return -EINVAL; + + mvnet = mdev_get_drvdata(mdev); + if (!mvnet) + 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)...