iPXE
Data Structures | Macros | Typedefs | Enumerations | Functions
hermon.h File Reference

Mellanox Hermon Infiniband HCA driver. More...

#include <stdint.h>
#include <ipxe/uaccess.h>
#include <ipxe/ib_packet.h>
#include <ipxe/bofm.h>
#include <ipxe/nvsvpd.h>
#include <ipxe/nvo.h>
#include "mlx_bitops.h"
#include "MT25408_PRM.h"

Go to the source code of this file.

Data Structures

struct  hermonprm_mgm_hash_st
 
struct  hermonprm_mcg_entry_st
 
struct  hermonprm_cq_db_record_st
 
struct  hermonprm_send_db_register_st
 
struct  hermonprm_event_db_register_st
 
struct  hermonprm_scalar_parameter_st
 
struct  hermonprm_event_mask_st
 
struct  hermonprm_port_state_change_event_st
 
struct  hermonprm_sense_port_st
 
struct  hermonprm_set_port_ib_st
 
struct  hermonprm_query_port_cap_st
 
struct  hermonprm_set_port_general_context_st
 
struct  hermonprm_set_port_rqp_calc_st
 
struct  hermonprm_set_port_mac_table_st
 
struct  hermonprm_set_port_vlan_st
 
struct  hermonprm_mod_stat_cfg_input_mod_st
 
struct  hermonprm_write_mtt
 
struct  hermonprm_ud_send_wqe
 
struct  hermonprm_mlx_send_wqe
 
struct  hermonprm_rc_send_wqe
 
struct  hermonprm_eth_send_wqe
 
struct  hermonprm_recv_wqe
 
union  hermonprm_completion_entry
 
union  hermonprm_event_entry
 
union  hermonprm_doorbell_register
 
union  hermonprm_mad
 
union  hermonprm_set_port
 
struct  hermon_dev_cap
 Hermon device capabilitiess. More...
 
struct  hermon_icm_map
 Hermon ICM memory map entry. More...
 
struct  hermon_mtt
 A Hermon MTT descriptor. More...
 
union  hermon_send_wqe
 A Hermon send work queue entry. More...
 
struct  hermon_send_work_queue
 A Hermon send work queue. More...
 
union  hermon_recv_wqe
 A Hermon receive work queue entry. More...
 
struct  hermon_recv_work_queue
 A Hermon receive work queue. More...
 
struct  hermon_queue_pair
 A Hermon queue pair. More...
 
struct  hermon_completion_queue
 A Hermon completion queue. More...
 
struct  hermon_event_queue
 A Hermon event queue. More...
 
struct  hermon_port_type
 A Hermon port type. More...
 
struct  hermon_port
 A Hermon port. More...
 
struct  hermon
 A Hermon device. More...
 

Macros

#define HERMON_MAX_PORTS   2
 
#define HERMON_PORT_BASE   1
 
#define HERMON_PCI_CONFIG_BAR   PCI_BASE_ADDRESS_0
 
#define HERMON_PCI_CONFIG_BAR_SIZE   0x100000
 
#define HERMON_PCI_UAR_BAR   PCI_BASE_ADDRESS_2
 
#define HERMON_RESET_OFFSET   0x0f0010
 
#define HERMON_RESET_MAGIC   0x01000000UL
 
#define HERMON_RESET_WAIT_TIME_MS   1000
 
#define HERMON_OPCODE_NOP   0x00
 
#define HERMON_OPCODE_SEND   0x0a
 
#define HERMON_OPCODE_RECV_ERROR   0xfe
 
#define HERMON_OPCODE_SEND_ERROR   0xff
 
#define HERMON_HCR_QUERY_DEV_CAP   0x0003
 
#define HERMON_HCR_QUERY_FW   0x0004
 
#define HERMON_HCR_INIT_HCA   0x0007
 
#define HERMON_HCR_CLOSE_HCA   0x0008
 
#define HERMON_HCR_INIT_PORT   0x0009
 
#define HERMON_HCR_CLOSE_PORT   0x000a
 
#define HERMON_HCR_SET_PORT   0x000c
 
#define HERMON_HCR_SW2HW_MPT   0x000d
 
#define HERMON_HCR_WRITE_MTT   0x0011
 
#define HERMON_HCR_MAP_EQ   0x0012
 
#define HERMON_HCR_SW2HW_EQ   0x0013
 
#define HERMON_HCR_HW2SW_EQ   0x0014
 
#define HERMON_HCR_QUERY_EQ   0x0015
 
#define HERMON_HCR_SW2HW_CQ   0x0016
 
#define HERMON_HCR_HW2SW_CQ   0x0017
 
#define HERMON_HCR_QUERY_CQ   0x0018
 
#define HERMON_HCR_RST2INIT_QP   0x0019
 
#define HERMON_HCR_INIT2RTR_QP   0x001a
 
#define HERMON_HCR_RTR2RTS_QP   0x001b
 
#define HERMON_HCR_RTS2RTS_QP   0x001c
 
#define HERMON_HCR_2RST_QP   0x0021
 
#define HERMON_HCR_QUERY_QP   0x0022
 
#define HERMON_HCR_CONF_SPECIAL_QP   0x0023
 
#define HERMON_HCR_MAD_IFC   0x0024
 
#define HERMON_HCR_READ_MCG   0x0025
 
#define HERMON_HCR_WRITE_MCG   0x0026
 
#define HERMON_HCR_MGID_HASH   0x0027
 
#define HERMON_HCR_MOD_STAT_CFG   0x0034
 
