summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rdma/hfi1
diff options
context:
space:
mode:
authorMitko Haralanov2016-02-05 17:57:49 +0100
committerDoug Ledford2016-02-29 23:10:38 +0100
commita86cd357e5be1b7eae3b399c02b972a92808c38a (patch)
tree37c29409978bc08072eb6cf1d75b880a2164bb6d /drivers/staging/rdma/hfi1
parentuapi/hfi1_user: Add command and event for TID caching (diff)
downloadkernel-qcow2-linux-a86cd357e5be1b7eae3b399c02b972a92808c38a.tar.gz
kernel-qcow2-linux-a86cd357e5be1b7eae3b399c02b972a92808c38a.tar.xz
kernel-qcow2-linux-a86cd357e5be1b7eae3b399c02b972a92808c38a.zip
staging/hfi1: Add definitions needed for TID cache
In preparation for adding the TID caching support, there is a set of headers, structures, and variables which will be needed. This commit adds them to the hfi.h header file. Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/staging/rdma/hfi1')
-rw-r--r--drivers/staging/rdma/hfi1/hfi.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/staging/rdma/hfi1/hfi.h b/drivers/staging/rdma/hfi1/hfi.h
index ddb21f0fffe7..51ecf45ef70b 100644
--- a/drivers/staging/rdma/hfi1/hfi.h
+++ b/drivers/staging/rdma/hfi1/hfi.h
@@ -179,6 +179,11 @@ struct ctxt_eager_bufs {
} *rcvtids;
};
+struct exp_tid_set {
+ struct list_head list;
+ u32 count;
+};
+
struct hfi1_ctxtdata {
/* shadow the ctxt's RcvCtrl register */
u64 rcvctrl;
@@ -247,6 +252,11 @@ struct hfi1_ctxtdata {
struct page **tid_pg_list;
/* dma handles for exp tid pages */
dma_addr_t *physshadow;
+
+ struct exp_tid_set tid_group_list;
+ struct exp_tid_set tid_used_list;
+ struct exp_tid_set tid_full_list;
+
/* lock protecting all Expected TID data */
spinlock_t exp_lock;
/* number of pio bufs for this ctxt (all procs, if shared) */
@@ -1137,6 +1147,16 @@ struct hfi1_filedata {
struct hfi1_user_sdma_pkt_q *pq;
/* for cpu affinity; -1 if none */
int rec_cpu_num;
+ struct mmu_notifier mn;
+ struct rb_root tid_rb_root;
+ spinlock_t tid_lock; /* protect tid_[limit,used] counters */
+ u32 tid_limit;
+ u32 tid_used;
+ spinlock_t rb_lock; /* protect tid_rb_root RB tree */
+ u32 *invalid_tids;
+ u32 invalid_tid_idx;
+ spinlock_t invalid_lock; /* protect the invalid_tids array */
+ int (*mmu_rb_insert)(struct rb_root *, struct mmu_rb_node *);
};
extern struct list_head hfi1_dev_list;