|
Packit |
5ea288 |
/* BEGIN_ICS_COPYRIGHT7 ****************************************
|
|
Packit |
5ea288 |
|
|
Packit Service |
6899a0 |
Copyright (c) 2015-2020, Intel Corporation
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
Redistribution and use in source and binary forms, with or without
|
|
Packit |
5ea288 |
modification, are permitted provided that the following conditions are met:
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
* Redistributions of source code must retain the above copyright notice,
|
|
Packit |
5ea288 |
this list of conditions and the following disclaimer.
|
|
Packit |
5ea288 |
* Redistributions in binary form must reproduce the above copyright
|
|
Packit |
5ea288 |
notice, this list of conditions and the following disclaimer in the
|
|
Packit |
5ea288 |
documentation and/or other materials provided with the distribution.
|
|
Packit |
5ea288 |
* Neither the name of Intel Corporation nor the names of its contributors
|
|
Packit |
5ea288 |
may be used to endorse or promote products derived from this software
|
|
Packit |
5ea288 |
without specific prior written permission.
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
Packit |
5ea288 |
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
Packit |
5ea288 |
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
Packit |
5ea288 |
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
|
Packit |
5ea288 |
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
Packit |
5ea288 |
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
Packit |
5ea288 |
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
Packit |
5ea288 |
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
Packit |
5ea288 |
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
Packit |
5ea288 |
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
** END_ICS_COPYRIGHT7 ****************************************/
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
/* [ICS VERSION STRING: unknown] */
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
#include <stdio.h>
|
|
Packit |
5ea288 |
#include <stdlib.h>
|
|
Packit |
5ea288 |
#include <unistd.h>
|
|
Packit |
5ea288 |
#include <errno.h>
|
|
Packit |
5ea288 |
#include <ctype.h>
|
|
Packit |
5ea288 |
#include <time.h>
|
|
Packit |
5ea288 |
#include <iba/ibt.h>
|
|
Packit |
5ea288 |
#include <stdarg.h>
|
|
Packit |
5ea288 |
#include "stl_print.h"
|
|
Packit |
5ea288 |
#include <iba/stl_helper.h>
|
|
Packit |
5ea288 |
#include <iba/stl_sa_priv.h>
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
#define SIZE_TIME 256 // used in buffer to generate time string for output
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void
|
|
Packit |
5ea288 |
PrintStlNodeRecord(PrintDest_t * dest, int indent,
|
|
Packit |
5ea288 |
const STL_NODE_RECORD * pNodeRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sLID: 0x%08x Type: %s Name: %.*s\n",
|
|
Packit |
5ea288 |
indent, "", pNodeRecord->RID.LID,
|
|
Packit |
5ea288 |
StlNodeTypeToText(pNodeRecord->NodeInfo.NodeType),
|
|
Packit |
5ea288 |
NODE_DESCRIPTION_ARRAY_SIZE,
|
|
Packit |
5ea288 |
pNodeRecord->NodeDesc.NodeString);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sPorts: %d PortNum: %d PartitionCap: %d\n",
|
|
Packit |
5ea288 |
indent, "", pNodeRecord->NodeInfo.NumPorts,
|
|
Packit |
5ea288 |
pNodeRecord->NodeInfo.u1.s.LocalPortNum,
|
|
Packit |
5ea288 |
pNodeRecord->NodeInfo.PartitionCap);
|
|
Packit |
5ea288 |
PrintFunc(dest,
|
|
Packit |
5ea288 |
"%*sNodeGuid: 0x%016" PRIx64 " PortGuid: 0x%016" PRIx64 "\n",
|
|
Packit |
5ea288 |
indent, "", pNodeRecord->NodeInfo.NodeGUID,
|
|
Packit |
5ea288 |
pNodeRecord->NodeInfo.PortGUID);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sSystemImageGuid: 0x%016" PRIx64 "\n", indent, "",
|
|
Packit |
5ea288 |
pNodeRecord->NodeInfo.SystemImageGUID);
|
|
Packit |
5ea288 |
PrintFunc(dest,
|
|
Packit |
5ea288 |
"%*sBaseVersion: %d SmaVersion: %d VendorID: 0x%x DeviceId: 0x%x Revision: 0x%x\n",
|
|
Packit |
5ea288 |
indent, "", pNodeRecord->NodeInfo.BaseVersion,
|
|
Packit |
5ea288 |
pNodeRecord->NodeInfo.ClassVersion,
|
|
Packit |
5ea288 |
pNodeRecord->NodeInfo.u1.s.VendorID,
|
|
Packit |
5ea288 |
pNodeRecord->NodeInfo.DeviceID,
|
|
Packit |
5ea288 |
pNodeRecord->NodeInfo.Revision);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void
|
|
Packit |
5ea288 |
PrintStlPortInfoRecord(PrintDest_t * dest, int indent,
|
|
Packit |
5ea288 |
const STL_PORTINFO_RECORD * pPortInfoRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
const STL_PORT_INFO *pPortInfo = &pPortInfoRecord->PortInfo;
|
|
Packit |
5ea288 |
char buffer[SIZE_TIME]; // Buffer for formatting time output
|
|
Packit |
5ea288 |
struct tm *loctime; // Time structure to convert into human readable time
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
PrintFunc(dest,
|
|
Packit |
5ea288 |
"%*sPortLID: 0x%08x PortNum: 0x%02x (%2u)\n",
|
|
Packit |
5ea288 |
indent, "", pPortInfoRecord->RID.EndPortLID,
|
|
Packit |
5ea288 |
(uint32) pPortInfoRecord->RID.PortNum,
|
|
Packit |
5ea288 |
(uint32) pPortInfoRecord->RID.PortNum);
|
|
Packit |
5ea288 |
PrintStlPortInfo(dest, indent, pPortInfo, 0, 0);
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
// Print out the linkdown reasons (in time order)
|
|
Packit |
5ea288 |
int startIdx = STL_LINKDOWN_REASON_NEXT_INDEX((STL_LINKDOWN_REASON*)&pPortInfoRecord->LinkDownReasons[0]);
|
|
Packit |
5ea288 |
if (pPortInfoRecord->LinkDownReasons[startIdx].Timestamp==0) {
|
|
Packit |
5ea288 |
// Empty entries exist, reset the startIdx to 0.
|
|
Packit |
5ea288 |
startIdx = 0;
|
|
Packit |
5ea288 |
} else {
|
|
Packit |
5ea288 |
if (++startIdx >= STL_NUM_LINKDOWN_REASONS) {
|
|
Packit |
5ea288 |
startIdx = 0;
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
// If no Linkdown reasons exist, print notice.
|
|
Packit |
5ea288 |
if (pPortInfoRecord->LinkDownReasons[startIdx].Timestamp==0) {
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sLinkDownErrorLog: None\n", indent,"");
|
|
Packit |
5ea288 |
} else {
|
|
Packit |
5ea288 |
int i = 0;
|
|
Packit |
5ea288 |
for (; i < STL_NUM_LINKDOWN_REASONS; i++) {
|
|
Packit |
5ea288 |
if (pPortInfoRecord->LinkDownReasons[startIdx].Timestamp==0) {
|
|
Packit |
5ea288 |
break; // We are done.
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
uint8 ldr = pPortInfoRecord->LinkDownReasons[startIdx].LinkDownReason;
|
|
Packit |
5ea288 |
uint8 nldr = pPortInfoRecord->LinkDownReasons[startIdx].NeighborLinkDownReason;
|
|
Packit |
5ea288 |
time_t ts = (time_t) pPortInfoRecord->LinkDownReasons[startIdx].Timestamp;
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
loctime=localtime(&ts); // convert timestamp into time structure
|
|
Packit |
5ea288 |
if (loctime == NULL) { // ensure we have a valid time back
|
|
Packit |
5ea288 |
strncpy(buffer, "N/A", SIZE_TIME);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
else {
|
|
Packit |
5ea288 |
strftime(buffer, SIZE_TIME, "%B %d, %I:%M:%S %p",loctime); // generate time string
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sLinkDownErrorLog: %2d (%20s) Time: %s \n",
|
|
Packit |
5ea288 |
indent, "", ldr, StlLinkDownReasonToText(ldr), buffer);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sNeighborLinkDownErrorLog: %2d (%20s) Time: %s\n",
|
|
Packit |
5ea288 |
indent, "", nldr, StlLinkDownReasonToText(nldr), buffer);
|
|
Packit |
5ea288 |
if (++startIdx >= STL_NUM_LINKDOWN_REASONS) {
|
|
Packit |
5ea288 |
startIdx = 0;
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void
|
|
Packit |
5ea288 |
PrintStlSwitchInfoRecord(PrintDest_t * dest, int indent,
|
|
Packit |
5ea288 |
const STL_SWITCHINFO_RECORD * pSwitchInfoRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
PrintStlSwitchInfo(dest, indent, &pSwitchInfoRecord->SwitchInfoData,
|
|
Packit |
5ea288 |
pSwitchInfoRecord->RID.LID, 0);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void
|
|
Packit |
5ea288 |
PrintStlPKeyTableRecord(PrintDest_t * dest, int indent,
|
|
Packit |
5ea288 |
const STL_P_KEY_TABLE_RECORD * pPKeyTableRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sLID: 0x%08x PortNum: %2u BlockNum: %2u\n",
|
|
Packit |
5ea288 |
indent, "", pPKeyTableRecord->RID.LID,
|
|
Packit |
5ea288 |
pPKeyTableRecord->RID.PortNum,
|
|
Packit |
5ea288 |
pPKeyTableRecord->RID.Blocknum);
|
|
Packit |
5ea288 |
PrintStlPKeyTable(dest, indent, &pPKeyTableRecord->PKeyTblData,
|
|
Packit |
5ea288 |
pPKeyTableRecord->RID.Blocknum, 0);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void
|
|
Packit |
5ea288 |
PrintStlSCSCTableRecord(PrintDest_t * dest, int indent, int extended,
|
|
Packit |
5ea288 |
const STL_SC_MAPPING_TABLE_RECORD * pSCSCMapRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sLID: 0x%08x InputPort: %3u OutputPort: %3u %s\n",
|
|
Packit |
5ea288 |
indent, "",
|
|
Packit |
5ea288 |
pSCSCMapRecord->RID.LID, pSCSCMapRecord->RID.InputPort,
|
|
Packit |
5ea288 |
pSCSCMapRecord->RID.OutputPort,
|
|
Packit |
5ea288 |
!extended ? "" : "(secondary)");
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
PrintStlSCSCMap(dest, indent, "",
|
|
Packit |
5ea288 |
(STL_SCSCMAP *) & pSCSCMapRecord->Map, TRUE);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void
|
|
Packit |
5ea288 |
PrintStlSLSCTableRecord(PrintDest_t * dest, int indent,
|
|
Packit |
5ea288 |
const STL_SL2SC_MAPPING_TABLE_RECORD * pSLSCMapRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sLID: 0x%08x\n",
|
|
Packit |
5ea288 |
indent, "", pSLSCMapRecord->RID.LID);
|
|
Packit |
5ea288 |
PrintStlSLSCMap(dest, indent, "",
|
|
Packit |
5ea288 |
(STL_SLSCMAP *) & pSLSCMapRecord->SLSCMap, TRUE);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void
|
|
Packit |
5ea288 |
PrintStlSCSLTableRecord(PrintDest_t * dest, int indent,
|
|
Packit |
5ea288 |
const STL_SC2SL_MAPPING_TABLE_RECORD * pSCSLMapRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sLID: 0x%08x\n",
|
|
Packit |
5ea288 |
indent, "", pSCSLMapRecord->RID.LID);
|
|
Packit |
5ea288 |
PrintStlSCSLMap(dest, indent, "",
|
|
Packit |
5ea288 |
(STL_SCSLMAP *) & pSCSLMapRecord->SCSLMap, TRUE);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void
|
|
Packit |
5ea288 |
PrintStlSCVLxTableRecord(PrintDest_t * dest, int indent,
|
|
Packit |
5ea288 |
const STL_SC2VL_R_MAPPING_TABLE_RECORD * pSCVLxMapRecord,
|
|
Packit |
5ea288 |
uint16_t attribute)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sLID: 0x%08x Port: %3u\n",
|
|
Packit |
5ea288 |
indent, "", pSCVLxMapRecord->RID.LID,
|
|
Packit |
5ea288 |
pSCVLxMapRecord->RID.Port);
|
|
Packit |
5ea288 |
PrintStlSCVLxMap(dest, indent, "",
|
|
Packit |
5ea288 |
(STL_SCVLMAP *) & pSCVLxMapRecord->SCVLMap, TRUE,
|
|
Packit |
5ea288 |
attribute, FALSE);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void
|
|
Packit |
5ea288 |
PrintStlLinearFDBRecord(PrintDest_t * dest, int indent,
|
|
Packit |
5ea288 |
const STL_LINEAR_FORWARDING_TABLE_RECORD *
|
|
Packit |
5ea288 |
pLinearFDBRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sLID: 0x%08x BlockNum: %6u\n",
|
|
Packit |
5ea288 |
indent, "", pLinearFDBRecord->RID.LID,
|
|
Packit |
5ea288 |
pLinearFDBRecord->RID.BlockNum);
|
|
Packit |
5ea288 |
PrintStlLinearFDB(dest, indent,
|
|
Packit |
5ea288 |
(STL_LINEAR_FORWARDING_TABLE *) pLinearFDBRecord->
|
|
Packit |
5ea288 |
LinearFdbData, pLinearFDBRecord->RID.BlockNum, 0);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void
|
|
Packit |
5ea288 |
PrintStlVLArbTableRecord(PrintDest_t * dest, int indent,
|
|
Packit |
5ea288 |
const STL_VLARBTABLE_RECORD * pVLArbTableRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sLID: 0x%08x Port: %02u\n", indent, "",
|
|
Packit |
5ea288 |
pVLArbTableRecord->RID.LID,
|
|
Packit |
5ea288 |
pVLArbTableRecord->RID.OutputPortNum);
|
|
Packit |
5ea288 |
PrintStlVLArbTable(dest, indent, &pVLArbTableRecord->VLArbTable,
|
|
Packit |
5ea288 |
pVLArbTableRecord->RID.BlockNum, 0);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void
|
|
Packit |
5ea288 |
PrintStlMcMemberRecord(PrintDest_t * dest, int indent,
|
|
Packit |
5ea288 |
const STL_MCMEMBER_RECORD * pMcMemberRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
char buf[8];
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sGID: 0x%016" PRIx64 ":0x%016" PRIx64 "\n",
|
|
Packit |
5ea288 |
indent, "",
|
|
Packit |
5ea288 |
pMcMemberRecord->RID.MGID.AsReg64s.H,
|
|
Packit |
5ea288 |
pMcMemberRecord->RID.MGID.AsReg64s.L);
|
|
Packit |
5ea288 |
PrintFunc(dest,
|
|
Packit |
5ea288 |
"%*sPortGid: 0x%016" PRIx64 ":0x%016" PRIx64
|
|
Packit |
5ea288 |
" Membership: %s%s%s\n", indent, "",
|
|
Packit |
5ea288 |
pMcMemberRecord->RID.PortGID.Type.Global.SubnetPrefix,
|
|
Packit |
5ea288 |
pMcMemberRecord->RID.PortGID.Type.Global.InterfaceID,
|
|
Packit |
5ea288 |
pMcMemberRecord->JoinFullMember ? "Full " : "",
|
|
Packit |
5ea288 |
pMcMemberRecord->JoinNonMember ? "Non " : "",
|
|
Packit |
5ea288 |
pMcMemberRecord->JoinSendOnlyMember ? "Sendonly " : "");
|
|
Packit |
5ea288 |
FormatTimeoutMult(buf, pMcMemberRecord->PktLifeTime);
|
|
Packit |
5ea288 |
PrintFunc(dest,
|
|
Packit |
5ea288 |
"%*sMLID: 0x%08x PKey: 0x%04x Mtu: %5s Rate: %4s PktLifeTime: %s\n",
|
|
Packit |
5ea288 |
indent, "", pMcMemberRecord->MLID, pMcMemberRecord->P_Key,
|
|
Packit |
5ea288 |
IbMTUToText(pMcMemberRecord->Mtu),
|
|
Packit |
5ea288 |
StlStaticRateToText(pMcMemberRecord->Rate), buf);
|
|
Packit |
5ea288 |
PrintFunc(dest,
|
|
Packit |
5ea288 |
"%*sQKey: 0x%08x SL: %2u HopLimit: 0x%02x TClass: 0x%02x\n",
|
|
Packit |
5ea288 |
indent, "", pMcMemberRecord->Q_Key, pMcMemberRecord->SL,
|
|
Packit |
5ea288 |
pMcMemberRecord->HopLimit, pMcMemberRecord->TClass);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void
|
|
Packit |
5ea288 |
PrintStlMCastFDBRecord(PrintDest_t * dest, int indent,
|
|
Packit |
5ea288 |
const STL_MULTICAST_FORWARDING_TABLE_RECORD *
|
|
Packit |
5ea288 |
pMCastFDBRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sLID: 0x%08x Position: %1u BlockNum: %7u\n",
|
|
Packit |
5ea288 |
indent, "", pMCastFDBRecord->RID.LID,
|
|
Packit |
5ea288 |
pMCastFDBRecord->RID.u1.s.Position,
|
|
Packit |
5ea288 |
pMCastFDBRecord->RID.u1.s.BlockNum);
|
|
Packit |
5ea288 |
PrintStlMCastFDB(dest, indent, &pMCastFDBRecord->MftTable,
|
|
Packit |
5ea288 |
pMCastFDBRecord->RID.u1.s.BlockNum, 0);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void
|
|
Packit |
5ea288 |
PrintStlLinkRecord(PrintDest_t * dest, int indent,
|
|
Packit |
5ea288 |
const STL_LINK_RECORD * pLinkRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sLID: 0x%08x -> 0x%08x Port: %3u -> %3u\n",
|
|
Packit |
5ea288 |
indent, "",
|
|
Packit |
5ea288 |
pLinkRecord->RID.FromLID, pLinkRecord->ToLID,
|
|
Packit |
5ea288 |
pLinkRecord->RID.FromPort, pLinkRecord->ToPort);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void
|
|
Packit |
5ea288 |
PrintStlInformInfoRecord(PrintDest_t * dest, int indent,
|
|
Packit |
5ea288 |
const STL_INFORM_INFO_RECORD * pInformInfoRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
PrintFunc(dest,
|
|
Packit |
5ea288 |
"%*sSubLID: 0x%08x Enum: 0x%04x\n", indent, "",
|
|
Packit |
5ea288 |
pInformInfoRecord->RID.SubscriberLID,
|
|
Packit |
5ea288 |
pInformInfoRecord->RID.Enum);
|
|
Packit |
5ea288 |
PrintStlInformInfo(dest, indent, &pInformInfoRecord->InformInfoData);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void PrintStlVfInfoRecord_detail(PrintDest_t *dest, int indent, int detail,
|
|
Packit |
5ea288 |
const STL_VFINFO_RECORD *pVfInfo, int showQueryParams)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
char buf[8];
|
|
Packit |
5ea288 |
char slStr[40];
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
PrintFunc(dest,"%*svFabric Index: %d Name: %s \n",
|
|
Packit |
5ea288 |
indent, "",
|
|
Packit |
5ea288 |
pVfInfo->vfIndex,
|
|
Packit |
5ea288 |
pVfInfo->vfName);
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
int remChars = sizeof(slStr);
|
|
Packit |
5ea288 |
char *slStrPtr = slStr;
|
|
Packit |
5ea288 |
int ret;
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
ret = snprintf(slStrPtr, remChars, "%d", pVfInfo->s1.slBase);
|
|
Packit |
5ea288 |
if (ret > 0 && ret <= remChars) {
|
|
Packit |
5ea288 |
remChars -= ret;
|
|
Packit |
5ea288 |
slStrPtr += ret;
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
if (pVfInfo->slMulticastSpecified) {
|
|
Packit |
5ea288 |
ret = snprintf(slStrPtr, remChars, " McastSL: %d", pVfInfo->slMulticast);
|
|
Packit |
5ea288 |
if (ret > 0 && ret <= remChars) {
|
|
Packit |
5ea288 |
remChars -= ret;
|
|
Packit |
5ea288 |
slStrPtr += ret;
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
if (detail > 1) {
|
|
Packit |
5ea288 |
if (showQueryParams != 0) {
|
|
Packit |
5ea288 |
PrintFunc(dest,"%*sServiceId: 0x%016"PRIx64" MGID: 0x%016"PRIx64":0x%016"PRIx64"\n",
|
|
Packit |
5ea288 |
indent, "", pVfInfo->ServiceID,
|
|
Packit |
5ea288 |
pVfInfo->MGID.AsReg64s.H,
|
|
Packit |
5ea288 |
pVfInfo->MGID.AsReg64s.L);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
// FormatTimeoutMult(buf, pVfInfo->s1.pktLifeTimeInc);
|
|
Packit |
5ea288 |
snprintf(buf, 8, "%d", 1<<pVfInfo->s1.pktLifeTimeInc);
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
PrintFunc(dest,"%*sPKey: 0x%x SL: %s Select: 0x%x%s %s%s PktLifeTimeMult: %s \n",
|
|
Packit |
5ea288 |
indent, "",
|
|
Packit |
5ea288 |
pVfInfo->pKey,
|
|
Packit |
5ea288 |
slStr,
|
|
Packit |
5ea288 |
pVfInfo->s1.selectFlags,
|
|
Packit |
5ea288 |
pVfInfo->s1.selectFlags? ":" : "",
|
|
Packit |
5ea288 |
(pVfInfo->s1.selectFlags&STL_VFINFO_REC_SEL_PKEY_QUERY) ? "PKEY " : "",
|
|
Packit |
5ea288 |
(pVfInfo->s1.selectFlags&STL_VFINFO_REC_SEL_SL_QUERY) ? "SL ": "",
|
|
Packit |
5ea288 |
pVfInfo->s1.pktLifeSpecified? buf: "unspecified");
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
if (pVfInfo->s1.mtuSpecified) {
|
|
Packit |
5ea288 |
PrintFunc(dest,"%*sMaxMtu: %5s ",
|
|
Packit |
5ea288 |
indent, "",
|
|
Packit |
5ea288 |
IbMTUToText(pVfInfo->s1.mtu));
|
|
Packit |
5ea288 |
} else
|
|
Packit |
5ea288 |
PrintFunc(dest,"%*sMaxMtu: unlimited ", indent, "");
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
PrintFunc(dest,"%*sMaxRate: %s ", indent, "",
|
|
Packit |
5ea288 |
pVfInfo->s1.rateSpecified ? IbStaticRateToText(pVfInfo->s1.rate) : "unlimited");
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sOptions: 0x%02x%s %s%s%s\n", indent, "",
|
|
Packit |
5ea288 |
pVfInfo->optionFlags,
|
|
Packit |
5ea288 |
pVfInfo->optionFlags? ":" : "",
|
|
Packit |
5ea288 |
(pVfInfo->optionFlags&STL_VFINFO_REC_OPT_SECURITY) ? "Security " : "",
|
|
Packit |
5ea288 |
(pVfInfo->optionFlags&STL_VFINFO_REC_OPT_QOS) ? "QoS " : "",
|
|
Packit |
5ea288 |
(pVfInfo->optionFlags&STL_VFINFO_REC_OPT_FLOW_DISABLE) ? "FlowCtrlDisable" : "");
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
FormatTimeoutMult(buf, pVfInfo->hoqLife);
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
if (pVfInfo->optionFlags&STL_VFINFO_REC_OPT_QOS) {
|
|
Packit |
5ea288 |
if (pVfInfo->priority) {
|
|
Packit |
5ea288 |
if (pVfInfo->bandwidthPercent) {
|
|
Packit |
5ea288 |
PrintFunc(dest,"%*sQOS: Bandwidth: %3d%% Priority: %s PreemptionRank: %u HoQLife: %s\n",
|
|
Packit |
5ea288 |
indent, "", pVfInfo->bandwidthPercent, "high", pVfInfo->preemptionRank, buf);
|
|
Packit |
5ea288 |
} else {
|
|
Packit |
5ea288 |
PrintFunc(dest,"%*sQOS: HighPriority PreemptionRank: %u HoQLife: %s\n", indent, "", pVfInfo->preemptionRank, buf);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
} else {
|
|
Packit |
5ea288 |
PrintFunc(dest,"%*sQOS: Bandwidth: %3d%% PreemptionRank: %u HoQLife: %s\n",
|
|
Packit |
5ea288 |
indent, "", pVfInfo->bandwidthPercent, pVfInfo->preemptionRank, buf);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
} else {
|
|
Packit |
5ea288 |
PrintFunc(dest,"%*sQOS: Disabled PreemptionRank: %u HoQLife: %s\n",
|
|
Packit |
5ea288 |
indent, "", pVfInfo->preemptionRank, buf);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
} else {
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sPKey: 0x%x SL: %s\n", indent, "", pVfInfo->pKey, slStr);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void PrintStlVfInfoRecord(PrintDest_t *dest, int indent, const STL_VFINFO_RECORD *pVfInfo)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
PrintStlVfInfoRecord_detail(dest, indent, 255, pVfInfo, 1);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
// implementation of single-line VFInfo output
|
|
Packit |
5ea288 |
// @param enumsAsText - when true, convert enumerated values to human-readable text, when false print enums as integer values
|
|
Packit |
5ea288 |
static void PrintStlVfInfoRecordCSV_impl(PrintDest_t *dest, int indent, const STL_VFINFO_RECORD *pVfInfo, boolean enumsAsText)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
char mcastSl[4] = "";
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
if (pVfInfo->slMulticastSpecified)
|
|
Packit |
5ea288 |
snprintf(mcastSl, sizeof(mcastSl), "%u", pVfInfo->slMulticast);
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
if (enumsAsText) {
|
|
Packit |
5ea288 |
PrintFunc(dest,"%*s%s:%d:0x%x:%d:%s:%s:0x%x:%s\n",
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
indent, "",
|
|
Packit |
5ea288 |
pVfInfo->vfName,
|
|
Packit |
5ea288 |
pVfInfo->vfIndex,
|
|
Packit |
5ea288 |
pVfInfo->pKey,
|
|
Packit |
5ea288 |
pVfInfo->s1.slBase,
|
|
Packit |
5ea288 |
(pVfInfo->s1.mtuSpecified)? IbMTUToText(pVfInfo->s1.mtu):"unlimited",
|
|
Packit |
5ea288 |
pVfInfo->s1.rateSpecified ? IbStaticRateToText(pVfInfo->s1.rate) : "unlimited",
|
|
Packit |
5ea288 |
pVfInfo->optionFlags,
|
|
Packit |
5ea288 |
mcastSl);
|
|
Packit |
5ea288 |
} else {
|
|
Packit |
5ea288 |
PrintFunc(dest,"%*s%s:%d:0x%x:%d:%d:%d:0x%x:%s\n",
|
|
Packit |
5ea288 |
indent, "",
|
|
Packit |
5ea288 |
pVfInfo->vfName,
|
|
Packit |
5ea288 |
pVfInfo->vfIndex,
|
|
Packit |
5ea288 |
pVfInfo->pKey,
|
|
Packit |
5ea288 |
pVfInfo->s1.slBase,
|
|
Packit |
5ea288 |
(pVfInfo->s1.mtuSpecified)? pVfInfo->s1.mtu:0,
|
|
Packit |
5ea288 |
pVfInfo->s1.rateSpecified ? pVfInfo->s1.rate:0,
|
|
Packit |
5ea288 |
pVfInfo->optionFlags,
|
|
Packit |
5ea288 |
mcastSl);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
// output VFINFO in a delimited format for easy parsing in shell scripts
|
|
Packit |
5ea288 |
void PrintStlVfInfoRecordCSV2(PrintDest_t *dest, int indent, const STL_VFINFO_RECORD *pVfInfo)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
PrintStlVfInfoRecordCSV_impl(dest, indent, pVfInfo, 0);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
// output VFINFO in a delimited format for easy parsing in shell scripts
|
|
Packit |
5ea288 |
void PrintStlVfInfoRecordCSV(PrintDest_t *dest, int indent, const STL_VFINFO_RECORD *pVfInfo)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
PrintStlVfInfoRecordCSV_impl(dest, indent, pVfInfo, 1);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void PrintStlTraceRecord(PrintDest_t *dest, int indent, const STL_TRACE_RECORD *pTraceRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sIDGeneration: 0x%04x\n",
|
|
Packit |
5ea288 |
indent, "", pTraceRecord->IDGeneration);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sNodeType: %s\n",
|
|
Packit |
5ea288 |
indent, "", StlNodeTypeToText(pTraceRecord->NodeType));
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sNodeID: 0x%016"PRIx64" ChassisID: %016"PRIx64"\n",
|
|
Packit |
5ea288 |
indent, "", pTraceRecord->NodeID, pTraceRecord->ChassisID);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sEntryPortID: 0x%016"PRIx64" ExitPortID: %016"PRIx64"\n",
|
|
Packit |
5ea288 |
indent, "", pTraceRecord->EntryPortID, pTraceRecord->ExitPortID);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sEntryPort: 0x%02x ExitPort: 0x%02x\n",
|
|
Packit |
5ea288 |
indent, "", pTraceRecord->EntryPort, pTraceRecord->ExitPort);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void PrintStlFabricInfoRecord(PrintDest_t *dest, int indent, const STL_FABRICINFO_RECORD *pFabricInfoRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sNumber of HFIs: %u\n",
|
|
Packit |
5ea288 |
indent, "", pFabricInfoRecord->NumHFIs);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sNumber of Switches: %u\n",
|
|
Packit |
5ea288 |
indent, "", pFabricInfoRecord->NumSwitches);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sNumber of Links: %u\n",
|
|
Packit |
5ea288 |
indent, "", pFabricInfoRecord->NumInternalHFILinks
|
|
Packit |
5ea288 |
+ pFabricInfoRecord->NumExternalHFILinks
|
|
Packit |
5ea288 |
+ pFabricInfoRecord->NumInternalISLs
|
|
Packit |
5ea288 |
+ pFabricInfoRecord->NumExternalISLs);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sNumber of HFI Links: %-7u (Internal: %u External: %u)\n",
|
|
Packit |
5ea288 |
indent, "", pFabricInfoRecord->NumInternalHFILinks +
|
|
Packit |
5ea288 |
pFabricInfoRecord->NumExternalHFILinks,
|
|
Packit |
5ea288 |
pFabricInfoRecord->NumInternalHFILinks,
|
|
Packit |
5ea288 |
pFabricInfoRecord->NumExternalHFILinks);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sNumber of ISLs: %-7u (Internal: %u External: %u)\n",
|
|
Packit |
5ea288 |
indent, "", pFabricInfoRecord->NumInternalISLs +
|
|
Packit |
5ea288 |
pFabricInfoRecord->NumExternalISLs,
|
|
Packit |
5ea288 |
pFabricInfoRecord->NumInternalISLs,
|
|
Packit |
5ea288 |
pFabricInfoRecord->NumExternalISLs);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sNumber of Degraded Links: %-7u (HFI Links: %u ISLs: %u)\n",
|
|
Packit |
5ea288 |
indent, "", pFabricInfoRecord->NumDegradedHFILinks +
|
|
Packit |
5ea288 |
pFabricInfoRecord->NumDegradedISLs,
|
|
Packit |
5ea288 |
pFabricInfoRecord->NumDegradedHFILinks,
|
|
Packit |
5ea288 |
pFabricInfoRecord->NumDegradedISLs);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sNumber of Omitted Links: %-7u (HFI Links: %u ISLs: %u)\n",
|
|
Packit |
5ea288 |
indent, "", pFabricInfoRecord->NumOmittedHFILinks +
|
|
Packit |
5ea288 |
pFabricInfoRecord->NumOmittedISLs,
|
|
Packit |
5ea288 |
pFabricInfoRecord->NumOmittedHFILinks,
|
|
Packit |
5ea288 |
pFabricInfoRecord->NumOmittedISLs);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void PrintQuarantinedNodeRecord(PrintDest_t *dest, int indent, const STL_QUARANTINED_NODE_RECORD *pQuarantinedNodeRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
int violStrLen = 256;
|
|
Packit |
5ea288 |
char violationString[violStrLen];
|
|
Packit |
5ea288 |
int previousViolation = 0;
|
|
Packit |
5ea288 |
memset(violationString, 0, sizeof(violationString));
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
if(pQuarantinedNodeRecord->quarantineReasons & STL_QUARANTINE_REASON_SPOOF_GENERIC) {
|
|
Packit |
5ea288 |
strncat(violationString, "NodeGUID/NodeType Spoofing", violStrLen - strlen(violationString));
|
|
Packit |
5ea288 |
previousViolation = 1;
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
if(pQuarantinedNodeRecord->quarantineReasons & STL_QUARANTINE_REASON_TOPO_NODE_DESC) {
|
|
Packit |
5ea288 |
strncat(violationString, previousViolation ? ", NodeDesc Mismatch" : "NodeDesc Mismatch",
|
|
Packit |
5ea288 |
violStrLen - strlen(violationString));
|
|
Packit |
5ea288 |
previousViolation = 1;
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
if(pQuarantinedNodeRecord->quarantineReasons & STL_QUARANTINE_REASON_TOPO_NODE_GUID) {
|
|
Packit |
5ea288 |
strncat(violationString, previousViolation ? ", NodeGUID Mismatch" : "NodeGUID Mismatch",
|
|
Packit |
5ea288 |
violStrLen - strlen(violationString));
|
|
Packit |
5ea288 |
previousViolation = 1;
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
if(pQuarantinedNodeRecord->quarantineReasons & STL_QUARANTINE_REASON_TOPO_PORT_GUID) {
|
|
Packit |
5ea288 |
strncat(violationString, previousViolation ? ", PortGUID Mismatch" : "PortGUID Mismatch",
|
|
Packit |
5ea288 |
violStrLen - strlen(violationString));
|
|
Packit |
5ea288 |
previousViolation = 1;
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
if(pQuarantinedNodeRecord->quarantineReasons & STL_QUARANTINE_REASON_TOPO_UNDEFINED_LINK) {
|
|
Packit |
5ea288 |
strncat(violationString, previousViolation ? ", Undefined Link" : "Undefined Link",
|
|
Packit |
5ea288 |
violStrLen - strlen(violationString));
|
|
Packit |
5ea288 |
previousViolation = 1;
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
if(pQuarantinedNodeRecord->quarantineReasons & STL_QUARANTINE_REASON_SMALL_MTU_SIZE) {
|
|
Packit |
5ea288 |
strncat(violationString, previousViolation ? ", Small MTU Size" : "Small MTU Size",
|
|
Packit |
5ea288 |
violStrLen - strlen(violationString));
|
|
Packit |
5ea288 |
previousViolation = 1;
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
if(pQuarantinedNodeRecord->quarantineReasons & STL_QUARANTINE_REASON_VL_COUNT) {
|
|
Packit |
5ea288 |
strncat(violationString, previousViolation ? ", Incorrect VL Count" : "Incorrect VL Count",
|
|
Packit |
5ea288 |
violStrLen - strlen(violationString));
|
|
Packit |
5ea288 |
previousViolation = 1;
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
if(pQuarantinedNodeRecord->quarantineReasons & STL_QUARANTINE_REASON_MAXLID) {
|
|
Packit |
5ea288 |
strncat(violationString, previousViolation ? ", MaximumLID unsupportable" : "MaximumLID unsupportable",
|
|
Packit |
5ea288 |
violStrLen - strlen(violationString));
|
|
Packit |
5ea288 |
previousViolation = 1;
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sConnected to Port %d of (LID: 0x%x, NodeGUID: 0x%016" PRIx64 ")\n", indent, "", pQuarantinedNodeRecord->trustedPortNum, pQuarantinedNodeRecord->trustedLid, pQuarantinedNodeRecord->trustedNodeGUID);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*s Offending Node Actual NodeGUID: 0x%016" PRIx64 "\n", indent, "", pQuarantinedNodeRecord->trustedNeighborNodeGUID);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*s Violation(s): %s\n", indent, "", violationString);
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
if(pQuarantinedNodeRecord->quarantineReasons & STL_QUARANTINE_REASON_TOPO_NODE_DESC) {
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*s Expected Node Description: %.*s\n", indent, "", STL_NODE_DESCRIPTION_ARRAY_SIZE, pQuarantinedNodeRecord->expectedNodeInfo.nodeDesc.NodeString);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
if(pQuarantinedNodeRecord->quarantineReasons & STL_QUARANTINE_REASON_TOPO_NODE_GUID) {
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*s Expected NodeGUID: 0x%016" PRIx64 "\n", indent, "", pQuarantinedNodeRecord->expectedNodeInfo.nodeGUID);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
if(pQuarantinedNodeRecord->quarantineReasons & STL_QUARANTINE_REASON_TOPO_PORT_GUID) {
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*s Expected PortGUID: 0x%016" PRIx64 "\n", indent, "", pQuarantinedNodeRecord->expectedNodeInfo.portGUID);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
if(pQuarantinedNodeRecord->quarantineReasons & STL_QUARANTINE_REASON_SPOOF_GENERIC) {
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*s <SPOOFED NODE REPORTED INFORMATION (May be falsified)>\n", indent, "");
|
|
Packit |
5ea288 |
} else {
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*s Received node Information:\n", indent, "");
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*s Node Description: %.*s\n", indent, "", NODE_DESCRIPTION_ARRAY_SIZE, pQuarantinedNodeRecord->NodeDesc.NodeString);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*s Type: %s Ports: %d PortNum: %d PartitionCap: %d\n", indent, "", StlNodeTypeToText(pQuarantinedNodeRecord->NodeInfo.NodeType), pQuarantinedNodeRecord->NodeInfo.NumPorts, pQuarantinedNodeRecord->NodeInfo.u1.s.LocalPortNum, pQuarantinedNodeRecord->NodeInfo.PartitionCap);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*s NodeGUID: 0x%016" PRIx64 " PortGUID: 0x%016" PRIx64 "\n", indent, "", pQuarantinedNodeRecord->NodeInfo.NodeGUID, pQuarantinedNodeRecord->NodeInfo.PortGUID);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*s SystemImageGuid: 0x%016" PRIx64 " BaseVersion: %d SmaVersion: %d\n", indent, "", pQuarantinedNodeRecord->NodeInfo.SystemImageGUID, pQuarantinedNodeRecord->NodeInfo.BaseVersion, pQuarantinedNodeRecord->NodeInfo.ClassVersion);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*s VendorID: 0x%x DeviceId: 0x%x Revision: 0x%x\n", indent, "", pQuarantinedNodeRecord->NodeInfo.u1.s.VendorID, pQuarantinedNodeRecord->NodeInfo.DeviceID, pQuarantinedNodeRecord->NodeInfo.Revision);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void PrintStlCongestionInfoRecord(PrintDest_t *dest, int indent, const STL_CONGESTION_INFO_RECORD *pCongestionInfo) {
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sLID %d\n", indent, "", pCongestionInfo->LID);
|
|
Packit |
5ea288 |
PrintStlCongestionInfo(dest, indent, &pCongestionInfo->CongestionInfo, 0);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void PrintStlSwitchCongestionSettingRecord(PrintDest_t *dest, int indent, const STL_SWITCH_CONGESTION_SETTING_RECORD *pSwCongestionSetting) {
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sLID %d\n", indent, "", pSwCongestionSetting->LID);
|
|
Packit |
5ea288 |
PrintStlSwitchCongestionSetting(dest, indent, &pSwCongestionSetting->SwitchCongestionSetting, 0);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void PrintStlSwitchPortCongestionSettingRecord(PrintDest_t *dest, int indent, const STL_SWITCH_PORT_CONGESTION_SETTING_RECORD *pSwPortCS) {
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sLID %d Port %d:\n", indent, "", pSwPortCS->RID.LID, pSwPortCS->RID.Port);
|
|
Packit |
5ea288 |
PrintStlSwitchPortCongestionSettingElement(dest, indent, pSwPortCS->SwitchPortCongestionSetting.Elements, 0, 0);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void PrintStlHfiCongestionSettingRecord(PrintDest_t *dest, int indent, const STL_HFI_CONGESTION_SETTING_RECORD *pHfiCongestionSetting) {
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sLID %d\n", indent, "", pHfiCongestionSetting->LID);
|
|
Packit |
5ea288 |
PrintStlHfiCongestionSetting(dest, indent, &pHfiCongestionSetting->HFICongestionSetting, 0);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void PrintStlHfiCongestionControlTabRecord(PrintDest_t *dest, int indent, const STL_HFI_CONGESTION_CONTROL_TABLE_RECORD *pHfiCongestionControl) {
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sLID %d BlockNum %d:\n", indent, "", pHfiCongestionControl->RID.LID, pHfiCongestionControl->RID.BlockNum);
|
|
Packit |
5ea288 |
PrintStlHfiCongestionControlTab(dest, indent, &pHfiCongestionControl->HFICongestionControlTable, 1, 0, 0);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void PrintBfrCtlTableRecord(PrintDest_t *dest, int indent, const STL_BUFFER_CONTROL_TABLE_RECORD *pBfrCtlTable)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sLID %d Port %d:\n", indent, "", pBfrCtlTable->RID.LID, pBfrCtlTable->RID.Port);
|
|
Packit |
5ea288 |
PrintStlBfrCtlTable(dest, indent, &pBfrCtlTable->BufferControlTable, 0);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void PrintStlCableInfoRecord(PrintDest_t *dest, int indent, const STL_CABLE_INFO_RECORD *pCableInfoRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sLID %d Port %d:\nPortType: %s\n", indent, "",
|
|
Packit |
5ea288 |
pCableInfoRecord->LID, pCableInfoRecord->Port, StlPortTypeToText(pCableInfoRecord->u1.s.PortType));
|
|
Packit |
5ea288 |
PrintStlCableInfo(dest, indent, pCableInfoRecord->Data,
|
|
Packit |
5ea288 |
pCableInfoRecord->u1.s.Address, pCableInfoRecord->Length+1, pCableInfoRecord->u1.s.PortType, CABLEINFO_DETAIL_ALL, 0, FALSE);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void PrintStlPortGroupTabRecord(PrintDest_t *dest, int indent, const STL_PORT_GROUP_TABLE_RECORD *pRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sLID %d Block %d:\n", indent, "", pRecord->RID.LID, pRecord->RID.BlockNum);
|
|
Packit |
5ea288 |
PrintStlPortGroupTable(dest, indent, pRecord->GroupBlock, pRecord->RID.BlockNum, 0, 0);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void PrintStlPortGroupFwdTabRecord(PrintDest_t *dest, int indent, const STL_PORT_GROUP_FORWARDING_TABLE_RECORD *pRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sSwitch LID: 0x%08x BlockNum: %6u\n", indent, "", pRecord->RID.LID, pRecord->RID.u1.s.BlockNum);
|
|
Packit |
5ea288 |
PrintStlPortGroupFDB(dest, indent+4, (STL_PORT_GROUP_FORWARDING_TABLE *) pRecord->PGFdbData, pRecord->RID.u1.s.BlockNum, 0);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
void PrintStlDeviceGroupMemberRecord(PrintDest_t *dest, int indent, const STL_DEVICE_GROUP_MEMBER_RECORD *pRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
PrintFunc(dest,"%*sDevice Group: %s LID: 0x%08x Port: %d PortGUID: 0x%016" PRIx64 " Node Description: %s\n", indent, "",
|
|
Packit |
5ea288 |
pRecord->DeviceGroupName, pRecord->LID, pRecord->Port, pRecord->GUID, pRecord->NodeDescription.NodeString);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void PrintStlDeviceGroupNameRecord(PrintDest_t *dest, int indent, const STL_DEVICE_GROUP_NAME_RECORD *pRecord, int record_no)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
PrintFunc(dest,"%*sGroup %d: %s\n", indent, "",
|
|
Packit |
5ea288 |
record_no, pRecord->DeviceGroupName);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void PrintStlDeviceTreeMemberRecord(PrintDest_t *dest, int indent, const STL_DEVICE_TREE_MEMBER_RECORD *pRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
char buf_act[256];
|
|
Packit |
5ea288 |
char buf_mode[256];
|
|
Packit |
5ea288 |
int length = strlen("Ports :"); // The string from FormatStlPortMask()
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
FormatStlPortMask(buf_act, pRecord->portMaskAct, MAX_STL_PORTS, sizeof(buf_act));
|
|
Packit |
5ea288 |
FormatStlPortMask(buf_mode, pRecord->portMaskPortLinkMode, MAX_STL_PORTS, sizeof(buf_mode));
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
PrintFunc(dest,"%*sNodeLID: 0x%08x NodeGUID: 0x%016" PRIx64 " NodeSystemImageGUID: 0x%016" PRIx64 " Type: [%s] Node Description: [%s] NumPorts: %d Active %s\n",
|
|
Packit |
5ea288 |
indent, "", pRecord->LID, pRecord->GUID, pRecord->SystemImageGUID, StlNodeTypeToText(pRecord->NodeType), pRecord->NodeDescription.NodeString, pRecord->NumPorts,
|
|
Packit |
5ea288 |
strlen(buf_act) > length ? buf_act : "ports: none");
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void PrintStlSwitchCostRecord(PrintDest_t *dest, int indent, const STL_SWITCH_COST_RECORD *pRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
int i;
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sSource LID: 0x%08x\n", indent, "", pRecord->SLID);
|
|
Packit |
5ea288 |
for(i = 0; (i < STL_SWITCH_COST_NUM_ENTRIES) && (pRecord->Cost[i].DLID != 0); ++i){
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sLID: 0x%08x -> Cost: %u\n", indent+4, "", pRecord->Cost[i].DLID, pRecord->Cost[i].value);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
#define HEXTOCHAR(c) ((isgraph(c)||(c)==' ')?(c):'.')
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
static void FormatChars(char *buf, const uint8* data, uint32 len)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
uint32 j;
|
|
Packit |
5ea288 |
int offset = 0;
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
for (j=0; j
|
|
Packit |
5ea288 |
buf[offset++]=HEXTOCHAR(data[j]);
|
|
Packit |
5ea288 |
}
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
void PrintStlServiceRecord(PrintDest_t *dest, int indent,
|
|
Packit |
5ea288 |
const STL_SERVICE_RECORD *pServiceRecord)
|
|
Packit |
5ea288 |
{
|
|
Packit |
5ea288 |
char buf[81];
|
|
Packit |
5ea288 |
int offset;
|
|
Packit |
5ea288 |
unsigned j;
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sSID: 0x%016"PRIx64" GID: 0x%016"PRIx64":0x%016"PRIx64" PKey: 0x%04x\n",
|
|
Packit |
5ea288 |
indent, "", pServiceRecord->RID.ServiceID,
|
|
Packit |
5ea288 |
pServiceRecord->RID.ServiceGID.Type.Global.SubnetPrefix,
|
|
Packit |
5ea288 |
pServiceRecord->RID.ServiceGID.Type.Global.InterfaceID,
|
|
Packit |
5ea288 |
pServiceRecord->RID.ServiceP_Key);
|
|
Packit |
5ea288 |
if (pServiceRecord->ServiceLease == SERVICE_LEASE_INFINITE)
|
|
Packit |
5ea288 |
strcpy(buf, "Infinite");
|
|
Packit |
5ea288 |
else
|
|
Packit |
5ea288 |
// %6d not quite big enough for uint32, but will cover most non-infinite
|
|
Packit |
5ea288 |
// practical values
|
|
Packit |
5ea288 |
sprintf(buf, "%6d s", pServiceRecord->ServiceLease);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*sLease: %s Name: %s\n",
|
|
Packit |
5ea288 |
indent, "", buf, pServiceRecord->ServiceName);
|
|
Packit |
5ea288 |
// dump service data
|
|
Packit |
5ea288 |
offset=sprintf(buf, "Data8: ");
|
|
Packit |
5ea288 |
for (j=0; j<16; ++j)
|
|
Packit |
5ea288 |
offset+=sprintf(&buf[offset], " %02x", pServiceRecord->ServiceData8[j]);
|
|
Packit |
5ea288 |
offset+=sprintf(&buf[offset], " ");
|
|
Packit |
5ea288 |
FormatChars(&buf[offset], pServiceRecord->ServiceData8, 16);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*s%s\n", indent, "", buf);
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
offset=sprintf(buf, "Data16:");
|
|
Packit |
5ea288 |
for (j=0; j<8; ++j)
|
|
Packit |
5ea288 |
offset+=sprintf(&buf[offset], " %04x", pServiceRecord->ServiceData16[j]);
|
|
Packit |
5ea288 |
offset+=sprintf(&buf[offset], " ");
|
|
Packit |
5ea288 |
FormatChars(&buf[offset], (uint8*)pServiceRecord->ServiceData16, 16);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*s%s\n", indent, "", buf);
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
offset=sprintf(buf, "Data32:");
|
|
Packit |
5ea288 |
for (j=0; j<4; ++j)
|
|
Packit |
5ea288 |
offset+=sprintf(&buf[offset], " %08x", pServiceRecord->ServiceData32[j]);
|
|
Packit |
5ea288 |
offset+=sprintf(&buf[offset], " ");
|
|
Packit |
5ea288 |
FormatChars(&buf[offset], (uint8*)pServiceRecord->ServiceData32, 16);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*s%s\n", indent, "", buf);
|
|
Packit |
5ea288 |
|
|
Packit |
5ea288 |
offset=sprintf(buf, "Data64:");
|
|
Packit |
5ea288 |
for (j=0; j<2; ++j)
|
|
Packit |
5ea288 |
offset+=sprintf(&buf[offset], " %016"PRIx64, pServiceRecord->ServiceData64[j]);
|
|
Packit |
5ea288 |
offset+=sprintf(&buf[offset], " ");
|
|
Packit |
5ea288 |
FormatChars(&buf[offset], (uint8*)pServiceRecord->ServiceData64, 16);
|
|
Packit |
5ea288 |
PrintFunc(dest, "%*s%s\n", indent, "", buf);
|
|
Packit |
5ea288 |
}
|