Displaying 17 results from an estimated 17 matches for "vring_create_virtqueue_split".
2019 Oct 29
2
[RFC PATCH 0/2] virtio: allow per vq DMA domain
We used to have use a single parent for all DMA operations. This tends
to complicate the mdev based hardware virtio datapath offloading which
may not implement the control path over datapath like ctrl vq in the
case of virtio-net.
So this series tries to intorduce per DMA domain by allowing trasnport
to specify the parent device for each virtqueue. Then for the case of
virtio-mdev device, it can
2020 Apr 06
0
[PATCH v4 08/12] virtio_ring: switch to virtio_legacy_init/size
...| 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 58b96baa8d48..2a2b12449bac 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -867,8 +867,10 @@ static struct virtqueue *vring_create_virtqueue_split(
}
/* TODO: allocate each queue chunk individually */
- for (; num && vring_size(num, vring_align) > PAGE_SIZE; num /= 2) {
- queue = vring_alloc_queue(vdev, vring_size(num, vring_align),
+ for (; num && vring_legacy_size(num, vring_align) > PAGE_SIZE;
+ num /= 2)...
2020 Apr 06
0
[PATCH v5 08/12] virtio_ring: switch to virtio_legacy_init/size
...| 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 58b96baa8d48..2a2b12449bac 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -867,8 +867,10 @@ static struct virtqueue *vring_create_virtqueue_split(
}
/* TODO: allocate each queue chunk individually */
- for (; num && vring_size(num, vring_align) > PAGE_SIZE; num /= 2) {
- queue = vring_alloc_queue(vdev, vring_size(num, vring_align),
+ for (; num && vring_legacy_size(num, vring_align) > PAGE_SIZE;
+ num /= 2)...
2020 Apr 06
0
[PATCH v6 08/12] virtio_ring: switch to virtio_legacy_init/size
...| 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 58b96baa8d48..2a2b12449bac 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -867,8 +867,10 @@ static struct virtqueue *vring_create_virtqueue_split(
}
/* TODO: allocate each queue chunk individually */
- for (; num && vring_size(num, vring_align) > PAGE_SIZE; num /= 2) {
- queue = vring_alloc_queue(vdev, vring_size(num, vring_align),
+ for (; num && vring_legacy_size(num, vring_align) > PAGE_SIZE;
+ num /= 2)...
2020 Apr 07
0
[PATCH v7 12/19] virtio_ring: switch to virtio_legacy_init/size
...| 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 58b96baa8d48..2a2b12449bac 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -867,8 +867,10 @@ static struct virtqueue *vring_create_virtqueue_split(
}
/* TODO: allocate each queue chunk individually */
- for (; num && vring_size(num, vring_align) > PAGE_SIZE; num /= 2) {
- queue = vring_alloc_queue(vdev, vring_size(num, vring_align),
+ for (; num && vring_legacy_size(num, vring_align) > PAGE_SIZE;
+ num /= 2)...
2020 Apr 07
0
[PATCH v8 12/19] virtio_ring: switch to virtio_legacy_init/size
...| 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 58b96baa8d48..2a2b12449bac 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -867,8 +867,10 @@ static struct virtqueue *vring_create_virtqueue_split(
}
/* TODO: allocate each queue chunk individually */
- for (; num && vring_size(num, vring_align) > PAGE_SIZE; num /= 2) {
- queue = vring_alloc_queue(vdev, vring_size(num, vring_align),
+ for (; num && vring_legacy_size(num, vring_align) > PAGE_SIZE;
+ num /= 2)...
2020 Apr 06
0
[PATCH v4 08/12] virtio_ring: switch to virtio_legacy_init/size
...| 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 58b96baa8d48..2a2b12449bac 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -867,8 +867,10 @@ static struct virtqueue *vring_create_virtqueue_split(
}
/* TODO: allocate each queue chunk individually */
- for (; num && vring_size(num, vring_align) > PAGE_SIZE; num /= 2) {
- queue = vring_alloc_queue(vdev, vring_size(num, vring_align),
+ for (; num && vring_legacy_size(num, vring_align) > PAGE_SIZE;
+ num /= 2)...
2019 Apr 08
2
[PATCH] virtio: Honour 'may_reduce_num' in vring_create_virtqueue
...virtio_ring.h | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 18846afb39da..5df92c308286 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -882,6 +882,8 @@ static struct virtqueue *vring_create_virtqueue_split(
GFP_KERNEL|__GFP_NOWARN|__GFP_ZERO);
if (queue)
break;
+ if (!may_reduce_num)
+ return NULL;
}
if (!num)
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
index fab02133a919..3dc70adfe5f5 100644
--- a/include/linux/virtio_ring.h
+++ b/include/linux/virt...
2023 May 26
1
[PATCH] virtio_ring: validate used buffer length
...vdev)) {
+ vring_split->buflen =
+ kmalloc_array(num, sizeof(*vring_split->buflen),
+ GFP_KERNEL);
+ if (!vring_split->buflen)
+ goto err_buflen;
+ }
+
return 0;
+
+err_buflen:
+ vring_free_split(vring_split, vdev, dma_dev);
+ return -ENOMEM;
}
static struct virtqueue *vring_create_virtqueue_split(
@@ -1297,6 +1344,7 @@ static int virtqueue_add_indirect_packed(struct vring_virtqueue *vq,
unsigned int i, n, err_idx;
u16 head, id;
dma_addr_t addr;
+ u32 buflen = 0;
head = vq->packed.next_avail_idx;
desc = alloc_indirect_packed(total_sg, gfp);
@@ -1325,6 +1373,8 @@ static int vir...
2023 May 31
1
[PATCH] virtio_ring: validate used buffer length
...gt; > +err_buflen:
> > > > > > > + vring_free_split(vring_split, vdev, dma_dev);
> > > > > > > + return -ENOMEM;
> > > > > > > }
> > > > > > >
> > > > > > > static struct virtqueue *vring_create_virtqueue_split(
> > > > > > > @@ -1297,6 +1344,7 @@ static int virtqueue_add_indirect_packed(struct vring_virtqueue *vq,
> > > > > > > unsigned int i, n, err_idx;
> > > > > > > u16 head, id;
> > > > > > > dma_add...
2023 May 31
1
[PATCH] virtio_ring: validate used buffer length
...; > > > > > > > + vring_free_split(vring_split, vdev, dma_dev);
> > > > > > > > + return -ENOMEM;
> > > > > > > > }
> > > > > > > >
> > > > > > > > static struct virtqueue *vring_create_virtqueue_split(
> > > > > > > > @@ -1297,6 +1344,7 @@ static int virtqueue_add_indirect_packed(struct vring_virtqueue *vq,
> > > > > > > > unsigned int i, n, err_idx;
> > > > > > > > u16 head, id;
> > > > > > >...
2023 Jun 01
1
[PATCH] virtio_ring: validate used buffer length
...; > > > > > > > + vring_free_split(vring_split, vdev, dma_dev);
> > > > > > > > + return -ENOMEM;
> > > > > > > > }
> > > > > > > >
> > > > > > > > static struct virtqueue *vring_create_virtqueue_split(
> > > > > > > > @@ -1297,6 +1344,7 @@ static int virtqueue_add_indirect_packed(struct vring_virtqueue *vq,
> > > > > > > > unsigned int i, n, err_idx;
> > > > > > > > u16 head, id;
> > > > > > >...
2023 Jun 01
1
[PATCH] virtio_ring: validate used buffer length
...; > > > + vring_free_split(vring_split, vdev, dma_dev);
> > > > > > > > > + return -ENOMEM;
> > > > > > > > > }
> > > > > > > > >
> > > > > > > > > static struct virtqueue *vring_create_virtqueue_split(
> > > > > > > > > @@ -1297,6 +1344,7 @@ static int virtqueue_add_indirect_packed(struct vring_virtqueue *vq,
> > > > > > > > > unsigned int i, n, err_idx;
> > > > > > > > > u16 head, id;
> > > >...
2020 Apr 06
2
[PATCH v2 1/2] virtio: stop using legacy struct vring
...117,7 @@ struct vring_virtqueue {
/* Available for split ring */
struct {
/* Actual memory layout for this queue. */
- struct vring vring;
+ struct vring_s vring;
/* Last written value to avail->flags */
u16 avail_flags_shadow;
@@ -858,7 +858,7 @@ static struct virtqueue *vring_create_virtqueue_split(
void *queue = NULL;
dma_addr_t dma_addr;
size_t queue_size_in_bytes;
- struct vring vring;
+ struct vring_s vring;
/* We assume num is a power of 2. */
if (num & (num - 1)) {
@@ -2051,7 +2051,7 @@ EXPORT_SYMBOL_GPL(vring_interrupt);
/* Only available for split ring */
struct vi...
2020 Apr 06
2
[PATCH v2 1/2] virtio: stop using legacy struct vring
...117,7 @@ struct vring_virtqueue {
/* Available for split ring */
struct {
/* Actual memory layout for this queue. */
- struct vring vring;
+ struct vring_s vring;
/* Last written value to avail->flags */
u16 avail_flags_shadow;
@@ -858,7 +858,7 @@ static struct virtqueue *vring_create_virtqueue_split(
void *queue = NULL;
dma_addr_t dma_addr;
size_t queue_size_in_bytes;
- struct vring vring;
+ struct vring_s vring;
/* We assume num is a power of 2. */
if (num & (num - 1)) {
@@ -2051,7 +2051,7 @@ EXPORT_SYMBOL_GPL(vring_interrupt);
/* Only available for split ring */
struct vi...
2018 Nov 21
19
[PATCH net-next v3 00/13] virtio: support packed ring
Hi,
This patch set implements packed ring support in virtio driver.
A performance test between pktgen (pktgen_sample03_burst_single_flow.sh)
and DPDK vhost (testpmd/rxonly/vhost-PMD) has been done, I saw
~30% performance gain in packed ring in this case.
To make this patch set work with below patch set for vhost,
some hacks are needed to set the _F_NEXT flag in indirect
descriptors (this should
2018 Nov 21
19
[PATCH net-next v3 00/13] virtio: support packed ring
Hi,
This patch set implements packed ring support in virtio driver.
A performance test between pktgen (pktgen_sample03_burst_single_flow.sh)
and DPDK vhost (testpmd/rxonly/vhost-PMD) has been done, I saw
~30% performance gain in packed ring in this case.
To make this patch set work with below patch set for vhost,
some hacks are needed to set the _F_NEXT flag in indirect
descriptors (this should