diff options
author | Stefan Roscher <stefan.roscher at de.ibm.com> | 2007-07-20 10:04:17 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-07-21 00:19:47 -0400 |
commit | e2f81daf23efde23d8cac1fc253d41838f0347cf (patch) | |
tree | 310c493f007cc10625426118eaf217e50dd978f3 /drivers/infiniband/hw/ehca/ipz_pt_fn.h | |
parent | 0c10f7b79b5bb07a37aa5927072abdc3f45ac8d3 (diff) |
IB/ehca: Support small QP queues
eHCA2 supports QP queues that can be as small as 512 bytes. This
greatly reduces memory overhead for consumers that use lots of QPs
with small queues (e.g. RDMA-only QPs). Apart from dealing with
firmware, this code needs to manage bite-sized chunks of kernel pages,
making sure that no kernel page is shared between different protection
domains.
Signed-off-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
Diffstat (limited to 'drivers/infiniband/hw/ehca/ipz_pt_fn.h')
-rw-r--r-- | drivers/infiniband/hw/ehca/ipz_pt_fn.h | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/ehca/ipz_pt_fn.h b/drivers/infiniband/hw/ehca/ipz_pt_fn.h index 39a4f64aff41..c6937a044e8a 100644 --- a/drivers/infiniband/hw/ehca/ipz_pt_fn.h +++ b/drivers/infiniband/hw/ehca/ipz_pt_fn.h | |||
@@ -51,11 +51,25 @@ | |||
51 | #include "ehca_tools.h" | 51 | #include "ehca_tools.h" |
52 | #include "ehca_qes.h" | 52 | #include "ehca_qes.h" |
53 | 53 | ||
54 | struct ehca_pd; | ||
55 | struct ipz_small_queue_page; | ||
56 | |||
54 | /* struct generic ehca page */ | 57 | /* struct generic ehca page */ |
55 | struct ipz_page { | 58 | struct ipz_page { |
56 | u8 entries[EHCA_PAGESIZE]; | 59 | u8 entries[EHCA_PAGESIZE]; |
57 | }; | 60 | }; |
58 | 61 | ||
62 | #define IPZ_SPAGE_PER_KPAGE (PAGE_SIZE / 512) | ||
63 | |||
64 | struct ipz_small_queue_page { | ||
65 | unsigned long page; | ||
66 | unsigned long bitmap[IPZ_SPAGE_PER_KPAGE / BITS_PER_LONG]; | ||
67 | int fill; | ||
68 | void *mapped_addr; | ||
69 | u32 mmap_count; | ||
70 | struct list_head list; | ||
71 | }; | ||
72 | |||
59 | /* struct generic queue in linux kernel virtual memory (kv) */ | 73 | /* struct generic queue in linux kernel virtual memory (kv) */ |
60 | struct ipz_queue { | 74 | struct ipz_queue { |
61 | u64 current_q_offset; /* current queue entry */ | 75 | u64 current_q_offset; /* current queue entry */ |
@@ -66,7 +80,8 @@ struct ipz_queue { | |||
66 | u32 queue_length; /* queue length allocated in bytes */ | 80 | u32 queue_length; /* queue length allocated in bytes */ |
67 | u32 pagesize; | 81 | u32 pagesize; |
68 | u32 toggle_state; /* toggle flag - per page */ | 82 | u32 toggle_state; /* toggle flag - per page */ |
69 | u32 dummy3; /* 64 bit alignment */ | 83 | u32 offset; /* save offset within page for small_qp */ |
84 | struct ipz_small_queue_page *small_page; | ||
70 | }; | 85 | }; |
71 | 86 | ||
72 | /* | 87 | /* |
@@ -188,9 +203,10 @@ struct ipz_qpt { | |||
188 | * see ipz_qpt_ctor() | 203 | * see ipz_qpt_ctor() |
189 | * returns true if ok, false if out of memory | 204 | * returns true if ok, false if out of memory |
190 | */ | 205 | */ |
191 | int ipz_queue_ctor(struct ipz_queue *queue, const u32 nr_of_pages, | 206 | int ipz_queue_ctor(struct ehca_pd *pd, struct ipz_queue *queue, |
192 | const u32 pagesize, const u32 qe_size, | 207 | const u32 nr_of_pages, const u32 pagesize, |
193 | const u32 nr_of_sg); | 208 | const u32 qe_size, const u32 nr_of_sg, |
209 | int is_small); | ||
194 | 210 | ||
195 | /* | 211 | /* |
196 | * destructor for a ipz_queue_t | 212 | * destructor for a ipz_queue_t |
@@ -198,7 +214,7 @@ int ipz_queue_ctor(struct ipz_queue *queue, const u32 nr_of_pages, | |||
198 | * see ipz_queue_ctor() | 214 | * see ipz_queue_ctor() |
199 | * returns true if ok, false if queue was NULL-ptr of free failed | 215 | * returns true if ok, false if queue was NULL-ptr of free failed |
200 | */ | 216 | */ |
201 | int ipz_queue_dtor(struct ipz_queue *queue); | 217 | int ipz_queue_dtor(struct ehca_pd *pd, struct ipz_queue *queue); |
202 | 218 | ||
203 | /* | 219 | /* |
204 | * constructor for a ipz_qpt_t, | 220 | * constructor for a ipz_qpt_t, |