[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201203170511.216407-5-sgarzare@redhat.com>
Date: Thu, 3 Dec 2020 18:04:56 +0100
From: Stefano Garzarella <sgarzare@...hat.com>
To: virtualization@...ts.linux-foundation.org
Cc: Stefan Hajnoczi <stefanha@...hat.com>,
"Michael S. Tsirkin" <mst@...hat.com>, Oren Duer <oren@...dia.com>,
Jason Wang <jasowang@...hat.com>,
Laurent Vivier <lvivier@...hat.com>,
Stefano Garzarella <sgarzare@...hat.com>,
linux-kernel@...r.kernel.org, Max Gurtovoy <mgurtovoy@...dia.com>,
Shahaf Shuler <shahafs@...dia.com>, Eli Cohen <elic@...dia.com>
Subject: [PATCH v3 04/19] vhost/iotlb: add VHOST_IOTLB_UNLIMITED macro
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 <jasowang@...hat.com>
Signed-off-by: Stefano Garzarella <sgarzare@...hat.com>
---
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
--
2.26.2
Powered by blists - more mailing lists