#define HERMON_HCR_QUERY_PORT   0x0043
 
#define HERMON_HCR_SENSE_PORT   0x004d
 
#define HERMON_HCR_RUN_FW   0x0ff6
 
#define HERMON_HCR_DISABLE_LAM   0x0ff7
 
#define HERMON_HCR_ENABLE_LAM   0x0ff8
 
#define HERMON_HCR_UNMAP_ICM   0x0ff9
 
#define HERMON_HCR_MAP_ICM   0x0ffa
 
#define HERMON_HCR_UNMAP_ICM_AUX   0x0ffb
 
#define HERMON_HCR_MAP_ICM_AUX   0x0ffc
 
#define HERMON_HCR_SET_ICM_SIZE   0x0ffd
 
#define HERMON_HCR_UNMAP_FA   0x0ffe
 
#define HERMON_HCR_MAP_FA   0x0fff
 
#define HERMON_ST_RC   0x00
 
#define HERMON_ST_UD   0x03
 
#define HERMON_ST_MLX   0x07
 
#define HERMON_PORT_TYPE_UNKNOWN   0
 
#define HERMON_PORT_TYPE_IB   1
 
#define HERMON_PORT_TYPE_ETH   2
 
#define HERMON_MTU_2048   0x04
 
#define HERMON_MTU_ETH   0x07
 
#define HERMON_INVALID_LKEY   0x00000100UL
 
#define HERMON_PAGE_SIZE   ( ( size_t ) 4096 )
 
#define HERMON_DB_POST_SND_OFFSET   0x14
 
#define HERMON_DB_EQ_OFFSET(_eqn)   ( 0x800 + HERMON_PAGE_SIZE * ( (_eqn) / 4 ) + 0x08 * ( (_eqn) % 4 ) )
 
#define HERMON_QP_OPT_PARAM_PM_STATE   0x00000400UL
 
#define HERMON_QP_OPT_PARAM_QKEY   0x00000020UL
 
#define HERMON_QP_OPT_PARAM_ALT_PATH   0x00000001UL
 
#define HERMON_MAP_EQ   ( 0UL << 31 )
 
#define HERMON_UNMAP_EQ   ( 1UL << 31 )
 
#define HERMON_SET_PORT_GENERAL_PARAM   0x0000
 
#define HERMON_SET_PORT_RECEIVE_QP   0x0100
 
#define HERMON_SET_PORT_MAC_TABLE   0x0200
 
#define HERMON_SET_PORT_VLAN_TABLE   0x0300
 
#define HERMON_SET_PORT_PRIORITY_TABLE   0x0400
 
#define HERMON_SET_PORT_GID_TABLE   0x0500
 
#define HERMON_EV_PORT_STATE_CHANGE   0x09
 
#define HERMON_SCHED_QP0   0x3f
 
#define HERMON_SCHED_DEFAULT   0x83
 
#define HERMON_LOG_MULTICAST_HASH_SIZE   7
 
#define HERMON_PM_STATE_ARMED   0x00
 
#define HERMON_PM_STATE_REARM   0x01
 
#define HERMON_PM_STATE_MIGRATED   0x03
 
#define HERMON_RETRY_MAX   0x07
 
#define HERMON_MOD_STAT_CFG_SET   0x01
 
#define HERMON_MOD_STAT_CFG_QUERY   0x03
 
#define HERMON_VPD_FIELD(port)   PCI_VPD_FIELD ( PCI_VPD_TAG_RW, 'V', ( '5' + (port) - 1 ) )
 
#define HERMON_MAX_GATHER   2
 
#define HERMON_MAX_SCATTER   2
 
#define HERMON_CMPT_MAX_ENTRIES   ( 1 << 24 )
 Number of cMPT entries of each type. More...
 
#define HERMON_UAR_NON_EQ_PAGE   128
 UAR page for doorbell accesses. More...
 
#define HERMON_MAX_MTTS   64
 Maximum number of allocatable MTT entries. More...
 
#define HERMON_SEND_WQE_ALIGN   128
 Alignment of Hermon send work queue entries. More...
 
#define HERMON_RECV_WQE_ALIGN   16
 Alignment of Hermon receive work queue entries. More...
 
#define HERMON_NUM_SPECIAL_QPS   8
 Number of special queue pairs. More...
 
#define HERMON_RSVD_SPECIAL_QPS   ( ( HERMON_NUM_SPECIAL_QPS << 1 ) - 1 )
 Number of queue pairs reserved for the "special QP" block. More...
 
#define HERMON_MAX_QPS   8
 Maximum number of allocatable queue pairs. More...
 
#define HERMON_QPN_RANDOM_MASK   0xfff000
 Queue pair number randomisation mask. More...
 
#define HERMON_MAX_CQS   8
 Maximum number of allocatable completion queues. More...
 
#define HERMON_MAX_EQS   8
 Maximum number of allocatable event queues. More...
 
#define HERMON_NUM_EQES   8
 Number of event queue entries. More...
 
#define HERMON_BITMASK_SIZE(max_entries)
 Size of a hermon resource bitmask. More...
 
#define HERMON_GLOBAL_PD   0x123456
 Global protection domain. More...
 
#define HERMON_MKEY_PREFIX   0x77000000UL
 Memory key prefix. More...
 
#define HERMON_HCR_BASE   0x80680
 
#define HERMON_HCR_REG(x)   ( HERMON_HCR_BASE + 4 * (x) )
 
#define HERMON_HCR_MAX_WAIT_MS   2000
 
#define HERMON_MBOX_ALIGN   4096
 
#define HERMON_MBOX_SIZE   1024
 
