summaryrefslogtreecommitdiff
path: root/include/rdma
diff options
context:
space:
mode:
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/ib_verbs.h7
-rw-r--r--include/rdma/restrack.h28
2 files changed, 3 insertions, 32 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 64ee7c08be22..2a17c2b30073 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -2533,6 +2533,8 @@ struct ib_device_ops {
DECLARE_RDMA_OBJ_SIZE(ib_pd);
};
+struct rdma_restrack_root;
+
struct ib_device {
/* Do not access @dma_device directly from ULP nor from HW drivers. */
struct device *dma_device;
@@ -2589,10 +2591,7 @@ struct ib_device {
#endif
u32 index;
- /*
- * Implementation details of the RDMA core, don't use in drivers
- */
- struct rdma_restrack_root res;
+ struct rdma_restrack_root *res;
const struct uapi_definition *driver_def;
enum rdma_driver_id driver_id;
diff --git a/include/rdma/restrack.h b/include/rdma/restrack.h
index 53e1a7fb7355..ecf3c7702a4f 100644
--- a/include/rdma/restrack.h
+++ b/include/rdma/restrack.h
@@ -7,7 +7,6 @@
#define _RDMA_RESTRACK_H_
#include <linux/typecheck.h>
-#include <linux/rwsem.h>
#include <linux/sched.h>
#include <linux/kref.h>
#include <linux/completion.h>
@@ -50,31 +49,6 @@ enum rdma_restrack_type {
};
struct ib_device;
-struct rdma_restrack_entry;
-
-/**
- * struct rdma_restrack_root - main resource tracking management
- * entity, per-device
- */
-struct rdma_restrack_root {
- /*
- * @rwsem: Read/write lock to protect erase of entry.
- * Lists and insertions are protected by XArray internal lock.
- */
- struct rw_semaphore rwsem;
- /**
- * @xa: Array of XArray structures to hold restrack entries.
- * We want to use array of XArrays because insertion is type
- * dependent. For types with xisiting unique ID (like QPN),
- * we will insert to that unique index. For other types,
- * we insert based on pointers and auto-allocate unique index.
- */
- struct xarray xa[RDMA_RESTRACK_MAX];
- /**
- * @next_id: Next ID to support cyclic allocation
- */
- u32 next_id[RDMA_RESTRACK_MAX];
-};
/**
* struct rdma_restrack_entry - metadata per-entry
@@ -125,8 +99,6 @@ struct rdma_restrack_entry {
u32 id;
};
-void rdma_restrack_init(struct ib_device *dev);
-void rdma_restrack_clean(struct ib_device *dev);
int rdma_restrack_count(struct ib_device *dev,
enum rdma_restrack_type type,
struct pid_namespace *ns);