Displaying 20 results from an estimated 258 matches for "total_sg".
2023 Feb 20
2
[PATCH vhost 01/10] virtio_ring: split: refactor virtqueue_add_split() for premapped
...inline unsigned int virtqueue_add_desc_split(struct virtqueue *vq,
> return next;
> }
>
> -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)
> +...
2023 Mar 02
1
[PATCH vhost v1 01/12] virtio_ring: split: refactor virtqueue_add_split() for premapped
...ers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -520,57 +520,38 @@ static inline unsigned int virtqueue_add_desc_split(struct virtqueue *vq,
return next;
}
-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)
+/* note: return NULL means no indirect that is valid. */
+static struct vring_desc *virtqueue_get_desc_split(struct vring_virtqueue *vq,
+ unsigned int total...
2014 Sep 03
0
[PATCH 3/3] virtio_ring: unify direct/indirect code paths.
...9,10 @@ struct vring_virtqueue
#define to_vvq(_vq) container_of(_vq, struct vring_virtqueue, vq)
-/* Set up an indirect table of descriptors and add it to the queue. */
-static inline int vring_add_indirect(struct vring_virtqueue *vq,
- struct scatterlist *sgs[],
- unsigned int total_sg,
- unsigned int out_sgs,
- unsigned int in_sgs,
- gfp_t gfp)
+static struct vring_desc *alloc_indirect(unsigned int total_sg, gfp_t gfp)
{
- struct vring_desc *desc;
- unsigned head;
- struct scatterlist *sg;
- int i, n;
+ struct vring_desc *desc;
+ unsigned int i;
/*...
2023 Mar 02
12
[PATCH vhost v1 00/12] virtio core prepares for AF_XDP
XDP socket(AF_XDP) is an excellent bypass kernel network framework. The zero
copy feature of xsk (XDP socket) needs to be supported by the driver. The
performance of zero copy is very good.
ENV: Qemu with vhost.
vhost cpu | Guest APP CPU |Guest Softirq CPU | PPS
-----------------------------|---------------|------------------|------------
xmit by sockperf: 90% | 100%
2017 Aug 10
5
[PATCH 0/2] virtio_scsi: Set can_queue based on size of virtqueue.
Earlier discussion:
https://lkml.org/lkml/2017/8/4/601
"Increased memory usage with scsi-mq"
Downstream bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=1478201
2017 Aug 10
5
[PATCH 0/2] virtio_scsi: Set can_queue based on size of virtqueue.
Earlier discussion:
https://lkml.org/lkml/2017/8/4/601
"Increased memory usage with scsi-mq"
Downstream bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=1478201
2018 Apr 13
3
[RFC v2] virtio: support packed ring
...include/uapi/linux/virtio_config.h | 12 +-
> > include/uapi/linux/virtio_ring.h | 61 ++
> > 4 files changed, 980 insertions(+), 195 deletions(-)
[...]
> > +static struct vring_packed_desc *alloc_indirect_packed(struct virtqueue *_vq,
> > + unsigned int total_sg,
> > + gfp_t gfp)
> > +{
> > + struct vring_packed_desc *desc;
> > +
> > + /*
> > + * We require lowmem mappings for the descriptors because
> > + * otherwise virt_to_phys will give us bogus addresses in the
> > + * virtqueue.
> >...
2018 Apr 13
3
[RFC v2] virtio: support packed ring
...include/uapi/linux/virtio_config.h | 12 +-
> > include/uapi/linux/virtio_ring.h | 61 ++
> > 4 files changed, 980 insertions(+), 195 deletions(-)
[...]
> > +static struct vring_packed_desc *alloc_indirect_packed(struct virtqueue *_vq,
> > + unsigned int total_sg,
> > + gfp_t gfp)
> > +{
> > + struct vring_packed_desc *desc;
> > +
> > + /*
> > + * We require lowmem mappings for the descriptors because
> > + * otherwise virt_to_phys will give us bogus addresses in the
> > + * virtqueue.
> >...
2014 Sep 03
8
[PATCH 0/3] virtio: simplify virtio_ring.
I resurrected these patches after prompting from Andy Lutomirski's
recent patches. I put them on the back-burner because vring_bench
had a 15% slowdown on my laptop: pktgen testing revealed a speedup,
if anything, so I've cleaned them up.
Rusty Russell (3):
virtio_net: pass well-formed sgs to virtqueue_add_*()
virtio_ring: assume sgs are always well-formed.
virtio_ring: unify
2014 Sep 03
8
[PATCH 0/3] virtio: simplify virtio_ring.
I resurrected these patches after prompting from Andy Lutomirski's
recent patches. I put them on the back-burner because vring_bench
had a 15% slowdown on my laptop: pktgen testing revealed a speedup,
if anything, so I've cleaned them up.
Rusty Russell (3):
virtio_net: pass well-formed sgs to virtqueue_add_*()
virtio_ring: assume sgs are always well-formed.
virtio_ring: unify
2014 Sep 04
1
[PATCH 3/3] virtio_ring: unify direct/indirect code paths.
...Previously vring_add_indirect() did the allocation and the simple
> linear layout. We replace that with alloc_indirect() which allocates
> the indirect table then chains it like the normal descriptor table so
> we can reuse the core logic.
>
> + if (vq->indirect && total_sg > 1 && vq->vq.num_free)
> + desc = alloc_indirect(total_sg, gfp);
> + else
> + desc = NULL;
> +
> + if (desc) {
> + /* Use a single buffer which doesn't continue */
> + vq->vring.desc[head]...
2014 Sep 04
1
[PATCH 3/3] virtio_ring: unify direct/indirect code paths.
...Previously vring_add_indirect() did the allocation and the simple
> linear layout. We replace that with alloc_indirect() which allocates
> the indirect table then chains it like the normal descriptor table so
> we can reuse the core logic.
>
> + if (vq->indirect && total_sg > 1 && vq->vq.num_free)
> + desc = alloc_indirect(total_sg, gfp);
> + else
> + desc = NULL;
> +
> + if (desc) {
> + /* Use a single buffer which doesn't continue */
> + vq->vring.desc[head]...
2023 Feb 14
11
[PATCH vhost 00/10] virtio core prepares for AF_XDP
XDP socket(AF_XDP) is an excellent bypass kernel network framework. The zero
copy feature of xsk (XDP socket) needs to be supported by the driver. The
performance of zero copy is very good.
ENV: Qemu with vhost.
vhost cpu | Guest APP CPU |Guest Softirq CPU | PPS
-----------------------------|---------------|------------------|------------
xmit by sockperf: 90% | 100%
2017 Aug 10
0
[PATCH 1/2] virtio: Reduce BUG if total_sg > virtqueue size to WARN.
If using indirect descriptors, you can make the total_sg as large as
you want. If not, BUG is too serious because the function later
returns -ENOSPC.
Thanks Paolo Bonzini, Christoph Hellwig.
Signed-off-by: Richard W.M. Jones <rjones at redhat.com>
---
drivers/virtio/virtio_ring.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff...
2023 Mar 07
2
[PATCH vhost v1 03/12] virtio_ring: split: introduce virtqueue_add_split_premapped()
...gt; gfp_t gfp)
> {
> struct vring_virtqueue *vq = to_vvq(_vq);
> @@ -767,9 +772,11 @@ static inline int virtqueue_add_split(struct virtqueue *_vq,
> goto end;
> }
>
> - err = virtqueue_map_sgs(vq, sgs, total_sg, out_sgs, in_sgs);
> - if (err)
> - goto err;
> + if (dma_map) {
Could we simply check sg->dma_addr in this case? Then we don't need to
introduce the dma_map flag.
Thanks
> + err = virtqueue_map_sgs(vq, sgs, total_sg, out_sgs, in_sgs);...
2014 Oct 07
2
BUG_ON in virtio-ring.c
Hi,
I'm hitting this bug with both ext4 and btrfs.
Here's an example of the backtrace:
https://gist.github.com/vzctl/e888a821333979120932
I tried raising this BUG only for direct ring and it solved the problem:
- BUG_ON(total_sg > vq->vring.num);
+ BUG_ON(total_sg > vq->vring.num && !vq->indirect);
Shall I submit the patch or is a more elaborate fix required?
--
Alexey
On Mon, May 27, 2013 at 7:38 AM, Rusty Russell <rusty at rustcorp.com.au> wrote:
> Dave Airlie <airlied at gm...
2014 Oct 07
2
BUG_ON in virtio-ring.c
Hi,
I'm hitting this bug with both ext4 and btrfs.
Here's an example of the backtrace:
https://gist.github.com/vzctl/e888a821333979120932
I tried raising this BUG only for direct ring and it solved the problem:
- BUG_ON(total_sg > vq->vring.num);
+ BUG_ON(total_sg > vq->vring.num && !vq->indirect);
Shall I submit the patch or is a more elaborate fix required?
--
Alexey
On Mon, May 27, 2013 at 7:38 AM, Rusty Russell <rusty at rustcorp.com.au> wrote:
> Dave Airlie <airlied at gm...
2018 Apr 17
0
[RFC v2] virtio: support packed ring
.../virtio_config.h | 12 +-
>>> include/uapi/linux/virtio_ring.h | 61 ++
>>> 4 files changed, 980 insertions(+), 195 deletions(-)
> [...]
>>> +static struct vring_packed_desc *alloc_indirect_packed(struct virtqueue *_vq,
>>> + unsigned int total_sg,
>>> + gfp_t gfp)
>>> +{
>>> + struct vring_packed_desc *desc;
>>> +
>>> + /*
>>> + * We require lowmem mappings for the descriptors because
>>> + * otherwise virt_to_phys will give us bogus addresses in the
>>> +...
2023 Mar 02
1
[PATCH vhost v1 02/12] virtio_ring: split: separate DMA codes
...-- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -520,6 +520,73 @@ static inline unsigned int virtqueue_add_desc_split(struct virtqueue *vq,
return next;
}
+static int virtqueue_map_sgs(struct vring_virtqueue *vq,
+ struct scatterlist *sgs[],
+ unsigned int total_sg,
+ unsigned int out_sgs,
+ unsigned int in_sgs)
+{
+ struct scatterlist *sg;
+ unsigned int n;
+
+ for (n = 0; n < out_sgs; n++) {
+ for (sg = sgs[n]; sg; sg = sg_next(sg)) {
+ dma_addr_t addr = vring_map_one_sg(vq, sg, DMA_TO_DEVICE);
+
+ if (vring_mapping_error(vq, addr))
+...
2014 Aug 28
1
[PATCH v2 0/4] virtio: Clean up scatterlists and use the DMA API
...vs. non-dma is relevant. I tried -net user a -net tap
>> with iperf running in both directions. I also tried switching
>> virtio_pci into non-DMA-API mode. No errors.
>>
>> Is there any chance that you could instrument that BUG_ON to print n,
>> i, in_sgs, out_sgs, total_sg, total_in, and total_out? I assume this
>> is some oddity with patch 1, but I'm mystified.
>
> Yes, its triggered by patch 1.
I must be doing something wrong, since virtio_net isn't sending me
through that code path at all. This may be related to ethtool
refusing to enable sc...