#define HERMON_HCR_IN_MBOX   0x00001000UL
 
#define HERMON_HCR_OUT_MBOX   0x00002000UL
 
#define HERMON_HCR_OPCODE(_command)   ( (_command) & 0xfff )
 
#define HERMON_HCR_IN_LEN(_command)   ( ( (_command) >> 12 ) & 0x7fc )
 
#define HERMON_HCR_OUT_LEN(_command)   ( ( (_command) >> 21 ) & 0x7fc )
 
#define HERMON_HCR_INOUT_CMD(_opcode, _in_mbox, _in_len, _out_mbox, _out_len)
 Build HCR command from component parts. More...
 
#define HERMON_HCR_IN_CMD(_opcode, _in_mbox, _in_len)   HERMON_HCR_INOUT_CMD ( _opcode, _in_mbox, _in_len, 0, 0 )
 
#define HERMON_HCR_OUT_CMD(_opcode, _out_mbox, _out_len)   HERMON_HCR_INOUT_CMD ( _opcode, 0, 0, _out_mbox, _out_len )
 
#define HERMON_HCR_VOID_CMD(_opcode)   HERMON_HCR_INOUT_CMD ( _opcode, 0, 0, 0, 0 )
 

Typedefs

typedef uint32_t hermon_bitmask_t
 A Hermon resource bitmask. More...
 

Enumerations

enum  hermon_icm_map_regions {
  HERMON_ICM_QP_CMPT = 0, HERMON_ICM_SRQ_CMPT, HERMON_ICM_CQ_CMPT, HERMON_ICM_EQ_CMPT,
  HERMON_ICM_OTHER, HERMON_ICM_NUM_REGIONS
}
 Discontiguous regions within Hermon ICM. More...
 
enum  hermon_queue_pair_state { HERMON_QP_ST_RST = 0, HERMON_QP_ST_INIT, HERMON_QP_ST_RTR, HERMON_QP_ST_RTS }
 Hermon queue pair state. More...
 

Functions

 FILE_LICENCE (GPL2_OR_LATER)
 
struct MLX_DECLARE_STRUCT (hermonprm_completion_queue_context)
 
struct MLX_DECLARE_STRUCT (hermonprm_completion_queue_entry)
 
struct MLX_DECLARE_STRUCT (hermonprm_completion_with_error)
 
struct MLX_DECLARE_STRUCT (hermonprm_cq_db_record)
 
struct MLX_DECLARE_STRUCT (hermonprm_eqc)
 
struct MLX_DECLARE_STRUCT (hermonprm_event_db_register)
 
struct MLX_DECLARE_STRUCT (hermonprm_event_mask)
 
struct MLX_DECLARE_STRUCT (hermonprm_event_queue_entry)
 
struct MLX_DECLARE_STRUCT (hermonprm_hca_command_register)
 
struct MLX_DECLARE_STRUCT (hermonprm_init_hca)
 
struct MLX_DECLARE_STRUCT (hermonprm_mad_ifc)
 
struct MLX_DECLARE_STRUCT (hermonprm_mcg_entry)
 
struct MLX_DECLARE_STRUCT (hermonprm_mgm_hash)
 
struct MLX_DECLARE_STRUCT (hermonprm_mod_stat_cfg)
 
struct MLX_DECLARE_STRUCT (hermonprm_mod_stat_cfg_input_mod)
 
struct MLX_DECLARE_STRUCT (hermonprm_mpt)
 
struct MLX_DECLARE_STRUCT (hermonprm_mtt)
 
struct MLX_DECLARE_STRUCT (hermonprm_port_state_change_event)
 
struct MLX_DECLARE_STRUCT (hermonprm_qp_db_record)
 
struct MLX_DECLARE_STRUCT (hermonprm_qp_ee_state_transitions)
 
struct MLX_DECLARE_STRUCT (hermonprm_query_dev_cap)
 
struct MLX_DECLARE_STRUCT (hermonprm_query_fw)
 
struct MLX_DECLARE_STRUCT (hermonprm_query_port_cap)
 
struct MLX_DECLARE_STRUCT (hermonprm_queue_pair_ee_context_entry)
 
struct MLX_DECLARE_STRUCT (hermonprm_scalar_parameter)
 
struct MLX_DECLARE_STRUCT (hermonprm_sense_port)
 
struct MLX_DECLARE_STRUCT (hermonprm_send_db_register)
 
struct MLX_DECLARE_STRUCT (hermonprm_set_port_ib)
 
struct MLX_DECLARE_STRUCT (hermonprm_set_port_general_context)
 
struct MLX_DECLARE_STRUCT (hermonprm_set_port_mac_table)
 
struct MLX_DECLARE_STRUCT (hermonprm_set_port_rqp_calc)
 
struct MLX_DECLARE_STRUCT (hermonprm_set_port_vlan)
 
struct MLX_DECLARE_STRUCT (hermonprm_ud_address_vector)
 
struct MLX_DECLARE_STRUCT (hermonprm_virtual_physical_mapping)
 
struct MLX_DECLARE_STRUCT (hermonprm_wqe_segment_ctrl_mlx)
 
struct MLX_DECLARE_STRUCT (hermonprm_wqe_segment_ctrl_send)
 
struct MLX_DECLARE_STRUCT (hermonprm_wqe_segment_data_ptr)
 
struct MLX_DECLARE_STRUCT (hermonprm_wqe_segment_ud)
 

Detailed Description

Mellanox Hermon Infiniband HCA driver.

Definition in file hermon.h.

Macro Definition Documentation

