search for: vring_desc_extra

Displaying 20 results from an estimated 30 matches for "vring_desc_extra".

2023 Mar 15
2
[PATCH v2 3/3] virtio_ring: Use const to annotate read-only pointer params
...t_indirect(const struct vring_virtqueue *vq, - struct vring_desc *desc) + const struct vring_desc *desc) { u16 flags; @@ -1183,7 +1183,7 @@ static u16 packed_last_used(u16 last_used_idx) } static void vring_unmap_extra_packed(const struct vring_virtqueue *vq, - struct vring_desc_extra *extra) + const struct vring_desc_extra *extra) { u16 flags; @@ -1206,7 +1206,7 @@ static void vring_unmap_extra_packed(const struct vring_virtqueue *vq, } static void vring_unmap_desc_packed(const struct vring_virtqueue *vq, - struct vring_packed_desc *desc) + const s...
2023 Mar 07
1
[PATCH vhost v1 03/12] virtio_ring: split: introduce virtqueue_add_split_premapped()
...> + bool dma_map; /* Addr is mapped by virtio core or not. */ > > This will stress the cache, can we pack the boolean into indir_desc? Rethink about this, I think we cannot pack this into indir_desc. Because we may save ctx to indir_desc. We can save this info to vring_desc_extra.addr, null means not dma mapped by virtio core. Thanks. > > > }; > > > > struct vring_desc_state_packed { > > @@ -440,7 +441,7 @@ static void vring_unmap_one_split_indirect(const struct vring_virtqueue *vq, > > } > > > > static unsigned int vring_...
2023 May 26
1
[PATCH] virtio_ring: validate used buffer length
...dation = false; +module_param(force_used_validation, bool, 0444); + #ifdef DEBUG /* For development, we want to crash whenever the ring is screwed. */ #define BAD_RING(_vq, fmt, args...) \ @@ -105,6 +108,9 @@ struct vring_virtqueue_split { struct vring_desc_state_split *desc_state; struct vring_desc_extra *desc_extra; + /* Maximum in buffer length, NULL means no used validation */ + u32 *buflen; + /* DMA address and size information */ dma_addr_t queue_dma_addr; size_t queue_size_in_bytes; @@ -145,6 +151,9 @@ struct vring_virtqueue_packed { struct vring_desc_state_packed *desc_state; str...
2023 Jun 22
1
[PATCH vhost v10 05/10] virtio_ring: split-detach: support return dma info to driver
...return needs_kick; > } > > -static void detach_buf_split(struct vring_virtqueue *vq, unsigned int head, > - void **ctx) > +static void detach_cursor_init_split(struct vring_virtqueue *vq, > + struct virtqueue_detach_cursor *cursor, u16 head) > +{ > + struct vring_desc_extra *extra; > + > + extra = &vq->split.desc_extra[head]; > + > + /* Clear data ptr. */ > + vq->split.desc_state[head].data = NULL; > + > + cursor->head = head; > + cursor->done = 0; > + > + if (extra->flags & VRING_DESC_F_INDIRECT) { > + cursor-&...
2023 May 31
1
[PATCH] virtio_ring: validate used buffer length
...gt; > What job? > > I meant the driver can do the validation since it has the knowledge of > the buffer length if it wants. It does not necessarily have it - not if virtio is doing DMA mapping. > > unmap is done in detach_buf_split and detach_buf_packed respectively. > > vring_desc_extra isn't even visible outside drivers/virtio/virtio_ring.c > > desc_extra doesn't contain buffer length for the case of indirect > descriptors. So we need to iterate in the descriptors when it looks > expensive if we don't need unmap. > > Thanks Well at the moment we o...
2023 May 31
1
[PATCH] virtio_ring: validate used buffer length
...; > > core. > > > > > > What job? > > > > I meant the driver can do the validation since it has the knowledge of > > the buffer length if it wants. > > > > > unmap is done in detach_buf_split and detach_buf_packed respectively. > > > vring_desc_extra isn't even visible outside drivers/virtio/virtio_ring.c > > > > desc_extra doesn't contain buffer length for the case of indirect > > descriptors. So we need to iterate in the descriptors when it looks > > expensive if we don't need unmap. > > > > Tha...
2023 Jun 01
1
[PATCH] virtio_ring: validate used buffer length
...ily have it - not if virtio is doing DMA > mapping. I don't see any dependencies for DMA, I mean anyhow the in buffer is allocated by the driver, so it should know how large it is. > > > > > unmap is done in detach_buf_split and detach_buf_packed respectively. > > > vring_desc_extra isn't even visible outside drivers/virtio/virtio_ring.c > > > > desc_extra doesn't contain buffer length for the case of indirect > > descriptors. So we need to iterate in the descriptors when it looks > > expensive if we don't need unmap. > > > > Tha...
2023 Jun 01
1
[PATCH] virtio_ring: validate used buffer length
...t; > > > What job? > > > > > > I meant the driver can do the validation since it has the knowledge of > > > the buffer length if it wants. > > > > > > > unmap is done in detach_buf_split and detach_buf_packed respectively. > > > > vring_desc_extra isn't even visible outside drivers/virtio/virtio_ring.c > > > > > > desc_extra doesn't contain buffer length for the case of indirect > > > descriptors. So we need to iterate in the descriptors when it looks > > > expensive if we don't need unmap. &gt...
2023 Mar 10
0
[PATCH v2 3/3] virtio_ring: Use const to annotate read-only pointer params
...t_indirect(const struct vring_virtqueue *vq, - struct vring_desc *desc) + const struct vring_desc *desc) { u16 flags; @@ -1183,7 +1183,7 @@ static u16 packed_last_used(u16 last_used_idx) } static void vring_unmap_extra_packed(const struct vring_virtqueue *vq, - struct vring_desc_extra *extra) + const struct vring_desc_extra *extra) { u16 flags; @@ -1206,7 +1206,7 @@ static void vring_unmap_extra_packed(const struct vring_virtqueue *vq, } static void vring_unmap_desc_packed(const struct vring_virtqueue *vq, - struct vring_packed_desc *desc) + const s...
2023 Mar 07
2
[PATCH vhost v1 03/12] virtio_ring: split: introduce virtqueue_add_split_premapped()
...ct(const struct vring_virtqueue *vq, > } > > static unsigned int vring_unmap_one_split(const struct vring_virtqueue *vq, > - unsigned int i) > + unsigned int i, bool dma_map) > { > struct vring_desc_extra *extra = vq->split.desc_extra; > u16 flags; > @@ -457,6 +458,9 @@ static unsigned int vring_unmap_one_split(const struct vring_virtqueue *vq, > (flags & VRING_DESC_F_WRITE) ? > DMA_FROM_DEVICE : DMA_TO_DEVI...
2023 Mar 22
1
[PATCH vhost v4 04/11] virtio_ring: split: support premapped
...; struct vring_desc_state_packed { @@ -448,7 +449,7 @@ static void vring_unmap_one_split_indirect(const struct vring_virtqueue *vq, } static unsigned int vring_unmap_one_split(const struct vring_virtqueue *vq, - unsigned int i) + unsigned int i, bool dma_map_internal) { struct vring_desc_extra *extra = vq->split.desc_extra; u16 flags; @@ -465,6 +466,9 @@ static unsigned int vring_unmap_one_split(const struct vring_virtqueue *vq, (flags & VRING_DESC_F_WRITE) ? DMA_FROM_DEVICE : DMA_TO_DEVICE); } else { + if (!dma_map_internal) + goto out; + dma_unmap_page(vrin...
2023 Mar 21
1
[PATCH vhost v3 04/11] virtio_ring: split: support premapped
...ed { > @@ -448,7 +449,7 @@ static void vring_unmap_one_split_indirect(const struct vring_virtqueue *vq, > } > > static unsigned int vring_unmap_one_split(const struct vring_virtqueue *vq, > - unsigned int i) > + unsigned int i, bool map_inter) > { > struct vring_desc_extra *extra = vq->split.desc_extra; > u16 flags; > @@ -465,6 +466,9 @@ static unsigned int vring_unmap_one_split(const struct vring_virtqueue *vq, > (flags & VRING_DESC_F_WRITE) ? > DMA_FROM_DEVICE : DMA_TO_DEVICE); > } else { > + if (!map_inter) > + goto o...
2023 Mar 07
3
[PATCH 0/3] virtio_ring: Clean up code for virtio ring and pci
This patch series performs a clean up of the code in virtio_ring and virtio_pci, modifying it to conform with the Linux kernel coding style guidance [1]. The modifications ensure the code easy to read and understand. This small series does few short cleanups in the code. Patch-1 Remove unnecessary num zero check, which performs in power_of_2. Patch-2 Avoid using inline for small functions.
2023 Mar 21
11
[PATCH vhost v3 00/11] 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%
2023 Mar 22
11
[PATCH vhost v4 00/11] 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%
2023 Mar 27
11
[PATCH vhost v6 00/11] 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%
2023 May 17
12
[PATCH vhost v9 00/12] virtio core prepares for AF_XDP
## About DMA APIs Now, virtio may can not work with DMA APIs when virtio features do not have VIRTIO_F_ACCESS_PLATFORM. 1. I tried to let DMA APIs return phy address by virtio-device. But DMA APIs just work with the "real" devices. 2. I tried to let xsk support callballs to get phy address from virtio-net driver as the dma address. But the maintainers of xsk may want to use
2023 Mar 15
4
[PATCH v2 0/3] virtio_ring: Clean up code for virtio ring and pci
This patch series performs a clean up of the code in virtio_ring and virtio_pci, modifying it to conform with the Linux kernel coding style guidance [1]. The modifications ensure the code easy to read and understand. This small series does few short cleanups in the code. Patch-1 Allow non power of 2 sizes for packed virtqueues. Patch-2 Avoid using inline for small functions. Patch-3 Use const to
2023 Mar 10
4
[PATCH v2 0/3] virtio_ring: Clean up code for virtio ring and pci
This patch series performs a clean up of the code in virtio_ring and virtio_pci, modifying it to conform with the Linux kernel coding style guidance [1]. The modifications ensure the code easy to read and understand. This small series does few short cleanups in the code. Patch-1 Allow non power of 2 sizes for virtqueues Patch-2 Avoid using inline for small functions. Patch-3 Use const to annotate
2023 May 09
12
[PATCH vhost v8 00/12] virtio core prepares for AF_XDP
## About DMA APIs Now, virtio may can not work with DMA APIs when virtio features do not have VIRTIO_F_ACCESS_PLATFORM. 1. I tried to let DMA APIs return phy address by virtio-device. But DMA APIs just work with the "real" devices. 2. I tried to let xsk support callballs to get phy address from virtio-net driver as the dma address. But the maintainers of xsk may want to use