search for: sg_mark_end

Displaying 20 results from an estimated 57 matches for "sg_mark_end".

2013 Jun 24
3
[konrad.wilk@oracle.com: [PATCH] drm/i915: make compact dma scatter lists creation work with SWIOTLB backend.]
..._set_page(sg, page, PAGE_SIZE, 0); + sg = sg_next(sg); + continue; + } +#endif if (!i || page_to_pfn(page) != last_pfn + 1) { if (i) sg = sg_next(sg); @@ -1812,8 +1819,10 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj) } last_pfn = page_to_pfn(page); } - - sg_mark_end(sg); +#ifdef CONFIG_SWIOTLB + if (!swiotlb_nr_tbl()) +#endif + sg_mark_end(sg); obj->pages = st; if (i915_gem_object_needs_bit17_swizzle(obj)) -- 1.8.1.4 ----- End forwarded message -----
2014 Sep 05
2
[PATCH 1/3] virtio_net: pass well-formed sgs to virtqueue_add_*()
...et/ipv4/ah4.c b/net/ipv4/ah4.c index a2afa89513a0..9ae5756d9e5f 100644 --- a/net/ipv4/ah4.c +++ b/net/ipv4/ah4.c @@ -227,6 +227,7 @@ static int ah_output(struct xfrm_state *x, struct sk_buff *skb) *seqhi = htonl(XFRM_SKB_CB(skb)->seq.output.hi); sg_set_buf(seqhisg, seqhi, seqhi_len); } + sg_mark_end(&sg[nfrags + sglists]); ahash_request_set_crypt(req, sg, icv, skb->len + seqhi_len); ahash_request_set_callback(req, 0, ah_output_done, skb); @@ -395,6 +396,7 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb) *seqhi = XFRM_SKB_CB(skb)->seq.input.hi; sg_set_buf(...
2014 Sep 05
2
[PATCH 1/3] virtio_net: pass well-formed sgs to virtqueue_add_*()
...et/ipv4/ah4.c b/net/ipv4/ah4.c index a2afa89513a0..9ae5756d9e5f 100644 --- a/net/ipv4/ah4.c +++ b/net/ipv4/ah4.c @@ -227,6 +227,7 @@ static int ah_output(struct xfrm_state *x, struct sk_buff *skb) *seqhi = htonl(XFRM_SKB_CB(skb)->seq.output.hi); sg_set_buf(seqhisg, seqhi, seqhi_len); } + sg_mark_end(&sg[nfrags + sglists]); ahash_request_set_crypt(req, sg, icv, skb->len + seqhi_len); ahash_request_set_callback(req, 0, ah_output_done, skb); @@ -395,6 +396,7 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb) *seqhi = XFRM_SKB_CB(skb)->seq.input.hi; sg_set_buf(...
2013 Jan 02
0
[PATCH] virtio: use chained scatterlists
...blk_bio_send_flush(struct virtblk_req *vbr) sg_set_buf(&vbr->sg[out++], &vbr->out_hdr, sizeof(vbr->out_hdr)); sg_set_buf(&vbr->sg[out + in++], &vbr->status, sizeof(vbr->status)); - virtblk_add_req(vbr, out, in); + sg_unset_end_markers(vbr->sg, out + in); + sg_mark_end(&vbr->sg[out - 1]); + sg_mark_end(&vbr->sg[out + in - 1]); + + virtblk_add_req(vbr, vbr->sg, vbr->sg + out); return 0; } @@ -174,9 +179,6 @@ static int virtblk_bio_send_data(struct virtblk_req *vbr) num = blk_bio_map_sg(vblk->disk->queue, bio, vbr->sg + out);...
2013 Jan 02
0
[PATCH] virtio: use chained scatterlists
...blk_bio_send_flush(struct virtblk_req *vbr) sg_set_buf(&vbr->sg[out++], &vbr->out_hdr, sizeof(vbr->out_hdr)); sg_set_buf(&vbr->sg[out + in++], &vbr->status, sizeof(vbr->status)); - virtblk_add_req(vbr, out, in); + sg_unset_end_markers(vbr->sg, out + in); + sg_mark_end(&vbr->sg[out - 1]); + sg_mark_end(&vbr->sg[out + in - 1]); + + virtblk_add_req(vbr, vbr->sg, vbr->sg + out); return 0; } @@ -174,9 +179,6 @@ static int virtblk_bio_send_data(struct virtblk_req *vbr) num = blk_bio_map_sg(vblk->disk->queue, bio, vbr->sg + out);...
2014 Sep 07
0
[PATCH 1/3] virtio_net: pass well-formed sgs to virtqueue_add_*()
...x a2afa89513a0..9ae5756d9e5f 100644 > --- a/net/ipv4/ah4.c > +++ b/net/ipv4/ah4.c > @@ -227,6 +227,7 @@ static int ah_output(struct xfrm_state *x, struct sk_buff *skb) > *seqhi = htonl(XFRM_SKB_CB(skb)->seq.output.hi); > sg_set_buf(seqhisg, seqhi, seqhi_len); > } > + sg_mark_end(&sg[nfrags + sglists]); > ahash_request_set_crypt(req, sg, icv, skb->len + seqhi_len); > ahash_request_set_callback(req, 0, ah_output_done, skb); > > @@ -395,6 +396,7 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb) > *seqhi = XFRM_SKB_CB(skb)->seq...
2013 Mar 06
7
[PATCH 0/6] virtio_add_buf replacement.
OK, so I've spent a few days benchmarking. Turns out 80% of virtio_add_buf cases are uni-directional (including the always-performance-sensitive networking code), and that gets no performance penalty (though tests with real networking would be appreciated!). I'm not reposting all the "convert driver to virtio_add_outbuf()" patches: just the scsi one which I didn't have
2013 Mar 06
7
[PATCH 0/6] virtio_add_buf replacement.
OK, so I've spent a few days benchmarking. Turns out 80% of virtio_add_buf cases are uni-directional (including the always-performance-sensitive networking code), and that gets no performance penalty (though tests with real networking would be appreciated!). I'm not reposting all the "convert driver to virtio_add_outbuf()" patches: just the scsi one which I didn't have
2019 Sep 05
2
[PATCH v2] drm/virtio: Use vmalloc for command buffer allocations.
...ata); + if (!pg) { + sg_free_table(sgt); + kfree(sgt); + return NULL; + } + + s = rest_of_page(data); + if (s > size) + s = size; + + sg_set_page(sg, pg, s, offset_in_page(data)); + + size -= s; + data += s; + *sg_ents += 1; + + if (size) { + sg_unmark_end(sg); + } else { + sg_mark_end(sg); + break; + } + } + + return sgt; +} + static int virtio_gpu_queue_ctrl_buffer_locked(struct virtio_gpu_device *vgdev, - struct virtio_gpu_vbuffer *vbuf) + struct virtio_gpu_vbuffer *vbuf, + struct scatterlist *vout) __releases(&vgdev->ctrlq.qlock)...
2019 Sep 05
2
[PATCH v2] drm/virtio: Use vmalloc for command buffer allocations.
...ata); + if (!pg) { + sg_free_table(sgt); + kfree(sgt); + return NULL; + } + + s = rest_of_page(data); + if (s > size) + s = size; + + sg_set_page(sg, pg, s, offset_in_page(data)); + + size -= s; + data += s; + *sg_ents += 1; + + if (size) { + sg_unmark_end(sg); + } else { + sg_mark_end(sg); + break; + } + } + + return sgt; +} + static int virtio_gpu_queue_ctrl_buffer_locked(struct virtio_gpu_device *vgdev, - struct virtio_gpu_vbuffer *vbuf) + struct virtio_gpu_vbuffer *vbuf, + struct scatterlist *vout) __releases(&vgdev->ctrlq.qlock)...
2013 Feb 19
24
[PATCH 00/16] virtio ring rework.
OK, this is (ab)uses some of Paolo's patches. The first 7 are candidates for this merge window (maybe), the rest I'm not so sure about. Thanks, Rusty. Paolo Bonzini (3): scatterlist: introduce sg_unmark_end virtio-blk: reorganize virtblk_add_req virtio-blk: use virtqueue_add_sgs on req path Rusty Russell (13): virtio_ring: virtqueue_add_sgs, to add multiple sgs. virtio-blk:
2013 Feb 19
24
[PATCH 00/16] virtio ring rework.
OK, this is (ab)uses some of Paolo's patches. The first 7 are candidates for this merge window (maybe), the rest I'm not so sure about. Thanks, Rusty. Paolo Bonzini (3): scatterlist: introduce sg_unmark_end virtio-blk: reorganize virtblk_add_req virtio-blk: use virtqueue_add_sgs on req path Rusty Russell (13): virtio_ring: virtqueue_add_sgs, to add multiple sgs. virtio-blk:
2013 Mar 18
28
[PATCH 00/22] virtqueue_add_sgs, virtqueue_add_outbuf, virtqueue_add_inbuf
Add virtqueue_add_sgs which is more general than virtqueue_add_buf, which makes virtio-scsi and virtio-blk nicer, then add virtqueue_add_inbuf and virtqueue_add_outbuf which handle the more general case, and finally delete virtqueue_add_buf(). I'm hoping this will be the final post of the whole series, and it can move from my pending-rebases tree into virtio-next. Thanks! Rusty. Paolo
2013 Mar 18
28
[PATCH 00/22] virtqueue_add_sgs, virtqueue_add_outbuf, virtqueue_add_inbuf
Add virtqueue_add_sgs which is more general than virtqueue_add_buf, which makes virtio-scsi and virtio-blk nicer, then add virtqueue_add_inbuf and virtqueue_add_outbuf which handle the more general case, and finally delete virtqueue_add_buf(). I'm hoping this will be the final post of the whole series, and it can move from my pending-rebases tree into virtio-next. Thanks! Rusty. Paolo
2019 Sep 06
0
[PATCH v2] drm/virtio: Use vmalloc for command buffer allocations.
...d, so: s = min(PAGE_SIZE, size); > + sg_set_page(sg, pg, s, offset_in_page(data)); Offset is always zero. > + > + size -= s; > + data += s; > + *sg_ents += 1; sg_ents isn't used anywhere. > + > + if (size) { > + sg_unmark_end(sg); > + } else { > + sg_mark_end(sg); > + break; > + } That looks a bit strange. I guess you need only one of the two because the other is the default? > static int virtio_gpu_queue_fenced_ctrl_buffer(struct virtio_gpu_device *vgdev, > struct virtio_gpu_vbuffer *vbuf, > struct virtio...
2013 Feb 24
3
[PATCH dontapply 0/2] tools/virtio updates for API testing
Here's a patchset to update tools/virtio with changes in 3.8, as well as the proposed API extension. Useful to see whether the extra level of indirection adds measureable overhead. I will upstream at least patch 1 soon. Michael S. Tsirkin (2): tools/virtio: fix build for 3.8 tools/virtio: update for the new virtio API drivers/vhost/test.c | 4 +++- tools/virtio/Makefile
2013 Feb 24
3
[PATCH dontapply 0/2] tools/virtio updates for API testing
Here's a patchset to update tools/virtio with changes in 3.8, as well as the proposed API extension. Useful to see whether the extra level of indirection adds measureable overhead. I will upstream at least patch 1 soon. Michael S. Tsirkin (2): tools/virtio: fix build for 3.8 tools/virtio: update for the new virtio API drivers/vhost/test.c | 4 +++- tools/virtio/Makefile
2010 Nov 16
1
[PATCH RFC] tools/virtio: virtio_ring testing tool
...s: Virtual / 4K */ +#define virt_to_page(p) ((struct page*)((virt_to_phys(p) / 4096) * \ + sizeof(struct page))) +#define offset_in_page(p) (((unsigned long)p) % 4096) +#define sg_phys(sg) ((sg->page_link & ~0x3) / sizeof(struct page) * 4096 + \ + sg->offset) +static inline void sg_mark_end(struct scatterlist *sg) +{ + /* + * Set termination bit, clear potential chain bit + */ + sg->page_link |= 0x02; + sg->page_link &= ~0x01; +} +static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents) +{ + memset(sgl, 0, sizeof(*sgl) * nents); + sg_mark_end(&sgl[...
2010 Nov 16
1
[PATCH RFC] tools/virtio: virtio_ring testing tool
...s: Virtual / 4K */ +#define virt_to_page(p) ((struct page*)((virt_to_phys(p) / 4096) * \ + sizeof(struct page))) +#define offset_in_page(p) (((unsigned long)p) % 4096) +#define sg_phys(sg) ((sg->page_link & ~0x3) / sizeof(struct page) * 4096 + \ + sg->offset) +static inline void sg_mark_end(struct scatterlist *sg) +{ + /* + * Set termination bit, clear potential chain bit + */ + sg->page_link |= 0x02; + sg->page_link &= ~0x01; +} +static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents) +{ + memset(sgl, 0, sizeof(*sgl) * nents); + sg_mark_end(&sgl[...
2013 Feb 18
9
[PATCH 0/5] vringh
This introduces vringh, which are generic accessors for virtio rings (host side). There's a host-side implementation in vhost, but it assumes that the rings are in userspace, and is tied to the vhost implementation. I have patches to adapt it to use vringh, but I'm pushing this in the next merge window for Sjur, who has CAIF patches which need it. This also includes a test program in