◆ HERMON_MAX_PORTS

#define HERMON_MAX_PORTS   2

Definition at line 27 of file hermon.h.

◆ HERMON_PORT_BASE

#define HERMON_PORT_BASE   1

Definition at line 28 of file hermon.h.

◆ HERMON_PCI_CONFIG_BAR

#define HERMON_PCI_CONFIG_BAR   PCI_BASE_ADDRESS_0

Definition at line 31 of file hermon.h.

◆ HERMON_PCI_CONFIG_BAR_SIZE

#define HERMON_PCI_CONFIG_BAR_SIZE   0x100000

Definition at line 32 of file hermon.h.

◆ HERMON_PCI_UAR_BAR

#define HERMON_PCI_UAR_BAR   PCI_BASE_ADDRESS_2

Definition at line 33 of file hermon.h.

◆ HERMON_RESET_OFFSET

#define HERMON_RESET_OFFSET   0x0f0010

Definition at line 36 of file hermon.h.

◆ HERMON_RESET_MAGIC

#define HERMON_RESET_MAGIC   0x01000000UL

Definition at line 37 of file hermon.h.

◆ HERMON_RESET_WAIT_TIME_MS

#define HERMON_RESET_WAIT_TIME_MS   1000

Definition at line 38 of file hermon.h.

◆ HERMON_OPCODE_NOP

#define HERMON_OPCODE_NOP   0x00

Definition at line 41 of file hermon.h.

◆ HERMON_OPCODE_SEND

#define HERMON_OPCODE_SEND   0x0a

Definition at line 42 of file hermon.h.

◆ HERMON_OPCODE_RECV_ERROR

#define HERMON_OPCODE_RECV_ERROR   0xfe

Definition at line 43 of file hermon.h.

◆ HERMON_OPCODE_SEND_ERROR

#define HERMON_OPCODE_SEND_ERROR   0xff

Definition at line 44 of file hermon.h.

◆ HERMON_HCR_QUERY_DEV_CAP

#define HERMON_HCR_QUERY_DEV_CAP   0x0003

Definition at line 47 of file hermon.h.

◆ HERMON_HCR_QUERY_FW

#define HERMON_HCR_QUERY_FW   0x0004

Definition at line 48 of file hermon.h.

◆ HERMON_HCR_INIT_HCA

#define HERMON_HCR_INIT_HCA   0x0007

Definition at line 49 of file hermon.h.

◆ HERMON_HCR_CLOSE_HCA

#define HERMON_HCR_CLOSE_HCA   0x0008

Definition at line 50 of file hermon.h.

◆ HERMON_HCR_INIT_PORT

#define HERMON_HCR_INIT_PORT   0x0009

Definition at line 51 of file hermon.h.

◆ HERMON_HCR_CLOSE_PORT

#define HERMON_HCR_CLOSE_PORT   0x000a

Definition at line 52 of file hermon.h.

◆ HERMON_HCR_SET_PORT

#define HERMON_HCR_SET_PORT   0x000c

Definition at line 53 of file hermon.h.

◆ HERMON_HCR_SW2HW_MPT

#define HERMON_HCR_SW2HW_MPT   0x000d

Definition at line 54 of file hermon.h.

◆ HERMON_HCR_WRITE_MTT

#define HERMON_HCR_WRITE_MTT   0x0011

Definition at line 55 of file hermon.h.

◆ HERMON_HCR_MAP_EQ

#define HERMON_HCR_MAP_EQ   0x0012

Definition at line 56 of file hermon.h.

◆ HERMON_HCR_SW2HW_EQ

#define HERMON_HCR_SW2HW_EQ   0x0013

Definition at line 57 of file hermon.h.

◆ HERMON_HCR_HW2SW_EQ

#define HERMON_HCR_HW2SW_EQ   0x0014

Definition at line 58 of file hermon.h.

◆ HERMON_HCR_QUERY_EQ

#define HERMON_HCR_QUERY_EQ   0x0015

Definition at line 59 of file hermon.h.

◆ HERMON_HCR_SW2HW_CQ

#define HERMON_HCR_SW2HW_CQ   0x0016

Definition at line 60 of file hermon.h.

◆ HERMON_HCR_HW2SW_CQ

#define HERMON_HCR_HW2SW_CQ   0x0017

Definition at line 61 of file hermon.h.

◆ HERMON_HCR_QUERY_CQ

#define HERMON_HCR_QUERY_CQ   0x0018

Definition at line 62 of file hermon.h.

◆ HERMON_HCR_RST2INIT_QP

#define HERMON_HCR_RST2INIT_QP   0x0019

Definition at line 63 of file hermon.h.

◆ HERMON_HCR_INIT2RTR_QP

#define HERMON_HCR_INIT2RTR_QP   0x001a

Definition at line 64 of file hermon.h.

◆ HERMON_HCR_RTR2RTS_QP

#define HERMON_HCR_RTR2RTS_QP   0x001b

Definition at line 65 of file hermon.h.

◆ HERMON_HCR_RTS2RTS_QP

#define HERMON_HCR_RTS2RTS_QP   0x001c

Definition at line 66 of file hermon.h.

◆ HERMON_HCR_2RST_QP

#define HERMON_HCR_2RST_QP   0x0021

Definition at line 67 of file hermon.h.

◆ HERMON_HCR_QUERY_QP

#define HERMON_HCR_QUERY_QP   0x0022

Definition at line 68 of file hermon.h.

◆ HERMON_HCR_CONF_SPECIAL_QP

#define HERMON_HCR_CONF_SPECIAL_QP   0x0023

