qib_verbs.h 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095
  1. /*
  2. * Copyright (c) 2006, 2007, 2008, 2009, 2010 QLogic Corporation.
  3. * All rights reserved.
  4. * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
  5. *
  6. * This software is available to you under a choice of one of two
  7. * licenses. You may choose to be licensed under the terms of the GNU
  8. * General Public License (GPL) Version 2, available from the file
  9. * COPYING in the main directory of this source tree, or the
  10. * OpenIB.org BSD license below:
  11. *
  12. * Redistribution and use in source and binary forms, with or
  13. * without modification, are permitted provided that the following
  14. * conditions are met:
  15. *
  16. * - Redistributions of source code must retain the above
  17. * copyright notice, this list of conditions and the following
  18. * disclaimer.
  19. *
  20. * - Redistributions in binary form must reproduce the above
  21. * copyright notice, this list of conditions and the following
  22. * disclaimer in the documentation and/or other materials
  23. * provided with the distribution.
  24. *
  25. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  26. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  27. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  28. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  29. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  30. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  31. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  32. * SOFTWARE.
  33. */
  34. #ifndef QIB_VERBS_H
  35. #define QIB_VERBS_H
  36. #include <linux/types.h>
  37. #include <linux/spinlock.h>
  38. #include <linux/kernel.h>
  39. #include <linux/interrupt.h>
  40. #include <linux/kref.h>
  41. #include <linux/workqueue.h>
  42. #include <rdma/ib_pack.h>
  43. #include <rdma/ib_user_verbs.h>
  44. struct qib_ctxtdata;
  45. struct qib_pportdata;
  46. struct qib_devdata;
  47. struct qib_verbs_txreq;
  48. #define QIB_MAX_RDMA_ATOMIC 16
  49. #define QIB_GUIDS_PER_PORT 5
  50. #define QPN_MAX (1 << 24)
  51. #define QPNMAP_ENTRIES (QPN_MAX / PAGE_SIZE / BITS_PER_BYTE)
  52. /*
  53. * Increment this value if any changes that break userspace ABI
  54. * compatibility are made.
  55. */
  56. #define QIB_UVERBS_ABI_VERSION 2
  57. /*
  58. * Define an ib_cq_notify value that is not valid so we know when CQ
  59. * notifications are armed.
  60. */
  61. #define IB_CQ_NONE (IB_CQ_NEXT_COMP + 1)
  62. #define IB_SEQ_NAK (3 << 29)
  63. /* AETH NAK opcode values */
  64. #define IB_RNR_NAK 0x20
  65. #define IB_NAK_PSN_ERROR 0x60
  66. #define IB_NAK_INVALID_REQUEST 0x61
  67. #define IB_NAK_REMOTE_ACCESS_ERROR 0x62
  68. #define IB_NAK_REMOTE_OPERATIONAL_ERROR 0x63
  69. #define IB_NAK_INVALID_RD_REQUEST 0x64
  70. /* Flags for checking QP state (see ib_qib_state_ops[]) */
  71. #define QIB_POST_SEND_OK 0x01
  72. #define QIB_POST_RECV_OK 0x02
  73. #define QIB_PROCESS_RECV_OK 0x04
  74. #define QIB_PROCESS_SEND_OK 0x08
  75. #define QIB_PROCESS_NEXT_SEND_OK 0x10
  76. #define QIB_FLUSH_SEND 0x20
  77. #define QIB_FLUSH_RECV 0x40
  78. #define QIB_PROCESS_OR_FLUSH_SEND \
  79. (QIB_PROCESS_SEND_OK | QIB_FLUSH_SEND)
  80. /* IB Performance Manager status values */
  81. #define IB_PMA_SAMPLE_STATUS_DONE 0x00
  82. #define IB_PMA_SAMPLE_STATUS_STARTED 0x01
  83. #define IB_PMA_SAMPLE_STATUS_RUNNING 0x02
  84. /* Mandatory IB performance counter select values. */
  85. #define IB_PMA_PORT_XMIT_DATA cpu_to_be16(0x0001)
  86. #define IB_PMA_PORT_RCV_DATA cpu_to_be16(0x0002)
  87. #define IB_PMA_PORT_XMIT_PKTS cpu_to_be16(0x0003)
  88. #define IB_PMA_PORT_RCV_PKTS cpu_to_be16(0x0004)
  89. #define IB_PMA_PORT_XMIT_WAIT cpu_to_be16(0x0005)
  90. #define QIB_VENDOR_IPG cpu_to_be16(0xFFA0)
  91. #define IB_BTH_REQ_ACK (1 << 31)
  92. #define IB_BTH_SOLICITED (1 << 23)
  93. #define IB_BTH_MIG_REQ (1 << 22)
  94. /* XXX Should be defined in ib_verbs.h enum ib_port_cap_flags */
  95. #define IB_PORT_OTHER_LOCAL_CHANGES_SUP (1 << 26)
  96. #define IB_GRH_VERSION 6
  97. #define IB_GRH_VERSION_MASK 0xF
  98. #define IB_GRH_VERSION_SHIFT 28
  99. #define IB_GRH_TCLASS_MASK 0xFF
  100. #define IB_GRH_TCLASS_SHIFT 20
  101. #define IB_GRH_FLOW_MASK 0xFFFFF
  102. #define IB_GRH_FLOW_SHIFT 0
  103. #define IB_GRH_NEXT_HDR 0x1B
  104. #define IB_DEFAULT_GID_PREFIX cpu_to_be64(0xfe80000000000000ULL)
  105. /* Values for set/get portinfo VLCap OperationalVLs */
  106. #define IB_VL_VL0 1
  107. #define IB_VL_VL0_1 2
  108. #define IB_VL_VL0_3 3
  109. #define IB_VL_VL0_7 4
  110. #define IB_VL_VL0_14 5
  111. static inline int qib_num_vls(int vls)
  112. {
  113. switch (vls) {
  114. default:
  115. case IB_VL_VL0:
  116. return 1;
  117. case IB_VL_VL0_1:
  118. return 2;
  119. case IB_VL_VL0_3:
  120. return 4;
  121. case IB_VL_VL0_7:
  122. return 8;
  123. case IB_VL_VL0_14:
  124. return 15;
  125. }
  126. }
  127. struct ib_reth {
  128. __be64 vaddr;
  129. __be32 rkey;
  130. __be32 length;
  131. } __attribute__ ((packed));
  132. struct ib_atomic_eth {
  133. __be32 vaddr[2]; /* unaligned so access as 2 32-bit words */
  134. __be32 rkey;
  135. __be64 swap_data;
  136. __be64 compare_data;
  137. } __attribute__ ((packed));
  138. struct qib_other_headers {
  139. __be32 bth[3];
  140. union {
  141. struct {
  142. __be32 deth[2];
  143. __be32 imm_data;
  144. } ud;
  145. struct {
  146. struct ib_reth reth;
  147. __be32 imm_data;
  148. } rc;
  149. struct {
  150. __be32 aeth;
  151. __be32 atomic_ack_eth[2];
  152. } at;
  153. __be32 imm_data;
  154. __be32 aeth;
  155. struct ib_atomic_eth atomic_eth;
  156. } u;
  157. } __attribute__ ((packed));
  158. /*
  159. * Note that UD packets with a GRH header are 8+40+12+8 = 68 bytes
  160. * long (72 w/ imm_data). Only the first 56 bytes of the IB header
  161. * will be in the eager header buffer. The remaining 12 or 16 bytes
  162. * are in the data buffer.
  163. */
  164. struct qib_ib_header {
  165. __be16 lrh[4];
  166. union {
  167. struct {
  168. struct ib_grh grh;
  169. struct qib_other_headers oth;
  170. } l;
  171. struct qib_other_headers oth;
  172. } u;
  173. } __attribute__ ((packed));
  174. struct qib_pio_header {
  175. __le32 pbc[2];
  176. struct qib_ib_header hdr;
  177. } __attribute__ ((packed));
  178. /*
  179. * There is one struct qib_mcast for each multicast GID.
  180. * All attached QPs are then stored as a list of
  181. * struct qib_mcast_qp.
  182. */
  183. struct qib_mcast_qp {
  184. struct list_head list;
  185. struct qib_qp *qp;
  186. };
  187. struct qib_mcast {
  188. struct rb_node rb_node;
  189. union ib_gid mgid;
  190. struct list_head qp_list;
  191. wait_queue_head_t wait;
  192. atomic_t refcount;
  193. int n_attached;
  194. };
  195. /* Protection domain */
  196. struct qib_pd {
  197. struct ib_pd ibpd;
  198. int user; /* non-zero if created from user space */
  199. };
  200. /* Address Handle */
  201. struct qib_ah {
  202. struct ib_ah ibah;
  203. struct ib_ah_attr attr;
  204. atomic_t refcount;
  205. };
  206. /*
  207. * This structure is used by qib_mmap() to validate an offset
  208. * when an mmap() request is made. The vm_area_struct then uses
  209. * this as its vm_private_data.
  210. */
  211. struct qib_mmap_info {
  212. struct list_head pending_mmaps;
  213. struct ib_ucontext *context;
  214. void *obj;
  215. __u64 offset;
  216. struct kref ref;
  217. unsigned size;
  218. };
  219. /*
  220. * This structure is used to contain the head pointer, tail pointer,
  221. * and completion queue entries as a single memory allocation so
  222. * it can be mmap'ed into user space.
  223. */
  224. struct qib_cq_wc {
  225. u32 head; /* index of next entry to fill */
  226. u32 tail; /* index of next ib_poll_cq() entry */
  227. union {
  228. /* these are actually size ibcq.cqe + 1 */
  229. struct ib_uverbs_wc uqueue[0];
  230. struct ib_wc kqueue[0];
  231. };
  232. };
  233. /*
  234. * The completion queue structure.
  235. */
  236. struct qib_cq {
  237. struct ib_cq ibcq;
  238. struct work_struct comptask;
  239. spinlock_t lock; /* protect changes in this struct */
  240. u8 notify;
  241. u8 triggered;
  242. struct qib_cq_wc *queue;
  243. struct qib_mmap_info *ip;
  244. };
  245. /*
  246. * A segment is a linear region of low physical memory.
  247. * XXX Maybe we should use phys addr here and kmap()/kunmap().
  248. * Used by the verbs layer.
  249. */
  250. struct qib_seg {
  251. void *vaddr;
  252. size_t length;
  253. };
  254. /* The number of qib_segs that fit in a page. */
  255. #define QIB_SEGSZ (PAGE_SIZE / sizeof(struct qib_seg))
  256. struct qib_segarray {
  257. struct qib_seg segs[QIB_SEGSZ];
  258. };
  259. struct qib_mregion {
  260. struct ib_pd *pd; /* shares refcnt of ibmr.pd */
  261. u64 user_base; /* User's address for this region */
  262. u64 iova; /* IB start address of this region */
  263. size_t length;
  264. u32 lkey;
  265. u32 offset; /* offset (bytes) to start of region */
  266. int access_flags;
  267. u32 max_segs; /* number of qib_segs in all the arrays */
  268. u32 mapsz; /* size of the map array */
  269. u8 page_shift; /* 0 - non unform/non powerof2 sizes */
  270. atomic_t refcount;
  271. struct qib_segarray *map[0]; /* the segments */
  272. };
  273. /*
  274. * These keep track of the copy progress within a memory region.
  275. * Used by the verbs layer.
  276. */
  277. struct qib_sge {
  278. struct qib_mregion *mr;
  279. void *vaddr; /* kernel virtual address of segment */
  280. u32 sge_length; /* length of the SGE */
  281. u32 length; /* remaining length of the segment */
  282. u16 m; /* current index: mr->map[m] */
  283. u16 n; /* current index: mr->map[m]->segs[n] */
  284. };
  285. /* Memory region */
  286. struct qib_mr {
  287. struct ib_mr ibmr;
  288. struct ib_umem *umem;
  289. struct qib_mregion mr; /* must be last */
  290. };
  291. /*
  292. * Send work request queue entry.
  293. * The size of the sg_list is determined when the QP is created and stored
  294. * in qp->s_max_sge.
  295. */
  296. struct qib_swqe {
  297. struct ib_send_wr wr; /* don't use wr.sg_list */
  298. u32 psn; /* first packet sequence number */
  299. u32 lpsn; /* last packet sequence number */
  300. u32 ssn; /* send sequence number */
  301. u32 length; /* total length of data in sg_list */
  302. struct qib_sge sg_list[0];
  303. };
  304. /*
  305. * Receive work request queue entry.
  306. * The size of the sg_list is determined when the QP (or SRQ) is created
  307. * and stored in qp->r_rq.max_sge (or srq->rq.max_sge).
  308. */
  309. struct qib_rwqe {
  310. u64 wr_id;
  311. u8 num_sge;
  312. struct ib_sge sg_list[0];
  313. };
  314. /*
  315. * This structure is used to contain the head pointer, tail pointer,
  316. * and receive work queue entries as a single memory allocation so
  317. * it can be mmap'ed into user space.
  318. * Note that the wq array elements are variable size so you can't
  319. * just index into the array to get the N'th element;
  320. * use get_rwqe_ptr() instead.
  321. */
  322. struct qib_rwq {
  323. u32 head; /* new work requests posted to the head */
  324. u32 tail; /* receives pull requests from here. */
  325. struct qib_rwqe wq[0];
  326. };
  327. struct qib_rq {
  328. struct qib_rwq *wq;
  329. spinlock_t lock; /* protect changes in this struct */
  330. u32 size; /* size of RWQE array */
  331. u8 max_sge;
  332. };
  333. struct qib_srq {
  334. struct ib_srq ibsrq;
  335. struct qib_rq rq;
  336. struct qib_mmap_info *ip;
  337. /* send signal when number of RWQEs < limit */
  338. u32 limit;
  339. };
  340. struct qib_sge_state {
  341. struct qib_sge *sg_list; /* next SGE to be used if any */
  342. struct qib_sge sge; /* progress state for the current SGE */
  343. u32 total_len;
  344. u8 num_sge;
  345. };
  346. /*
  347. * This structure holds the information that the send tasklet needs
  348. * to send a RDMA read response or atomic operation.
  349. */
  350. struct qib_ack_entry {
  351. u8 opcode;
  352. u8 sent;
  353. u32 psn;
  354. u32 lpsn;
  355. union {
  356. struct qib_sge rdma_sge;
  357. u64 atomic_data;
  358. };
  359. };
  360. /*
  361. * Variables prefixed with s_ are for the requester (sender).
  362. * Variables prefixed with r_ are for the responder (receiver).
  363. * Variables prefixed with ack_ are for responder replies.
  364. *
  365. * Common variables are protected by both r_rq.lock and s_lock in that order
  366. * which only happens in modify_qp() or changing the QP 'state'.
  367. */
  368. struct qib_qp {
  369. struct ib_qp ibqp;
  370. struct qib_qp *next; /* link list for QPN hash table */
  371. struct qib_qp *timer_next; /* link list for qib_ib_timer() */
  372. struct list_head iowait; /* link for wait PIO buf */
  373. struct list_head rspwait; /* link for waititing to respond */
  374. struct ib_ah_attr remote_ah_attr;
  375. struct ib_ah_attr alt_ah_attr;
  376. struct qib_ib_header s_hdr; /* next packet header to send */
  377. atomic_t refcount;
  378. wait_queue_head_t wait;
  379. wait_queue_head_t wait_dma;
  380. struct timer_list s_timer;
  381. struct work_struct s_work;
  382. struct qib_mmap_info *ip;
  383. struct qib_sge_state *s_cur_sge;
  384. struct qib_verbs_txreq *s_tx;
  385. struct qib_mregion *s_rdma_mr;
  386. struct qib_sge_state s_sge; /* current send request data */
  387. struct qib_ack_entry s_ack_queue[QIB_MAX_RDMA_ATOMIC + 1];
  388. struct qib_sge_state s_ack_rdma_sge;
  389. struct qib_sge_state s_rdma_read_sge;
  390. struct qib_sge_state r_sge; /* current receive data */
  391. spinlock_t r_lock; /* used for APM */
  392. spinlock_t s_lock;
  393. atomic_t s_dma_busy;
  394. u32 s_flags;
  395. u32 s_cur_size; /* size of send packet in bytes */
  396. u32 s_len; /* total length of s_sge */
  397. u32 s_rdma_read_len; /* total length of s_rdma_read_sge */
  398. u32 s_next_psn; /* PSN for next request */
  399. u32 s_last_psn; /* last response PSN processed */
  400. u32 s_sending_psn; /* lowest PSN that is being sent */
  401. u32 s_sending_hpsn; /* highest PSN that is being sent */
  402. u32 s_psn; /* current packet sequence number */
  403. u32 s_ack_rdma_psn; /* PSN for sending RDMA read responses */
  404. u32 s_ack_psn; /* PSN for acking sends and RDMA writes */
  405. u32 s_rnr_timeout; /* number of milliseconds for RNR timeout */
  406. u32 r_ack_psn; /* PSN for next ACK or atomic ACK */
  407. u64 r_wr_id; /* ID for current receive WQE */
  408. unsigned long r_aflags;
  409. u32 r_len; /* total length of r_sge */
  410. u32 r_rcv_len; /* receive data len processed */
  411. u32 r_psn; /* expected rcv packet sequence number */
  412. u32 r_msn; /* message sequence number */
  413. u16 s_hdrwords; /* size of s_hdr in 32 bit words */
  414. u16 s_rdma_ack_cnt;
  415. u8 state; /* QP state */
  416. u8 s_state; /* opcode of last packet sent */
  417. u8 s_ack_state; /* opcode of packet to ACK */
  418. u8 s_nak_state; /* non-zero if NAK is pending */
  419. u8 r_state; /* opcode of last packet received */
  420. u8 r_nak_state; /* non-zero if NAK is pending */
  421. u8 r_min_rnr_timer; /* retry timeout value for RNR NAKs */
  422. u8 r_flags;
  423. u8 r_max_rd_atomic; /* max number of RDMA read/atomic to receive */
  424. u8 r_head_ack_queue; /* index into s_ack_queue[] */
  425. u8 qp_access_flags;
  426. u8 s_max_sge; /* size of s_wq->sg_list */
  427. u8 s_retry_cnt; /* number of times to retry */
  428. u8 s_rnr_retry_cnt;
  429. u8 s_retry; /* requester retry counter */
  430. u8 s_rnr_retry; /* requester RNR retry counter */
  431. u8 s_pkey_index; /* PKEY index to use */
  432. u8 s_alt_pkey_index; /* Alternate path PKEY index to use */
  433. u8 s_max_rd_atomic; /* max number of RDMA read/atomic to send */
  434. u8 s_num_rd_atomic; /* number of RDMA read/atomic pending */
  435. u8 s_tail_ack_queue; /* index into s_ack_queue[] */
  436. u8 s_srate;
  437. u8 s_draining;
  438. u8 s_mig_state;
  439. u8 timeout; /* Timeout for this QP */
  440. u8 alt_timeout; /* Alternate path timeout for this QP */
  441. u8 port_num;
  442. enum ib_mtu path_mtu;
  443. u32 remote_qpn;
  444. u32 qkey; /* QKEY for this QP (for UD or RD) */
  445. u32 s_size; /* send work queue size */
  446. u32 s_head; /* new entries added here */
  447. u32 s_tail; /* next entry to process */
  448. u32 s_cur; /* current work queue entry */
  449. u32 s_acked; /* last un-ACK'ed entry */
  450. u32 s_last; /* last completed entry */
  451. u32 s_ssn; /* SSN of tail entry */
  452. u32 s_lsn; /* limit sequence number (credit) */
  453. struct qib_swqe *s_wq; /* send work queue */
  454. struct qib_swqe *s_wqe;
  455. struct qib_rq r_rq; /* receive work queue */
  456. struct qib_sge r_sg_list[0]; /* verified SGEs */
  457. };
  458. /*
  459. * Atomic bit definitions for r_aflags.
  460. */
  461. #define QIB_R_WRID_VALID 0
  462. #define QIB_R_REWIND_SGE 1
  463. /*
  464. * Bit definitions for r_flags.
  465. */
  466. #define QIB_R_REUSE_SGE 0x01
  467. #define QIB_R_RDMAR_SEQ 0x02
  468. #define QIB_R_RSP_NAK 0x04
  469. #define QIB_R_RSP_SEND 0x08
  470. #define QIB_R_COMM_EST 0x10
  471. /*
  472. * Bit definitions for s_flags.
  473. *
  474. * QIB_S_SIGNAL_REQ_WR - set if QP send WRs contain completion signaled
  475. * QIB_S_BUSY - send tasklet is processing the QP
  476. * QIB_S_TIMER - the RC retry timer is active
  477. * QIB_S_ACK_PENDING - an ACK is waiting to be sent after RDMA read/atomics
  478. * QIB_S_WAIT_FENCE - waiting for all prior RDMA read or atomic SWQEs
  479. * before processing the next SWQE
  480. * QIB_S_WAIT_RDMAR - waiting for a RDMA read or atomic SWQE to complete
  481. * before processing the next SWQE
  482. * QIB_S_WAIT_RNR - waiting for RNR timeout
  483. * QIB_S_WAIT_SSN_CREDIT - waiting for RC credits to process next SWQE
  484. * QIB_S_WAIT_DMA - waiting for send DMA queue to drain before generating
  485. * next send completion entry not via send DMA
  486. * QIB_S_WAIT_PIO - waiting for a send buffer to be available
  487. * QIB_S_WAIT_TX - waiting for a struct qib_verbs_txreq to be available
  488. * QIB_S_WAIT_DMA_DESC - waiting for DMA descriptors to be available
  489. * QIB_S_WAIT_KMEM - waiting for kernel memory to be available
  490. * QIB_S_WAIT_PSN - waiting for a packet to exit the send DMA queue
  491. * QIB_S_WAIT_ACK - waiting for an ACK packet before sending more requests
  492. * QIB_S_SEND_ONE - send one packet, request ACK, then wait for ACK
  493. */
  494. #define QIB_S_SIGNAL_REQ_WR 0x0001
  495. #define QIB_S_BUSY 0x0002
  496. #define QIB_S_TIMER 0x0004
  497. #define QIB_S_RESP_PENDING 0x0008
  498. #define QIB_S_ACK_PENDING 0x0010
  499. #define QIB_S_WAIT_FENCE 0x0020
  500. #define QIB_S_WAIT_RDMAR 0x0040
  501. #define QIB_S_WAIT_RNR 0x0080
  502. #define QIB_S_WAIT_SSN_CREDIT 0x0100
  503. #define QIB_S_WAIT_DMA 0x0200
  504. #define QIB_S_WAIT_PIO 0x0400
  505. #define QIB_S_WAIT_TX 0x0800
  506. #define QIB_S_WAIT_DMA_DESC 0x1000
  507. #define QIB_S_WAIT_KMEM 0x2000
  508. #define QIB_S_WAIT_PSN 0x4000
  509. #define QIB_S_WAIT_ACK 0x8000
  510. #define QIB_S_SEND_ONE 0x10000
  511. #define QIB_S_UNLIMITED_CREDIT 0x20000
  512. /*
  513. * Wait flags that would prevent any packet type from being sent.
  514. */
  515. #define QIB_S_ANY_WAIT_IO (QIB_S_WAIT_PIO | QIB_S_WAIT_TX | \
  516. QIB_S_WAIT_DMA_DESC | QIB_S_WAIT_KMEM)
  517. /*
  518. * Wait flags that would prevent send work requests from making progress.
  519. */
  520. #define QIB_S_ANY_WAIT_SEND (QIB_S_WAIT_FENCE | QIB_S_WAIT_RDMAR | \
  521. QIB_S_WAIT_RNR | QIB_S_WAIT_SSN_CREDIT | QIB_S_WAIT_DMA | \
  522. QIB_S_WAIT_PSN | QIB_S_WAIT_ACK)
  523. #define QIB_S_ANY_WAIT (QIB_S_ANY_WAIT_IO | QIB_S_ANY_WAIT_SEND)
  524. #define QIB_PSN_CREDIT 16
  525. /*
  526. * Since struct qib_swqe is not a fixed size, we can't simply index into
  527. * struct qib_qp.s_wq. This function does the array index computation.
  528. */
  529. static inline struct qib_swqe *get_swqe_ptr(struct qib_qp *qp,
  530. unsigned n)
  531. {
  532. return (struct qib_swqe *)((char *)qp->s_wq +
  533. (sizeof(struct qib_swqe) +
  534. qp->s_max_sge *
  535. sizeof(struct qib_sge)) * n);
  536. }
  537. /*
  538. * Since struct qib_rwqe is not a fixed size, we can't simply index into
  539. * struct qib_rwq.wq. This function does the array index computation.
  540. */
  541. static inline struct qib_rwqe *get_rwqe_ptr(struct qib_rq *rq, unsigned n)
  542. {
  543. return (struct qib_rwqe *)
  544. ((char *) rq->wq->wq +
  545. (sizeof(struct qib_rwqe) +
  546. rq->max_sge * sizeof(struct ib_sge)) * n);
  547. }
  548. /*
  549. * QPN-map pages start out as NULL, they get allocated upon
  550. * first use and are never deallocated. This way,
  551. * large bitmaps are not allocated unless large numbers of QPs are used.
  552. */
  553. struct qpn_map {
  554. void *page;
  555. };
  556. struct qib_qpn_table {
  557. spinlock_t lock; /* protect changes in this struct */
  558. unsigned flags; /* flags for QP0/1 allocated for each port */
  559. u32 last; /* last QP number allocated */
  560. u32 nmaps; /* size of the map table */
  561. u16 limit;
  562. u16 mask;
  563. /* bit map of free QP numbers other than 0/1 */
  564. struct qpn_map map[QPNMAP_ENTRIES];
  565. };
  566. struct qib_lkey_table {
  567. spinlock_t lock; /* protect changes in this struct */
  568. u32 next; /* next unused index (speeds search) */
  569. u32 gen; /* generation count */
  570. u32 max; /* size of the table */
  571. struct qib_mregion **table;
  572. };
  573. struct qib_opcode_stats {
  574. u64 n_packets; /* number of packets */
  575. u64 n_bytes; /* total number of bytes */
  576. };
  577. struct qib_ibport {
  578. struct qib_qp *qp0;
  579. struct qib_qp *qp1;
  580. struct ib_mad_agent *send_agent; /* agent for SMI (traps) */
  581. struct qib_ah *sm_ah;
  582. struct qib_ah *smi_ah;
  583. struct rb_root mcast_tree;
  584. spinlock_t lock; /* protect changes in this struct */
  585. /* non-zero when timer is set */
  586. unsigned long mkey_lease_timeout;
  587. unsigned long trap_timeout;
  588. __be64 gid_prefix; /* in network order */
  589. __be64 mkey;
  590. __be64 guids[QIB_GUIDS_PER_PORT - 1]; /* writable GUIDs */
  591. u64 tid; /* TID for traps */
  592. u64 n_unicast_xmit; /* total unicast packets sent */
  593. u64 n_unicast_rcv; /* total unicast packets received */
  594. u64 n_multicast_xmit; /* total multicast packets sent */
  595. u64 n_multicast_rcv; /* total multicast packets received */
  596. u64 z_symbol_error_counter; /* starting count for PMA */
  597. u64 z_link_error_recovery_counter; /* starting count for PMA */
  598. u64 z_link_downed_counter; /* starting count for PMA */
  599. u64 z_port_rcv_errors; /* starting count for PMA */
  600. u64 z_port_rcv_remphys_errors; /* starting count for PMA */
  601. u64 z_port_xmit_discards; /* starting count for PMA */
  602. u64 z_port_xmit_data; /* starting count for PMA */
  603. u64 z_port_rcv_data; /* starting count for PMA */
  604. u64 z_port_xmit_packets; /* starting count for PMA */
  605. u64 z_port_rcv_packets; /* starting count for PMA */
  606. u32 z_local_link_integrity_errors; /* starting count for PMA */
  607. u32 z_excessive_buffer_overrun_errors; /* starting count for PMA */
  608. u32 z_vl15_dropped; /* starting count for PMA */
  609. u32 n_rc_resends;
  610. u32 n_rc_acks;
  611. u32 n_rc_qacks;
  612. u32 n_rc_delayed_comp;
  613. u32 n_seq_naks;
  614. u32 n_rdma_seq;
  615. u32 n_rnr_naks;
  616. u32 n_other_naks;
  617. u32 n_loop_pkts;
  618. u32 n_pkt_drops;
  619. u32 n_vl15_dropped;
  620. u32 n_rc_timeouts;
  621. u32 n_dmawait;
  622. u32 n_unaligned;
  623. u32 n_rc_dupreq;
  624. u32 n_rc_seqnak;
  625. u32 port_cap_flags;
  626. u32 pma_sample_start;
  627. u32 pma_sample_interval;
  628. __be16 pma_counter_select[5];
  629. u16 pma_tag;
  630. u16 pkey_violations;
  631. u16 qkey_violations;
  632. u16 mkey_violations;
  633. u16 mkey_lease_period;
  634. u16 sm_lid;
  635. u16 repress_traps;
  636. u8 sm_sl;
  637. u8 mkeyprot;
  638. u8 subnet_timeout;
  639. u8 vl_high_limit;
  640. u8 sl_to_vl[16];
  641. struct qib_opcode_stats opstats[128];
  642. };
  643. struct qib_ibdev {
  644. struct ib_device ibdev;
  645. struct list_head pending_mmaps;
  646. spinlock_t mmap_offset_lock; /* protect mmap_offset */
  647. u32 mmap_offset;
  648. struct qib_mregion *dma_mr;
  649. /* QP numbers are shared by all IB ports */
  650. struct qib_qpn_table qpn_table;
  651. struct qib_lkey_table lk_table;
  652. struct list_head piowait; /* list for wait PIO buf */
  653. struct list_head dmawait; /* list for wait DMA */
  654. struct list_head txwait; /* list for wait qib_verbs_txreq */
  655. struct list_head memwait; /* list for wait kernel memory */
  656. struct list_head txreq_free;
  657. struct timer_list mem_timer;
  658. struct qib_qp **qp_table;
  659. struct qib_pio_header *pio_hdrs;
  660. dma_addr_t pio_hdrs_phys;
  661. /* list of QPs waiting for RNR timer */
  662. spinlock_t pending_lock; /* protect wait lists, PMA counters, etc. */
  663. unsigned qp_table_size; /* size of the hash table */
  664. spinlock_t qpt_lock;
  665. u32 n_piowait;
  666. u32 n_txwait;
  667. u32 n_pds_allocated; /* number of PDs allocated for device */
  668. spinlock_t n_pds_lock;
  669. u32 n_ahs_allocated; /* number of AHs allocated for device */
  670. spinlock_t n_ahs_lock;
  671. u32 n_cqs_allocated; /* number of CQs allocated for device */
  672. spinlock_t n_cqs_lock;
  673. u32 n_qps_allocated; /* number of QPs allocated for device */
  674. spinlock_t n_qps_lock;
  675. u32 n_srqs_allocated; /* number of SRQs allocated for device */
  676. spinlock_t n_srqs_lock;
  677. u32 n_mcast_grps_allocated; /* number of mcast groups allocated */
  678. spinlock_t n_mcast_grps_lock;
  679. };
  680. struct qib_verbs_counters {
  681. u64 symbol_error_counter;
  682. u64 link_error_recovery_counter;
  683. u64 link_downed_counter;
  684. u64 port_rcv_errors;
  685. u64 port_rcv_remphys_errors;
  686. u64 port_xmit_discards;
  687. u64 port_xmit_data;
  688. u64 port_rcv_data;
  689. u64 port_xmit_packets;
  690. u64 port_rcv_packets;
  691. u32 local_link_integrity_errors;
  692. u32 excessive_buffer_overrun_errors;
  693. u32 vl15_dropped;
  694. };
  695. static inline struct qib_mr *to_imr(struct ib_mr *ibmr)
  696. {
  697. return container_of(ibmr, struct qib_mr, ibmr);
  698. }
  699. static inline struct qib_pd *to_ipd(struct ib_pd *ibpd)
  700. {
  701. return container_of(ibpd, struct qib_pd, ibpd);
  702. }
  703. static inline struct qib_ah *to_iah(struct ib_ah *ibah)
  704. {
  705. return container_of(ibah, struct qib_ah, ibah);
  706. }
  707. static inline struct qib_cq *to_icq(struct ib_cq *ibcq)
  708. {
  709. return container_of(ibcq, struct qib_cq, ibcq);
  710. }
  711. static inline struct qib_srq *to_isrq(struct ib_srq *ibsrq)
  712. {
  713. return container_of(ibsrq, struct qib_srq, ibsrq);
  714. }
  715. static inline struct qib_qp *to_iqp(struct ib_qp *ibqp)
  716. {
  717. return container_of(ibqp, struct qib_qp, ibqp);
  718. }
  719. static inline struct qib_ibdev *to_idev(struct ib_device *ibdev)
  720. {
  721. return container_of(ibdev, struct qib_ibdev, ibdev);
  722. }
  723. /*
  724. * Send if not busy or waiting for I/O and either
  725. * a RC response is pending or we can process send work requests.
  726. */
  727. static inline int qib_send_ok(struct qib_qp *qp)
  728. {
  729. return !(qp->s_flags & (QIB_S_BUSY | QIB_S_ANY_WAIT_IO)) &&
  730. (qp->s_hdrwords || (qp->s_flags & QIB_S_RESP_PENDING) ||
  731. !(qp->s_flags & QIB_S_ANY_WAIT_SEND));
  732. }
  733. extern struct workqueue_struct *qib_wq;
  734. extern struct workqueue_struct *qib_cq_wq;
  735. /*
  736. * This must be called with s_lock held.
  737. */
  738. static inline void qib_schedule_send(struct qib_qp *qp)
  739. {
  740. if (qib_send_ok(qp))
  741. queue_work(qib_wq, &qp->s_work);
  742. }
  743. static inline int qib_pkey_ok(u16 pkey1, u16 pkey2)
  744. {
  745. u16 p1 = pkey1 & 0x7FFF;
  746. u16 p2 = pkey2 & 0x7FFF;
  747. /*
  748. * Low 15 bits must be non-zero and match, and
  749. * one of the two must be a full member.
  750. */
  751. return p1 && p1 == p2 && ((__s16)pkey1 < 0 || (__s16)pkey2 < 0);
  752. }
  753. void qib_bad_pqkey(struct qib_ibport *ibp, __be16 trap_num, u32 key, u32 sl,
  754. u32 qp1, u32 qp2, __be16 lid1, __be16 lid2);
  755. void qib_cap_mask_chg(struct qib_ibport *ibp);
  756. void qib_sys_guid_chg(struct qib_ibport *ibp);
  757. void qib_node_desc_chg(struct qib_ibport *ibp);
  758. int qib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
  759. struct ib_wc *in_wc, struct ib_grh *in_grh,
  760. struct ib_mad *in_mad, struct ib_mad *out_mad);
  761. int qib_create_agents(struct qib_ibdev *dev);
  762. void qib_free_agents(struct qib_ibdev *dev);
  763. /*
  764. * Compare the lower 24 bits of the two values.
  765. * Returns an integer <, ==, or > than zero.
  766. */
  767. static inline int qib_cmp24(u32 a, u32 b)
  768. {
  769. return (((int) a) - ((int) b)) << 8;
  770. }
  771. struct qib_mcast *qib_mcast_find(struct qib_ibport *ibp, union ib_gid *mgid);
  772. int qib_snapshot_counters(struct qib_pportdata *ppd, u64 *swords,
  773. u64 *rwords, u64 *spkts, u64 *rpkts,
  774. u64 *xmit_wait);
  775. int qib_get_counters(struct qib_pportdata *ppd,
  776. struct qib_verbs_counters *cntrs);
  777. int qib_multicast_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid);
  778. int qib_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid);
  779. int qib_mcast_tree_empty(struct qib_ibport *ibp);
  780. __be32 qib_compute_aeth(struct qib_qp *qp);
  781. struct qib_qp *qib_lookup_qpn(struct qib_ibport *ibp, u32 qpn);
  782. struct ib_qp *qib_create_qp(struct ib_pd *ibpd,
  783. struct ib_qp_init_attr *init_attr,
  784. struct ib_udata *udata);
  785. int qib_destroy_qp(struct ib_qp *ibqp);
  786. int qib_error_qp(struct qib_qp *qp, enum ib_wc_status err);
  787. int qib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
  788. int attr_mask, struct ib_udata *udata);
  789. int qib_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
  790. int attr_mask, struct ib_qp_init_attr *init_attr);
  791. unsigned qib_free_all_qps(struct qib_devdata *dd);
  792. void qib_init_qpn_table(struct qib_devdata *dd, struct qib_qpn_table *qpt);
  793. void qib_free_qpn_table(struct qib_qpn_table *qpt);
  794. void qib_get_credit(struct qib_qp *qp, u32 aeth);
  795. unsigned qib_pkt_delay(u32 plen, u8 snd_mult, u8 rcv_mult);
  796. void qib_verbs_sdma_desc_avail(struct qib_pportdata *ppd, unsigned avail);
  797. void qib_put_txreq(struct qib_verbs_txreq *tx);
  798. int qib_verbs_send(struct qib_qp *qp, struct qib_ib_header *hdr,
  799. u32 hdrwords, struct qib_sge_state *ss, u32 len);
  800. void qib_copy_sge(struct qib_sge_state *ss, void *data, u32 length,
  801. int release);
  802. void qib_skip_sge(struct qib_sge_state *ss, u32 length, int release);
  803. void qib_uc_rcv(struct qib_ibport *ibp, struct qib_ib_header *hdr,
  804. int has_grh, void *data, u32 tlen, struct qib_qp *qp);
  805. void qib_rc_rcv(struct qib_ctxtdata *rcd, struct qib_ib_header *hdr,
  806. int has_grh, void *data, u32 tlen, struct qib_qp *qp);
  807. int qib_check_ah(struct ib_device *ibdev, struct ib_ah_attr *ah_attr);
  808. void qib_rc_rnr_retry(unsigned long arg);
  809. void qib_rc_send_complete(struct qib_qp *qp, struct qib_ib_header *hdr);
  810. void qib_rc_error(struct qib_qp *qp, enum ib_wc_status err);
  811. int qib_post_ud_send(struct qib_qp *qp, struct ib_send_wr *wr);
  812. void qib_ud_rcv(struct qib_ibport *ibp, struct qib_ib_header *hdr,
  813. int has_grh, void *data, u32 tlen, struct qib_qp *qp);
  814. int qib_alloc_lkey(struct qib_lkey_table *rkt, struct qib_mregion *mr);
  815. int qib_free_lkey(struct qib_ibdev *dev, struct qib_mregion *mr);
  816. int qib_lkey_ok(struct qib_lkey_table *rkt, struct qib_pd *pd,
  817. struct qib_sge *isge, struct ib_sge *sge, int acc);
  818. int qib_rkey_ok(struct qib_qp *qp, struct qib_sge *sge,
  819. u32 len, u64 vaddr, u32 rkey, int acc);
  820. int qib_post_srq_receive(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
  821. struct ib_recv_wr **bad_wr);
  822. struct ib_srq *qib_create_srq(struct ib_pd *ibpd,
  823. struct ib_srq_init_attr *srq_init_attr,
  824. struct ib_udata *udata);
  825. int qib_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
  826. enum ib_srq_attr_mask attr_mask,
  827. struct ib_udata *udata);
  828. int qib_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr);
  829. int qib_destroy_srq(struct ib_srq *ibsrq);
  830. void qib_cq_enter(struct qib_cq *cq, struct ib_wc *entry, int sig);
  831. int qib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *entry);
  832. struct ib_cq *qib_create_cq(struct ib_device *ibdev, int entries,
  833. int comp_vector, struct ib_ucontext *context,
  834. struct ib_udata *udata);
  835. int qib_destroy_cq(struct ib_cq *ibcq);
  836. int qib_req_notify_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags notify_flags);
  837. int qib_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata);
  838. struct ib_mr *qib_get_dma_mr(struct ib_pd *pd, int acc);
  839. struct ib_mr *qib_reg_phys_mr(struct ib_pd *pd,
  840. struct ib_phys_buf *buffer_list,
  841. int num_phys_buf, int acc, u64 *iova_start);
  842. struct ib_mr *qib_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
  843. u64 virt_addr, int mr_access_flags,
  844. struct ib_udata *udata);
  845. int qib_dereg_mr(struct ib_mr *ibmr);
  846. struct ib_mr *qib_alloc_fast_reg_mr(struct ib_pd *pd, int max_page_list_len);
  847. struct ib_fast_reg_page_list *qib_alloc_fast_reg_page_list(
  848. struct ib_device *ibdev, int page_list_len);
  849. void qib_free_fast_reg_page_list(struct ib_fast_reg_page_list *pl);
  850. int qib_fast_reg_mr(struct qib_qp *qp, struct ib_send_wr *wr);
  851. struct ib_fmr *qib_alloc_fmr(struct ib_pd *pd, int mr_access_flags,
  852. struct ib_fmr_attr *fmr_attr);
  853. int qib_map_phys_fmr(struct ib_fmr *ibfmr, u64 *page_list,
  854. int list_len, u64 iova);
  855. int qib_unmap_fmr(struct list_head *fmr_list);
  856. int qib_dealloc_fmr(struct ib_fmr *ibfmr);
  857. void qib_release_mmap_info(struct kref *ref);
  858. struct qib_mmap_info *qib_create_mmap_info(struct qib_ibdev *dev, u32 size,
  859. struct ib_ucontext *context,
  860. void *obj);
  861. void qib_update_mmap_info(struct qib_ibdev *dev, struct qib_mmap_info *ip,
  862. u32 size, void *obj);
  863. int qib_mmap(struct ib_ucontext *context, struct vm_area_struct *vma);
  864. int qib_get_rwqe(struct qib_qp *qp, int wr_id_only);
  865. void qib_migrate_qp(struct qib_qp *qp);
  866. int qib_ruc_check_hdr(struct qib_ibport *ibp, struct qib_ib_header *hdr,
  867. int has_grh, struct qib_qp *qp, u32 bth0);
  868. u32 qib_make_grh(struct qib_ibport *ibp, struct ib_grh *hdr,
  869. struct ib_global_route *grh, u32 hwords, u32 nwords);
  870. void qib_make_ruc_header(struct qib_qp *qp, struct qib_other_headers *ohdr,
  871. u32 bth0, u32 bth2);
  872. void qib_do_send(struct work_struct *work);
  873. void qib_send_complete(struct qib_qp *qp, struct qib_swqe *wqe,
  874. enum ib_wc_status status);
  875. void qib_send_rc_ack(struct qib_qp *qp);
  876. int qib_make_rc_req(struct qib_qp *qp);
  877. int qib_make_uc_req(struct qib_qp *qp);
  878. int qib_make_ud_req(struct qib_qp *qp);
  879. int qib_register_ib_device(struct qib_devdata *);
  880. void qib_unregister_ib_device(struct qib_devdata *);
  881. void qib_ib_rcv(struct qib_ctxtdata *, void *, void *, u32);
  882. void qib_ib_piobufavail(struct qib_devdata *);
  883. unsigned qib_get_npkeys(struct qib_devdata *);
  884. unsigned qib_get_pkey(struct qib_ibport *, unsigned);
  885. extern const enum ib_wc_opcode ib_qib_wc_opcode[];
  886. /*
  887. * Below HCA-independent IB PhysPortState values, returned
  888. * by the f_ibphys_portstate() routine.
  889. */
  890. #define IB_PHYSPORTSTATE_SLEEP 1
  891. #define IB_PHYSPORTSTATE_POLL 2
  892. #define IB_PHYSPORTSTATE_DISABLED 3
  893. #define IB_PHYSPORTSTATE_CFG_TRAIN 4
  894. #define IB_PHYSPORTSTATE_LINKUP 5
  895. #define IB_PHYSPORTSTATE_LINK_ERR_RECOVER 6
  896. #define IB_PHYSPORTSTATE_CFG_DEBOUNCE 8
  897. #define IB_PHYSPORTSTATE_CFG_IDLE 0xB
  898. #define IB_PHYSPORTSTATE_RECOVERY_RETRAIN 0xC
  899. #define IB_PHYSPORTSTATE_RECOVERY_WAITRMT 0xE
  900. #define IB_PHYSPORTSTATE_RECOVERY_IDLE 0xF
  901. #define IB_PHYSPORTSTATE_CFG_ENH 0x10
  902. #define IB_PHYSPORTSTATE_CFG_WAIT_ENH 0x13
  903. extern const int ib_qib_state_ops[];
  904. extern __be64 ib_qib_sys_image_guid; /* in network order */
  905. extern unsigned int ib_qib_lkey_table_size;
  906. extern unsigned int ib_qib_max_cqes;
  907. extern unsigned int ib_qib_max_cqs;
  908. extern unsigned int ib_qib_max_qp_wrs;
  909. extern unsigned int ib_qib_max_qps;
  910. extern unsigned int ib_qib_max_sges;
  911. extern unsigned int ib_qib_max_mcast_grps;
  912. extern unsigned int ib_qib_max_mcast_qp_attached;
  913. extern unsigned int ib_qib_max_srqs;
  914. extern unsigned int ib_qib_max_srq_sges;
  915. extern unsigned int ib_qib_max_srq_wrs;
  916. extern const u32 ib_qib_rnr_table[];
  917. extern struct ib_dma_mapping_ops qib_dma_mapping_ops;
  918. #endif /* QIB_VERBS_H */