1*9517SBill.Taylor@Sun.COM /* 2*9517SBill.Taylor@Sun.COM * CDDL HEADER START 3*9517SBill.Taylor@Sun.COM * 4*9517SBill.Taylor@Sun.COM * The contents of this file are subject to the terms of the 5*9517SBill.Taylor@Sun.COM * Common Development and Distribution License (the "License"). 6*9517SBill.Taylor@Sun.COM * You may not use this file except in compliance with the License. 7*9517SBill.Taylor@Sun.COM * 8*9517SBill.Taylor@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*9517SBill.Taylor@Sun.COM * or http://www.opensolaris.org/os/licensing. 10*9517SBill.Taylor@Sun.COM * See the License for the specific language governing permissions 11*9517SBill.Taylor@Sun.COM * and limitations under the License. 12*9517SBill.Taylor@Sun.COM * 13*9517SBill.Taylor@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 14*9517SBill.Taylor@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*9517SBill.Taylor@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 16*9517SBill.Taylor@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 17*9517SBill.Taylor@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 18*9517SBill.Taylor@Sun.COM * 19*9517SBill.Taylor@Sun.COM * CDDL HEADER END 20*9517SBill.Taylor@Sun.COM */ 21*9517SBill.Taylor@Sun.COM 22*9517SBill.Taylor@Sun.COM /* 23*9517SBill.Taylor@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 24*9517SBill.Taylor@Sun.COM * Use is subject to license terms. 25*9517SBill.Taylor@Sun.COM */ 26*9517SBill.Taylor@Sun.COM 27*9517SBill.Taylor@Sun.COM #ifndef _SYS_IB_ADAPTERS_HERMON_CFG_H 28*9517SBill.Taylor@Sun.COM #define _SYS_IB_ADAPTERS_HERMON_CFG_H 29*9517SBill.Taylor@Sun.COM 30*9517SBill.Taylor@Sun.COM /* 31*9517SBill.Taylor@Sun.COM * hermon_cfg.h 32*9517SBill.Taylor@Sun.COM * Contains some prototypes and the structure needed to provided the 33*9517SBill.Taylor@Sun.COM * Hermon Configuration Profile variables. 34*9517SBill.Taylor@Sun.COM */ 35*9517SBill.Taylor@Sun.COM 36*9517SBill.Taylor@Sun.COM #include <sys/types.h> 37*9517SBill.Taylor@Sun.COM #include <sys/conf.h> 38*9517SBill.Taylor@Sun.COM #include <sys/ddi.h> 39*9517SBill.Taylor@Sun.COM #include <sys/sunddi.h> 40*9517SBill.Taylor@Sun.COM 41*9517SBill.Taylor@Sun.COM #ifdef __cplusplus 42*9517SBill.Taylor@Sun.COM extern "C" { 43*9517SBill.Taylor@Sun.COM #endif 44*9517SBill.Taylor@Sun.COM 45*9517SBill.Taylor@Sun.COM /* For PCIe Relaxed Ordering implementation */ 46*9517SBill.Taylor@Sun.COM #define HERMON_RO_DISABLED 0 47*9517SBill.Taylor@Sun.COM #define HERMON_RO_ENABLED 1 48*9517SBill.Taylor@Sun.COM 49*9517SBill.Taylor@Sun.COM /* 50*9517SBill.Taylor@Sun.COM * Configuration profiles 51*9517SBill.Taylor@Sun.COM */ 52*9517SBill.Taylor@Sun.COM #define HERMON_CFG_MEMFREE 0x0001 53*9517SBill.Taylor@Sun.COM 54*9517SBill.Taylor@Sun.COM #define HERMON_MAX_PORTS 2 55*9517SBill.Taylor@Sun.COM 56*9517SBill.Taylor@Sun.COM #define HERMON_LOG_CMPT_PER_TYPE 24 /* for now, allot 2**24 per */ 57*9517SBill.Taylor@Sun.COM 58*9517SBill.Taylor@Sun.COM /* 59*9517SBill.Taylor@Sun.COM * The hermon_cfg_profile_t structure is used internally by the Hermon driver 60*9517SBill.Taylor@Sun.COM * to hold all of the configuration information for the driver. It contains 61*9517SBill.Taylor@Sun.COM * information such as the maximum number (and size) of Hermon's queue pairs. 62*9517SBill.Taylor@Sun.COM * completion queues, translation tables, etc. It also contains configuration 63*9517SBill.Taylor@Sun.COM * information such as whether the device is using agents in the Hermon 64*9517SBill.Taylor@Sun.COM * firmware (i.e. SMA, PMA, BMA) or whether it must register with the IBMF 65*9517SBill.Taylor@Sun.COM * for management requests. Each of the fields is described below. 66*9517SBill.Taylor@Sun.COM */ 67*9517SBill.Taylor@Sun.COM typedef struct hermon_cfg_profile_s { 68*9517SBill.Taylor@Sun.COM /* Number of supported QPs and their maximum size */ 69*9517SBill.Taylor@Sun.COM uint32_t cp_log_num_qp; 70*9517SBill.Taylor@Sun.COM uint32_t cp_log_max_qp_sz; 71*9517SBill.Taylor@Sun.COM 72*9517SBill.Taylor@Sun.COM /* Number of supported SGL per WQE */ 73*9517SBill.Taylor@Sun.COM uint32_t cp_wqe_max_sgl; 74*9517SBill.Taylor@Sun.COM uint32_t cp_wqe_real_max_sgl; 75*9517SBill.Taylor@Sun.COM 76*9517SBill.Taylor@Sun.COM /* Number of supported CQs and their maximum size */ 77*9517SBill.Taylor@Sun.COM uint32_t cp_log_num_cq; 78*9517SBill.Taylor@Sun.COM uint32_t cp_log_max_cq_sz; 79*9517SBill.Taylor@Sun.COM 80*9517SBill.Taylor@Sun.COM /* Number of supported SRQs and their maximum size */ 81*9517SBill.Taylor@Sun.COM uint32_t cp_log_num_srq; 82*9517SBill.Taylor@Sun.COM uint32_t cp_log_max_srq_sz; 83*9517SBill.Taylor@Sun.COM uint32_t cp_srq_max_sgl; 84*9517SBill.Taylor@Sun.COM uint32_t cp_srq_resize_enabled; 85*9517SBill.Taylor@Sun.COM 86*9517SBill.Taylor@Sun.COM /* The max remaps of a particular fmr */ 87*9517SBill.Taylor@Sun.COM uint32_t cp_fmr_max_remaps; 88*9517SBill.Taylor@Sun.COM 89*9517SBill.Taylor@Sun.COM /* Number of EQs, and their default size */ 90*9517SBill.Taylor@Sun.COM uint32_t cp_log_num_eq; 91*9517SBill.Taylor@Sun.COM uint32_t cp_log_eq_sz; 92*9517SBill.Taylor@Sun.COM 93*9517SBill.Taylor@Sun.COM /* Number of supported RDBs and their default size */ 94*9517SBill.Taylor@Sun.COM uint32_t cp_log_num_rdb; 95*9517SBill.Taylor@Sun.COM uint32_t cp_log_default_rdb_sz; 96*9517SBill.Taylor@Sun.COM 97*9517SBill.Taylor@Sun.COM /* 98*9517SBill.Taylor@Sun.COM * Number of support multicast groups, number of QP per multicast 99*9517SBill.Taylor@Sun.COM * group, and the number of entries (from the total number) in 100*9517SBill.Taylor@Sun.COM * the multicast group "hash table" 101*9517SBill.Taylor@Sun.COM */ 102*9517SBill.Taylor@Sun.COM uint32_t cp_log_num_mcg; 103*9517SBill.Taylor@Sun.COM uint32_t cp_num_qp_per_mcg; 104*9517SBill.Taylor@Sun.COM uint32_t cp_log_num_mcg_hash; 105*9517SBill.Taylor@Sun.COM 106*9517SBill.Taylor@Sun.COM /* 107*9517SBill.Taylor@Sun.COM * Number of supported MPTs (memory regions and windows) and their 108*9517SBill.Taylor@Sun.COM * maximum size. Also the number of MTTs. 109*9517SBill.Taylor@Sun.COM */ 110*9517SBill.Taylor@Sun.COM uint32_t cp_log_num_cmpt; /* control MPTs */ 111*9517SBill.Taylor@Sun.COM uint32_t cp_log_num_dmpt; /* data MPTs */ 112*9517SBill.Taylor@Sun.COM uint32_t cp_log_max_mrw_sz; 113*9517SBill.Taylor@Sun.COM uint32_t cp_log_num_mtt; 114*9517SBill.Taylor@Sun.COM 115*9517SBill.Taylor@Sun.COM /* 116*9517SBill.Taylor@Sun.COM * Number of supported Hermon mailboxes ("In" and "Out") and their 117*9517SBill.Taylor@Sun.COM * maximum sizes, respectively 118*9517SBill.Taylor@Sun.COM */ 119*9517SBill.Taylor@Sun.COM uint32_t cp_log_num_inmbox; 120*9517SBill.Taylor@Sun.COM uint32_t cp_log_num_outmbox; 121*9517SBill.Taylor@Sun.COM uint32_t cp_log_num_intr_inmbox; 122*9517SBill.Taylor@Sun.COM uint32_t cp_log_num_intr_outmbox; 123*9517SBill.Taylor@Sun.COM uint32_t cp_log_inmbox_size; 124*9517SBill.Taylor@Sun.COM uint32_t cp_log_outmbox_size; 125*9517SBill.Taylor@Sun.COM 126*9517SBill.Taylor@Sun.COM /* Number of supported UAR pages */ 127*9517SBill.Taylor@Sun.COM uint32_t cp_log_num_uar; 128*9517SBill.Taylor@Sun.COM 129*9517SBill.Taylor@Sun.COM /* Number of ICM (4KB) pages per UAR context entry */ 130*9517SBill.Taylor@Sun.COM uint32_t cp_num_pgs_per_uce; 131*9517SBill.Taylor@Sun.COM 132*9517SBill.Taylor@Sun.COM /* Number of supported Protection Domains (PD) */ 133*9517SBill.Taylor@Sun.COM uint32_t cp_log_num_pd; 134*9517SBill.Taylor@Sun.COM 135*9517SBill.Taylor@Sun.COM /* Number of supported Address Handles (AH) */ 136*9517SBill.Taylor@Sun.COM uint32_t cp_log_num_ah; 137*9517SBill.Taylor@Sun.COM 138*9517SBill.Taylor@Sun.COM /* 139*9517SBill.Taylor@Sun.COM * Number of supported PKeys per PKey table (i.e. per port). Also the 140*9517SBill.Taylor@Sun.COM * number of SGID per GID table. 141*9517SBill.Taylor@Sun.COM */ 142*9517SBill.Taylor@Sun.COM uint32_t cp_log_max_pkeytbl; 143*9517SBill.Taylor@Sun.COM uint32_t cp_log_max_gidtbl; 144*9517SBill.Taylor@Sun.COM 145*9517SBill.Taylor@Sun.COM /* Maximum "responder resources" and "initiator depth" per QP */ 146*9517SBill.Taylor@Sun.COM uint32_t cp_hca_max_rdma_in_qp; 147*9517SBill.Taylor@Sun.COM uint32_t cp_hca_max_rdma_out_qp; 148*9517SBill.Taylor@Sun.COM 149*9517SBill.Taylor@Sun.COM /* Maximum supported MTU and port width */ 150*9517SBill.Taylor@Sun.COM uint32_t cp_max_mtu; 151*9517SBill.Taylor@Sun.COM uint32_t cp_max_port_width; 152*9517SBill.Taylor@Sun.COM 153*9517SBill.Taylor@Sun.COM /* Number of supported Virtual Lanes (VL) */ 154*9517SBill.Taylor@Sun.COM uint32_t cp_max_vlcap; 155*9517SBill.Taylor@Sun.COM 156*9517SBill.Taylor@Sun.COM /* Number of supported ports (1 or 2) */ 157*9517SBill.Taylor@Sun.COM uint32_t cp_num_ports; 158*9517SBill.Taylor@Sun.COM 159*9517SBill.Taylor@Sun.COM /* 160*9517SBill.Taylor@Sun.COM * Whether or not to use the built-in (i.e. in firmware) agents 161*9517SBill.Taylor@Sun.COM * for QP0 and QP1, respectively 162*9517SBill.Taylor@Sun.COM */ 163*9517SBill.Taylor@Sun.COM uint32_t cp_qp0_agents_in_fw; 164*9517SBill.Taylor@Sun.COM uint32_t cp_qp1_agents_in_fw; 165*9517SBill.Taylor@Sun.COM 166*9517SBill.Taylor@Sun.COM /* Whether DMA mappings should bypass the PCI IOMMU or not */ 167*9517SBill.Taylor@Sun.COM uint32_t cp_iommu_bypass; 168*9517SBill.Taylor@Sun.COM 169*9517SBill.Taylor@Sun.COM /* Delay after software reset */ 170*9517SBill.Taylor@Sun.COM uint32_t cp_sw_reset_delay; 171*9517SBill.Taylor@Sun.COM 172*9517SBill.Taylor@Sun.COM /* Time to wait in-between attempts to poll the 'go' bit */ 173*9517SBill.Taylor@Sun.COM uint32_t cp_cmd_poll_delay; 174*9517SBill.Taylor@Sun.COM 175*9517SBill.Taylor@Sun.COM /* Max time to continue to poll the 'go bit */ 176*9517SBill.Taylor@Sun.COM uint32_t cp_cmd_poll_max; 177*9517SBill.Taylor@Sun.COM 178*9517SBill.Taylor@Sun.COM /* Default AckReq frequency */ 179*9517SBill.Taylor@Sun.COM uint32_t cp_ackreq_freq; 180*9517SBill.Taylor@Sun.COM 181*9517SBill.Taylor@Sun.COM /* Specify whether to use MSI (if available) */ 182*9517SBill.Taylor@Sun.COM uint32_t cp_use_msi_if_avail; 183*9517SBill.Taylor@Sun.COM 184*9517SBill.Taylor@Sun.COM /* 185*9517SBill.Taylor@Sun.COM * Used to override SystemImageGUID, NodeGUID and PortGUID(s) as 186*9517SBill.Taylor@Sun.COM * specified by the Hermon device node properties 187*9517SBill.Taylor@Sun.COM */ 188*9517SBill.Taylor@Sun.COM uint64_t cp_sysimgguid; 189*9517SBill.Taylor@Sun.COM uint64_t cp_nodeguid; 190*9517SBill.Taylor@Sun.COM uint64_t cp_portguid[HERMON_MAX_PORTS]; 191*9517SBill.Taylor@Sun.COM 192*9517SBill.Taylor@Sun.COM } hermon_cfg_profile_t; 193*9517SBill.Taylor@Sun.COM 194*9517SBill.Taylor@Sun.COM int hermon_cfg_profile_init_phase1(hermon_state_t *state); 195*9517SBill.Taylor@Sun.COM int hermon_cfg_profile_init_phase2(hermon_state_t *state); 196*9517SBill.Taylor@Sun.COM void hermon_cfg_profile_fini(hermon_state_t *state); 197*9517SBill.Taylor@Sun.COM 198*9517SBill.Taylor@Sun.COM #ifdef __cplusplus 199*9517SBill.Taylor@Sun.COM } 200*9517SBill.Taylor@Sun.COM #endif 201*9517SBill.Taylor@Sun.COM 202*9517SBill.Taylor@Sun.COM #endif /* _SYS_IB_ADAPTERS_HERMON_CFG_H */ 203