Displaying 20 results from an estimated 38 matches for "virtqueue_add_".
Did you mean:
virtqueue_add
2014 Sep 03
0
[PATCH 1/3] virtio_net: pass well-formed sgs to virtqueue_add_*()
This is the only driver which doesn't hand virtqueue_add_inbuf and
virtqueue_add_outbuf a well-formed, well-terminated sg. Fix it,
so we can make virtio_add_* simpler.
pktgen results:
modprobe pktgen
echo 'add_device eth0' > /proc/net/pktgen/kpktgend_0
echo nowait 1 > /proc/net/pktgen/eth0
echo count 1000000 > /proc/net/pktgen/eth0...
2014 Sep 07
0
[PATCH 1/3] virtio_net: pass well-formed sgs to virtqueue_add_*()
...scritto:
> > + sg_init_table(rq->sg, MAX_SKB_FRAGS + 2);
>
> I think 2 is enough here. That said...
>
> > sg_set_buf(rq->sg, &hdr->hdr, sizeof hdr->hdr);
> > -
> > skb_to_sgvec(skb, rq->sg + 1, 0, skb->len);
> >
> > err = virtqueue_add_inbuf(rq->vq, rq->sg, 2, skb, gfp);
>
> ... skb_to_sgvec will already make the sg well formed, so the
> sg_init_table is _almost_ redundant; it is only there to remove
> intermediate end marks. The block layer takes care to remove
> them, but skb_to_sgvec doesn't.
>
&g...
2014 Sep 05
2
[PATCH 1/3] virtio_net: pass well-formed sgs to virtqueue_add_*()
Il 03/09/2014 06:29, Rusty Russell ha scritto:
> + sg_init_table(rq->sg, MAX_SKB_FRAGS + 2);
I think 2 is enough here. That said...
> sg_set_buf(rq->sg, &hdr->hdr, sizeof hdr->hdr);
> -
> skb_to_sgvec(skb, rq->sg + 1, 0, skb->len);
>
> err = virtqueue_add_inbuf(rq->vq, rq->sg, 2, skb, gfp);
... skb_to_sgvec will already make the sg well formed, so the
sg_init_table is _almost_ redundant; it is only there to remove
intermediate end marks. The block layer takes care to remove
them, but skb_to_sgvec doesn't.
If the following patch can be ac...
2014 Sep 05
2
[PATCH 1/3] virtio_net: pass well-formed sgs to virtqueue_add_*()
Il 03/09/2014 06:29, Rusty Russell ha scritto:
> + sg_init_table(rq->sg, MAX_SKB_FRAGS + 2);
I think 2 is enough here. That said...
> sg_set_buf(rq->sg, &hdr->hdr, sizeof hdr->hdr);
> -
> skb_to_sgvec(skb, rq->sg + 1, 0, skb->len);
>
> err = virtqueue_add_inbuf(rq->vq, rq->sg, 2, skb, gfp);
... skb_to_sgvec will already make the sg well formed, so the
sg_init_table is _almost_ redundant; it is only there to remove
intermediate end marks. The block layer takes care to remove
them, but skb_to_sgvec doesn't.
If the following patch can be ac...
2019 Apr 23
1
[PATCH] virtio/virtio_ring: do some comment fixes
...tions(+), 13 deletions(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 5df92c308286..3794c7666a99 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -1718,10 +1718,10 @@ static inline int virtqueue_add(struct virtqueue *_vq,
/**
* virtqueue_add_sgs - expose buffers to other end
- * @vq: the struct virtqueue we're talking about.
+ * @_vq: the struct virtqueue we're talking about.
* @sgs: array of terminated scatterlists.
- * @out_num: the number of scatterlists readable by other side
- * @in_num: the number of scatterlists which a...
2017 Jul 12
0
[PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG
...e_xb, sg_pfn_start,
+ page_xb_end, 1);
+ if (sg_pfn_start == page_xb_end + 1)
+ break;
+ sg_pfn_end = xb_find_next_bit(&vb->page_xb, sg_pfn_start + 1,
+ page_xb_end, 0);
+ sg_addr = sg_pfn_start << PAGE_SHIFT;
+ sg_size = (sg_pfn_end - sg_pfn_start) * PAGE_SIZE;
+ virtqueue_add_chain_desc(vq, sg_addr, sg_size, &head_id,
+ &prev_id, 0);
+ xb_zero(&vb->page_xb, sg_pfn_start, sg_pfn_end);
+ sg_pfn_start = sg_pfn_end + 1;
+ }
+
+ if (head_id != VIRTQUEUE_DESC_ID_INIT) {
+ virtqueue_add_chain(vq, head_id, 0, NULL, vb, NULL);
+ virtqueue_kick_async(vq, vb...
2016 Nov 28
1
[PATCH v3] crypto: add virtio-crypto driver
...t; > > +
>>> > > + /* Return status and session id back */
>>> > > + sg_init_one(&inhdr, &vcrypto->input, sizeof(vcrypto->input));
>>> > > + sgs[num_out + num_in++] = &inhdr;
>>> > > +
>>> > > + err = virtqueue_add_sgs(vcrypto->ctrl_vq, sgs, num_out,
>>> > > + num_in, vcrypto, GFP_ATOMIC);
>>> > > + if (err < 0) {
>>> > > + spin_unlock(&vcrypto->ctrl_lock);
>>> > > + kfree(cipher_key);
>>> > > + return err;
>>&g...
2016 Nov 28
1
[PATCH v3] crypto: add virtio-crypto driver
...t; > > +
>>> > > + /* Return status and session id back */
>>> > > + sg_init_one(&inhdr, &vcrypto->input, sizeof(vcrypto->input));
>>> > > + sgs[num_out + num_in++] = &inhdr;
>>> > > +
>>> > > + err = virtqueue_add_sgs(vcrypto->ctrl_vq, sgs, num_out,
>>> > > + num_in, vcrypto, GFP_ATOMIC);
>>> > > + if (err < 0) {
>>> > > + spin_unlock(&vcrypto->ctrl_lock);
>>> > > + kfree(cipher_key);
>>> > > + return err;
>>&g...
2023 Apr 25
12
[PATCH vhost v7 00/11] virtio core prepares for AF_XDP
...virtio_ring: split: separate dma codes
virtio_ring: packed: separate dma codes
virtio_ring: packed-indirect: separate dma codes
virtio_ring: split: support premapped
virtio_ring: packed: support premapped
virtio_ring: packed-indirect: support premapped
virtio_ring: update document for virtqueue_add_*
virtio_ring: introduce virtqueue_dma_dev()
virtio_ring: correct the expression of the description of
virtqueue_resize()
virtio_ring: separate the logic of reset/enable from virtqueue_resize
virtio_ring: introduce virtqueue_reset()
drivers/virtio/virtio_ring.c | 352 ++++++++++++++++++...
2017 Mar 29
2
[PATCH 3/6] virtio: allow extra context per descriptor
...t virtqueue *_vq,
vq->desc_state[head].data = data;
if (indirect)
vq->desc_state[head].indir_desc = desc;
+ if (ctx)
+ vq->desc_state[head].indir_desc = ctx;
/* Put entry in available array (but don't update avail->idx until they
* do sync). */
@@ -461,7 +465,8 @@ int virtqueue_add_sgs(struct virtqueue *_vq,
for (sg = sgs[i]; sg; sg = sg_next(sg))
total_sg++;
}
- return virtqueue_add(_vq, sgs, total_sg, out_sgs, in_sgs, data, gfp);
+ return virtqueue_add(_vq, sgs, total_sg, out_sgs, in_sgs,
+ data, NULL, gfp);
}
EXPORT_SYMBOL_GPL(virtqueue_add_sgs);
@@ -483...
2017 Mar 29
2
[PATCH 3/6] virtio: allow extra context per descriptor
...t virtqueue *_vq,
vq->desc_state[head].data = data;
if (indirect)
vq->desc_state[head].indir_desc = desc;
+ if (ctx)
+ vq->desc_state[head].indir_desc = ctx;
/* Put entry in available array (but don't update avail->idx until they
* do sync). */
@@ -461,7 +465,8 @@ int virtqueue_add_sgs(struct virtqueue *_vq,
for (sg = sgs[i]; sg; sg = sg_next(sg))
total_sg++;
}
- return virtqueue_add(_vq, sgs, total_sg, out_sgs, in_sgs, data, gfp);
+ return virtqueue_add(_vq, sgs, total_sg, out_sgs, in_sgs,
+ data, NULL, gfp);
}
EXPORT_SYMBOL_GPL(virtqueue_add_sgs);
@@ -483...
2018 Feb 23
0
[PATCH RFC 2/2] virtio_ring: support packed ring
...*desc;
+
+ /*
+ * We require lowmem mappings for the descriptors because
+ * otherwise virt_to_phys will give us bogus addresses in the
+ * virtqueue.
+ */
+ gfp &= ~__GFP_HIGHMEM;
+
+ desc = kmalloc(total_sg * sizeof(struct vring_packed_desc), gfp);
+
+ return desc;
+}
+
+static inline int virtqueue_add_split(struct virtqueue *_vq,
+ struct scatterlist *sgs[],
+ unsigned int total_sg,
+ unsigned int out_sgs,
+ unsigned int in_sgs,
+ void *data,
+ void *ctx,
+ gfp_t gfp)
{
struct vring_virtqueue *vq = to_vvq(_vq);
struct scatterlist...
2018 Feb 23
5
[PATCH RFC 0/2] Packed ring for virtio
Hello everyone,
This RFC implements a subset of packed ring which is described at
https://github.com/oasis-tcs/virtio-docs/blob/master/virtio-v1.1-packed-wd08.pdf
The code was tested with DPDK vhost (testpmd/vhost-PMD) implemented
by Jens at http://dpdk.org/ml/archives/dev/2018-January/089417.html
Minor changes are needed for the vhost code, e.g. to kick the guest.
It's not a complete
2018 Mar 16
0
[PATCH RFC 2/2] virtio_ring: support packed ring
...s will give us bogus addresses in the
> > + * virtqueue.
> > + */
> > + gfp &= ~__GFP_HIGHMEM;
> > +
> > + desc = kmalloc(total_sg * sizeof(struct vring_packed_desc), gfp);
> > +
> > + return desc;
> > +}
> > +
> > +static inline int virtqueue_add_split(struct virtqueue *_vq,
> > + struct scatterlist *sgs[],
> > + unsigned int total_sg,
> > + unsigned int out_sgs,
> > + unsigned int in_sgs,
> > + void *data,
> > + void *ctx,
> > + gfp_t gf...
2023 Mar 21
11
[PATCH vhost v3 00/11] virtio core prepares for AF_XDP
...virtio_ring: split: separate dma codes
virtio_ring: packed: separate dma codes
virtio_ring: packed-indirect: separate dma codes
virtio_ring: split: support premapped
virtio_ring: packed: support premapped
virtio_ring: packed-indirect: support premapped
virtio_ring: update document for virtqueue_add_*
virtio_ring: introduce virtqueue_dma_dev()
virtio_ring: correct the expression of the description of
virtqueue_resize()
virtio_ring: separate the logic of reset/enable from virtqueue_resize
virtio_ring: introduce virtqueue_reset()
drivers/virtio/virtio.c | 6 +
drivers/virtio/...
2023 Mar 22
11
[PATCH vhost v4 00/11] virtio core prepares for AF_XDP
...virtio_ring: split: separate dma codes
virtio_ring: packed: separate dma codes
virtio_ring: packed-indirect: separate dma codes
virtio_ring: split: support premapped
virtio_ring: packed: support premapped
virtio_ring: packed-indirect: support premapped
virtio_ring: update document for virtqueue_add_*
virtio_ring: introduce virtqueue_dma_dev()
virtio_ring: correct the expression of the description of
virtqueue_resize()
virtio_ring: separate the logic of reset/enable from virtqueue_resize
virtio_ring: introduce virtqueue_reset()
drivers/virtio/virtio.c | 6 +
drivers/virtio/...
2023 Mar 24
11
[PATCH vhost v5 00/11] virtio core prepares for AF_XDP
...virtio_ring: split: separate dma codes
virtio_ring: packed: separate dma codes
virtio_ring: packed-indirect: separate dma codes
virtio_ring: split: support premapped
virtio_ring: packed: support premapped
virtio_ring: packed-indirect: support premapped
virtio_ring: update document for virtqueue_add_*
virtio_ring: introduce virtqueue_dma_dev()
virtio_ring: correct the expression of the description of
virtqueue_resize()
virtio_ring: separate the logic of reset/enable from virtqueue_resize
virtio_ring: introduce virtqueue_reset()
drivers/virtio/virtio.c | 6 +
drivers/virtio/...
2023 Mar 27
11
[PATCH vhost v6 00/11] virtio core prepares for AF_XDP
...virtio_ring: split: separate dma codes
virtio_ring: packed: separate dma codes
virtio_ring: packed-indirect: separate dma codes
virtio_ring: split: support premapped
virtio_ring: packed: support premapped
virtio_ring: packed-indirect: support premapped
virtio_ring: update document for virtqueue_add_*
virtio_ring: introduce virtqueue_dma_dev()
virtio_ring: correct the expression of the description of
virtqueue_resize()
virtio_ring: separate the logic of reset/enable from virtqueue_resize
virtio_ring: introduce virtqueue_reset()
drivers/virtio/virtio.c | 6 +
drivers/virtio/...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...escriptors because
> + * otherwise virt_to_phys will give us bogus addresses in the
> + * virtqueue.
> + */
> + gfp &= ~__GFP_HIGHMEM;
> +
> + desc = kmalloc(total_sg * sizeof(struct vring_packed_desc), gfp);
> +
> + return desc;
> +}
> +
> +static inline int virtqueue_add_split(struct virtqueue *_vq,
> + struct scatterlist *sgs[],
> + unsigned int total_sg,
> + unsigned int out_sgs,
> + unsigned int in_sgs,
> + void *data,
> + void *ctx,
> + gfp_t gfp)
> {
> struct vring_vi...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...escriptors because
> + * otherwise virt_to_phys will give us bogus addresses in the
> + * virtqueue.
> + */
> + gfp &= ~__GFP_HIGHMEM;
> +
> + desc = kmalloc(total_sg * sizeof(struct vring_packed_desc), gfp);
> +
> + return desc;
> +}
> +
> +static inline int virtqueue_add_split(struct virtqueue *_vq,
> + struct scatterlist *sgs[],
> + unsigned int total_sg,
> + unsigned int out_sgs,
> + unsigned int in_sgs,
> + void *data,
> + void *ctx,
> + gfp_t gfp)
> {
> struct vring_vi...