|
Packit |
857059 |
/* BEGIN_ICS_COPYRIGHT2 ****************************************
|
|
Packit |
857059 |
|
|
Packit |
857059 |
Copyright (c) 2015-2017, Intel Corporation
|
|
Packit |
857059 |
|
|
Packit |
857059 |
Redistribution and use in source and binary forms, with or without
|
|
Packit |
857059 |
modification, are permitted provided that the following conditions are met:
|
|
Packit |
857059 |
|
|
Packit |
857059 |
* Redistributions of source code must retain the above copyright notice,
|
|
Packit |
857059 |
this list of conditions and the following disclaimer.
|
|
Packit |
857059 |
* Redistributions in binary form must reproduce the above copyright
|
|
Packit |
857059 |
notice, this list of conditions and the following disclaimer in the
|
|
Packit |
857059 |
documentation and/or other materials provided with the distribution.
|
|
Packit |
857059 |
* Neither the name of Intel Corporation nor the names of its contributors
|
|
Packit |
857059 |
may be used to endorse or promote products derived from this software
|
|
Packit |
857059 |
without specific prior written permission.
|
|
Packit |
857059 |
|
|
Packit |
857059 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
Packit |
857059 |
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
Packit |
857059 |
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
Packit |
857059 |
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
|
Packit |
857059 |
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
Packit |
857059 |
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
Packit |
857059 |
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
Packit |
857059 |
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
Packit |
857059 |
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
Packit |
857059 |
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
Packit |
857059 |
|
|
Packit |
857059 |
* ** END_ICS_COPYRIGHT2 ****************************************/
|
|
Packit |
857059 |
|
|
Packit |
857059 |
// -------------------------------------------------------------------- //
|
|
Packit |
857059 |
// //
|
|
Packit |
857059 |
// WARNING: These structures do NOT represent the IBTA defined //
|
|
Packit |
857059 |
// structures as they appear in the Volume1 spec. //
|
|
Packit |
857059 |
// //
|
|
Packit |
857059 |
// -------------------------------------------------------------------- //
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#ifndef _IB_SA_H_
|
|
Packit |
857059 |
#define _IB_SA_H_
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#include "ib_types.h"
|
|
Packit |
857059 |
#include "ib_mad.h"
|
|
Packit |
857059 |
#include "cs_hashtable.h"
|
|
Packit |
857059 |
#include "iba/stl_sm_types.h"
|
|
Packit |
857059 |
#include "iba/stl_sa_priv.h"
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#if defined(__KERNEL__) && ! defined(__VXWORKS__)
|
|
Packit |
857059 |
#include "linux/iba/public/ipackon.h"
|
|
Packit |
857059 |
#else
|
|
Packit |
857059 |
#include "iba/public/ipackon.h"
|
|
Packit |
857059 |
#endif
|
|
Packit |
857059 |
|
|
Packit |
857059 |
// IBTA: Volume 1, Section 15.2.1
|
|
Packit |
857059 |
|
|
Packit |
857059 |
//
|
|
Packit |
857059 |
// Subnet Administration(SA) Mad format
|
|
Packit |
857059 |
//
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#define IB_SAMAD_DATA_COUNT 200
|
|
Packit |
857059 |
#define IB_SA_HEADER_SIZE 20 // SA header fields after RMPP header and before data
|
|
Packit |
857059 |
#define IB_SA_FULL_HEADER_SIZE 32 // SA header including RMPP header
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#define STL_SAMAD_BLOCK_SIZE 2048
|
|
Packit |
857059 |
#define STL_SAMAD_DATA_COUNT (STL_SAMAD_BLOCK_SIZE - (IB_SA_FULL_HEADER_SIZE + 8)) // Original SA header is one byte short
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#define SAMAD_DATA_COUNT IB_SAMAD_DATA_COUNT
|
|
Packit |
857059 |
#define SA_HEADER_SIZE IB_SA_HEADER_SIZE // SA header fields after RMPP header and before data
|
|
Packit |
857059 |
#define SA_FULL_HEADER_SIZE IB_SA_FULL_HEADER_SIZE // SA header including RMPP header
|
|
Packit |
857059 |
|
|
Packit |
857059 |
// SA MAD header only
|
|
Packit |
857059 |
typedef struct {
|
|
Packit |
857059 |
uint8_t rmppVersion;
|
|
Packit |
857059 |
uint8_t rmppType;
|
|
Packit |
857059 |
union {
|
|
Packit |
857059 |
struct {
|
|
Packit |
857059 |
#if CPU_BE
|
|
Packit |
857059 |
uint8_t rmppRespTime : 5; // 5 bit field
|
|
Packit |
857059 |
uint8_t rmppFlags : 3; // 3 bit field
|
|
Packit |
857059 |
#else
|
|
Packit |
857059 |
uint8_t rmppFlags : 3; // 3 bit field
|
|
Packit |
857059 |
uint8_t rmppRespTime : 5; // 5 bit field
|
|
Packit |
857059 |
#endif
|
|
Packit |
857059 |
} tf;
|
|
Packit |
857059 |
uint8_t timeFlag; // entire 8 bits
|
|
Packit |
857059 |
} u;
|
|
Packit |
857059 |
uint8_t rmppStatus;
|
|
Packit |
857059 |
uint32_t segNum;
|
|
Packit |
857059 |
uint32_t length;
|
|
Packit |
857059 |
uint64_t smKey; // SM key
|
|
Packit |
857059 |
uint16_t offset; // num 8-byte words from begin of attrib to begin of next attrib
|
|
Packit |
857059 |
uint16_t rservd; // reserved
|
|
Packit |
857059 |
uint64_t mask; // attribute components for queries
|
|
Packit |
857059 |
} PACK_SUFFIX SAMadh_t;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
// (old = 192) Maximum data in a single SA Mad
|
|
Packit |
857059 |
#define IB_SA_DATA_LEN 200
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#define SA_AMOD_TEMPLATE 0xffffffff
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#define SA_EM_ADD 0x0 // add record modifier
|
|
Packit |
857059 |
#define SA_EM_DELETE 0x1 // delete record modifier
|
|
Packit |
857059 |
#define SA_EM_EDIT 0x2 // edit record modifier
|
|
Packit |
857059 |
|
|
Packit |
857059 |
// IBTA: Volume 1, Section 15.2.3
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#define MAD_STATUS_SA_NO_ERROR 0x0000 // no error
|
|
Packit |
857059 |
#define MAD_STATUS_SA_NO_RESOURCES 0x0100 // No resources
|
|
Packit |
857059 |
#define MAD_STATUS_SA_REQ_INVALID 0x0200 // Request invalid
|
|
Packit |
857059 |
#define MAD_STATUS_SA_NO_RECORDS 0x0300 // No records found
|
|
Packit |
857059 |
#define MAD_STATUS_SA_TOO_MANY_RECS 0x0400 // Too many records
|
|
Packit |
857059 |
#define MAD_STATUS_SA_REQ_INVALID_GID 0x0500 // invalid GID
|
|
Packit |
857059 |
#define MAD_STATUS_SA_REQ_INSUFFICIENT_COMPONENTS 0x0600 // Insufficient Components
|
|
Packit |
857059 |
#define MAD_STATUS_SA_REQ_DENIED 0x0700 // request is denied - new in IBTA 1.2.1
|
|
Packit |
857059 |
#define MAD_STATUS_SA_REQ_PRIORITY 0x0800 // suggested QoS is unobtainable - IBTA 1.2.1 Annex A13
|
|
Packit |
857059 |
|
|
Packit |
857059 |
// IBTA: Volume 1, Section 13.6.2.1 - RMPP
|
|
Packit |
857059 |
#define RMPP_VERSION 1
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#define RMPP_TYPE_NOT 0
|
|
Packit |
857059 |
#define RMPP_TYPE_DATA 1
|
|
Packit |
857059 |
#define RMPP_TYPE_ACK 2
|
|
Packit |
857059 |
#define RMPP_TYPE_STOP 3
|
|
Packit |
857059 |
#define RMPP_TYPE_ABORT 4
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#define RMPP_RESPTIME_NONE 0x1F
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#define RMPP_FLAGS_ACTIVE 0x01
|
|
Packit |
857059 |
#define RMPP_FLAGS_FIRST 0x02
|
|
Packit |
857059 |
#define RMPP_FLAGS_LAST 0x04
|
|
Packit |
857059 |
|
|
Packit |
857059 |
// IBTA: Volume 1, Section 13.6.2.1 - RMPP Status
|
|
Packit |
857059 |
#define RMPP_STATUS_NO_ERROR 0
|
|
Packit |
857059 |
#define RMPP_STATUS_STOP_NORESOURCES 1
|
|
Packit |
857059 |
#define RMPP_STATUS_ABORT_TIMETOOLONG 118
|
|
Packit |
857059 |
#define RMPP_STATUS_ABORT_INCONSISTENT_LAST_PAYLOADLENGTH 119
|
|
Packit |
857059 |
#define RMPP_STATUS_ABORT_INCONSISTENT_FIRST_SEGNUM 120
|
|
Packit |
857059 |
#define RMPP_STATUS_ABORT_BADTYPE 121
|
|
Packit |
857059 |
#define RMPP_STATUS_ABORT_NEWWINDOWLAST_TOOSMALL 122
|
|
Packit |
857059 |
#define RMPP_STATUS_ABORT_SEGNUM_TOOBIG 123
|
|
Packit |
857059 |
#define RMPP_STATUS_ABORT_ILLEGAL_STATUS 124
|
|
Packit |
857059 |
#define RMPP_STATUS_ABORT_UNSUPPORTED_VERSION 125
|
|
Packit |
857059 |
#define RMPP_STATUS_ABORT_TOO_MANY_RETRIES 126
|
|
Packit |
857059 |
#define RMPP_STATUS_ABORT_UNSPECIFIED 127
|
|
Packit |
857059 |
|
|
Packit |
857059 |
// IBTA: Volume 1, Section 15.2.2
|
|
Packit |
857059 |
|
|
Packit |
857059 |
//
|
|
Packit |
857059 |
// SA class methods
|
|
Packit |
857059 |
//
|
|
Packit |
857059 |
#define SA_CM_GET 0x01 // Get an attribute from a node
|
|
Packit |
857059 |
#define SA_CM_GET_RESP 0x81 // Get/Set response
|
|
Packit |
857059 |
#define SA_CM_SET 0x02 // Set an attribute from a node
|
|
Packit |
857059 |
#define SA_CM_REPORT 0x06 // Forward a subscribed event
|
|
Packit |
857059 |
#define SA_CM_REPORT_RESP 0x86 // Report response
|
|
Packit |
857059 |
#define SA_CM_GETTABLE 0x12 // SM table request
|
|
Packit |
857059 |
#define SA_CM_GETTABLE_RESP 0x92 // Gettable response
|
|
Packit |
857059 |
#define SA_CM_GETTRACETABLE 0x13 // Request path trace table - returns GETTABLE_RESP
|
|
Packit |
857059 |
#define SA_CM_GETMULTI 0x14 // Multi-packet request
|
|
Packit |
857059 |
#define SA_CM_GETMULTI_RESP 0x94 // Multi-packet response
|
|
Packit |
857059 |
#define SA_CM_DELETE 0x15 // Request to delete an attribute
|
|
Packit |
857059 |
#define SA_CM_DELETE_RESP 0x95 // Response to delete an attribute
|
|
Packit |
857059 |
|
|
Packit |
857059 |
// IBTA: Volume 1, Section 15.2.5.1
|
|
Packit |
857059 |
|
|
Packit |
857059 |
//
|
|
Packit |
857059 |
// SA Attributes
|
|
Packit |
857059 |
//
|
|
Packit |
857059 |
#define SA_CLASSPORTINFO 0x0001 // Class information
|
|
Packit |
857059 |
#define SA_NOTICE 0x0002 // Notice information
|
|
Packit |
857059 |
#define SA_INFORMINFO 0x0003 // Subscription information
|
|
Packit |
857059 |
#define SA_NODE_RECORD 0x0011 // NodeInfo record
|
|
Packit |
857059 |
#define SA_PORTINFO_RECORD 0x0012 // PortInfo record
|
|
Packit |
857059 |
#define SA_SWITCH_RECORD 0x0014 // SwitchInfo record
|
|
Packit |
857059 |
#define SA_LFT_RECORD 0x0015 // LFT record
|
|
Packit |
857059 |
#define SA_RFT_RECORD 0x0016 // RFT record
|
|
Packit |
857059 |
#define SA_MFT_RECORD 0x0017 // MFT record
|
|
Packit |
857059 |
#define SA_SMINFO_RECORD 0x0018 // SmInfo record
|
|
Packit |
857059 |
#define SA_INFORM_RECORD 0x00f3 // InforInfo record
|
|
Packit |
857059 |
//was SA_NOTICE_RECORD 0x00f4 // Notice record
|
|
Packit |
857059 |
#define SA_LINK_RECORD 0x0020 // Link record
|
|
Packit |
857059 |
//was SA_GUIDINFO_RECORD 0x0030 // GUIDs assigned to a port
|
|
Packit |
857059 |
#define SA_SERVICE_RECORD 0x0031 // Service Ad record
|
|
Packit |
857059 |
#define SA_PARTITION_RECORD 0x0033 // Partition record
|
|
Packit |
857059 |
//was SA_RANGE_RECORD 0x0034 // Range record
|
|
Packit |
857059 |
#define SA_PATH_RECORD 0x0035 // Subnet path information
|
|
Packit |
857059 |
#define SA_VLARBITRATION_RECORD 0x0036 // VL arbitration record
|
|
Packit |
857059 |
//was SA_MCGROUP_RECORD 0x0037 // MC Group record
|
|
Packit |
857059 |
#define SA_MCMEMBER_RECORD 0x0038 // MC Member record
|
|
Packit |
857059 |
#define SA_TRACE_RECORD 0x0039 // Trace Record
|
|
Packit |
857059 |
#define SA_MULTIPATH_RECORD 0x003A // Request for multi paths
|
|
Packit |
857059 |
#define SA_SARESPONSE 0x8001 // Container for query responses
|
|
Packit |
857059 |
#define SA_VFABRIC_RECORD 0xFF02 // "Vendor unique" vfabric record
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#define IB_LINK_LOCAL_SCOPE 0x2
|
|
Packit |
857059 |
#define IB_SITE_LOCAL_SCOPE 0x5
|
|
Packit |
857059 |
#define IB_ORG_LOCAL_SCOPE 0x8
|
|
Packit |
857059 |
#define IB_GLOBAL_SCOPE 0xE
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/*
|
|
Packit |
857059 |
* subscriber table (informInfo)
|
|
Packit |
857059 |
*/
|
|
Packit |
857059 |
typedef struct {
|
|
Packit |
857059 |
CS_HashTablep subsMap; /* pointer to hashmap of subscriptions */
|
|
Packit |
857059 |
Lock_t subsLock;
|
|
Packit |
857059 |
} SubscriberTable_t;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/*
|
|
Packit |
857059 |
* event subscription entry key structure
|
|
Packit |
857059 |
*/
|
|
Packit |
857059 |
typedef struct {
|
|
Packit |
857059 |
Gid_t subscriberGid;
|
|
Packit |
857059 |
STL_LID lid; // destination lid
|
|
Packit |
857059 |
uint16_t trapnum; // trap number
|
|
Packit |
857059 |
uint32_t qpn; // queue pair number - 24 bits
|
|
Packit |
857059 |
uint8_t producer; // producer of traps/notices - using 3 bits
|
|
Packit |
857059 |
uint8_t rtv; // time to respond to requests - 5 bits
|
|
Packit |
857059 |
uint16_t pkey; // original PKey
|
|
Packit |
857059 |
uint32_t qkey; // queue pair key (32)
|
|
Packit |
857059 |
STL_LID startLid; // calculated start Lid
|
|
Packit |
857059 |
STL_LID endLid; // calculated end Lid
|
|
Packit |
857059 |
uint8_t ibMode; // true if subscriber needs IB notices.
|
|
Packit |
857059 |
} SubscriberKey_t;
|
|
Packit |
857059 |
typedef SubscriberKey_t * SubscriberKeyp;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/*
|
|
Packit |
857059 |
* service record table (ServiceRecord)
|
|
Packit |
857059 |
*/
|
|
Packit |
857059 |
typedef struct {
|
|
Packit |
857059 |
CS_HashTablep serviceRecMap; /* pointer to hashmap of service records */
|
|
Packit |
857059 |
Lock_t serviceRecLock;
|
|
Packit |
857059 |
} ServiceRecTable_t;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/*
|
|
Packit |
857059 |
* event subscription entry key structure
|
|
Packit |
857059 |
*/
|
|
Packit |
857059 |
typedef struct {
|
|
Packit |
857059 |
uint64_t serviceId; // Id of service on port specified by serviceGid
|
|
Packit |
857059 |
IB_GID serviceGid;
|
|
Packit |
857059 |
uint16_t servicep_key; // p_key used in contacting service
|
|
Packit |
857059 |
} ServiceRecKey_t;
|
|
Packit |
857059 |
typedef ServiceRecKey_t * ServiceRecKeyp;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
//
|
|
Packit |
857059 |
// Calculate 8-byte multiple padding for multi record SA responses
|
|
Packit |
857059 |
//
|
|
Packit |
857059 |
#define Calculate_Padding(RECSIZE) ( (((RECSIZE)%8) == 0 ) ? 0 : (8 - ((RECSIZE)%8)) )
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#endif // _IB_SA_H_
|