fip.h revision b494511a9cf72b1fc4eb13a0e593f55c624ab829
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#ifndef _SYS_IB_EOIB_FIP_H
#define _SYS_IB_EOIB_FIP_H
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/ethernet.h>
/*
* Sizes of various objects in FIP headers
*/
#define FIP_VENDOR_LEN 8
#define FIP_GUID_LEN 8
#define FIP_SYSNAME_LEN 32
#define FIP_PORTNAME_LEN 8
#define FIP_MGID_PREFIX_LEN 5
#define FIP_VNIC_NAME_LEN 16
#define FIP_VHUBID_LEN 3
/*
* EoIB Pkeys and Qkeys
*/
#define EIB_ADMIN_PKEY 0xFFFF
#define EIB_FIP_QKEY 0x80020002
#define EIB_DATA_QKEY 0x80020003
/*
* EoIB Advertise and Solicit MCG GUIDs
*/
#define EIB_GUID_ADVERTISE_PREFIX 0xFF12E01B00060000
#define EIB_GUID_SOLICIT_PREFIX 0xFF12E01B00070000
/*
* FIP_Protocol_Version
*/
#define FIP_PROTO_VERSION 0
typedef struct fip_proto_s {
} fip_proto_t;
/*
* Basic FIP Header: Opcodes and subcodes for EoIB
*/
#define FIP_OPCODE_EOIB 0xFFF9
#define FIP_SUBCODE_H_SOLICIT 0x1
#define FIP_SUBCODE_G_ADVERTISE 0x2
#define FIP_SUBCODE_H_VNIC_LOGIN 0x3
#define FIP_SUBCODE_G_VNIC_LOGIN_ACK 0x4
#define FIP_SUBCODE_H_VNIC_LOGOUT 0x5
#define FIP_SUBCODE_G_VHUB_UPDATE 0x6
#define FIP_SUBCODE_G_VHUB_TABLE 0x7
#define FIP_SUBCODE_H_KEEP_ALIVE 0x8
/*
* Basic FIP Header: Flags relevant to EoIB
*/
#define FIP_BHFLAG_GWAVAIL 0x4
#define FIP_BHFLAG_SLCTMSG 0x2
/*
* FIP_Basic_Header
*/
#define FIP_DESC_TYPE_VENDOR_ID 13
#define FIP_DESC_LEN_VENDOR_ID 3
typedef struct fip_basic_hdr_s {
#define FIP_IBA_QPN_MASK 0x00FFFFFF
#define FIP_IBA_PORTID_MASK 0x0FFF
#define FIP_IBA_SL_MASK 0xF000
#define FIP_IBA_SL_SHIFT 12
/*
* FIP_Descriptor_Infiniband_Address
*/
#define FIP_DESC_TYPE_IBA 240
#define FIP_DESC_LEN_IBA 7
typedef struct fip_desc_iba_s {
/*
* FIP Solicitation Control Message:
*
* FIP_Protocol_Version
* FIP_Basic_Header
* FIP_Descriptor_Infiniband_Address
*/
typedef struct fip_solicit_s {
/*
* FIP_Descriptor_EoIB_Gateway_Information
*/
#define FIP_DESC_TYPE_EOIB_GW_INFO 241
#define FIP_DESC_LEN_EOIB_GW_INFO 4
typedef struct fip_desc_gwinfo_s {
#define FIP_GWI_HOST_ADMIND_VNICS_MASK 0x80
#define FIP_GWI_NUM_NET_VNICS_MASK 0x0FFF
#define FIP_GWI_RSS_QPN_MASK 0xF000
#define FIP_GWI_RSS_QPN_SHIFT 12
/*
* FIP_Descriptor_Gateway_Identifier
*/
#define FIP_DESC_TYPE_GW_ID 248
#define FIP_DESC_LEN_GW_ID 15
typedef struct fip_desc_gwid_s {
/*
* FIP_Descriptor_Keep_Alive_Parameters
*/
#define FIP_DESC_TYPE_KEEP_ALIVE 249
#define FIP_DESC_LEN_KEEP_ALIVE 6
typedef struct fip_desc_keepalive_s {
/*
* FIP Advertise Control Message:
*
* FIP_Protocol_Version
* FIP_Basic_Header
* FIP_Descriptor_Infiniband_Address
* FIP_Descriptor_EoIB_Gateway_Information
* FIP_Descriptor_Gateway_Identifier
* FIP_Descriptor_Keep_Alive_Parameters
*/
typedef struct fip_advertise_s {
/*
* FIP_Descriptor_vNIC_Login
*/
#define FIP_DESC_TYPE_VNIC_LOGIN 242
#define FIP_DESC_LEN_VNIC_LOGIN 13
typedef struct fip_desc_vnic_login_s {
/*
* Flags, masks and error codes for FIP_Descriptor_vNIC_Login
*/
#define FIP_VL_VNIC_ID_MSBIT 0x8000
#define FIP_VL_FLAGS_V 0x8000
#define FIP_VL_FLAGS_M 0x4000
#define FIP_VL_FLAGS_VP 0x2000
#define FIP_VL_FLAGS_H 0x1000
#define FIP_VL_VLAN_MASK 0x0FFF
#define FIP_VL_RSS_MASK 0x10
#define FIP_VL_N_RSS_MCGID_MASK 0x0F
#define FIP_VL_N_MAC_MCGID_MASK 0x3F
#define FIP_VL_CTL_QPN_MASK 0x00FFFFFF
#define FIP_VL_SYN_MASK 0xFF000000
#define FIP_VL_SYN_SHIFT 24
#define FIP_VL_SYN_SUCCESS 0
#define FIP_VL_SYN_REJECTED 1
#define FIP_VL_SYN_GW_NO_RESOURCE 2
#define FIP_VL_SYN_NO_MORE_NWK_ADDRS 3
#define FIP_VL_SYN_UNKNOWN_HOST 4
#define FIP_VL_SYN_UNSUPP_PARAM 5
/*
* FIP_Descriptor_Partition
*/
#define FIP_DESC_TYPE_PARTITION 246
#define FIP_DESC_LEN_PARTITION 4
typedef struct fip_desc_partition_s {
/*
* FIP Login Control Message:
*
* FIP_Protocol_Version
* FIP_Basic_Header
* FIP_Descriptor_Infiniband_Address
* FIP_Descriptor_vNIC_Login
*/
typedef struct fip_login_s {
} fip_login_t;
/*
* FIP Login ACK Control Message:
*
* FIP_Protocol_Version
* FIP_Basic_Header
* FIP_Descriptor_Infiniband_Address
* FIP_Descriptor_vNIC_Login
* FIP_Descriptor_Partition
*/
typedef struct fip_login_ack_s {
/*
* FIP_Descriptor_vNIC_Identity
*/
#define FIP_DESC_TYPE_VNIC_IDENTITY 245
#define FIP_DESC_LEN_VNIC_IDENTITY 13
typedef struct fip_desc_vnic_identity_s {
#define FIP_VI_FLAG_U 0x80000000
#define FIP_VI_FLAG_R 0x40000000
#define FIP_VI_FLAG_VP 0x01000000
/*
* FIP Keep Alive Control Message:
*
* FIP_Protocol_Version
* FIP_Basic_Header
* FIP_Descriptor_vNIC_Identity
*/
typedef struct fip_keep_alive_s {
/*
* FIP_vHUB_Table_Entry
*/
typedef struct fip_vhub_table_entry_s {
#define FIP_TE_VALID 0x80
#define FIP_TE_RSS 0x40
#define FIP_TE_TYPE_MASK 0x0F
#define FIP_TE_TYPE_VNIC 0x00
#define FIP_TE_TYPE_GATEWAY 0x01
#define FIP_TE_TYPE_UNICAST_MISS 0x02
#define FIP_TE_TYPE_MULTICAST_ENTRY 0x03
#define FIP_TE_TYPE_VHUB_MULTICAST 0x04
#define FIP_TE_SL_MASK 0x0F
#define FIP_TE_QPN_MASK 0x00FFFFFF
#define FIP_VHUB_TABLE_ENTRY_SZ (sizeof (fip_vhub_table_entry_t))
/*
* FIP_Descriptor_vHUB_Update
*/
#define FIP_DESC_TYPE_VHUB_UPDATE 243
#define FIP_DESC_LEN_VHUB_UPDATE 9
typedef struct fip_desc_vhub_update_s {
#define FIP_UP_VP_SHIFT 24
#define FIP_UP_VP_MASK 0x1
#define FIP_UP_EPORT_STATE_SHIFT 28
#define FIP_UP_EPORT_STATE_MASK 0x3
#define FIP_UP_VHUB_ID_MASK 0x00FFFFFF
#define FIP_EPORT_DOWN 0x0
#define FIP_EPORT_UP 0x1
/*
* FIP_Descriptor_vHUB_Table
*/
#define FIP_DESC_TYPE_VHUB_TABLE 244
typedef struct fip_desc_vhub_table_s {
/*
* FIP_vHUB_Table_Entry
* FIP_vHUB_Table_Entry
* .
* .
* .
* uint32_t Checksum
*/
#define FIP_TB_FLAGS_VP_SHIFT 24
#define FIP_TB_FLAGS_VP_MASK 0x1
#define FIP_TB_VHUB_ID_MASK 0x00FFFFFF
#define FIP_TB_HDR_MIDDLE 0x00
#define FIP_TB_HDR_FIRST 0x40
#define FIP_TB_HDR_LAST 0x80
#define FIP_TB_HDR_ONLY 0xC0
#define FIP_DESC_VHUB_TABLE_SZ (sizeof (fip_desc_vhub_table_t))
/*
* FIP vHUB Table Message:
*
* FIP_Protocol_Version
* FIP_Basic_Header
* FIP_Descriptor_vHUB_Table
*/
typedef struct fip_vhub_table_s {
/*
* FIP vHUB Update Message:
*
* FIP_Protocol_Version
* FIP_Basic_Header
* FIP_Descriptor_vHUB_Update
*/
typedef struct fip_vhub_update_s {
/*
* Just a generic container to handle either type of VHUB
* messages
*/
typedef struct fip_vhub_pkt_s {
#ifdef __cplusplus
}
#endif
#endif /* _SYS_IB_EOIB_FIP_H */