iPXE
arbel.h
Go to the documentation of this file.
1 #ifndef _ARBEL_H
2 #define _ARBEL_H
3 
4 /** @file
5  *
6  * Mellanox Arbel Infiniband HCA driver
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 
12 #include <stdint.h>
13 #include <ipxe/uaccess.h>
14 #include <ipxe/ib_packet.h>
15 #include "mlx_bitops.h"
16 #include "MT25218_PRM.h"
17 
18 /*
19  * Hardware constants
20  *
21  */
22 
23 /* Ports in existence */
24 #define ARBEL_NUM_PORTS 2
25 #define ARBEL_PORT_BASE 1
26 
27 /* PCI BARs */
28 #define ARBEL_PCI_CONFIG_BAR PCI_BASE_ADDRESS_0
29 #define ARBEL_PCI_CONFIG_BAR_SIZE 0x100000
30 #define ARBEL_PCI_UAR_BAR PCI_BASE_ADDRESS_2
31 #define ARBEL_PCI_UAR_IDX 1
32 #define ARBEL_PCI_UAR_SIZE 0x1000
33 
34 /* Device reset */
35 #define ARBEL_RESET_OFFSET 0x0f0010
36 #define ARBEL_RESET_MAGIC 0x01000000UL
37 #define ARBEL_RESET_WAIT_TIME_MS 1000
38 
39 /* UAR context table (UCE) resource types */
40 #define ARBEL_UAR_RES_NONE 0x00
41 #define ARBEL_UAR_RES_CQ_CI 0x01
42 #define ARBEL_UAR_RES_CQ_ARM 0x02
43 #define ARBEL_UAR_RES_SQ 0x03
44 #define ARBEL_UAR_RES_RQ 0x04
45 #define ARBEL_UAR_RES_GROUP_SEP 0x07
46 
47 /* Work queue entry and completion queue entry opcodes */
48 #define ARBEL_OPCODE_SEND 0x0a
49 #define ARBEL_OPCODE_RECV_ERROR 0xfe
50 #define ARBEL_OPCODE_SEND_ERROR 0xff
51 
52 /* HCA command register opcodes */
53 #define ARBEL_HCR_QUERY_DEV_LIM 0x0003
54 #define ARBEL_HCR_QUERY_FW 0x0004
55 #define ARBEL_HCR_INIT_HCA 0x0007
56 #define ARBEL_HCR_CLOSE_HCA 0x0008
57 #define ARBEL_HCR_INIT_IB 0x0009
58 #define ARBEL_HCR_CLOSE_IB 0x000a
59 #define ARBEL_HCR_SW2HW_MPT 0x000d
60 #define ARBEL_HCR_MAP_EQ 0x0012
61 #define ARBEL_HCR_SW2HW_EQ 0x0013
62 #define ARBEL_HCR_HW2SW_EQ 0x0014
63 #define ARBEL_HCR_SW2HW_CQ 0x0016
64 #define ARBEL_HCR_HW2SW_CQ 0x0017
65 #define ARBEL_HCR_QUERY_CQ 0x0018
66 #define ARBEL_HCR_RST2INIT_QPEE 0x0019
67 #define ARBEL_HCR_INIT2RTR_QPEE 0x001a
68 #define ARBEL_HCR_RTR2RTS_QPEE 0x001b
69 #define ARBEL_HCR_RTS2RTS_QPEE 0x001c
70 #define ARBEL_HCR_2RST_QPEE 0x0021
71 #define ARBEL_HCR_QUERY_QPEE 0x0022
72 #define ARBEL_HCR_CONF_SPECIAL_QP 0x0023
73 #define ARBEL_HCR_MAD_IFC 0x0024
74 #define ARBEL_HCR_READ_MGM 0x0025
75 #define ARBEL_HCR_WRITE_MGM 0x0026
76 #define ARBEL_HCR_MGID_HASH 0x0027
77 #define ARBEL_HCR_RUN_FW 0x0ff6
78 #define ARBEL_HCR_DISABLE_LAM 0x0ff7
79 #define ARBEL_HCR_ENABLE_LAM 0x0ff8
80 #define ARBEL_HCR_UNMAP_ICM 0x0ff9
81 #define ARBEL_HCR_MAP_ICM 0x0ffa
82 #define ARBEL_HCR_UNMAP_ICM_AUX 0x0ffb
83 #define ARBEL_HCR_MAP_ICM_AUX 0x0ffc
84 #define ARBEL_HCR_SET_ICM_SIZE 0x0ffd
85 #define ARBEL_HCR_UNMAP_FA 0x0ffe
86 #define ARBEL_HCR_MAP_FA 0x0fff
87 
88 /* Service types */
89 #define ARBEL_ST_RC 0x00
90 #define ARBEL_ST_UD 0x03
91 #define ARBEL_ST_MLX 0x07
92 
93 /* MTUs */
94 #define ARBEL_MTU_2048 0x04
95 
96 #define ARBEL_NO_EQ 64
97 
98 #define ARBEL_INVALID_LKEY 0x00000100UL
99 
100 #define ARBEL_PAGE_SIZE ( ( size_t ) 4096 )
101 
102 #define ARBEL_RDB_ENTRY_SIZE ( ( size_t ) 32 )
103 
104 #define ARBEL_DB_POST_SND_OFFSET 0x10
105 #define ARBEL_DB_EQ_OFFSET(_eqn) ( 0x08 * (_eqn) )
106 
107 #define ARBEL_QPEE_OPT_PARAM_QKEY 0x00000020UL
108 
109 #define ARBEL_MAP_EQ ( 0UL << 31 )
110 #define ARBEL_UNMAP_EQ ( 1UL << 31 )
111 
112 #define ARBEL_EV_PORT_STATE_CHANGE 0x09
113 
114 #define ARBEL_LOG_MULTICAST_HASH_SIZE 3
115 
116 #define ARBEL_PM_STATE_ARMED 0x00
117 #define ARBEL_PM_STATE_REARM 0x01
118 #define ARBEL_PM_STATE_MIGRATED 0x03
119 
120 #define ARBEL_RETRY_MAX 0x07
121 
122 /*
123  * Datatypes that seem to be missing from the autogenerated documentation
124  *
125  */
128 /* -------------- */
129  pseudo_bit_t hash[0x00010];
131 } __attribute__ (( packed ));
132 
135 /* -------------- */
136  pseudo_bit_t value[0x00020];
137 } __attribute__ (( packed ));
138 
141 /* -------------- */
159  pseudo_bit_t gpio[0x00001];
163 } __attribute__ (( packed ));
164 
166  pseudo_bit_t ci[0x00020];
167 } __attribute__ (( packed ));
168 
172 } __attribute__ (( packed ));
173 
174 /*
175  * Wrapper structures for hardware datatypes
176  *
177  */
178 
179 struct MLX_DECLARE_STRUCT ( arbelprm_access_lam );
180 struct MLX_DECLARE_STRUCT ( arbelprm_completion_queue_context );
181 struct MLX_DECLARE_STRUCT ( arbelprm_completion_queue_entry );
182 struct MLX_DECLARE_STRUCT ( arbelprm_completion_with_error );
183 struct MLX_DECLARE_STRUCT ( arbelprm_cq_arm_db_record );
184 struct MLX_DECLARE_STRUCT ( arbelprm_cq_ci_db_record );
185 struct MLX_DECLARE_STRUCT ( arbelprm_event_mask );
186 struct MLX_DECLARE_STRUCT ( arbelprm_event_queue_entry );
187 struct MLX_DECLARE_STRUCT ( arbelprm_eq_set_ci );
188 struct MLX_DECLARE_STRUCT ( arbelprm_eqc );
189 struct MLX_DECLARE_STRUCT ( arbelprm_hca_command_register );
190 struct MLX_DECLARE_STRUCT ( arbelprm_init_hca );
191 struct MLX_DECLARE_STRUCT ( arbelprm_init_ib );
192 struct MLX_DECLARE_STRUCT ( arbelprm_mad_ifc );
193 struct MLX_DECLARE_STRUCT ( arbelprm_mgm_entry );
194 struct MLX_DECLARE_STRUCT ( arbelprm_mgm_hash );
195 struct MLX_DECLARE_STRUCT ( arbelprm_mpt );
196 struct MLX_DECLARE_STRUCT ( arbelprm_port_state_change_event );
197 struct MLX_DECLARE_STRUCT ( arbelprm_qp_db_record );
198 struct MLX_DECLARE_STRUCT ( arbelprm_qp_ee_state_transitions );
199 struct MLX_DECLARE_STRUCT ( arbelprm_query_dev_lim );
200 struct MLX_DECLARE_STRUCT ( arbelprm_query_fw );
201 struct MLX_DECLARE_STRUCT ( arbelprm_queue_pair_ee_context_entry );
202 struct MLX_DECLARE_STRUCT ( arbelprm_recv_wqe_segment_next );
203 struct MLX_DECLARE_STRUCT ( arbelprm_scalar_parameter );
204 struct MLX_DECLARE_STRUCT ( arbelprm_send_doorbell );
205 struct MLX_DECLARE_STRUCT ( arbelprm_ud_address_vector );
206 struct MLX_DECLARE_STRUCT ( arbelprm_virtual_physical_mapping );
207 struct MLX_DECLARE_STRUCT ( arbelprm_wqe_segment_ctrl_mlx );
208 struct MLX_DECLARE_STRUCT ( arbelprm_wqe_segment_ctrl_send );
209 struct MLX_DECLARE_STRUCT ( arbelprm_wqe_segment_data_ptr );
210 struct MLX_DECLARE_STRUCT ( arbelprm_wqe_segment_next );
211 struct MLX_DECLARE_STRUCT ( arbelprm_wqe_segment_ud );
212 
213 /*
214  * Composite hardware datatypes
215  *
216  */
217 
218 #define ARBEL_MAX_GATHER 2
219 
221  struct arbelprm_wqe_segment_next next;
222  struct arbelprm_wqe_segment_ctrl_send ctrl;
223  struct arbelprm_wqe_segment_ud ud;
224  struct arbelprm_wqe_segment_data_ptr data[ARBEL_MAX_GATHER];
225 } __attribute__ (( packed ));
226 
228  struct arbelprm_wqe_segment_next next;
229  struct arbelprm_wqe_segment_ctrl_mlx ctrl;
230  struct arbelprm_wqe_segment_data_ptr data[ARBEL_MAX_GATHER];
232 } __attribute__ (( packed ));
233 
235  struct arbelprm_wqe_segment_next next;
236  struct arbelprm_wqe_segment_ctrl_send ctrl;
237  struct arbelprm_wqe_segment_data_ptr data[ARBEL_MAX_GATHER];
238 } __attribute__ (( packed ));
239 
240 #define ARBEL_MAX_SCATTER 2
241 
243  /* The autogenerated header is inconsistent between send and
244  * receive WQEs. The "ctrl" structure for receive WQEs is
245  * defined to include the "next" structure. Since the "ctrl"
246  * part of the "ctrl" structure contains only "reserved, must
247  * be zero" bits, we ignore its definition and provide
248  * something more usable.
249  */
250  struct arbelprm_recv_wqe_segment_next next;
251  uint32_t ctrl[2]; /* All "reserved, must be zero" */
252  struct arbelprm_wqe_segment_data_ptr data[ARBEL_MAX_SCATTER];
253 } __attribute__ (( packed ));
254 
256  struct arbelprm_completion_queue_entry normal;
257  struct arbelprm_completion_with_error error;
258 } __attribute__ (( packed ));
259 
261  struct arbelprm_event_queue_entry generic;
262  struct arbelprm_port_state_change_event port_state_change;
263 } __attribute__ (( packed ));
264 
266  struct arbelprm_cq_arm_db_record cq_arm;
267  struct arbelprm_cq_ci_db_record cq_ci;
268  struct arbelprm_qp_db_record qp;
269 } __attribute__ (( packed ));
270 
272  struct arbelprm_send_doorbell send;
274 } __attribute__ (( packed ));
275 
277  struct arbelprm_eq_set_ci ci;
279 } __attribute__ (( packed ));
280 
282  struct arbelprm_mad_ifc ifc;
283  union ib_mad mad;
284 } __attribute__ (( packed ));
285 
286 /*
287  * iPXE-specific definitions
288  *
289  */
290 
291 /** Arbel device limits */
293  /** Number of reserved QPs */
294  unsigned int reserved_qps;
295  /** QP context entry size */
297  /** Extended QP context entry size */
299  /** Number of reserved SRQs */
300  unsigned int reserved_srqs;
301  /** SRQ context entry size */
303  /** Number of reserved EEs */
304  unsigned int reserved_ees;
305  /** EE context entry size */
307  /** Extended EE context entry size */
309  /** Number of reserved CQs */
310  unsigned int reserved_cqs;
311  /** CQ context entry size */
313  /** Number of reserved EQs */
314  unsigned int reserved_eqs;
315  /** Number of reserved MTTs */
316  unsigned int reserved_mtts;
317  /** MTT entry size */
319  /** Number of reserved MRWs */
320  unsigned int reserved_mrws;
321  /** MPT entry size */
323  /** Number of reserved RDBs */
324  unsigned int reserved_rdbs;
325  /** EQ context entry size */
327  /** Number of reserved UARs */
328  unsigned int reserved_uars;
329  /** UAR scratchpad entry size */
331 };
332 
333 /** Alignment of Arbel send work queue entries */
334 #define ARBEL_SEND_WQE_ALIGN 128
335 
336 /** An Arbel send work queue entry */
338  struct arbelprm_wqe_segment_next next;
343 } __attribute__ (( packed ));
344 
345 /** An Arbel send work queue */
347  /** Doorbell record number */
348  unsigned int doorbell_idx;
349  /** Work queue entries */
351  /** Size of work queue */
352  size_t wqe_size;
353 };
354 
355 /** Alignment of Arbel receive work queue entries */
356 #define ARBEL_RECV_WQE_ALIGN 64
357 
358 /** An Arbel receive work queue entry */
362 } __attribute__ (( packed ));
363 
364 /** An Arbel receive work queue */
366  /** Doorbell record number */
367  unsigned int doorbell_idx;
368  /** Work queue entries */
370  /** Size of work queue */
371  size_t wqe_size;
372  /** GRH buffers (if applicable) */
374  /** Size of GRB buffers */
375  size_t grh_size;
376 };
377 
378 /** Number of special queue pairs */
379 #define ARBEL_NUM_SPECIAL_QPS 4
380 
381 /** Number of queue pairs reserved for the "special QP" block
382  *
383  * The special QPs must be in (2n,2n+1) pairs, hence we need to
384  * reserve one extra QP to allow for alignment.
385  */
386 #define ARBEL_RSVD_SPECIAL_QPS ( ARBEL_NUM_SPECIAL_QPS + 1 )
387 
388 /** Maximum number of allocatable queue pairs
389  *
390  * This is a policy decision, not a device limit.
391  */
392 #define ARBEL_MAX_QPS 8
393 
394 /** Queue pair number randomisation mask */
395 #define ARBEL_QPN_RANDOM_MASK 0xfff000
396 
397 /** Arbel queue pair state */
403 };
404 
405 /** An Arbel queue pair */
407  /** Send work queue */
409  /** Receive work queue */
411  /** Queue state */
413 };
414 
415 /** Maximum number of allocatable completion queues
416  *
417  * This is a policy decision, not a device limit.
418  */
419 #define ARBEL_MAX_CQS 8
420 
421 /** An Arbel completion queue */
423  /** Consumer counter doorbell record number */
424  unsigned int ci_doorbell_idx;
425  /** Arm queue doorbell record number */
426  unsigned int arm_doorbell_idx;
427  /** Completion queue entries */
429  /** Size of completion queue */
430  size_t cqe_size;
431 };
432 
433 /** Maximum number of allocatable event queues
434  *
435  * This is a policy decision, not a device limit.
436  */
437 #define ARBEL_MAX_EQS 64
438 
439 /** A Arbel event queue */
441  /** Event queue entries */
443  /** Size of event queue */
444  size_t eqe_size;
445  /** Event queue number */
446  unsigned long eqn;
447  /** Next event queue entry index */
448  unsigned long next_idx;
449  /** Doorbell register */
450  void *doorbell;
451 };
452 
453 /** Number of event queue entries
454  *
455  * This is a policy decision.
456  */
457 #define ARBEL_NUM_EQES 4
458 
459 
460 /** An Arbel resource bitmask */
462 
463 /** Size of an Arbel resource bitmask */
464 #define ARBEL_BITMASK_SIZE(max_entries) \
465  ( ( (max_entries) + ( 8 * sizeof ( arbel_bitmask_t ) ) - 1 ) / \
466  ( 8 * sizeof ( arbel_bitmask_t ) ) )
467 
468 /** An Arbel device */
469 struct arbel {
470  /** PCI device */
471  struct pci_device *pci;
472  /** PCI configuration registers */
473  void *config;
474  /** PCI user Access Region */
475  void *uar;
476  /** Event queue consumer index doorbells */
478 
479  /** Command input mailbox */
480  void *mailbox_in;
481  /** Command output mailbox */
482  void *mailbox_out;
483 
484  /** Device open request counter */
485  unsigned int open_count;
486 
487  /** Firmware size */
488  size_t firmware_len;
489  /** Firmware area in external memory
490  *
491  * This is allocated when first needed, and freed only on
492  * final teardown, in order to avoid memory map changes at
493  * runtime.
494  */
496  /** ICM size */
497  size_t icm_len;
498  /** ICM AUX size */
499  size_t icm_aux_len;
500  /** ICM area
501  *
502  * This is allocated when first needed, and freed only on
503  * final teardown, in order to avoid memory map changes at
504  * runtime.
505  */
507  /** Offset within ICM of doorbell records */
509  /** Doorbell records */
511  /** Event queue */
513  /** Unrestricted LKey
514  *
515  * Used to get unrestricted memory access.
516  */
517  unsigned long lkey;
518 
519  /** Completion queue in-use bitmask */
521  /** Queue pair in-use bitmask */
523 
524  /** Device limits */
526  /** Special QPN base */
527  unsigned long special_qpn_base;
528  /** QPN base */
529  unsigned long qpn_base;
530 
531  /** Infiniband devices */
533 };
534 
535 /** Global protection domain */
536 #define ARBEL_GLOBAL_PD 0x123456
537 
538 /** Memory key prefix */
539 #define ARBEL_MKEY_PREFIX 0x77000000UL
540 
541 /*
542  * HCA commands
543  *
544  */
545 
546 #define ARBEL_HCR_BASE 0x80680
547 #define ARBEL_HCR_REG(x) ( ARBEL_HCR_BASE + 4 * (x) )
548 #define ARBEL_HCR_MAX_WAIT_MS 2000
549 #define ARBEL_MBOX_ALIGN 4096
550 #define ARBEL_MBOX_SIZE 512
551 
552 /* HCA command is split into
553  *
554  * bits 11:0 Opcode
555  * bit 12 Input uses mailbox
556  * bit 13 Output uses mailbox
557  * bits 22:14 Input parameter length (in dwords)
558  * bits 31:23 Output parameter length (in dwords)
559  *
560  * Encoding the information in this way allows us to cut out several
561  * parameters to the arbel_command() call.
562  */
563 #define ARBEL_HCR_IN_MBOX 0x00001000UL
564 #define ARBEL_HCR_OUT_MBOX 0x00002000UL
565 #define ARBEL_HCR_OPCODE( _command ) ( (_command) & 0xfff )
566 #define ARBEL_HCR_IN_LEN( _command ) ( ( (_command) >> 12 ) & 0x7fc )
567 #define ARBEL_HCR_OUT_LEN( _command ) ( ( (_command) >> 21 ) & 0x7fc )
568 
569 /** Build HCR command from component parts */
570 #define ARBEL_HCR_INOUT_CMD( _opcode, _in_mbox, _in_len, \
571  _out_mbox, _out_len ) \
572  ( (_opcode) | \
573  ( (_in_mbox) ? ARBEL_HCR_IN_MBOX : 0 ) | \
574  ( ( (_in_len) / 4 ) << 14 ) | \
575  ( (_out_mbox) ? ARBEL_HCR_OUT_MBOX : 0 ) | \
576  ( ( (_out_len) / 4 ) << 23 ) )
577 
578 #define ARBEL_HCR_IN_CMD( _opcode, _in_mbox, _in_len ) \
579  ARBEL_HCR_INOUT_CMD ( _opcode, _in_mbox, _in_len, 0, 0 )
580 
581 #define ARBEL_HCR_OUT_CMD( _opcode, _out_mbox, _out_len ) \
582  ARBEL_HCR_INOUT_CMD ( _opcode, 0, 0, _out_mbox, _out_len )
583 
584 #define ARBEL_HCR_VOID_CMD( _opcode ) \
585  ARBEL_HCR_INOUT_CMD ( _opcode, 0, 0, 0, 0 )
586 
587 /*
588  * Doorbell record allocation
589  *
590  * The doorbell record map looks like:
591  *
592  * ARBEL_MAX_CQS * Arm completion queue doorbell
593  * ARBEL_MAX_QPS * Send work request doorbell
594  * Group separator
595  * ...(empty space)...
596  * ARBEL_MAX_QPS * Receive work request doorbell
597  * ARBEL_MAX_CQS * Completion queue consumer counter update doorbell
598  */
599 
600 #define ARBEL_MAX_DOORBELL_RECORDS 512
601 #define ARBEL_GROUP_SEPARATOR_DOORBELL \
602  ( ARBEL_MAX_CQS + ARBEL_RSVD_SPECIAL_QPS + ARBEL_MAX_QPS )
603 
604 /**
605  * Get arm completion queue doorbell index
606  *
607  * @v arbel Arbel device
608  * @v cq Completion queue
609  * @ret doorbell_idx Doorbell index
610  */
611 static inline unsigned int
613  struct ib_completion_queue *cq ) {
614  return ( cq->cqn - arbel->limits.reserved_cqs );
615 }
616 
617 /**
618  * Get send work request doorbell index
619  *
620  * @v arbel Arbel device
621  * @v qp Queue pair
622  * @ret doorbell_idx Doorbell index
623  */
624 static inline unsigned int
626  return ( ARBEL_MAX_CQS +
627  ( ( qp->qpn & ~ARBEL_QPN_RANDOM_MASK ) -
628  arbel->special_qpn_base ) );
629 }
630 
631 /**
632  * Get receive work request doorbell index
633  *
634  * @v arbel Arbel device
635  * @v qp Queue pair
636  * @ret doorbell_idx Doorbell index
637  */
638 static inline unsigned int
641  ( ( qp->qpn & ~ARBEL_QPN_RANDOM_MASK ) -
642  arbel->special_qpn_base ) - 1 );
643 }
644 
645 /**
646  * Get completion queue consumer counter doorbell index
647  *
648  * @v arbel Arbel device
649  * @v cq Completion queue
650  * @ret doorbell_idx Doorbell index
651  */
652 static inline unsigned int
654  struct ib_completion_queue *cq ) {
655  return ( ARBEL_MAX_DOORBELL_RECORDS -
656  ( cq->cqn - arbel->limits.reserved_cqs ) - 1 );
657 }
658 
659 #endif /* _ARBEL_H */
struct arbelprm_port_state_change_st data
Definition: arbel.h:171
struct arbelprm_wqe_segment_ud ud
Definition: arbel.h:223
struct ib_global_route_header * grh
GRH buffers (if applicable)
Definition: arbel.h:373
An Arbel send work queue entry.
Definition: arbel.h:337
arbel_bitmask_t cq_inuse[ARBEL_BITMASK_SIZE(ARBEL_MAX_CQS)]
Completion queue in-use bitmask.
Definition: arbel.h:520
static unsigned int arbel_cq_arm_doorbell_idx(struct arbel *arbel, struct ib_completion_queue *cq)
Get arm completion queue doorbell index.
Definition: arbel.h:612
static unsigned int arbel_send_doorbell_idx(struct arbel *arbel, struct ib_queue_pair *qp)
Get send work request doorbell index.
Definition: arbel.h:625
Arbel device limits.
Definition: arbel.h:292
unsigned int reserved_srqs
Number of reserved SRQs.
Definition: arbel.h:300
unsigned int reserved_mtts
Number of reserved MTTs.
Definition: arbel.h:316
union arbel_recv_wqe * wqe
Work queue entries.
Definition: arbel.h:369
An Arbel send work queue.
Definition: arbel.h:346
userptr_t icm
ICM area.
Definition: arbel.h:506
pseudo_bit_t send_queue_drained[0x00001]
Definition: arbel.h:145
pseudo_bit_t srq_catastrophe[0x00001]
Definition: arbel.h:156
void * eq_ci_doorbells
Event queue consumer index doorbells.
Definition: arbel.h:477
pseudo_bit_t clientreregister[0x00001]
Definition: arbel.h:160
uint8_t headers[IB_MAX_HEADER_SIZE]
Definition: arbel.h:231
size_t eeec_entry_size
Extended EE context entry size.
Definition: arbel.h:308
static unsigned int arbel_cq_ci_doorbell_idx(struct arbel *arbel, struct ib_completion_queue *cq)
Get completion queue consumer counter doorbell index.
Definition: arbel.h:653
An Arbel receive work queue entry.
Definition: arbel.h:359
struct ib_device * ibdev[ARBEL_NUM_PORTS]
Infiniband devices.
Definition: arbel.h:532
pseudo_bit_t completion[0x00001]
Definition: arbel.h:142
size_t eqc_entry_size
EQ context entry size.
Definition: arbel.h:326
struct arbelprm_eq_set_ci ci
Definition: arbel.h:277
pseudo_bit_t wq_access_violation[0x00001]
Definition: arbel.h:155
arbel_queue_pair_state
Arbel queue pair state.
Definition: arbel.h:398
struct arbelprm_wqe_segment_data_ptr data[ARBEL_MAX_SCATTER]
Definition: arbel.h:252
void * mailbox_out
Command output mailbox.
Definition: arbel.h:482
unsigned int doorbell_idx
Doorbell record number.
Definition: arbel.h:367
size_t wqe_size
Size of work queue.
Definition: arbel.h:352
struct arbelprm_wqe_segment_data_ptr data[ARBEL_MAX_GATHER]
Definition: arbel.h:230
void * config
PCI configuration registers.
Definition: arbel.h:473
struct arbelprm_mad_ifc ifc
Definition: arbel.h:282
unsigned int reserved_eqs
Number of reserved EQs.
Definition: arbel.h:314
unsigned long eqn
Event queue number.
Definition: arbel.h:446
unsigned int doorbell_idx
Doorbell record number.
Definition: arbel.h:348
#define ARBEL_MAX_GATHER
Definition: arbel.h:218
pseudo_bit_t reserved1[0x00010]
Definition: arbel.h:130
pseudo_bit_t command_done[0x00001]
Definition: arbel.h:152
unsigned long lkey
Unrestricted LKey.
Definition: arbel.h:517
pseudo_bit_t communication_established[0x00001]
Definition: arbel.h:144
unsigned char pseudo_bit_t
Datatype used to represent a bit in the pseudo-structures.
Definition: nx_bitops.h:37
uint32_t arbel_bitmask_t
An Arbel resource bitmask.
Definition: arbel.h:461
union arbel_send_wqe * wqe
Work queue entries.
Definition: arbel.h:350
struct arbelprm_qp_db_record qp
Definition: arbel.h:268
size_t cqc_entry_size
CQ context entry size.
Definition: arbel.h:312
Definition: arbel.h:260
union arbelprm_doorbell_record * db_rec
Doorbell records.
Definition: arbel.h:510
size_t eqpc_entry_size
Extended QP context entry size.
Definition: arbel.h:298
Access to external ("user") memory.
unsigned int ci_doorbell_idx
Consumer counter doorbell record number.
Definition: arbel.h:424
struct arbel_event_queue eq
Event queue.
Definition: arbel.h:512
pseudo_bit_t qpc_catastrophe[0x00001]
Definition: arbel.h:148
size_t grh_size
Size of GRB buffers.
Definition: arbel.h:375
union arbelprm_event_entry * eqe
Event queue entries.
Definition: arbel.h:442
struct arbelprm_send_doorbell send
Definition: arbel.h:272
An Infiniband device.
Definition: infiniband.h:398
struct arbelprm_wqe_segment_next next
Definition: arbel.h:235
unsigned int reserved_rdbs
Number of reserved RDBs.
Definition: arbel.h:324
size_t srqc_entry_size
SRQ context entry size.
Definition: arbel.h:302
#define ARBEL_QPN_RANDOM_MASK
Queue pair number randomisation mask.
Definition: arbel.h:395
struct arbelprm_mlx_send_wqe mlx
Definition: arbel.h:340
Mellanox bit operations.
struct arbelprm_event_queue_entry generic
Definition: arbel.h:261
pseudo_bit_t wq_catastrophe[0x00001]
Definition: arbel.h:147
#define ARBEL_SEND_WQE_ALIGN
Alignment of Arbel send work queue entries.
Definition: arbel.h:334
union arbelprm_completion_entry * cqe
Completion queue entries.
Definition: arbel.h:428
size_t db_rec_offset
Offset within ICM of doorbell records.
Definition: arbel.h:508
struct arbelprm_cq_ci_db_record cq_ci
Definition: arbel.h:267
size_t cqe_size
Size of completion queue.
Definition: arbel.h:430
An Infiniband Global Route Header.
Definition: ib_packet.h:89
userptr_t firmware_area
Firmware area in external memory.
Definition: arbel.h:495
struct arbelprm_completion_with_error error
Definition: arbel.h:257
pseudo_bit_t path_migration_failed[0x00001]
Definition: arbel.h:149
unsigned int arm_doorbell_idx
Arm queue doorbell record number.
Definition: arbel.h:426
size_t eqe_size
Size of event queue.
Definition: arbel.h:444
union ib_mad mad
Definition: arbel.h:283
An Arbel receive work queue.
Definition: arbel.h:365
An Arbel completion queue.
Definition: arbel.h:422
pseudo_bit_t cq_error[0x00001]
Definition: arbel.h:146
pseudo_bit_t gpio[0x00001]
Definition: arbel.h:159
An Arbel queue pair.
Definition: arbel.h:406
size_t mtt_entry_size
MTT entry size.
Definition: arbel.h:318
#define ARBEL_MAX_CQS
Maximum number of allocatable completion queues.
Definition: arbel.h:419
struct arbelprm_completion_queue_entry normal
Definition: arbel.h:256
struct arbelprm_wqe_segment_next next
Definition: arbel.h:221
A PCI device.
Definition: pci.h:206
pseudo_bit_t srq_rq_limit[0x00001]
Definition: arbel.h:158
unsigned int reserved_cqs
Number of reserved CQs.
Definition: arbel.h:310
size_t eec_entry_size
EE context entry size.
Definition: arbel.h:306
void * uar
PCI user Access Region.
Definition: arbel.h:475
An Infiniband Completion Queue.
Definition: infiniband.h:224
void * doorbell
Doorbell register.
Definition: arbel.h:450
pseudo_bit_t reserved[0x00020]
Definition: arbel.h:170
pseudo_bit_t reserved0[0x00020]
Definition: arbel.h:134
unsigned char uint8_t
Definition: stdint.h:10
size_t wqe_size
Size of work queue.
Definition: arbel.h:371
uint8_t force_align[ARBEL_SEND_WQE_ALIGN]
Definition: arbel.h:342
enum arbel_queue_pair_state state
Queue state.
Definition: arbel.h:412
struct arbelprm_wqe_segment_next next
Definition: arbel.h:338
unsigned int uint32_t
Definition: stdint.h:12
unsigned int reserved_mrws
Number of reserved MRWs.
Definition: arbel.h:320
unsigned int reserved_ees
Number of reserved EEs.
Definition: arbel.h:304
size_t icm_aux_len
ICM AUX size.
Definition: arbel.h:499
pseudo_bit_t port_state_change[0x00001]
Definition: arbel.h:151
struct arbelprm_wqe_segment_next next
Definition: arbel.h:228
pseudo_bit_t path_migration_armed[0x00001]
Definition: arbel.h:161
unsigned long qpn_base
QPN base.
Definition: arbel.h:529
struct arbelprm_ud_send_wqe ud
Definition: arbel.h:339
An Infiniband Queue Pair.
Definition: infiniband.h:157
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static unsigned int arbel_recv_doorbell_idx(struct arbel *arbel, struct ib_queue_pair *qp)
Get receive work request doorbell index.
Definition: arbel.h:639
struct arbelprm_qp_db_record qp
Definition: arbel.h:13
pseudo_bit_t reserved3[0x00008]
Definition: arbel.h:162
struct arbelprm_wqe_segment_ctrl_send ctrl
Definition: arbel.h:236
struct arbelprm_port_state_change_event port_state_change
Definition: arbel.h:262
unsigned int reserved_qps
Number of reserved QPs.
Definition: arbel.h:294
pseudo_bit_t reserved0[0x00020]
Definition: arbel.h:140
#define ARBEL_NUM_PORTS
Definition: arbel.h:24
size_t qpc_entry_size
QP context entry size.
Definition: arbel.h:296
size_t firmware_len
Firmware size.
Definition: arbel.h:488
pseudo_bit_t wq_invalid_request[0x00001]
Definition: arbel.h:154
size_t uar_scratch_entry_size
UAR scratchpad entry size.
Definition: arbel.h:330
uint32_t ctrl[2]
Definition: arbel.h:251
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:341
struct arbelprm_wqe_segment_ctrl_mlx ctrl
Definition: arbel.h:229
pseudo_bit_t reserved1[0x00001]
Definition: arbel.h:150
struct arbelprm_recv_wqe_segment_next next
Definition: arbel.h:250
struct arbel_dev_limits limits
Device limits.
Definition: arbel.h:525
#define ARBEL_MAX_SCATTER
Definition: arbel.h:240
Infiniband packet format.
struct arbelprm_recv_wqe recv
Definition: arbel.h:360
uint8_t force_align[ARBEL_RECV_WQE_ALIGN]
Definition: arbel.h:361
unsigned long cqn
Completion queue number.
Definition: infiniband.h:230
size_t icm_len
ICM size.
Definition: arbel.h:497
A management datagram.
Definition: ib_mad.h:610
pseudo_bit_t srq_last_wqe[0x00001]
Definition: arbel.h:157
unsigned int open_count
Device open request counter.
Definition: arbel.h:485
struct arbel_dev_limits __attribute__
unsigned long next_idx
Next event queue entry index.
Definition: arbel.h:448
unsigned long special_qpn_base
Special QPN base.
Definition: arbel.h:527
struct arbel_recv_work_queue recv
Receive work queue.
Definition: arbel.h:410
unsigned int reserved_uars
Number of reserved UARs.
Definition: arbel.h:328
pseudo_bit_t reserved2[0x00005]
Definition: arbel.h:153
struct pci_device * pci
PCI device.
Definition: arbel.h:471
#define ARBEL_RECV_WQE_ALIGN
Alignment of Arbel receive work queue entries.
Definition: arbel.h:356
pseudo_bit_t value[0x00020]
Definition: arbel.h:136
struct arbelprm_wqe_segment_data_ptr data[ARBEL_MAX_GATHER]
Definition: arbel.h:237
struct arbelprm_cq_arm_db_record cq_arm
Definition: arbel.h:266
struct arbelprm_wqe_segment_ctrl_send ctrl
Definition: arbel.h:222
Definition: arbel.h:255
struct arbelprm_wqe_segment_data_ptr data[ARBEL_MAX_GATHER]
Definition: arbel.h:224
struct arbel_send_work_queue send
Send work queue.
Definition: arbel.h:408
struct MLX_DECLARE_STRUCT(arbelprm_access_lam)
An Arbel device.
Definition: arbel.h:469
pseudo_bit_t reserved0[0x00020]
Definition: arbel.h:127
arbel_bitmask_t qp_inuse[ARBEL_BITMASK_SIZE(ARBEL_MAX_QPS)]
Queue pair in-use bitmask.
Definition: arbel.h:522
unsigned long int dword
Definition: smc9000.h:40
#define ARBEL_BITMASK_SIZE(max_entries)
Size of an Arbel resource bitmask.
Definition: arbel.h:464
pseudo_bit_t hash[0x00010]
Definition: arbel.h:129
A Arbel event queue.
Definition: arbel.h:440
#define IB_MAX_HEADER_SIZE
Maximum size required for IB headers.
Definition: ib_packet.h:156
size_t mpt_entry_size
MPT entry size.
Definition: arbel.h:322
void * mailbox_in
Command input mailbox.
Definition: arbel.h:480
#define ARBEL_MAX_QPS
Maximum number of allocatable queue pairs.
Definition: arbel.h:392
unsigned long userptr_t
A pointer to a user buffer.
Definition: uaccess.h:33
pseudo_bit_t ci[0x00020]
Definition: arbel.h:166
#define ARBEL_MAX_DOORBELL_RECORDS
Definition: arbel.h:600
pseudo_bit_t path_migration_succeeded[0x00001]
Definition: arbel.h:143