Definition at line 69 of file hermon.h.

◆ HERMON_HCR_MAD_IFC

#define HERMON_HCR_MAD_IFC   0x0024

Definition at line 70 of file hermon.h.

◆ HERMON_HCR_READ_MCG

#define HERMON_HCR_READ_MCG   0x0025

Definition at line 71 of file hermon.h.

◆ HERMON_HCR_WRITE_MCG

#define HERMON_HCR_WRITE_MCG   0x0026

Definition at line 72 of file hermon.h.

◆ HERMON_HCR_MGID_HASH

#define HERMON_HCR_MGID_HASH   0x0027

Definition at line 73 of file hermon.h.

◆ HERMON_HCR_MOD_STAT_CFG

#define HERMON_HCR_MOD_STAT_CFG   0x0034

Definition at line 74 of file hermon.h.

◆ HERMON_HCR_QUERY_PORT

#define HERMON_HCR_QUERY_PORT   0x0043

Definition at line 75 of file hermon.h.

◆ HERMON_HCR_SENSE_PORT

#define HERMON_HCR_SENSE_PORT   0x004d

Definition at line 76 of file hermon.h.

◆ HERMON_HCR_RUN_FW

#define HERMON_HCR_RUN_FW   0x0ff6

Definition at line 77 of file hermon.h.

◆ HERMON_HCR_DISABLE_LAM

#define HERMON_HCR_DISABLE_LAM   0x0ff7

Definition at line 78 of file hermon.h.

◆ HERMON_HCR_ENABLE_LAM

#define HERMON_HCR_ENABLE_LAM   0x0ff8

Definition at line 79 of file hermon.h.

◆ HERMON_HCR_UNMAP_ICM

#define HERMON_HCR_UNMAP_ICM   0x0ff9

Definition at line 80 of file hermon.h.

◆ HERMON_HCR_MAP_ICM

#define HERMON_HCR_MAP_ICM   0x0ffa

Definition at line 81 of file hermon.h.

◆ HERMON_HCR_UNMAP_ICM_AUX

#define HERMON_HCR_UNMAP_ICM_AUX   0x0ffb

Definition at line 82 of file hermon.h.

◆ HERMON_HCR_MAP_ICM_AUX

#define HERMON_HCR_MAP_ICM_AUX   0x0ffc

Definition at line 83 of file hermon.h.

◆ HERMON_HCR_SET_ICM_SIZE

#define HERMON_HCR_SET_ICM_SIZE   0x0ffd

Definition at line 84 of file hermon.h.

◆ HERMON_HCR_UNMAP_FA

#define HERMON_HCR_UNMAP_FA   0x0ffe

Definition at line 85 of file hermon.h.

◆ HERMON_HCR_MAP_FA

#define HERMON_HCR_MAP_FA   0x0fff

Definition at line 86 of file hermon.h.

◆ HERMON_ST_RC

#define HERMON_ST_RC   0x00

Definition at line 89 of file hermon.h.

◆ HERMON_ST_UD

#define HERMON_ST_UD   0x03

Definition at line 90 of file hermon.h.

◆ HERMON_ST_MLX

#define HERMON_ST_MLX   0x07

Definition at line 91 of file hermon.h.

◆ HERMON_PORT_TYPE_UNKNOWN

#define HERMON_PORT_TYPE_UNKNOWN   0

Definition at line 94 of file hermon.h.

◆ HERMON_PORT_TYPE_IB

#define HERMON_PORT_TYPE_IB   1

Definition at line 95 of file hermon.h.

◆ HERMON_PORT_TYPE_ETH

#define HERMON_PORT_TYPE_ETH   2

Definition at line 96 of file hermon.h.

◆ HERMON_MTU_2048

#define HERMON_MTU_2048   0x04

Definition at line 99 of file hermon.h.

◆ HERMON_MTU_ETH

#define HERMON_MTU_ETH   0x07

Definition at line 100 of file hermon.h.

◆ HERMON_INVALID_LKEY

#define HERMON_INVALID_LKEY   0x00000100UL

Definition at line 102 of file hermon.h.

◆ HERMON_PAGE_SIZE

#define HERMON_PAGE_SIZE   ( ( size_t ) 4096 )

Definition at line 104 of file hermon.h.

◆ HERMON_DB_POST_SND_OFFSET

#define HERMON_DB_POST_SND_OFFSET   0x14

Definition at line 106 of file hermon.h.

◆ HERMON_DB_EQ_OFFSET

#define HERMON_DB_EQ_OFFSET (   _eqn)    ( 0x800 + HERMON_PAGE_SIZE * ( (_eqn) / 4 ) + 0x08 * ( (_eqn) % 4 ) )

Definition at line 107 of file hermon.h.

◆ HERMON_QP_OPT_PARAM_PM_STATE

#define HERMON_QP_OPT_PARAM_PM_STATE   0x00000400UL

Definition at line 110 of file hermon.h.

◆ HERMON_QP_OPT_PARAM_QKEY

#define HERMON_QP_OPT_PARAM_QKEY   0x00000020UL

Definition at line 111 of file hermon.h.

◆ HERMON_QP_OPT_PARAM_ALT_PATH

#define HERMON_QP_OPT_PARAM_ALT_PATH   0x00000001UL

Definition at line 112 of file hermon.h.

◆ HERMON_MAP_EQ

#define HERMON_MAP_EQ   ( 0UL << 31 )

Definition at line 114 of file hermon.h.

◆ HERMON_UNMAP_EQ

#define HERMON_UNMAP_EQ   ( 1UL << 31 )

