search for: vqs

Displaying 20 results from an estimated 2237 matches for "vqs".

Did you mean: vq
2013 Apr 27
2
[PATCH v6 0/2] tcm_vhost flush
Changes in v6: - Allow device specific fields per vq - Track cmd per vq - Do not track evt - Switch to static array for inflight allocation, completely get rid of the pain to handle inflight allocation failure. Asias He (2): vhost: Allow device specific fields per vq tcm_vhost: Wait for pending requests in vhost_scsi_flush() drivers/vhost/net.c | 60 +++++++++++--------
2013 Apr 27
2
[PATCH v6 0/2] tcm_vhost flush
Changes in v6: - Allow device specific fields per vq - Track cmd per vq - Do not track evt - Switch to static array for inflight allocation, completely get rid of the pain to handle inflight allocation failure. Asias He (2): vhost: Allow device specific fields per vq tcm_vhost: Wait for pending requests in vhost_scsi_flush() drivers/vhost/net.c | 60 +++++++++++--------
2013 May 07
1
[PATCH] vhost-test: Make vhost/test.c work
...ansferred before requeueing the job. * Using this limit prevents one virtqueue from starving others. */ @@ -29,16 +29,20 @@ enum { VHOST_TEST_VQ_MAX = 1, }; +struct vhost_test_virtqueue { + struct vhost_virtqueue vq; +}; + struct vhost_test { struct vhost_dev dev; - struct vhost_virtqueue vqs[VHOST_TEST_VQ_MAX]; + struct vhost_test_virtqueue vqs[VHOST_TEST_VQ_MAX]; }; /* Expects to be always run from workqueue - which acts as * read-size critical section for our kind of RCU. */ static void handle_vq(struct vhost_test *n) { - struct vhost_virtqueue *vq = &n->dev.vqs[VHOST_...
2013 May 07
1
[PATCH] vhost-test: Make vhost/test.c work
...ansferred before requeueing the job. * Using this limit prevents one virtqueue from starving others. */ @@ -29,16 +29,20 @@ enum { VHOST_TEST_VQ_MAX = 1, }; +struct vhost_test_virtqueue { + struct vhost_virtqueue vq; +}; + struct vhost_test { struct vhost_dev dev; - struct vhost_virtqueue vqs[VHOST_TEST_VQ_MAX]; + struct vhost_test_virtqueue vqs[VHOST_TEST_VQ_MAX]; }; /* Expects to be always run from workqueue - which acts as * read-size critical section for our kind of RCU. */ static void handle_vq(struct vhost_test *n) { - struct vhost_virtqueue *vq = &n->dev.vqs[VHOST_...
2010 Sep 14
1
[PATCH] vhost: max s/g to match qemu
...OV)) { r = -ENOBUFS; goto err; } diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index c579dcc..a45270e 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -212,6 +212,45 @@ static int vhost_worker(void *data) } } +/* Helper to allocate iovec buffers for all vqs. */ +static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) +{ + int i; + for (i = 0; i < dev->nvqs; ++i) { + dev->vqs[i].indirect = kmalloc(sizeof *dev->vqs[i].indirect * + UIO_MAXIOV, GFP_KERNEL); + dev->vqs[i].log = kmalloc(sizeof *dev->vqs[i].log * UIO_MAXIOV,...
2010 Sep 14
1
[PATCH] vhost: max s/g to match qemu
...OV)) { r = -ENOBUFS; goto err; } diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index c579dcc..a45270e 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -212,6 +212,45 @@ static int vhost_worker(void *data) } } +/* Helper to allocate iovec buffers for all vqs. */ +static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) +{ + int i; + for (i = 0; i < dev->nvqs; ++i) { + dev->vqs[i].indirect = kmalloc(sizeof *dev->vqs[i].indirect * + UIO_MAXIOV, GFP_KERNEL); + dev->vqs[i].log = kmalloc(sizeof *dev->vqs[i].log * UIO_MAXIOV,...
2013 May 08
1
[PATCH v2] vhost-test: Make vhost/test.c work
.../drivers/vhost/test.c index 1ee45bc..7b49d10 100644 --- a/drivers/vhost/test.c +++ b/drivers/vhost/test.c @@ -29,16 +29,20 @@ enum { VHOST_TEST_VQ_MAX = 1, }; +struct vhost_test_virtqueue { + struct vhost_virtqueue vq; +}; + struct vhost_test { struct vhost_dev dev; - struct vhost_virtqueue vqs[VHOST_TEST_VQ_MAX]; + struct vhost_test_virtqueue vqs[VHOST_TEST_VQ_MAX]; }; /* Expects to be always run from workqueue - which acts as * read-size critical section for our kind of RCU. */ static void handle_vq(struct vhost_test *n) { - struct vhost_virtqueue *vq = &n->dev.vqs[VHOST_...
2013 May 08
1
[PATCH v2] vhost-test: Make vhost/test.c work
.../drivers/vhost/test.c index 1ee45bc..7b49d10 100644 --- a/drivers/vhost/test.c +++ b/drivers/vhost/test.c @@ -29,16 +29,20 @@ enum { VHOST_TEST_VQ_MAX = 1, }; +struct vhost_test_virtqueue { + struct vhost_virtqueue vq; +}; + struct vhost_test { struct vhost_dev dev; - struct vhost_virtqueue vqs[VHOST_TEST_VQ_MAX]; + struct vhost_test_virtqueue vqs[VHOST_TEST_VQ_MAX]; }; /* Expects to be always run from workqueue - which acts as * read-size critical section for our kind of RCU. */ static void handle_vq(struct vhost_test *n) { - struct vhost_virtqueue *vq = &n->dev.vqs[VHOST_...
2013 Apr 27
0
[PATCH] vhost: Move vhost-net zerocopy support fields to net.c
...(struct vhost_ubuf_ref *ubufs) +{ + kref_put(&ubufs->kref, vhost_zerocopy_done_signal); + wait_event(ubufs->wait, !atomic_read(&ubufs->kref.refcount)); + kfree(ubufs); +} + +int vhost_net_set_ubuf_info(struct vhost_net *n) +{ + bool zcopy; + int i; + + for (i = 0; i < n->dev.nvqs; ++i) { + zcopy = vhost_zcopy_mask & (0x1 << i); + if (!zcopy) + continue; + n->vqs[i].ubuf_info = kmalloc(sizeof(*n->vqs[i].ubuf_info) * + UIO_MAXIOV, GFP_KERNEL); + if (!n->vqs[i].ubuf_info) + goto err; + } + return 0; + +err: + while (i--) { + zcopy = vhost...
2013 Apr 27
0
[PATCH] vhost: Move vhost-net zerocopy support fields to net.c
...(struct vhost_ubuf_ref *ubufs) +{ + kref_put(&ubufs->kref, vhost_zerocopy_done_signal); + wait_event(ubufs->wait, !atomic_read(&ubufs->kref.refcount)); + kfree(ubufs); +} + +int vhost_net_set_ubuf_info(struct vhost_net *n) +{ + bool zcopy; + int i; + + for (i = 0; i < n->dev.nvqs; ++i) { + zcopy = vhost_zcopy_mask & (0x1 << i); + if (!zcopy) + continue; + n->vqs[i].ubuf_info = kmalloc(sizeof(*n->vqs[i].ubuf_info) * + UIO_MAXIOV, GFP_KERNEL); + if (!n->vqs[i].ubuf_info) + goto err; + } + return 0; + +err: + while (i--) { + zcopy = vhost...
2014 Jun 26
1
[PATCH v2 2/2] block: virtio-blk: support multi virt queues per virtio-blk device
...ev; > - struct virtqueue *vq; > - spinlock_t vq_lock; > > /* The disk structure for the kernel. */ > struct gendisk *disk; > @@ -47,6 +50,10 @@ struct virtio_blk > > /* Ida index - used to track minor number allocations. */ > int index; > + > + /* num of vqs */ > + int num_vqs; > + struct virtio_blk_vq *vqs; > }; > > struct virtblk_req > @@ -133,14 +140,15 @@ static void virtblk_done(struct virtqueue *vq) > { > struct virtio_blk *vblk = vq->vdev->priv; > bool req_done = false; > + int qid = vq->index; &gt...
2014 Jun 26
1
[PATCH v2 2/2] block: virtio-blk: support multi virt queues per virtio-blk device
...ev; > - struct virtqueue *vq; > - spinlock_t vq_lock; > > /* The disk structure for the kernel. */ > struct gendisk *disk; > @@ -47,6 +50,10 @@ struct virtio_blk > > /* Ida index - used to track minor number allocations. */ > int index; > + > + /* num of vqs */ > + int num_vqs; > + struct virtio_blk_vq *vqs; > }; > > struct virtblk_req > @@ -133,14 +140,15 @@ static void virtblk_done(struct virtqueue *vq) > { > struct virtio_blk *vblk = vq->vdev->priv; > bool req_done = false; > + int qid = vq->index; &gt...
2018 Dec 28
0
[PATCH v1 2/2] virtio: don't allocate vqs when names[i] = NULL
Some vqs may not need to be allocated when their related feature bits are disabled. So callers may pass in such vqs with "names = NULL". Then we skip such vq allocations. Signed-off-by: Wei Wang <wei.w.wang at intel.com> --- drivers/misc/mic/vop/vop_main.c | 9 +++++++-- drivers/re...
2016 Jul 18
2
[PATCH v2] virtio_blk: Fix a slient kernel panic
...irtio_blk.c b/drivers/block/virtio_blk.c index 42758b5..d920512 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -381,9 +381,9 @@ static int init_vq(struct virtio_blk *vblk) { int err = 0; int i; - vq_callback_t **callbacks; - const char **names; - struct virtqueue **vqs; + vq_callback_t **callbacks = NULL; + const char **names = NULL; + struct virtqueue **vqs = NULL; unsigned short num_vqs; struct virtio_device *vdev = vblk->vdev; @@ -394,22 +394,16 @@ static int init_vq(struct virtio_blk *vblk) num_vqs = 1; vblk->vqs = kmalloc(sizeof(*vblk->...
2016 Jul 18
2
[PATCH v2] virtio_blk: Fix a slient kernel panic
...irtio_blk.c b/drivers/block/virtio_blk.c index 42758b5..d920512 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -381,9 +381,9 @@ static int init_vq(struct virtio_blk *vblk) { int err = 0; int i; - vq_callback_t **callbacks; - const char **names; - struct virtqueue **vqs; + vq_callback_t **callbacks = NULL; + const char **names = NULL; + struct virtqueue **vqs = NULL; unsigned short num_vqs; struct virtio_device *vdev = vblk->vdev; @@ -394,22 +394,16 @@ static int init_vq(struct virtio_blk *vblk) num_vqs = 1; vblk->vqs = kmalloc(sizeof(*vblk->...
2014 Jun 26
0
[PATCH v3 2/2] block: virtio-blk: support multi virt queues per virtio-blk device
...smp; + struct virtio_blk { struct virtio_device *vdev; - struct virtqueue *vq; - spinlock_t vq_lock; /* The disk structure for the kernel. */ struct gendisk *disk; @@ -47,6 +52,10 @@ struct virtio_blk /* Ida index - used to track minor number allocations. */ int index; + + /* num of vqs */ + int num_vqs; + struct virtio_blk_vq *vqs; }; struct virtblk_req @@ -133,14 +142,15 @@ static void virtblk_done(struct virtqueue *vq) { struct virtio_blk *vblk = vq->vdev->priv; bool req_done = false; + int qid = vq->index; struct virtblk_req *vbr; unsigned long flags; u...
2016 Jul 18
2
[PATCH v2] virtio_blk: Fix a slient kernel panic
...vers/block/virtio_blk.c > > +++ b/drivers/block/virtio_blk.c > > @@ -381,9 +381,9 @@ static int init_vq(struct virtio_blk *vblk) > > { > > int err = 0; > > int i; > > - vq_callback_t **callbacks; > > - const char **names; > > - struct virtqueue **vqs; > > + vq_callback_t **callbacks = NULL; > > + const char **names = NULL; > > + struct virtqueue **vqs = NULL; > > If you init the variables to NULL anyway... Hi, Cornelia. Thanks for reviewing this patch. Seems there is no need to init these variables to NULL. I will re...
2016 Jul 18
2
[PATCH v2] virtio_blk: Fix a slient kernel panic
...vers/block/virtio_blk.c > > +++ b/drivers/block/virtio_blk.c > > @@ -381,9 +381,9 @@ static int init_vq(struct virtio_blk *vblk) > > { > > int err = 0; > > int i; > > - vq_callback_t **callbacks; > > - const char **names; > > - struct virtqueue **vqs; > > + vq_callback_t **callbacks = NULL; > > + const char **names = NULL; > > + struct virtqueue **vqs = NULL; > > If you init the variables to NULL anyway... Hi, Cornelia. Thanks for reviewing this patch. Seems there is no need to init these variables to NULL. I will re...
2016 Nov 06
8
virtio_pci irq handling cleanups
Hi Michael, this series contains a couple cleanups for the virtio_pci interrupt handling code, including a switch to the new pci_irq_alloc_vectors helper. All these are in preparation of taking advantage of the new PCI layer / core IRQ interrupt affinity handling, for which I will send out a series once this and some core interrupt handling changes are in.
2016 Nov 06
8
virtio_pci irq handling cleanups
Hi Michael, this series contains a couple cleanups for the virtio_pci interrupt handling code, including a switch to the new pci_irq_alloc_vectors helper. All these are in preparation of taking advantage of the new PCI layer / core IRQ interrupt affinity handling, for which I will send out a series once this and some core interrupt handling changes are in.