aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXuan Zhuo <[email protected]>2024-05-11 11:14:01 +0800
committerJakub Kicinski <[email protected]>2024-05-13 17:07:41 -0700
commitf9dac92ba9081062a6477ee015bd3b8c5914efc4 (patch)
tree2c3d1f95db49c92d29566ebaafbb9a699a9e5239
parent6e62702feb6d474e969b52f0379de93e9729e457 (diff)
virtio_ring: enable premapped mode whatever use_dma_api
Now, we have virtio DMA APIs, the driver can be the premapped mode whatever the virtio core uses dma api or not. So remove the limit of checking use_dma_api from virtqueue_set_dma_premapped(). Signed-off-by: Xuan Zhuo <[email protected]> Acked-by: Jason Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
-rw-r--r--drivers/virtio/virtio_ring.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 6f7e5010a673..2a972752ff1b 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -2782,7 +2782,7 @@ EXPORT_SYMBOL_GPL(virtqueue_resize);
*
* Returns zero or a negative error.
* 0: success.
- * -EINVAL: vring does not use the dma api, so we can not enable premapped mode.
+ * -EINVAL: too late to enable premapped mode, the vq already contains buffers.
*/
int virtqueue_set_dma_premapped(struct virtqueue *_vq)
{
@@ -2798,11 +2798,6 @@ int virtqueue_set_dma_premapped(struct virtqueue *_vq)
return -EINVAL;
}
- if (!vq->use_dma_api) {
- END_USE(vq);
- return -EINVAL;
- }
-
vq->premapped = true;
vq->do_unmap = false;