Definition at line 115 of file hermon.h.

◆ HERMON_SET_PORT_GENERAL_PARAM

#define HERMON_SET_PORT_GENERAL_PARAM   0x0000

Definition at line 117 of file hermon.h.

◆ HERMON_SET_PORT_RECEIVE_QP

#define HERMON_SET_PORT_RECEIVE_QP   0x0100

Definition at line 118 of file hermon.h.

◆ HERMON_SET_PORT_MAC_TABLE

#define HERMON_SET_PORT_MAC_TABLE   0x0200

Definition at line 119 of file hermon.h.

◆ HERMON_SET_PORT_VLAN_TABLE

#define HERMON_SET_PORT_VLAN_TABLE   0x0300

Definition at line 120 of file hermon.h.

◆ HERMON_SET_PORT_PRIORITY_TABLE

#define HERMON_SET_PORT_PRIORITY_TABLE   0x0400

Definition at line 121 of file hermon.h.

◆ HERMON_SET_PORT_GID_TABLE

#define HERMON_SET_PORT_GID_TABLE   0x0500

Definition at line 122 of file hermon.h.

◆ HERMON_EV_PORT_STATE_CHANGE

#define HERMON_EV_PORT_STATE_CHANGE   0x09

Definition at line 124 of file hermon.h.

◆ HERMON_SCHED_QP0

#define HERMON_SCHED_QP0   0x3f

Definition at line 126 of file hermon.h.

◆ HERMON_SCHED_DEFAULT

#define HERMON_SCHED_DEFAULT   0x83

Definition at line 127 of file hermon.h.

◆ HERMON_LOG_MULTICAST_HASH_SIZE

#define HERMON_LOG_MULTICAST_HASH_SIZE   7

Definition at line 129 of file hermon.h.

◆ HERMON_PM_STATE_ARMED

#define HERMON_PM_STATE_ARMED   0x00

Definition at line 131 of file hermon.h.

◆ HERMON_PM_STATE_REARM

#define HERMON_PM_STATE_REARM   0x01

Definition at line 132 of file hermon.h.

◆ HERMON_PM_STATE_MIGRATED

#define HERMON_PM_STATE_MIGRATED   0x03

Definition at line 133 of file hermon.h.

◆ HERMON_RETRY_MAX

#define HERMON_RETRY_MAX   0x07

Definition at line 135 of file hermon.h.

◆ HERMON_MOD_STAT_CFG_SET

#define HERMON_MOD_STAT_CFG_SET   0x01

Definition at line 137 of file hermon.h.

◆ HERMON_MOD_STAT_CFG_QUERY

#define HERMON_MOD_STAT_CFG_QUERY   0x03

Definition at line 138 of file hermon.h.

◆ HERMON_VPD_FIELD

#define HERMON_VPD_FIELD (   port)    PCI_VPD_FIELD ( PCI_VPD_TAG_RW, 'V', ( '5' + (port) - 1 ) )

Definition at line 140 of file hermon.h.

◆ HERMON_MAX_GATHER

#define HERMON_MAX_GATHER   2

Definition at line 494 of file hermon.h.

◆ HERMON_MAX_SCATTER

#define HERMON_MAX_SCATTER   2

Definition at line 518 of file hermon.h.

◆ HERMON_CMPT_MAX_ENTRIES

#define HERMON_CMPT_MAX_ENTRIES   ( 1 << 24 )

Number of cMPT entries of each type.

Definition at line 599 of file hermon.h.

◆ HERMON_UAR_NON_EQ_PAGE

#define HERMON_UAR_NON_EQ_PAGE   128

UAR page for doorbell accesses.

Pages 0-127 are reserved for event queue doorbells only, so we use page 128.

Definition at line 624 of file hermon.h.

◆ HERMON_MAX_MTTS

#define HERMON_MAX_MTTS   64

Maximum number of allocatable MTT entries.

This is a policy decision, not a device limit.

Definition at line 630 of file hermon.h.

◆ HERMON_SEND_WQE_ALIGN

#define HERMON_SEND_WQE_ALIGN   128

Alignment of Hermon send work queue entries.

Definition at line 645 of file hermon.h.

◆ HERMON_RECV_WQE_ALIGN

#define HERMON_RECV_WQE_ALIGN   16

Alignment of Hermon receive work queue entries.

Definition at line 675 of file hermon.h.

◆ HERMON_NUM_SPECIAL_QPS

#define HERMON_NUM_SPECIAL_QPS   8

Number of special queue pairs.

Definition at line 698 of file hermon.h.

◆ HERMON_RSVD_SPECIAL_QPS

#define HERMON_RSVD_SPECIAL_QPS   ( ( HERMON_NUM_SPECIAL_QPS << 1 ) - 1 )

Number of queue pairs reserved for the "special QP" block.

The special QPs must be within a contiguous block aligned on its own size.

Definition at line 705 of file hermon.h.

◆ HERMON_MAX_QPS

#define HERMON_MAX_QPS   8

Maximum number of allocatable queue pairs.

This is a policy decision, not a device limit.

Definition at line 711 of file hermon.h.

◆ HERMON_QPN_RANDOM_MASK

#define HERMON_QPN_RANDOM_MASK   0xfff000

Queue pair number randomisation mask.

Definition at line 714 of file hermon.h.

◆ HERMON_MAX_CQS

#define HERMON_MAX_CQS   8

Maximum number of allocatable completion queues.

This is a policy decision, not a device limit.

Definition at line 744 of file hermon.h.

◆ HERMON_MAX_EQS

