aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ehca/ehca_classes.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/ehca/ehca_classes.h')
-rw-r--r--drivers/infiniband/hw/ehca/ehca_classes.h50
1 files changed, 35 insertions, 15 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_classes.h b/drivers/infiniband/hw/ehca/ehca_classes.h
index 043e4fb23fb0..3725aa8664d9 100644
--- a/drivers/infiniband/hw/ehca/ehca_classes.h
+++ b/drivers/infiniband/hw/ehca/ehca_classes.h
@@ -43,7 +43,6 @@
43#ifndef __EHCA_CLASSES_H__ 43#ifndef __EHCA_CLASSES_H__
44#define __EHCA_CLASSES_H__ 44#define __EHCA_CLASSES_H__
45 45
46
47struct ehca_module; 46struct ehca_module;
48struct ehca_qp; 47struct ehca_qp;
49struct ehca_cq; 48struct ehca_cq;
@@ -100,6 +99,11 @@ struct ehca_sport {
100 struct ehca_sma_attr saved_attr; 99 struct ehca_sma_attr saved_attr;
101}; 100};
102 101
102#define HCA_CAP_MR_PGSIZE_4K 1
103#define HCA_CAP_MR_PGSIZE_64K 2
104#define HCA_CAP_MR_PGSIZE_1M 4
105#define HCA_CAP_MR_PGSIZE_16M 8
106
103struct ehca_shca { 107struct ehca_shca {
104 struct ib_device ib_device; 108 struct ib_device ib_device;
105 struct ibmebus_dev *ibmebus_dev; 109 struct ibmebus_dev *ibmebus_dev;
@@ -115,6 +119,8 @@ struct ehca_shca {
115 struct h_galpas galpas; 119 struct h_galpas galpas;
116 struct mutex modify_mutex; 120 struct mutex modify_mutex;
117 u64 hca_cap; 121 u64 hca_cap;
122 /* MR pgsize: bit 0-3 means 4K, 64K, 1M, 16M respectively */
123 u32 hca_cap_mr_pgsize;
118 int max_mtu; 124 int max_mtu;
119}; 125};
120 126
@@ -122,6 +128,10 @@ struct ehca_pd {
122 struct ib_pd ib_pd; 128 struct ib_pd ib_pd;
123 struct ipz_pd fw_pd; 129 struct ipz_pd fw_pd;
124 u32 ownpid; 130 u32 ownpid;
131 /* small queue mgmt */
132 struct mutex lock;
133 struct list_head free[2];
134 struct list_head full[2];
125}; 135};
126 136
127enum ehca_ext_qp_type { 137enum ehca_ext_qp_type {
@@ -206,6 +216,7 @@ struct ehca_mr {
206 enum ehca_mr_flag flags; 216 enum ehca_mr_flag flags;
207 u32 num_kpages; /* number of kernel pages */ 217 u32 num_kpages; /* number of kernel pages */
208 u32 num_hwpages; /* number of hw pages to form MR */ 218 u32 num_hwpages; /* number of hw pages to form MR */
219 u64 hwpage_size; /* hw page size used for this MR */
209 int acl; /* ACL (stored here for usage in reregister) */ 220 int acl; /* ACL (stored here for usage in reregister) */
210 u64 *start; /* virtual start address (stored here for */ 221 u64 *start; /* virtual start address (stored here for */
211 /* usage in reregister) */ 222 /* usage in reregister) */
@@ -240,6 +251,7 @@ struct ehca_mr_pginfo {
240 enum ehca_mr_pgi_type type; 251 enum ehca_mr_pgi_type type;
241 u64 num_kpages; 252 u64 num_kpages;
242 u64 kpage_cnt; 253 u64 kpage_cnt;
254 u64 hwpage_size; /* hw page size used for this MR */
243 u64 num_hwpages; /* number of hw pages */ 255 u64 num_hwpages; /* number of hw pages */
244 u64 hwpage_cnt; /* counter for hw pages */ 256 u64 hwpage_cnt; /* counter for hw pages */
245 u64 next_hwpage; /* next hw page in buffer/chunk/listelem */ 257 u64 next_hwpage; /* next hw page in buffer/chunk/listelem */
@@ -298,6 +310,8 @@ int ehca_init_av_cache(void);
298void ehca_cleanup_av_cache(void); 310void ehca_cleanup_av_cache(void);
299int ehca_init_mrmw_cache(void); 311int ehca_init_mrmw_cache(void);
300void ehca_cleanup_mrmw_cache(void); 312void ehca_cleanup_mrmw_cache(void);
313int ehca_init_small_qp_cache(void);
314void ehca_cleanup_small_qp_cache(void);
301 315
302extern rwlock_t ehca_qp_idr_lock; 316extern rwlock_t ehca_qp_idr_lock;
303extern rwlock_t ehca_cq_idr_lock; 317extern rwlock_t ehca_cq_idr_lock;
@@ -315,7 +329,7 @@ struct ipzu_queue_resp {
315 u32 queue_length; /* queue length allocated in bytes */ 329 u32 queue_length; /* queue length allocated in bytes */
316 u32 pagesize; 330 u32 pagesize;
317 u32 toggle_state; 331 u32 toggle_state;
318 u32 dummy; /* padding for 8 byte alignment */ 332 u32 offset; /* save offset within a page for small_qp */
319}; 333};
320 334
321struct ehca_create_cq_resp { 335struct ehca_create_cq_resp {
@@ -357,15 +371,29 @@ enum ehca_ll_comp_flags {
357 LLQP_COMP_MASK = 0x60, 371 LLQP_COMP_MASK = 0x60,
358}; 372};
359 373
374struct ehca_alloc_queue_parms {
375 /* input parameters */
376 int max_wr;
377 int max_sge;
378 int page_size;
379 int is_small;
380
381 /* output parameters */
382 u16 act_nr_wqes;
383 u8 act_nr_sges;
384 u32 queue_size; /* bytes for small queues, pages otherwise */
385};
386
360struct ehca_alloc_qp_parms { 387struct ehca_alloc_qp_parms {
361/* input parameters */ 388 struct ehca_alloc_queue_parms squeue;
389 struct ehca_alloc_queue_parms rqueue;
390
391 /* input parameters */
362 enum ehca_service_type servicetype; 392 enum ehca_service_type servicetype;
393 int qp_storage;
363 int sigtype; 394 int sigtype;
364 enum ehca_ext_qp_type ext_type; 395 enum ehca_ext_qp_type ext_type;
365 enum ehca_ll_comp_flags ll_comp_flags; 396 enum ehca_ll_comp_flags ll_comp_flags;
366
367 int max_send_wr, max_recv_wr;
368 int max_send_sge, max_recv_sge;
369 int ud_av_l_key_ctl; 397 int ud_av_l_key_ctl;
370 398
371 u32 token; 399 u32 token;
@@ -375,18 +403,10 @@ struct ehca_alloc_qp_parms {
375 403
376 u32 srq_qpn, srq_token, srq_limit; 404 u32 srq_qpn, srq_token, srq_limit;
377 405
378/* output parameters */ 406 /* output parameters */
379 u32 real_qp_num; 407 u32 real_qp_num;
380 struct ipz_qp_handle qp_handle; 408 struct ipz_qp_handle qp_handle;
381 struct h_galpas galpas; 409 struct h_galpas galpas;
382
383 u16 act_nr_send_wqes;
384 u16 act_nr_recv_wqes;
385 u8 act_nr_recv_sges;
386 u8 act_nr_send_sges;
387
388 u32 nr_rq_pages;
389 u32 nr_sq_pages;
390}; 410};
391 411
392int ehca_cq_assign_qp(struct ehca_cq *cq, struct ehca_qp *qp); 412int ehca_cq_assign_qp(struct ehca_cq *cq, struct ehca_qp *qp);