Thread (35 messages) 35 messages, 3 authors, 2020-12-15

Re: [PATCH v3 04/19] vhost/iotlb: add VHOST_IOTLB_UNLIMITED macro

From: Jason Wang <hidden>
Date: 2020-12-07 03:57:14
Also in: lkml

On 2020/12/4 上午1:04, Stefano Garzarella wrote:
It's possible to allocate an unlimited IOTLB calling
vhost_iotlb_alloc() with 'limit' = 0.

Add a new macro (VHOST_IOTLB_UNLIMITED) for this case and document
it in the vhost_iotlb_alloc() documentation block.

Suggested-by: Jason Wang <redacted>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>

Acked-by: Jason Wang <redacted>

quoted hunk ↗ jump to hunk
---
  include/linux/vhost_iotlb.h | 2 ++
  drivers/vhost/iotlb.c       | 3 ++-
  2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/linux/vhost_iotlb.h b/include/linux/vhost_iotlb.h
index 6b09b786a762..47019f97f795 100644
--- a/include/linux/vhost_iotlb.h
+++ b/include/linux/vhost_iotlb.h
@@ -4,6 +4,8 @@
  
  #include <linux/interval_tree_generic.h>
  
+#define VHOST_IOTLB_UNLIMITED 0
+
  struct vhost_iotlb_map {
  	struct rb_node rb;
  	struct list_head link;
diff --git a/drivers/vhost/iotlb.c b/drivers/vhost/iotlb.c
index 0fd3f87e913c..80fdde78ee5a 100644
--- a/drivers/vhost/iotlb.c
+++ b/drivers/vhost/iotlb.c
@@ -100,7 +100,8 @@ EXPORT_SYMBOL_GPL(vhost_iotlb_del_range);
  
  /**
   * vhost_iotlb_alloc - add a new vhost IOTLB
- * @limit: maximum number of IOTLB entries
+ * @limit: maximum number of IOTLB entries (use VHOST_IOTLB_UNLIMITED for an
+ *         unlimited IOTLB)
   * @flags: VHOST_IOTLB_FLAG_XXX
   *
   * Returns an error is memory allocation fails
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help