#define HERMON_MAX_EQS   8

Maximum number of allocatable event queues.

This is a policy decision, not a device limit.

Definition at line 762 of file hermon.h.

◆ HERMON_NUM_EQES

#define HERMON_NUM_EQES   8

Number of event queue entries.

This is a policy decision.

Definition at line 784 of file hermon.h.

◆ HERMON_BITMASK_SIZE

#define HERMON_BITMASK_SIZE (   max_entries)
Value:
( ( (max_entries) + ( 8 * sizeof ( hermon_bitmask_t ) ) - 1 ) / \
( 8 * sizeof ( hermon_bitmask_t ) ) )
uint32_t hermon_bitmask_t
A Hermon resource bitmask.
Definition: hermon.h:787

Size of a hermon resource bitmask.

Definition at line 790 of file hermon.h.

◆ HERMON_GLOBAL_PD

#define HERMON_GLOBAL_PD   0x123456

Global protection domain.

Definition at line 916 of file hermon.h.

◆ HERMON_MKEY_PREFIX

#define HERMON_MKEY_PREFIX   0x77000000UL

Memory key prefix.

Definition at line 919 of file hermon.h.

◆ HERMON_HCR_BASE

#define HERMON_HCR_BASE   0x80680

Definition at line 926 of file hermon.h.

◆ HERMON_HCR_REG

#define HERMON_HCR_REG (   x)    ( HERMON_HCR_BASE + 4 * (x) )

Definition at line 927 of file hermon.h.

◆ HERMON_HCR_MAX_WAIT_MS

#define HERMON_HCR_MAX_WAIT_MS   2000

Definition at line 928 of file hermon.h.

◆ HERMON_MBOX_ALIGN

#define HERMON_MBOX_ALIGN   4096

Definition at line 929 of file hermon.h.

◆ HERMON_MBOX_SIZE

#define HERMON_MBOX_SIZE   1024

Definition at line 930 of file hermon.h.

◆ HERMON_HCR_IN_MBOX

#define HERMON_HCR_IN_MBOX   0x00001000UL

Definition at line 943 of file hermon.h.

◆ HERMON_HCR_OUT_MBOX

#define HERMON_HCR_OUT_MBOX   0x00002000UL

Definition at line 944 of file hermon.h.

◆ HERMON_HCR_OPCODE

#define HERMON_HCR_OPCODE (   _command)    ( (_command) & 0xfff )

Definition at line 945 of file hermon.h.

◆ HERMON_HCR_IN_LEN

#define HERMON_HCR_IN_LEN (   _command)    ( ( (_command) >> 12 ) & 0x7fc )

Definition at line 946 of file hermon.h.

◆ HERMON_HCR_OUT_LEN

#define HERMON_HCR_OUT_LEN (   _command)    ( ( (_command) >> 21 ) & 0x7fc )

Definition at line 947 of file hermon.h.

◆ HERMON_HCR_INOUT_CMD

#define HERMON_HCR_INOUT_CMD (   _opcode,
  _in_mbox,
  _in_len,
  _out_mbox,
  _out_len 
)
Value:
( (_opcode) | \
( (_in_mbox) ? HERMON_HCR_IN_MBOX : 0 ) | \
( ( (_in_len) / 4 ) << 14 ) | \
( (_out_mbox) ? HERMON_HCR_OUT_MBOX : 0 ) | \
( ( (_out_len) / 4 ) << 23 ) )
#define HERMON_HCR_IN_MBOX
Definition: hermon.h:943
#define HERMON_HCR_OUT_MBOX
Definition: hermon.h:944

Build HCR command from component parts.

Definition at line 950 of file hermon.h.

◆ HERMON_HCR_IN_CMD

#define HERMON_HCR_IN_CMD (   _opcode,
  _in_mbox,
  _in_len 
)    HERMON_HCR_INOUT_CMD ( _opcode, _in_mbox, _in_len, 0, 0 )

Definition at line 958 of file hermon.h.

◆ HERMON_HCR_OUT_CMD

#define HERMON_HCR_OUT_CMD (   _opcode,
  _out_mbox,
  _out_len 
)    HERMON_HCR_INOUT_CMD ( _opcode, 0, 0, _out_mbox, _out_len )

Definition at line 961 of file hermon.h.

◆ HERMON_HCR_VOID_CMD

#define HERMON_HCR_VOID_CMD (   _opcode)    HERMON_HCR_INOUT_CMD ( _opcode, 0, 0, 0, 0 )

Definition at line 964 of file hermon.h.

Typedef Documentation

◆ hermon_bitmask_t

A Hermon resource bitmask.

Definition at line 787 of file hermon.h.

Enumeration Type Documentation

◆ hermon_icm_map_regions

Discontiguous regions within Hermon ICM.

Enumerator
HERMON_ICM_QP_CMPT 
HERMON_ICM_SRQ_CMPT 
HERMON_ICM_CQ_CMPT 
HERMON_ICM_EQ_CMPT 
HERMON_ICM_OTHER 
HERMON_ICM_NUM_REGIONS 

Definition at line 610 of file hermon.h.

◆ hermon_queue_pair_state

Hermon queue pair state.

Enumerator
HERMON_QP_ST_RST 
HERMON_QP_ST_INIT 
HERMON_QP_ST_RTR 
HERMON_QP_ST_RTS 

Definition at line 717 of file hermon.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER  )

◆ MLX_DECLARE_STRUCT() [1/38]

struct MLX_DECLARE_STRUCT ( hermonprm_completion_queue_context  )

◆ MLX_DECLARE_STRUCT() [2/38]

