search for: max_segment_size

Displaying 20 results from an estimated 38 matches for "max_segment_size".

2023 May 10
3
[PATCH] virtio_ring: use u32 for virtio_max_dma_size
...ers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -289,12 +289,16 @@ static bool vring_use_dma_api(const struct virtio_device *vdev) return false; } -size_t virtio_max_dma_size(const struct virtio_device *vdev) +u32 virtio_max_dma_size(const struct virtio_device *vdev) { - size_t max_segment_size = SIZE_MAX; + u32 max_segment_size = U32_MAX; - if (vring_use_dma_api(vdev)) - max_segment_size = dma_max_mapping_size(vdev->dev.parent); + if (vring_use_dma_api(vdev)) { + size_t max_dma_size = dma_max_mapping_size(vdev->dev.parent); + + if (max_dma_size < max_segment_size) + max_s...
2023 May 10
2
[PATCH] virtio_ring: use u32 for virtio_max_dma_size
...virtio_device *vdev) > return false; > } > > -size_t virtio_max_dma_size(const struct virtio_device *vdev) > +u32 virtio_max_dma_size(const struct virtio_device *vdev) LGTM But, should we change the parameter to vq, then use the dma_dev? @Jason Thanks. > { > - size_t max_segment_size = SIZE_MAX; > + u32 max_segment_size = U32_MAX; > > - if (vring_use_dma_api(vdev)) > - max_segment_size = dma_max_mapping_size(vdev->dev.parent); > + if (vring_use_dma_api(vdev)) { > + size_t max_dma_size = dma_max_mapping_size(vdev->dev.parent); > + > + if (max_dma...
2023 May 10
1
[PATCH] virtio_ring: use u32 for virtio_max_dma_size
...irtio/virtio_ring.c > @@ -289,12 +289,16 @@ static bool vring_use_dma_api(const struct virtio_device *vdev) > return false; > } > > -size_t virtio_max_dma_size(const struct virtio_device *vdev) > +u32 virtio_max_dma_size(const struct virtio_device *vdev) > { > - size_t max_segment_size = SIZE_MAX; > + u32 max_segment_size = U32_MAX; > > - if (vring_use_dma_api(vdev)) > - max_segment_size = dma_max_mapping_size(vdev->dev.parent); > + if (vring_use_dma_api(vdev)) { > + size_t max_dma_size = dma_max_mapping_size(vdev->dev.parent); > + > + if (max_d...
2023 Jul 04
1
[PATCH] virtio_ring: use u32 for virtio_max_dma_size
...irtio/virtio_ring.c > @@ -289,12 +289,16 @@ static bool vring_use_dma_api(const struct virtio_device *vdev) > return false; > } > > -size_t virtio_max_dma_size(const struct virtio_device *vdev) > +u32 virtio_max_dma_size(const struct virtio_device *vdev) > { > - size_t max_segment_size = SIZE_MAX; > + u32 max_segment_size = U32_MAX; > > - if (vring_use_dma_api(vdev)) > - max_segment_size = dma_max_mapping_size(vdev->dev.parent); > + if (vring_use_dma_api(vdev)) { > + size_t max_dma_size = dma_max_mapping_size(vdev->dev.parent); > + > + if (max_d...
2023 May 10
1
[PATCH] virtio_ring: use u32 for virtio_max_dma_size
...irtio_device *vdev) > > +u32 virtio_max_dma_size(const struct virtio_device *vdev) > > > LGTM > > But, should we change the parameter to vq, then use the dma_dev? > > @Jason > > Thanks. > that would be an unrelated rework. > > { > > - size_t max_segment_size = SIZE_MAX; > > + u32 max_segment_size = U32_MAX; > > > > - if (vring_use_dma_api(vdev)) > > - max_segment_size = dma_max_mapping_size(vdev->dev.parent); > > + if (vring_use_dma_api(vdev)) { > > + size_t max_dma_size = dma_max_mapping_size(vdev->dev.paren...
2023 May 10
1
[PATCH] virtio_ring: use u32 for virtio_max_dma_size
...e the parameter to vq, then use the dma_dev? > > > > @Jason > > > > Thanks. > > > > > that would be an unrelated rework. Probably, but I think it's better to be done on top otherwise we may forget. Thanks > > > > { > > > - size_t max_segment_size = SIZE_MAX; > > > + u32 max_segment_size = U32_MAX; > > > > > > - if (vring_use_dma_api(vdev)) > > > - max_segment_size = dma_max_mapping_size(vdev->dev.parent); > > > + if (vring_use_dma_api(vdev)) { > > > + size_t...
2019 Jul 22
4
[PATCH 2/2] virtio/virtio_ring: Fix the dma_max_mapping_size call
...ff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index c8be1c4f5b55..37c143971211 100644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -262,7 +262,7 @@ size_t virtio_max_dma_size(struct virtio_device *vdev) > { > size_t max_segment_size = SIZE_MAX; > > - if (vring_use_dma_api(vdev)) > + if (vring_use_dma_api(vdev) && vdev->dev.dma_mask) Hmm, might it make sense to roll that check up into vring_use_dma_api() itself? After all, if the device has no mask then it's likely that other DMA API ops wouldn'...
2019 Jul 22
4
[PATCH 2/2] virtio/virtio_ring: Fix the dma_max_mapping_size call
...ff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index c8be1c4f5b55..37c143971211 100644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -262,7 +262,7 @@ size_t virtio_max_dma_size(struct virtio_device *vdev) > { > size_t max_segment_size = SIZE_MAX; > > - if (vring_use_dma_api(vdev)) > + if (vring_use_dma_api(vdev) && vdev->dev.dma_mask) Hmm, might it make sense to roll that check up into vring_use_dma_api() itself? After all, if the device has no mask then it's likely that other DMA API ops wouldn'...
2013 Feb 09
1
[blkfront] max_segments & max_segment_size
Hi, I have (very) poor write performance with Xen PV, used over RBD, and I suppose it''s because of very short values for max_segments and max_segment_size. (I have 250MB/s write speed in Dom0 vs 40MB/s write speed in DomU) From what I read, there is already a patch to fix that, called "multi page ring support for block devices" : http://lists.xen.org/archives/html/xen-devel/2012-03/msg00388.html But it doesn''t seem to have be...
2019 Jul 22
6
[PATCH 0/2] Fix NULL pointer dereference with virtio-blk-pci and virtual IOMMU
When running a guest featuring a virtio-blk-pci protected with a virtual IOMMU we hit a NULL pointer dereference. This series removes the dma_max_mapping_size() call in virtio_max_dma_size when the device does not have any dma_mask set. A check is also added to early return in dma_addressing_limited() if the dma_mask is NULL. Eric Auger (2): dma-mapping: Protect dma_addressing_limited against
2012 Aug 21
5
[PATCH 1/2 v1] blkdrv: Add queue limits parameters for sg block drive
...+ + pstrcat(path, MAXPATHLEN, d->d_name); + pstrcat(path, MAXPATHLEN, "/queue/"); + + read_queue_limit(path, "max_sectors_kb", &bs->max_sectors); + read_queue_limit(path, "max_segments", &bs->max_segments); + read_queue_limit(path, "max_segment_size", &bs->max_segment_size); +} + static int hdev_open(BlockDriverState *bs, const char *filename, int flags) { BDRVRawState *s = bs->opaque; @@ -868,6 +925,7 @@ static int hdev_open(BlockDriverState *bs, const char *filename, int flags) temp = realpath(filename, resolve...
2012 Aug 21
5
[PATCH 1/2 v1] blkdrv: Add queue limits parameters for sg block drive
...+ + pstrcat(path, MAXPATHLEN, d->d_name); + pstrcat(path, MAXPATHLEN, "/queue/"); + + read_queue_limit(path, "max_sectors_kb", &bs->max_sectors); + read_queue_limit(path, "max_segments", &bs->max_segments); + read_queue_limit(path, "max_segment_size", &bs->max_segment_size); +} + static int hdev_open(BlockDriverState *bs, const char *filename, int flags) { BDRVRawState *s = bs->opaque; @@ -868,6 +925,7 @@ static int hdev_open(BlockDriverState *bs, const char *filename, int flags) temp = realpath(filename, resolve...
2019 Jul 25
2
[PATCH 2/2] virtio/virtio_ring: Fix the dma_max_mapping_size call
...s/virtio/virtio_ring.c >>> index c8be1c4f5b55..37c143971211 100644 >>> --- a/drivers/virtio/virtio_ring.c >>> +++ b/drivers/virtio/virtio_ring.c >>> @@ -262,7 +262,7 @@ size_t virtio_max_dma_size(struct virtio_device *vdev) >>> { >>> size_t max_segment_size = SIZE_MAX; >>> - if (vring_use_dma_api(vdev)) >>> + if (vring_use_dma_api(vdev) && vdev->dev.dma_mask) >> >> Hmm, might it make sense to roll that check up into vring_use_dma_api() >> itself? After all, if the device has no mask then it's likel...
2019 Jul 25
2
[PATCH 2/2] virtio/virtio_ring: Fix the dma_max_mapping_size call
...s/virtio/virtio_ring.c >>> index c8be1c4f5b55..37c143971211 100644 >>> --- a/drivers/virtio/virtio_ring.c >>> +++ b/drivers/virtio/virtio_ring.c >>> @@ -262,7 +262,7 @@ size_t virtio_max_dma_size(struct virtio_device *vdev) >>> { >>> size_t max_segment_size = SIZE_MAX; >>> - if (vring_use_dma_api(vdev)) >>> + if (vring_use_dma_api(vdev) && vdev->dev.dma_mask) >> >> Hmm, might it make sense to roll that check up into vring_use_dma_api() >> itself? After all, if the device has no mask then it's likel...
2019 Jul 22
0
[PATCH 2/2] virtio/virtio_ring: Fix the dma_max_mapping_size call
...insertion(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index c8be1c4f5b55..37c143971211 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -262,7 +262,7 @@ size_t virtio_max_dma_size(struct virtio_device *vdev) { size_t max_segment_size = SIZE_MAX; - if (vring_use_dma_api(vdev)) + if (vring_use_dma_api(vdev) && vdev->dev.dma_mask) max_segment_size = dma_max_mapping_size(&vdev->dev); return max_segment_size; -- 2.20.1
2019 Jul 22
2
[PATCH 2/2] virtio/virtio_ring: Fix the dma_max_mapping_size call
...diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index c8be1c4f5b55..37c143971211 100644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -262,7 +262,7 @@ size_t virtio_max_dma_size(struct virtio_device *vdev) > { > size_t max_segment_size = SIZE_MAX; > > - if (vring_use_dma_api(vdev)) > + if (vring_use_dma_api(vdev) && vdev->dev.dma_mask) > max_segment_size = dma_max_mapping_size(&vdev->dev); > > return max_segment_size; > -- > 2.20.1
2019 Jul 22
2
[PATCH 2/2] virtio/virtio_ring: Fix the dma_max_mapping_size call
...diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index c8be1c4f5b55..37c143971211 100644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -262,7 +262,7 @@ size_t virtio_max_dma_size(struct virtio_device *vdev) > { > size_t max_segment_size = SIZE_MAX; > > - if (vring_use_dma_api(vdev)) > + if (vring_use_dma_api(vdev) && vdev->dev.dma_mask) > max_segment_size = dma_max_mapping_size(&vdev->dev); > > return max_segment_size; > -- > 2.20.1
2019 Feb 07
5
[PATCH v7 0/5] Fix virtio-blk issue with SWIOTLB
Hi, here is the next version of this patch-set. Previous versions can be found here: V1: https://lore.kernel.org/lkml/20190110134433.15672-1-joro at 8bytes.org/ V2: https://lore.kernel.org/lkml/20190115132257.6426-1-joro at 8bytes.org/ V3: https://lore.kernel.org/lkml/20190123163049.24863-1-joro at 8bytes.org/ V4: https://lore.kernel.org/lkml/20190129084342.26030-1-joro at 8bytes.org/
2023 Mar 15
2
[PATCH v2 3/3] virtio_ring: Use const to annotate read-only pointer params
...io_device *vdev) { if (!virtio_has_dma_quirk(vdev)) return true; @@ -289,7 +289,7 @@ static bool vring_use_dma_api(struct virtio_device *vdev) return false; } -size_t virtio_max_dma_size(struct virtio_device *vdev) +size_t virtio_max_dma_size(const struct virtio_device *vdev) { size_t max_segment_size = SIZE_MAX; @@ -423,7 +423,7 @@ static void virtqueue_init(struct vring_virtqueue *vq, u32 num) */ static void vring_unmap_one_split_indirect(const struct vring_virtqueue *vq, - struct vring_desc *desc) + const struct vring_desc *desc) { u16 flags; @@ -1183,7 +1183,7 @@ st...
2018 Apr 25
0
[PATCH v2 2/5] dma-mapping: Introduce dma_iommu_detach_device() API
...(struct device *dev, u64 dma_base, static inline void arch_teardown_dma_ops(struct device *dev) { } #endif +extern void dma_iommu_detach_device(struct device *dev); + static inline unsigned int dma_get_max_seg_size(struct device *dev) { if (dev->dma_parms && dev->dma_parms->max_segment_size) -- 2.17.0