24 #define ARBEL_NUM_PORTS 2 25 #define ARBEL_PORT_BASE 1 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 35 #define ARBEL_RESET_OFFSET 0x0f0010 36 #define ARBEL_RESET_MAGIC 0x01000000UL 37 #define ARBEL_RESET_WAIT_TIME_MS 1000 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 48 #define ARBEL_OPCODE_SEND 0x0a 49 #define ARBEL_OPCODE_RECV_ERROR 0xfe 50 #define ARBEL_OPCODE_SEND_ERROR 0xff 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 89 #define ARBEL_ST_RC 0x00 90 #define ARBEL_ST_UD 0x03 91 #define ARBEL_ST_MLX 0x07 94 #define ARBEL_MTU_2048 0x04 96 #define ARBEL_NO_EQ 64 98 #define ARBEL_INVALID_LKEY 0x00000100UL 100 #define ARBEL_PAGE_SIZE ( ( size_t ) 4096 ) 102 #define ARBEL_RDB_ENTRY_SIZE ( ( size_t ) 32 ) 104 #define ARBEL_DB_POST_SND_OFFSET 0x10 105 #define ARBEL_DB_EQ_OFFSET(_eqn) ( 0x08 * (_eqn) ) 107 #define ARBEL_QPEE_OPT_PARAM_QKEY 0x00000020UL 109 #define ARBEL_MAP_EQ ( 0UL << 31 ) 110 #define ARBEL_UNMAP_EQ ( 1UL << 31 ) 112 #define ARBEL_EV_PORT_STATE_CHANGE 0x09 114 #define ARBEL_LOG_MULTICAST_HASH_SIZE 3 116 #define ARBEL_PM_STATE_ARMED 0x00 117 #define ARBEL_PM_STATE_REARM 0x01 118 #define ARBEL_PM_STATE_MIGRATED 0x03 120 #define ARBEL_RETRY_MAX 0x07 218 #define ARBEL_MAX_GATHER 2 221 struct arbelprm_wqe_segment_next
next;
222 struct arbelprm_wqe_segment_ctrl_send
ctrl;
223 struct arbelprm_wqe_segment_ud
ud;
228 struct arbelprm_wqe_segment_next
next;
229 struct arbelprm_wqe_segment_ctrl_mlx
ctrl;
235 struct arbelprm_wqe_segment_next
next;
236 struct arbelprm_wqe_segment_ctrl_send
ctrl;
240 #define ARBEL_MAX_SCATTER 2 250 struct arbelprm_recv_wqe_segment_next
next;
256 struct arbelprm_completion_queue_entry
normal;
257 struct arbelprm_completion_with_error
error;
267 struct arbelprm_cq_ci_db_record
cq_ci;
268 struct arbelprm_qp_db_record
qp;
272 struct arbelprm_send_doorbell
send;
277 struct arbelprm_eq_set_ci
ci;
282 struct arbelprm_mad_ifc
ifc;
334 #define ARBEL_SEND_WQE_ALIGN 128 338 struct arbelprm_wqe_segment_next
next;
356 #define ARBEL_RECV_WQE_ALIGN 64 379 #define ARBEL_NUM_SPECIAL_QPS 4 386 #define ARBEL_RSVD_SPECIAL_QPS ( ARBEL_NUM_SPECIAL_QPS + 1 ) 392 #define ARBEL_MAX_QPS 8 395 #define ARBEL_QPN_RANDOM_MASK 0xfff000 419 #define ARBEL_MAX_CQS 8 437 #define ARBEL_MAX_EQS 64 457 #define ARBEL_NUM_EQES 4 464 #define ARBEL_BITMASK_SIZE(max_entries) \ 465 ( ( (max_entries) + ( 8 * sizeof ( arbel_bitmask_t ) ) - 1 ) / \ 466 ( 8 * sizeof ( arbel_bitmask_t ) ) ) 536 #define ARBEL_GLOBAL_PD 0x123456 539 #define ARBEL_MKEY_PREFIX 0x77000000UL 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 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 ) 570 #define ARBEL_HCR_INOUT_CMD( _opcode, _in_mbox, _in_len, \ 571 _out_mbox, _out_len ) \ 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 ) ) 578 #define ARBEL_HCR_IN_CMD( _opcode, _in_mbox, _in_len ) \ 579 ARBEL_HCR_INOUT_CMD ( _opcode, _in_mbox, _in_len, 0, 0 ) 581 #define ARBEL_HCR_OUT_CMD( _opcode, _out_mbox, _out_len ) \ 582 ARBEL_HCR_INOUT_CMD ( _opcode, 0, 0, _out_mbox, _out_len ) 584 #define ARBEL_HCR_VOID_CMD( _opcode ) \ 585 ARBEL_HCR_INOUT_CMD ( _opcode, 0, 0, 0, 0 ) 600 #define ARBEL_MAX_DOORBELL_RECORDS 512 601 #define ARBEL_GROUP_SEPARATOR_DOORBELL \ 602 ( ARBEL_MAX_CQS + ARBEL_RSVD_SPECIAL_QPS + ARBEL_MAX_QPS ) 611 static inline unsigned int 624 static inline unsigned int 638 static inline unsigned int 652 static inline unsigned int struct arbelprm_port_state_change_st data
struct arbelprm_wqe_segment_ud ud
struct ib_global_route_header * grh
GRH buffers (if applicable)
An Arbel send work queue entry.
arbel_bitmask_t cq_inuse[ARBEL_BITMASK_SIZE(ARBEL_MAX_CQS)]
Completion queue in-use bitmask.
static unsigned int arbel_cq_arm_doorbell_idx(struct arbel *arbel, struct ib_completion_queue *cq)
Get arm completion queue doorbell index.
static unsigned int arbel_send_doorbell_idx(struct arbel *arbel, struct ib_queue_pair *qp)
Get send work request doorbell index.
unsigned int reserved_srqs
Number of reserved SRQs.
unsigned int reserved_mtts
Number of reserved MTTs.
union arbel_recv_wqe * wqe
Work queue entries.
An Arbel send work queue.
pseudo_bit_t send_queue_drained[0x00001]
pseudo_bit_t srq_catastrophe[0x00001]
void * eq_ci_doorbells
Event queue consumer index doorbells.
pseudo_bit_t clientreregister[0x00001]
uint8_t headers[IB_MAX_HEADER_SIZE]
size_t eeec_entry_size
Extended EE context entry size.
static unsigned int arbel_cq_ci_doorbell_idx(struct arbel *arbel, struct ib_completion_queue *cq)
Get completion queue consumer counter doorbell index.
An Arbel receive work queue entry.
struct ib_device * ibdev[ARBEL_NUM_PORTS]
Infiniband devices.
pseudo_bit_t completion[0x00001]
size_t eqc_entry_size
EQ context entry size.
struct arbelprm_eq_set_ci ci
pseudo_bit_t wq_access_violation[0x00001]
arbel_queue_pair_state
Arbel queue pair state.
struct arbelprm_wqe_segment_data_ptr data[ARBEL_MAX_SCATTER]
void * mailbox_out
Command output mailbox.
unsigned int doorbell_idx
Doorbell record number.
size_t wqe_size
Size of work queue.
struct arbelprm_wqe_segment_data_ptr data[ARBEL_MAX_GATHER]
void * config
PCI configuration registers.
struct arbelprm_mad_ifc ifc
unsigned int reserved_eqs
Number of reserved EQs.
unsigned long eqn
Event queue number.
unsigned int doorbell_idx
Doorbell record number.
pseudo_bit_t reserved1[0x00010]
pseudo_bit_t command_done[0x00001]
unsigned long lkey
Unrestricted LKey.
pseudo_bit_t communication_established[0x00001]
unsigned char pseudo_bit_t
Datatype used to represent a bit in the pseudo-structures.
uint32_t arbel_bitmask_t
An Arbel resource bitmask.
union arbel_send_wqe * wqe
Work queue entries.
struct arbelprm_qp_db_record qp
size_t cqc_entry_size
CQ context entry size.
union arbelprm_doorbell_record * db_rec
Doorbell records.
size_t eqpc_entry_size
Extended QP context entry size.
Access to external ("user") memory.
unsigned int ci_doorbell_idx
Consumer counter doorbell record number.
struct arbel_event_queue eq
Event queue.
pseudo_bit_t qpc_catastrophe[0x00001]
size_t grh_size
Size of GRB buffers.
union arbelprm_event_entry * eqe
Event queue entries.
struct arbelprm_send_doorbell send
struct arbelprm_wqe_segment_next next
unsigned int reserved_rdbs
Number of reserved RDBs.
size_t srqc_entry_size
SRQ context entry size.
#define ARBEL_QPN_RANDOM_MASK
Queue pair number randomisation mask.
struct arbelprm_mlx_send_wqe mlx
uint32_t userptr_t
A pointer to a user buffer.
struct arbelprm_event_queue_entry generic
pseudo_bit_t wq_catastrophe[0x00001]
#define ARBEL_SEND_WQE_ALIGN
Alignment of Arbel send work queue entries.
union arbelprm_completion_entry * cqe
Completion queue entries.
size_t db_rec_offset
Offset within ICM of doorbell records.
struct arbelprm_cq_ci_db_record cq_ci
size_t cqe_size
Size of completion queue.
userptr_t firmware_area
Firmware area in external memory.
struct arbelprm_completion_with_error error
pseudo_bit_t path_migration_failed[0x00001]
unsigned int arm_doorbell_idx
Arm queue doorbell record number.
size_t eqe_size
Size of event queue.
An Arbel receive work queue.
An Arbel completion queue.
pseudo_bit_t cq_error[0x00001]
pseudo_bit_t gpio[0x00001]
size_t mtt_entry_size
MTT entry size.
#define ARBEL_MAX_CQS
Maximum number of allocatable completion queues.
struct arbelprm_completion_queue_entry normal
struct arbelprm_wqe_segment_next next
pseudo_bit_t srq_rq_limit[0x00001]
unsigned int reserved_cqs
Number of reserved CQs.
size_t eec_entry_size
EE context entry size.
void * uar
PCI user Access Region.
An Infiniband Completion Queue.
void * doorbell
Doorbell register.
pseudo_bit_t reserved[0x00020]
pseudo_bit_t reserved0[0x00020]
size_t wqe_size
Size of work queue.
uint8_t force_align[ARBEL_SEND_WQE_ALIGN]
enum arbel_queue_pair_state state
Queue state.
struct arbelprm_wqe_segment_next next
unsigned int reserved_mrws
Number of reserved MRWs.
unsigned int reserved_ees
Number of reserved EEs.
size_t icm_aux_len
ICM AUX size.
pseudo_bit_t port_state_change[0x00001]
struct arbelprm_wqe_segment_next next
pseudo_bit_t path_migration_armed[0x00001]
unsigned long qpn_base
QPN base.
struct arbelprm_ud_send_wqe ud
An Infiniband Queue Pair.
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.
struct arbelprm_qp_db_record qp
pseudo_bit_t reserved3[0x00008]
struct arbelprm_wqe_segment_ctrl_send ctrl
struct arbelprm_port_state_change_event port_state_change
unsigned int reserved_qps
Number of reserved QPs.
pseudo_bit_t reserved0[0x00020]
size_t qpc_entry_size
QP context entry size.
size_t firmware_len
Firmware size.
pseudo_bit_t wq_invalid_request[0x00001]
size_t uar_scratch_entry_size
UAR scratchpad entry size.
struct arbelprm_rc_send_wqe rc
struct arbelprm_wqe_segment_ctrl_mlx ctrl
pseudo_bit_t reserved1[0x00001]
struct arbelprm_recv_wqe_segment_next next
struct arbel_dev_limits limits
Device limits.
#define ARBEL_MAX_SCATTER
Infiniband packet format.
struct arbelprm_recv_wqe recv
uint8_t force_align[ARBEL_RECV_WQE_ALIGN]
unsigned long cqn
Completion queue number.
pseudo_bit_t srq_last_wqe[0x00001]
unsigned int open_count
Device open request counter.
struct arbel_dev_limits __attribute__
unsigned long next_idx
Next event queue entry index.
unsigned long special_qpn_base
Special QPN base.
struct arbel_recv_work_queue recv
Receive work queue.
unsigned int reserved_uars
Number of reserved UARs.
pseudo_bit_t reserved2[0x00005]
struct pci_device * pci
PCI device.
#define ARBEL_RECV_WQE_ALIGN
Alignment of Arbel receive work queue entries.
pseudo_bit_t value[0x00020]
struct arbelprm_wqe_segment_data_ptr data[ARBEL_MAX_GATHER]
struct arbelprm_cq_arm_db_record cq_arm
struct arbelprm_wqe_segment_ctrl_send ctrl
struct arbelprm_wqe_segment_data_ptr data[ARBEL_MAX_GATHER]
struct arbel_send_work_queue send
Send work queue.
struct MLX_DECLARE_STRUCT(arbelprm_access_lam)
pseudo_bit_t reserved0[0x00020]
arbel_bitmask_t qp_inuse[ARBEL_BITMASK_SIZE(ARBEL_MAX_QPS)]
Queue pair in-use bitmask.
#define ARBEL_BITMASK_SIZE(max_entries)
Size of an Arbel resource bitmask.
pseudo_bit_t hash[0x00010]
#define IB_MAX_HEADER_SIZE
Maximum size required for IB headers.
size_t mpt_entry_size
MPT entry size.
void * mailbox_in
Command input mailbox.
#define ARBEL_MAX_QPS
Maximum number of allocatable queue pairs.
#define ARBEL_MAX_DOORBELL_RECORDS
pseudo_bit_t path_migration_succeeded[0x00001]