struct MLX_DECLARE_STRUCT ( hermonprm_completion_queue_entry  )

◆ MLX_DECLARE_STRUCT() [3/38]

struct MLX_DECLARE_STRUCT ( hermonprm_completion_with_error  )

◆ MLX_DECLARE_STRUCT() [4/38]

struct MLX_DECLARE_STRUCT ( hermonprm_cq_db_record  )

◆ MLX_DECLARE_STRUCT() [5/38]

struct MLX_DECLARE_STRUCT ( hermonprm_eqc  )

◆ MLX_DECLARE_STRUCT() [6/38]

struct MLX_DECLARE_STRUCT ( hermonprm_event_db_register  )

◆ MLX_DECLARE_STRUCT() [7/38]

struct MLX_DECLARE_STRUCT ( hermonprm_event_mask  )

◆ MLX_DECLARE_STRUCT() [8/38]

struct MLX_DECLARE_STRUCT ( hermonprm_event_queue_entry  )

◆ MLX_DECLARE_STRUCT() [9/38]

struct MLX_DECLARE_STRUCT ( hermonprm_hca_command_register  )

◆ MLX_DECLARE_STRUCT() [10/38]

struct MLX_DECLARE_STRUCT ( hermonprm_init_hca  )

◆ MLX_DECLARE_STRUCT() [11/38]

struct MLX_DECLARE_STRUCT ( hermonprm_mad_ifc  )

◆ MLX_DECLARE_STRUCT() [12/38]

struct MLX_DECLARE_STRUCT ( hermonprm_mcg_entry  )

◆ MLX_DECLARE_STRUCT() [13/38]

struct MLX_DECLARE_STRUCT ( hermonprm_mgm_hash  )

◆ MLX_DECLARE_STRUCT() [14/38]

struct MLX_DECLARE_STRUCT ( hermonprm_mod_stat_cfg  )

◆ MLX_DECLARE_STRUCT() [15/38]

struct MLX_DECLARE_STRUCT ( hermonprm_mod_stat_cfg_input_mod  )

◆ MLX_DECLARE_STRUCT() [16/38]

struct MLX_DECLARE_STRUCT ( hermonprm_mpt  )

◆ MLX_DECLARE_STRUCT() [17/38]

struct MLX_DECLARE_STRUCT ( hermonprm_mtt  )

◆ MLX_DECLARE_STRUCT() [18/38]

struct MLX_DECLARE_STRUCT ( hermonprm_port_state_change_event  )

◆ MLX_DECLARE_STRUCT() [19/38]

struct MLX_DECLARE_STRUCT ( hermonprm_qp_db_record  )

◆ MLX_DECLARE_STRUCT() [20/38]

struct MLX_DECLARE_STRUCT ( hermonprm_qp_ee_state_transitions  )

◆ MLX_DECLARE_STRUCT() [21/38]

struct MLX_DECLARE_STRUCT ( hermonprm_query_dev_cap  )

◆ MLX_DECLARE_STRUCT() [22/38]

struct MLX_DECLARE_STRUCT ( hermonprm_query_fw  )

◆ MLX_DECLARE_STRUCT() [23/38]

struct MLX_DECLARE_STRUCT ( hermonprm_query_port_cap  )

◆ MLX_DECLARE_STRUCT() [24/38]

struct MLX_DECLARE_STRUCT ( hermonprm_queue_pair_ee_context_entry  )

◆ MLX_DECLARE_STRUCT() [25/38]

struct MLX_DECLARE_STRUCT ( hermonprm_scalar_parameter  )

◆ MLX_DECLARE_STRUCT() [26/38]

struct MLX_DECLARE_STRUCT ( hermonprm_sense_port  )

◆ MLX_DECLARE_STRUCT() [27/38]

struct MLX_DECLARE_STRUCT ( hermonprm_send_db_register  )

◆ MLX_DECLARE_STRUCT() [28/38]

struct MLX_DECLARE_STRUCT ( hermonprm_set_port_ib  )

◆ MLX_DECLARE_STRUCT() [29/38]

struct MLX_DECLARE_STRUCT ( hermonprm_set_port_general_context  )

◆ MLX_DECLARE_STRUCT() [30/38]

struct MLX_DECLARE_STRUCT ( hermonprm_set_port_mac_table  )

◆ MLX_DECLARE_STRUCT() [31/38]

struct MLX_DECLARE_STRUCT ( hermonprm_set_port_rqp_calc  )

◆ MLX_DECLARE_STRUCT() [32/38]

struct MLX_DECLARE_STRUCT ( hermonprm_set_port_vlan  )

◆ MLX_DECLARE_STRUCT() [33/38]

struct MLX_DECLARE_STRUCT ( hermonprm_ud_address_vector  )

◆ MLX_DECLARE_STRUCT() [34/38]

struct MLX_DECLARE_STRUCT ( hermonprm_virtual_physical_mapping  )

◆ MLX_DECLARE_STRUCT() [35/38]

struct MLX_DECLARE_STRUCT ( hermonprm_wqe_segment_ctrl_mlx  )

◆ MLX_DECLARE_STRUCT() [36/38]

struct MLX_DECLARE_STRUCT ( hermonprm_wqe_segment_ctrl_send  )

◆ MLX_DECLARE_STRUCT() [37/38]

struct MLX_DECLARE_STRUCT ( hermonprm_wqe_segment_data_ptr  )

◆ MLX_DECLARE_STRUCT() [38/38]

struct MLX_DECLARE_STRUCT ( hermonprm_wqe_segment_ud  )