Blame IbPrint/stl_pa.c

Packit Service ac7b0b
/* BEGIN_ICS_COPYRIGHT7 ****************************************
Packit Service ac7b0b
Packit Service ac7b0b
Copyright (c) 2015-2017, Intel Corporation
Packit Service ac7b0b
Packit Service ac7b0b
Redistribution and use in source and binary forms, with or without
Packit Service ac7b0b
modification, are permitted provided that the following conditions are met:
Packit Service ac7b0b
Packit Service ac7b0b
    * Redistributions of source code must retain the above copyright notice,
Packit Service ac7b0b
      this list of conditions and the following disclaimer.
Packit Service ac7b0b
    * Redistributions in binary form must reproduce the above copyright
Packit Service ac7b0b
      notice, this list of conditions and the following disclaimer in the
Packit Service ac7b0b
      documentation and/or other materials provided with the distribution.
Packit Service ac7b0b
    * Neither the name of Intel Corporation nor the names of its contributors
Packit Service ac7b0b
      may be used to endorse or promote products derived from this software
Packit Service ac7b0b
      without specific prior written permission.
Packit Service ac7b0b
Packit Service ac7b0b
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Packit Service ac7b0b
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Packit Service ac7b0b
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Packit Service ac7b0b
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
Packit Service ac7b0b
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit Service ac7b0b
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Packit Service ac7b0b
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Packit Service ac7b0b
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Packit Service ac7b0b
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Packit Service ac7b0b
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit Service ac7b0b
Packit Service ac7b0b
** END_ICS_COPYRIGHT7   ****************************************/
Packit Service ac7b0b
Packit Service ac7b0b
/* [ICS VERSION STRING: unknown] */
Packit Service ac7b0b
Packit Service ac7b0b
#include <stdio.h>
Packit Service ac7b0b
#include <stdlib.h>
Packit Service ac7b0b
#include <unistd.h>
Packit Service ac7b0b
#include <errno.h>
Packit Service ac7b0b
#include <iba/ibt.h>
Packit Service ac7b0b
#include <iba/stl_pa_priv.h>
Packit Service ac7b0b
#include <iba/ib_helper.h>
Packit Service ac7b0b
#include <stdarg.h>
Packit Service ac7b0b
#include <time.h>
Packit Service ac7b0b
#include "ibprint.h"
Packit Service ac7b0b
Packit Service ac7b0b
void PrintStlPAImageId(PrintDest_t *dest, int indent, const STL_PA_IMAGE_ID_DATA *pImageId)
Packit Service ac7b0b
{
Packit Service ac7b0b
	time_t absTime = (time_t)pImageId->imageTime.absoluteTime;
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sImageNumber: 0x%"PRIx64" Offset: %d\n",
Packit Service ac7b0b
			indent, "", pImageId->imageNumber, pImageId->imageOffset);
Packit Service ac7b0b
	if (absTime) {
Packit Service ac7b0b
		char buf[80];
Packit Service ac7b0b
		snprintf(buf, sizeof(buf), "%s", ctime((const time_t *)&absTime));
Packit Service ac7b0b
		if ((strlen(buf)>0) && (buf[strlen(buf)-1] == '\n'))
Packit Service ac7b0b
			buf[strlen(buf)-1] = '\0';
Packit Service ac7b0b
Packit Service ac7b0b
		PrintFunc(dest, "%*sImageTime: %s\n", indent, "", buf);
Packit Service ac7b0b
	}
Packit Service ac7b0b
	return;
Packit Service ac7b0b
}
Packit Service ac7b0b
Packit Service ac7b0b
void PrintStlPAGroupList(PrintDest_t *dest, int indent, const int numRecords, const STL_PA_GROUP_LIST *pGroupList)
Packit Service ac7b0b
{
Packit Service ac7b0b
	int i;
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sNumber of Groups: %u\n", indent, "", numRecords);
Packit Service ac7b0b
	for (i = 0; i < numRecords; i++)
Packit Service ac7b0b
		PrintFunc(dest, "%*sGroup %u: %s\n", indent, "", i+1, pGroupList[i].groupName);
Packit Service ac7b0b
	return;
Packit Service ac7b0b
}
Packit Service ac7b0b
Packit Service ac7b0b
void PrintStlPAGroupList2(PrintDest_t *dest, int indent, const int numRecords, const STL_PA_GROUP_LIST2 *pGroupList)
Packit Service ac7b0b
{
Packit Service ac7b0b
	int i;
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sNumber of Groups: %u\n", indent, "", numRecords);
Packit Service ac7b0b
	for (i = 0; i < numRecords; i++)
Packit Service ac7b0b
		PrintFunc(dest, "%*sGroup %u: %s\n", indent, "", i+1, pGroupList[i].groupName);
Packit Service ac7b0b
Packit Service ac7b0b
	PrintStlPAImageId(dest, indent+2, &pGroupList[0].imageId);
Packit Service ac7b0b
	return;
Packit Service ac7b0b
}
Packit Service ac7b0b
Packit Service ac7b0b
void PrintStlPAGroupUtilStats(PrintDest_t *dest, int indent, const STL_PA_PM_UTIL_STATS *pUtilStat)
Packit Service ac7b0b
{
Packit Service ac7b0b
	int i;
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sUtil: Tot %6"PRIu64" Max %6u Min %6u Avg %6u MiB/s\n",
Packit Service ac7b0b
				indent, "", pUtilStat->totalMBps, pUtilStat->maxMBps, pUtilStat->minMBps, pUtilStat->avgMBps);
Packit Service ac7b0b
	PrintFunc(dest, "%*sUtil: ", indent, "");
Packit Service ac7b0b
	for (i = 0; i < STL_PM_UTIL_BUCKETS; i++)
Packit Service ac7b0b
		PrintFunc(dest, " %4d", pUtilStat->BWBuckets[i]);
Packit Service ac7b0b
	PrintFunc(dest, "%*s\n", indent, "");
Packit Service ac7b0b
	PrintFunc(dest, "%*sPkts: Tot %6"PRIu64" Max %6u Min %6u Avg %6u KiPps/s\n",
Packit Service ac7b0b
				indent, "", pUtilStat->totalKPps, pUtilStat->maxKPps, pUtilStat->minKPps, pUtilStat->avgKPps);
Packit Service ac7b0b
	PrintFunc(dest, "%*s NoResp Ports: PMA: %u  Topo: %u\n",
Packit Service ac7b0b
				indent, "", pUtilStat->pmaNoRespPorts, pUtilStat->topoIncompPorts);
Packit Service ac7b0b
Packit Service ac7b0b
	return;
Packit Service ac7b0b
}
Packit Service ac7b0b
Packit Service ac7b0b
void PrintStlPAGroupErrorStats(PrintDest_t *dest, int indent, const STL_PM_CATEGORY_STATS *pErrStat)
Packit Service ac7b0b
{
Packit Service ac7b0b
	int i;
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sIntegrity     Max %6u     Buckets: ",
Packit Service ac7b0b
		indent, "", pErrStat->categoryMaximums.integrityErrors);
Packit Service ac7b0b
	for (i = 0; i < STL_PM_CATEGORY_BUCKETS; i++)
Packit Service ac7b0b
		PrintFunc(dest, " %4u ", pErrStat->ports[i].integrityErrors);
Packit Service ac7b0b
	PrintFunc(dest, "\n");
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sCongestion    Max %6u     Buckets: ",
Packit Service ac7b0b
		indent, "", pErrStat->categoryMaximums.congestion);
Packit Service ac7b0b
	for (i = 0; i < STL_PM_CATEGORY_BUCKETS; i++)
Packit Service ac7b0b
		PrintFunc(dest, " %4u ", pErrStat->ports[i].congestion);
Packit Service ac7b0b
	PrintFunc(dest, "\n");
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sSmaCongestion Max %6u     Buckets: ",
Packit Service ac7b0b
		indent, "", pErrStat->categoryMaximums.smaCongestion);
Packit Service ac7b0b
	for (i = 0; i < STL_PM_CATEGORY_BUCKETS; i++)
Packit Service ac7b0b
		PrintFunc(dest, " %4u ", pErrStat->ports[i].smaCongestion);
Packit Service ac7b0b
	PrintFunc(dest, "\n");
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sBubble        Max %6u     Buckets: ",
Packit Service ac7b0b
			  indent, "", pErrStat->categoryMaximums.bubble);
Packit Service ac7b0b
	for (i = 0; i < STL_PM_CATEGORY_BUCKETS; i++)
Packit Service ac7b0b
		PrintFunc(dest, " %4u ", pErrStat->ports[i].bubble);
Packit Service ac7b0b
	PrintFunc(dest, "\n");
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sSecurity      Max %6u     Buckets: ",
Packit Service ac7b0b
		indent, "", pErrStat->categoryMaximums.securityErrors);
Packit Service ac7b0b
	for (i = 0; i < STL_PM_CATEGORY_BUCKETS; i++)
Packit Service ac7b0b
		PrintFunc(dest, " %4u ", pErrStat->ports[i].securityErrors);
Packit Service ac7b0b
	PrintFunc(dest, "\n");
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sRouting       Max %6u     Buckets: ",
Packit Service ac7b0b
		indent, "", pErrStat->categoryMaximums.routingErrors);
Packit Service ac7b0b
	for (i = 0; i < STL_PM_CATEGORY_BUCKETS; i++)
Packit Service ac7b0b
		PrintFunc(dest, " %4u ", pErrStat->ports[i].routingErrors);
Packit Service ac7b0b
	PrintFunc(dest, "\n");
Packit Service ac7b0b
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sUtilization:    %3u.%1u%%\n", indent, "",
Packit Service ac7b0b
		   pErrStat->categoryMaximums.utilizationPct10 / 10,
Packit Service ac7b0b
		   pErrStat->categoryMaximums.utilizationPct10 % 10);
Packit Service ac7b0b
	PrintFunc(dest, "%*sDiscards:       %3u.%1u%%\n", indent, "",
Packit Service ac7b0b
		   pErrStat->categoryMaximums.discardsPct10 / 10,
Packit Service ac7b0b
		   pErrStat->categoryMaximums.discardsPct10 % 10);
Packit Service ac7b0b
Packit Service ac7b0b
	return;
Packit Service ac7b0b
}
Packit Service ac7b0b
Packit Service ac7b0b
void PrintStlPAGroupInfo(PrintDest_t *dest, int indent, const STL_PA_PM_GROUP_INFO_DATA *pGroupInfo)
Packit Service ac7b0b
{
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sGroup name: %s\n",
Packit Service ac7b0b
				indent, "", pGroupInfo->groupName);
Packit Service ac7b0b
	if (pGroupInfo->minInternalRate != IB_STATIC_RATE_DONTCARE
Packit Service ac7b0b
				|| pGroupInfo->maxInternalRate != IB_STATIC_RATE_DONTCARE)
Packit Service ac7b0b
		PrintFunc(dest, "%*sNum internal ports: %u MinRate: %4s MaxRate: %4s MaxMiBps: %u\n",
Packit Service ac7b0b
				indent, "", pGroupInfo->numInternalPorts,
Packit Service ac7b0b
				StlStaticRateToText(pGroupInfo->minInternalRate),
Packit Service ac7b0b
				StlStaticRateToText(pGroupInfo->maxInternalRate),
Packit Service ac7b0b
				pGroupInfo->maxInternalMBps);
Packit Service ac7b0b
	else
Packit Service ac7b0b
		PrintFunc(dest, "%*sNum internal ports: %u\n",
Packit Service ac7b0b
				indent, "", pGroupInfo->numInternalPorts);
Packit Service ac7b0b
Packit Service ac7b0b
	if (pGroupInfo->minExternalRate != IB_STATIC_RATE_DONTCARE
Packit Service ac7b0b
				|| pGroupInfo->maxExternalRate != IB_STATIC_RATE_DONTCARE)
Packit Service ac7b0b
		PrintFunc(dest, "%*sNum external ports: %u MinRate: %4s MaxRate: %4s MaxMiBps: %u\n",
Packit Service ac7b0b
				indent, "", pGroupInfo->numExternalPorts,
Packit Service ac7b0b
				StlStaticRateToText(pGroupInfo->minExternalRate),
Packit Service ac7b0b
				StlStaticRateToText(pGroupInfo->maxExternalRate),
Packit Service ac7b0b
				pGroupInfo->maxExternalMBps);
Packit Service ac7b0b
	else
Packit Service ac7b0b
		PrintFunc(dest, "%*sNum external ports: %u\n",
Packit Service ac7b0b
				indent, "", pGroupInfo->numExternalPorts);
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sInternal utilization statistics:\n",
Packit Service ac7b0b
				indent, "");
Packit Service ac7b0b
	PrintStlPAGroupUtilStats(dest, indent+2, &pGroupInfo->internalUtilStats);
Packit Service ac7b0b
	PrintFunc(dest, "%*sSend utilization statistics:\n",
Packit Service ac7b0b
				indent, "");
Packit Service ac7b0b
	PrintStlPAGroupUtilStats(dest, indent+2, &pGroupInfo->sendUtilStats);
Packit Service ac7b0b
	PrintFunc(dest, "%*sReceive utilization statistics:\n",
Packit Service ac7b0b
				indent, "");
Packit Service ac7b0b
	PrintStlPAGroupUtilStats(dest, indent+2, &pGroupInfo->recvUtilStats);
Packit Service ac7b0b
	PrintFunc(dest, "%*sInternal Error Summary:\n",
Packit Service ac7b0b
				indent, "");
Packit Service ac7b0b
	PrintStlPAGroupErrorStats(dest, indent+2, &pGroupInfo->internalCategoryStats);
Packit Service ac7b0b
	PrintFunc(dest, "%*sExternal Error Summary:\n",
Packit Service ac7b0b
				indent, "");
Packit Service ac7b0b
	PrintStlPAGroupErrorStats(dest, indent+2, &pGroupInfo->externalCategoryStats);
Packit Service ac7b0b
	PrintFunc(dest, "%*sImageID:\n",
Packit Service ac7b0b
				indent, "");
Packit Service ac7b0b
	PrintStlPAImageId(dest, indent+2, &pGroupInfo->imageId);
Packit Service ac7b0b
	return;
Packit Service ac7b0b
}
Packit Service ac7b0b
Packit Service ac7b0b
void PrintStlPAPortCounters(PrintDest_t *dest, int indent, const STL_PORT_COUNTERS_DATA *pPortCounters, const STL_LID nodeLid, const uint32 portNumber, const uint32 flags)
Packit Service ac7b0b
{
Packit Service ac7b0b
	PrintFunc(dest, "%*s%s controlled Port Counters (%s) for LID 0x%.*x, port number %u%s:\n",
Packit Service ac7b0b
				indent, "", (flags & STL_PA_PC_FLAG_USER_COUNTERS) ? "User" : "PM",
Packit Service ac7b0b
				(flags & STL_PA_PC_FLAG_DELTA) ? "delta" : "total",
Packit Service ac7b0b
				(nodeLid <= IB_MAX_UCAST_LID ? 4:8),
Packit Service ac7b0b
				nodeLid, portNumber,
Packit Service ac7b0b
				(flags&STL_PA_PC_FLAG_UNEXPECTED_CLEAR)?" (Unexpected Clear)":"");
Packit Service ac7b0b
	PrintFunc(dest, "%*sPerformance: Transmit\n", indent, "");
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Xmit Data             %20"PRIu64" MB (%"PRIu64" Flits)\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->portXmitData/FLITS_PER_MB,
Packit Service ac7b0b
			pPortCounters->portXmitData);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Xmit Pkts             %20"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->portXmitPkts);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    MC Xmit Pkts          %20"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->portMulticastXmitPkts);
Packit Service ac7b0b
	PrintFunc(dest, "%*sPerformance: Receive\n",
Packit Service ac7b0b
			indent, "");
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Rcv Data              %20"PRIu64" MB (%"PRIu64" Flits)\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->portRcvData/FLITS_PER_MB,
Packit Service ac7b0b
			pPortCounters->portRcvData);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Rcv Pkts              %20"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->portRcvPkts);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    MC Rcv Pkts           %20"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->portMulticastRcvPkts);
Packit Service ac7b0b
	PrintFunc(dest, "%*sSignal Integrity Errors:             \n",
Packit Service ac7b0b
			indent, "");
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Link Quality Ind      %10u\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->lq.s.linkQualityIndicator);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Uncorrectable Err     %10u\n", // 8-bit
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->uncorrectableErrors);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Link Downed           %10u\n", // 32-bit
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->linkDowned);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Num Lanes Down        %10u\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->lq.s.numLanesDown);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Rcv Errors            %10"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->portRcvErrors);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Exc. Buffer Overrun   %10"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->excessiveBufferOverruns);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    FM Config             %10"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->fmConfigErrors);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Link Error Recovery   %10u\n", // 32-bit
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->linkErrorRecovery);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Local Link Integrity  %10"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->localLinkIntegrityErrors);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Rcv Rmt Phys Err      %10"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->portRcvRemotePhysicalErrors);
Packit Service ac7b0b
	PrintFunc(dest, "%*sSecurity Errors:              \n",
Packit Service ac7b0b
			indent, "");
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Xmit Constraint       %10"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->portXmitConstraintErrors);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Rcv Constraint        %10"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->portRcvConstraintErrors);
Packit Service ac7b0b
	PrintFunc(dest, "%*sRouting and Other Errors:     \n",
Packit Service ac7b0b
			indent, "");
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Rcv Sw Relay Err      %10"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->portRcvSwitchRelayErrors);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Xmit Discards         %10"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->portXmitDiscards);
Packit Service ac7b0b
	PrintFunc(dest, "%*sCongestion:             \n",
Packit Service ac7b0b
			indent, "");
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Cong Discards         %10"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->swPortCongestion);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Rcv FECN              %10"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->portRcvFECN);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Rcv BECN              %10"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->portRcvBECN);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Mark FECN             %10"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->portMarkFECN);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Xmit Time Cong        %10"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->portXmitTimeCong);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Xmit Wait             %10"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->portXmitWait);
Packit Service ac7b0b
	PrintFunc(dest, "%*sBubbles:	             \n",
Packit Service ac7b0b
			indent, "");
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Xmit Wasted BW        %10"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->portXmitWastedBW);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Xmit Wait Data        %10"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->portXmitWaitData);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Rcv Bubble            %10"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pPortCounters->portRcvBubble);
Packit Service ac7b0b
	if (flags & STL_PA_PC_FLAG_CLEAR_FAIL) {
Packit Service ac7b0b
		PrintFunc(dest, "\nPort Counter Clear was Unsuccessful\n\n");
Packit Service ac7b0b
	}
Packit Service ac7b0b
	PrintStlPAImageId(dest, indent+2, &pPortCounters->imageId);
Packit Service ac7b0b
}
Packit Service ac7b0b
Packit Service ac7b0b
void PrintStlPAGroupConfig(PrintDest_t *dest, int indent, const char *groupName, const int numRecords, const STL_PA_PM_GROUP_CFG_RSP *pGroupConfig)
Packit Service ac7b0b
{
Packit Service ac7b0b
	int i;
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sGroup name: %s\n",
Packit Service ac7b0b
				indent, "", groupName);
Packit Service ac7b0b
	PrintFunc(dest, "%*sNumber ports: %u\n",
Packit Service ac7b0b
				indent, "", numRecords);
Packit Service ac7b0b
	for (i = 0; i < numRecords; i++) {
Packit Service ac7b0b
		PrintFunc(dest, "%*s%u:LID:0x%.*x Port:%u  GUID:0x%016"PRIx64"  NodeDesc: %.*s\n",
Packit Service ac7b0b
				indent, "", i+1,(pGroupConfig[i].nodeLid <= IB_MAX_UCAST_LID ? 4:8),
Packit Service ac7b0b
				pGroupConfig[i].nodeLid,
Packit Service ac7b0b
				pGroupConfig[i].portNumber,
Packit Service ac7b0b
				pGroupConfig[i].nodeGUID,
Packit Service ac7b0b
			   	(int)sizeof(pGroupConfig[i].nodeDesc),
Packit Service ac7b0b
			   	pGroupConfig[i].nodeDesc);
Packit Service ac7b0b
	}
Packit Service ac7b0b
	PrintStlPAImageId(dest, indent, &pGroupConfig->imageId);
Packit Service ac7b0b
Packit Service ac7b0b
	return;
Packit Service ac7b0b
}
Packit Service ac7b0b
Packit Service ac7b0b
void PrintStlPAGroupNodeInfo(PrintDest_t *dest, int indent, const char *groupName, const int numRecords, const STL_PA_GROUP_NODEINFO_RSP *pGroupNodeInfo)
Packit Service ac7b0b
{
Packit Service ac7b0b
	char buf[80];
Packit Service ac7b0b
	int i;
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sGroup name: %s\n",
Packit Service ac7b0b
				indent, "", groupName);
Packit Service ac7b0b
	PrintFunc(dest, "%*sNumber nodes: %u\n",
Packit Service ac7b0b
				indent, "", numRecords);
Packit Service ac7b0b
	for (i = 0; i < numRecords; i++) {
Packit Service ac7b0b
		PrintFunc(dest, "%*s%u:LID: 0x%08x Type:  %s  Name: %.*s\n",
Packit Service ac7b0b
			indent, "", i+1, pGroupNodeInfo[i].nodeLID,
Packit Service ac7b0b
			StlNodeTypeToText(pGroupNodeInfo[i].nodeType),
Packit Service ac7b0b
			(int)sizeof(pGroupNodeInfo[i].nodeDesc),
Packit Service ac7b0b
			pGroupNodeInfo[i].nodeDesc);
Packit Service ac7b0b
		PrintFunc(dest, "%*s NodeGuid: 0x%016" PRIx64 "\n",
Packit Service ac7b0b
			indent, " ",pGroupNodeInfo[i].nodeGUID);
Packit Service ac7b0b
		FormatStlPortMask(buf, pGroupNodeInfo[i].portSelectMask, MAX_STL_PORTS, 80);
Packit Service ac7b0b
		PrintFunc(dest, "%*s PortSelectMask: %s\n", indent, " ", buf);
Packit Service ac7b0b
		PrintSeparator(dest);
Packit Service ac7b0b
	}
Packit Service ac7b0b
	PrintStlPAImageId(dest, indent, &pGroupNodeInfo->imageId);
Packit Service ac7b0b
Packit Service ac7b0b
	return;
Packit Service ac7b0b
}
Packit Service ac7b0b
Packit Service ac7b0b
void PrintStlPAGroupLinkInfo(PrintDest_t *dest, int indent, const char *groupName, const int numRecords, const STL_PA_GROUP_LINKINFO_RSP *pGroupLinkInfo)
Packit Service ac7b0b
{
Packit Service ac7b0b
	int i;
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sGroup name: %s\n",
Packit Service ac7b0b
				indent, "", groupName);
Packit Service ac7b0b
	PrintFunc(dest, "%*sNumber links: %u\n",
Packit Service ac7b0b
				indent, "", numRecords);
Packit Service ac7b0b
	for (i = 0; i < numRecords; i++) {
Packit Service ac7b0b
		PrintFunc(dest, "%*s%u:LID: 0x%08x -> 0x%08x Port: %3u -> %3u\n",
Packit Service ac7b0b
			indent, "", i+1, pGroupLinkInfo[i].fromLID, pGroupLinkInfo[i].toLID,
Packit Service ac7b0b
			pGroupLinkInfo[i].fromPort, pGroupLinkInfo[i].toPort);
Packit Service ac7b0b
		PrintFunc(dest, "%*s MTU: %5s txRate: %4s rxRate: %4s\n",
Packit Service ac7b0b
			indent, " ", IbMTUToText(pGroupLinkInfo[i].mtu),
Packit Service ac7b0b
			StlStaticRateToText(StlLinkSpeedWidthToStaticRate(pGroupLinkInfo[i].activeSpeed, pGroupLinkInfo[i].txLinkWidthDowngradeActive)),
Packit Service ac7b0b
			StlStaticRateToText(StlLinkSpeedWidthToStaticRate(pGroupLinkInfo[i].activeSpeed, pGroupLinkInfo[i].rxLinkWidthDowngradeActive))); 
Packit Service ac7b0b
		PrintFunc(dest, "%*s Local Status: %s\n", indent, "",
Packit Service ac7b0b
				StlFocusStatusToText(pGroupLinkInfo[i].localStatus));
Packit Service ac7b0b
		PrintFunc(dest, "%*s Neighbor Status: %s\n", indent, "",
Packit Service ac7b0b
				StlFocusStatusToText(pGroupLinkInfo[i].neighborStatus));
Packit Service ac7b0b
		PrintSeparator(dest);
Packit Service ac7b0b
	}
Packit Service ac7b0b
	PrintStlPAImageId(dest, indent, &pGroupLinkInfo->imageId);
Packit Service ac7b0b
Packit Service ac7b0b
	return;
Packit Service ac7b0b
}
Packit Service ac7b0b
Packit Service ac7b0b
Packit Service ac7b0b
void PrintStlPMConfig(PrintDest_t *dest, int indent, const STL_PA_PM_CFG_DATA *pPMConfig)
Packit Service ac7b0b
{
Packit Service ac7b0b
	char buf[80];
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sSweep Interval: %u sec  PM Flags (0x%X):\n",
Packit Service ac7b0b
			  indent, "", pPMConfig->sweepInterval, pPMConfig->pmFlags);
Packit Service ac7b0b
	StlFormatPmFlags(buf, pPMConfig->pmFlags);
Packit Service ac7b0b
	PrintFunc(dest, "%*s  %s\n", indent, "", buf);
Packit Service ac7b0b
	StlFormatPmFlags2(buf, pPMConfig->pmFlags);
Packit Service ac7b0b
	PrintFunc(dest, "%*s  %s\n", indent, "", buf);
Packit Service ac7b0b
	PrintFunc(dest, "%*sMax Clients: %u\n",
Packit Service ac7b0b
				indent, "", pPMConfig->maxClients);
Packit Service ac7b0b
	PrintFunc(dest, "%*sTotal Images: %-7u   Freeze Images: %-7u   Freeze Lease: %-7u sec\n",
Packit Service ac7b0b
				indent, "", pPMConfig->sizeHistory, pPMConfig->sizeFreeze,
Packit Service ac7b0b
				pPMConfig->lease);
Packit Service ac7b0b
	PrintFunc(dest, "%*sErr Thresholds: Integrity: %-7u        Congestion: %-7u\n",
Packit Service ac7b0b
				indent, "", pPMConfig->categoryThresholds.integrityErrors,
Packit Service ac7b0b
				pPMConfig->categoryThresholds.congestion );
Packit Service ac7b0b
	PrintFunc(dest, "%*s                SMA Congest: %-7u      Bubble: %-7u\n",
Packit Service ac7b0b
				indent, "",pPMConfig->categoryThresholds.smaCongestion,
Packit Service ac7b0b
				pPMConfig->categoryThresholds.bubble);
Packit Service ac7b0b
	PrintFunc(dest, "%*s                Security: %-7u         Routing: %-7u\n",
Packit Service ac7b0b
				indent, "", pPMConfig->categoryThresholds.securityErrors,
Packit Service ac7b0b
				pPMConfig->categoryThresholds.routingErrors );
Packit Service ac7b0b
	PrintFunc(dest, "%*s Integrity Wts: Lnk Wdth Dngd: %-7u    Link Qual: %-7u\n",
Packit Service ac7b0b
				indent, "", pPMConfig->integrityWeights.LinkWidthDowngrade,
Packit Service ac7b0b
				pPMConfig->integrityWeights.LinkQualityIndicator );
Packit Service ac7b0b
	PrintFunc(dest, "%*s                Uncorrectable: %-7u    Link Downed: %-7u\n",
Packit Service ac7b0b
				indent, "", pPMConfig->integrityWeights.UncorrectableErrors,
Packit Service ac7b0b
				pPMConfig->integrityWeights.LinkDowned);
Packit Service ac7b0b
	PrintFunc(dest, "%*s                Rcv Errors: %-7u       Excs Bfr Ovrn: %-7u\n",
Packit Service ac7b0b
				indent, "", pPMConfig->integrityWeights.PortRcvErrors,
Packit Service ac7b0b
				pPMConfig->integrityWeights.ExcessiveBufferOverruns);
Packit Service ac7b0b
	PrintFunc(dest, "%*s                FM Config Err: %-7u    Link Err Recov: %-7u\n",
Packit Service ac7b0b
			    indent, "", pPMConfig->integrityWeights.FMConfigErrors,
Packit Service ac7b0b
				pPMConfig->integrityWeights.LinkErrorRecovery);
Packit Service ac7b0b
	PrintFunc(dest, "%*s                Loc Link Integ: %-7u \n",
Packit Service ac7b0b
				indent, "", pPMConfig->integrityWeights.LocalLinkIntegrityErrors );
Packit Service ac7b0b
	PrintFunc(dest, "%*s Congest Wts:  Cong Discards: %-7u     Rcv FECN: %-7u\n",
Packit Service ac7b0b
				indent, "", pPMConfig->congestionWeights.SwPortCongestion,
Packit Service ac7b0b
				pPMConfig->congestionWeights.PortRcvFECN);
Packit Service ac7b0b
	PrintFunc(dest, "%*s               Rcv BECN: %-7u          Mark FECN: %-7u\n",
Packit Service ac7b0b
				indent, "", pPMConfig->congestionWeights.PortRcvBECN,
Packit Service ac7b0b
				pPMConfig->congestionWeights.PortMarkFECN);
Packit Service ac7b0b
	PrintFunc(dest, "%*s               Tx Time Cong: %-7u      Tx Wait: %-7u\n",
Packit Service ac7b0b
				indent, "", pPMConfig->congestionWeights.PortXmitTimeCong,
Packit Service ac7b0b
				pPMConfig->congestionWeights.PortXmitWait);
Packit Service ac7b0b
	PrintFunc(dest, "%*sPM Memory Size: %"PRIu64" MiB (%" PRIu64 " bytes)\n",
Packit Service ac7b0b
				indent, "", pPMConfig->memoryFootprint/(1024*1024),
Packit Service ac7b0b
				pPMConfig->memoryFootprint );
Packit Service ac7b0b
	PrintFunc(dest, "%*sPMA MADs: MaxAttempts: %-6u MinRespTimeout: %-6u RespTimeout: %-6u\n",
Packit Service ac7b0b
				indent, "", pPMConfig->maxAttempts, pPMConfig->minRespTimeout,
Packit Service ac7b0b
			   	pPMConfig->respTimeout );
Packit Service ac7b0b
	PrintFunc(dest, "%*sSweep: MaxParallelNodes: %-6u PmaBatchSize: %-6u ErrorClear: %1u\n",
Packit Service ac7b0b
				indent, "", pPMConfig->maxParallelNodes,
Packit Service ac7b0b
			   	pPMConfig->pmaBatchSize, pPMConfig->errorClear);
Packit Service ac7b0b
Packit Service ac7b0b
	return;
Packit Service ac7b0b
}
Packit Service ac7b0b
Packit Service ac7b0b
Packit Service ac7b0b
void PrintStlPAFocusPorts(PrintDest_t *dest, int indent, const char *groupName, const int numRecords, const uint32 select, const uint32 start, const uint32 range,
Packit Service ac7b0b
	const STL_FOCUS_PORTS_RSP *pFocusPorts)
Packit Service ac7b0b
{
Packit Service ac7b0b
	int i;
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sGroup name: %s\n", indent, "", groupName);
Packit Service ac7b0b
	PrintFunc(dest, "%*sNumber links: %u\n", indent, "", numRecords);
Packit Service ac7b0b
	PrintFunc(dest, "%*sFocus select: %s\n", indent, "", StlFocusAttributeToText(select));
Packit Service ac7b0b
	PrintFunc(dest, "%*sFocus start:  %u\n", indent, "", start);
Packit Service ac7b0b
	PrintFunc(dest, "%*sFocus range:  %u\n", indent, "", range);
Packit Service ac7b0b
	for (i = 0; i < numRecords; i++) {
Packit Service ac7b0b
		PrintFunc(dest, "%*s%u:LID:0x%04x  Port:%u  Rate: %4s MTU: %5s nbrLID:0x%04x  nbrPort:%u\n",
Packit Service ac7b0b
				indent, "", i+start, pFocusPorts[i].nodeLid, pFocusPorts[i].portNumber,
Packit Service ac7b0b
				StlStaticRateToText(pFocusPorts[i].rate), IbMTUToText(pFocusPorts[i].maxVlMtu),
Packit Service ac7b0b
				pFocusPorts[i].neighborLid, pFocusPorts[i].neighborPortNumber);
Packit Service ac7b0b
		if (IS_FOCUS_SELECT_UTIL(select)) {
Packit Service ac7b0b
			PrintFunc(dest, "%*s   Value:  %16.1f   nbrValue:  %16.1f\n",
Packit Service ac7b0b
				indent, "", (float)pFocusPorts[i].value/10.0, (float)pFocusPorts[i].neighborValue/10.0);
Packit Service ac7b0b
		} else if (IS_FOCUS_SELECT_NO_VAL(select)) {
Packit Service ac7b0b
			// Skip print of Values
Packit Service ac7b0b
		} else {
Packit Service ac7b0b
			PrintFunc(dest, "%*s   Value:  %16"PRIu64"   nbrValue:  %16"PRIu64"\n",
Packit Service ac7b0b
				indent, "", pFocusPorts[i].value, pFocusPorts[i].neighborValue);
Packit Service ac7b0b
		}
Packit Service ac7b0b
		PrintFunc(dest, "%*s   GUID: 0x%016"PRIx64"   nbrGuid: 0x%016"PRIx64"\n",
Packit Service ac7b0b
				indent, "", pFocusPorts[i].nodeGUID, pFocusPorts[i].neighborGuid);
Packit Service ac7b0b
		PrintFunc(dest, "%*s   Status: %s Name: %.*s\n", indent, "",
Packit Service ac7b0b
				StlFocusStatusToText(pFocusPorts[i].localStatus),
Packit Service ac7b0b
				(int)sizeof(pFocusPorts[i].nodeDesc), pFocusPorts[i].nodeDesc);
Packit Service ac7b0b
		PrintFunc(dest, "%*s   Status: %s Neighbor Name: %.*s\n", indent, "",
Packit Service ac7b0b
				StlFocusStatusToText(pFocusPorts[i].neighborStatus),
Packit Service ac7b0b
				(int)sizeof(pFocusPorts[i].neighborNodeDesc), pFocusPorts[i].neighborNodeDesc);
Packit Service ac7b0b
	}
Packit Service ac7b0b
	PrintStlPAImageId(dest, indent, &pFocusPorts[0].imageId);
Packit Service ac7b0b
Packit Service ac7b0b
	return;
Packit Service ac7b0b
}
Packit Service ac7b0b
Packit Service ac7b0b
void PrintStlPAFocusPortsMultiSelect(PrintDest_t *dest, int indent, const char *groupName, const int numRecords, const uint32 start, const uint32 range, const STL_FOCUS_PORTS_MULTISELECT_RSP *pFocusPorts, uint8 logical_operator,
Packit Service ac7b0b
	STL_FOCUS_PORT_TUPLE *tuple)
Packit Service ac7b0b
{
Packit Service ac7b0b
	int i, j;
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sGroup name: %s\n", indent, "", groupName);
Packit Service ac7b0b
	PrintFunc(dest, "%*sNumber links: %u\n", indent, "", numRecords);
Packit Service ac7b0b
	PrintFunc(dest, "%*sFocus start:  %u\n", indent, "", start);
Packit Service ac7b0b
	PrintFunc(dest, "%*sFocus range:  %u\n", indent, "", range);
Packit Service ac7b0b
Packit Service ac7b0b
	for (j = 0; j < MAX_NUM_FOCUS_PORT_TUPLES; j++) {
Packit Service ac7b0b
		if (tuple[j].comparator != FOCUS_PORTS_COMPARATOR_INVALID) {
Packit Service ac7b0b
			PrintFunc(dest, "%*sFocus select: %-22s %-25s %16"PRIu64"\n", indent, "",
Packit Service ac7b0b
				StlFocusAttributeToText(tuple[j].select),
Packit Service ac7b0b
				StlComparatorToText(tuple[j].comparator),
Packit Service ac7b0b
				tuple[j].argument);
Packit Service ac7b0b
		}
Packit Service ac7b0b
	}
Packit Service ac7b0b
Packit Service ac7b0b
	if (logical_operator != FOCUS_PORTS_LOGICAL_OPERATOR_INVALID) {
Packit Service ac7b0b
		PrintFunc(dest, "%*sTuples joined by logical operator: %s\n", indent, "", StlOperatorToText(logical_operator));
Packit Service ac7b0b
	}
Packit Service ac7b0b
Packit Service ac7b0b
	for (i = 0; i < numRecords; i++) {
Packit Service ac7b0b
		PrintFunc(dest, "%*s%3u:LID:0x%.*x  Port:%u  Rate: %4s MTU: %5s nbrLID:0x%.*x  nbrPort:%u\n",
Packit Service ac7b0b
				indent, "", i+start, (pFocusPorts[i].nodeLid <= IB_MAX_UCAST_LID ? 4:8), pFocusPorts[i].nodeLid,
Packit Service ac7b0b
				pFocusPorts[i].portNumber,
Packit Service ac7b0b
				StlStaticRateToText(pFocusPorts[i].rate), IbMTUToText(pFocusPorts[i].maxVlMtu),
Packit Service ac7b0b
				(pFocusPorts[i].neighborLid <= IB_MAX_UCAST_LID ? 4:8), pFocusPorts[i].neighborLid,
Packit Service ac7b0b
				pFocusPorts[i].neighborPortNumber);
Packit Service ac7b0b
		for (j = 0; j < MAX_NUM_FOCUS_PORT_TUPLES; j++) {
Packit Service ac7b0b
			if (tuple[j].comparator != FOCUS_PORTS_COMPARATOR_INVALID) {
Packit Service ac7b0b
				if (IS_FOCUS_SELECT_UTIL(tuple[j].select)) {
Packit Service ac7b0b
					PrintFunc(dest, "%*s   %-22s Value:  %16.1f"   "   nbrValue:  %16.1f\n",
Packit Service ac7b0b
						indent, "", StlFocusAttributeToText(tuple[j].select), (float)pFocusPorts[i].value[j]/10.0, (float)pFocusPorts[i].neighborValue[j]/10.0);
Packit Service ac7b0b
				} else {
Packit Service ac7b0b
					PrintFunc(dest, "%*s   %-22s Value:  %16"PRIu64"   nbrValue:  %16"PRIu64"\n",
Packit Service ac7b0b
						indent, "", StlFocusAttributeToText(tuple[j].select), pFocusPorts[i].value[j], pFocusPorts[i].neighborValue[j]);
Packit Service ac7b0b
				}
Packit Service ac7b0b
			}
Packit Service ac7b0b
		}
Packit Service ac7b0b
		PrintFunc(dest, "%*s   GUID: 0x%016"PRIx64"   nbrGuid: 0x%016"PRIx64"\n",
Packit Service ac7b0b
				indent, "", pFocusPorts[i].nodeGUID, pFocusPorts[i].neighborGuid);
Packit Service ac7b0b
		PrintFunc(dest, "%*s   Status: %s Name: %.*s\n", indent, "",
Packit Service ac7b0b
				StlFocusStatusToText(pFocusPorts[i].localStatus),
Packit Service ac7b0b
				(int)sizeof(pFocusPorts[i].nodeDesc), pFocusPorts[i].nodeDesc);
Packit Service ac7b0b
		PrintFunc(dest, "%*s   Status: %s Neighbor Name: %.*s\n", indent, "",
Packit Service ac7b0b
				StlFocusStatusToText(pFocusPorts[i].neighborStatus),
Packit Service ac7b0b
				(int)sizeof(pFocusPorts[i].neighborNodeDesc), pFocusPorts[i].neighborNodeDesc);
Packit Service ac7b0b
	}
Packit Service ac7b0b
	PrintStlPAImageId(dest, indent, &pFocusPorts[0].imageId);
Packit Service ac7b0b
Packit Service ac7b0b
	return;
Packit Service ac7b0b
}
Packit Service ac7b0b
Packit Service ac7b0b
void PrintStlPAImageInfo(PrintDest_t *dest, int indent, const STL_PA_IMAGE_INFO_DATA *pImageInfo)
Packit Service ac7b0b
{
Packit Service ac7b0b
	int i;
Packit Service ac7b0b
	time_t sweepStart = (time_t)pImageInfo->sweepStart;
Packit Service ac7b0b
	char buf[80];
Packit Service ac7b0b
Packit Service ac7b0b
	ctime_r((const time_t *)&sweepStart, buf);
Packit Service ac7b0b
	if ((strlen(buf)>0) && (buf[strlen(buf)-1] == '\n'))
Packit Service ac7b0b
		buf[strlen(buf)-1] = '\0';
Packit Service ac7b0b
	PrintStlPAImageId(dest, indent, &pImageInfo->imageId);
Packit Service ac7b0b
	PrintFunc(dest, "%*sImageSweepStart: %s  Duration: %u.%03u Seconds\n",
Packit Service ac7b0b
				indent, "", buf,
Packit Service ac7b0b
				pImageInfo->sweepDuration/1000000,
Packit Service ac7b0b
				(pImageInfo->sweepDuration%1000000)/1000);
Packit Service ac7b0b
	if (pImageInfo->imageInterval) {
Packit Service ac7b0b
		PrintFunc(dest, "%*sImage Interval: %u Seconds\n",
Packit Service ac7b0b
					indent, "", pImageInfo->imageInterval);
Packit Service ac7b0b
	}
Packit Service ac7b0b
	PrintFunc(dest, "%*sNum SW Ports: %u  HFI Ports: %u\n",
Packit Service ac7b0b
				indent, "", pImageInfo->numSwitchPorts,
Packit Service ac7b0b
			   	pImageInfo->numHFIPorts);
Packit Service ac7b0b
	PrintFunc(dest, "%*sNum SWs: %u  Links: %u  SMs: %u\n",
Packit Service ac7b0b
				indent, "", pImageInfo->numSwitchNodes,
Packit Service ac7b0b
				pImageInfo->numLinks, pImageInfo->numSMs);
Packit Service ac7b0b
	PrintFunc(dest, "%*sNum NoResp Nodes: %u  NoResp Ports: %u  Unexpected Clear Ports: %u\n",
Packit Service ac7b0b
				indent, "", pImageInfo->numNoRespNodes,
Packit Service ac7b0b
				pImageInfo->numNoRespPorts,
Packit Service ac7b0b
			   	pImageInfo->numUnexpectedClearPorts);
Packit Service ac7b0b
	PrintFunc(dest, "%*sNum Skipped Nodes: %u  Skipped Ports: %u\n",
Packit Service ac7b0b
				indent, "", pImageInfo->numSkippedNodes,
Packit Service ac7b0b
				pImageInfo->numSkippedPorts);
Packit Service ac7b0b
	for (i = 0; i < 2; i++) {
Packit Service ac7b0b
		if (i != 0 && ! pImageInfo->SMInfo[i].lid)
Packit Service ac7b0b
			continue;
Packit Service ac7b0b
		PrintFunc(dest, "%*s%s: LID: 0x%.*x  Port: %3u  Priority: %2u  State: %s\n",
Packit Service ac7b0b
				indent, "", (i==0)?"   Master SM":"Secondary SM",
Packit Service ac7b0b
				(pImageInfo->SMInfo[i].lid <= IB_MAX_UCAST_LID ? 4:8),
Packit Service ac7b0b
				pImageInfo->SMInfo[i].lid,
Packit Service ac7b0b
				pImageInfo->SMInfo[i].portNumber,
Packit Service ac7b0b
				pImageInfo->SMInfo[i].priority,
Packit Service ac7b0b
				IbSMStateToText(pImageInfo->SMInfo[i].state));
Packit Service ac7b0b
		PrintFunc(dest, "%*s              PortGuid: %016"PRIx64"\n",
Packit Service ac7b0b
				indent, "", pImageInfo->SMInfo[i].smPortGuid);
Packit Service ac7b0b
		PrintFunc(dest, "%*s              Name: %.*s\n",
Packit Service ac7b0b
				indent, "", (int)sizeof(pImageInfo->SMInfo[i].smNodeDesc),
Packit Service ac7b0b
				pImageInfo->SMInfo[i].smNodeDesc);
Packit Service ac7b0b
	}
Packit Service ac7b0b
Packit Service ac7b0b
	return;
Packit Service ac7b0b
}
Packit Service ac7b0b
Packit Service ac7b0b
void PrintStlPAMoveFreeze(PrintDest_t *dest, int indent, const STL_MOVE_FREEZE_DATA *pMoveFreeze)
Packit Service ac7b0b
{
Packit Service ac7b0b
	PrintFunc(dest, "%*sOld Freeze Image\n", indent, "");
Packit Service ac7b0b
	PrintStlPAImageId(dest, indent, &pMoveFreeze->oldFreezeImage);
Packit Service ac7b0b
	PrintFunc(dest, "%*sNew Freeze Image\n", indent, "");
Packit Service ac7b0b
	PrintStlPAImageId(dest, indent, &pMoveFreeze->newFreezeImage);
Packit Service ac7b0b
Packit Service ac7b0b
	return;
Packit Service ac7b0b
}
Packit Service ac7b0b
Packit Service ac7b0b
void PrintStlPAVFList(PrintDest_t *dest, int indent, const int numRecords, const STL_PA_VF_LIST *pVFList)
Packit Service ac7b0b
{
Packit Service ac7b0b
	int i;
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sNumber of VFs: %u\n", indent, "", numRecords);
Packit Service ac7b0b
	for (i = 0; i < numRecords; i++) {
Packit Service ac7b0b
		PrintFunc(dest, "%*sVF %u: %s\n", indent, "", i+1, pVFList[i].vfName);
Packit Service ac7b0b
	}
Packit Service ac7b0b
	return;
Packit Service ac7b0b
}
Packit Service ac7b0b
Packit Service ac7b0b
void PrintStlPAVFList2(PrintDest_t *dest, int indent, const int numRecords, const STL_PA_VF_LIST2 *pVFList)
Packit Service ac7b0b
{
Packit Service ac7b0b
	int i;
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sNumber of VFs: %u\n", indent, "", numRecords);
Packit Service ac7b0b
	for (i = 0; i < numRecords; i++) {
Packit Service ac7b0b
		PrintFunc(dest, "%*sVF %u: %s\n", indent, "", i+1, pVFList[i].vfName);
Packit Service ac7b0b
	}
Packit Service ac7b0b
	PrintStlPAImageId(dest, indent+2, &pVFList[0].imageId);
Packit Service ac7b0b
	return;
Packit Service ac7b0b
}
Packit Service ac7b0b
Packit Service ac7b0b
void PrintStlPAVFInfo(PrintDest_t *dest, int indent, const STL_PA_VF_INFO_DATA *pVFInfo)
Packit Service ac7b0b
{
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sVF name: %s\n",
Packit Service ac7b0b
				indent, "", pVFInfo->vfName);
Packit Service ac7b0b
	if (pVFInfo->minInternalRate != IB_STATIC_RATE_DONTCARE
Packit Service ac7b0b
				|| pVFInfo->maxInternalRate != IB_STATIC_RATE_DONTCARE)
Packit Service ac7b0b
		PrintFunc(dest, "%*sNumPorts: %u MinRate: %4s MaxRate: %4s MaxMiBps: %u\n",
Packit Service ac7b0b
				indent, "", pVFInfo->numPorts,
Packit Service ac7b0b
				StlStaticRateToText(pVFInfo->minInternalRate),
Packit Service ac7b0b
				StlStaticRateToText(pVFInfo->maxInternalRate),
Packit Service ac7b0b
				pVFInfo->maxInternalMBps);
Packit Service ac7b0b
	else
Packit Service ac7b0b
		PrintFunc(dest, "%*sNum ports: %u\n",
Packit Service ac7b0b
				indent, "", pVFInfo->numPorts);
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sInternal utilization statistics:\n",
Packit Service ac7b0b
				indent, "");
Packit Service ac7b0b
	PrintStlPAGroupUtilStats(dest, indent+2, &pVFInfo->internalUtilStats);
Packit Service ac7b0b
	PrintFunc(dest, "%*sInternal Error Summary:\n",
Packit Service ac7b0b
				indent, "");
Packit Service ac7b0b
	PrintStlPAGroupErrorStats(dest, indent+2, &pVFInfo->internalCategoryStats);
Packit Service ac7b0b
	PrintFunc(dest, "%*sImage Id:\n",
Packit Service ac7b0b
				indent, "");
Packit Service ac7b0b
	PrintStlPAImageId(dest, indent+2, &pVFInfo->imageId);
Packit Service ac7b0b
Packit Service ac7b0b
	return;
Packit Service ac7b0b
}
Packit Service ac7b0b
Packit Service ac7b0b
void PrintStlPAVFConfig(PrintDest_t *dest, int indent, const char *vfName, const int numRecords, const STL_PA_VF_CFG_RSP *pVFConfig)
Packit Service ac7b0b
{
Packit Service ac7b0b
	int i;
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sVF name: %s\n",
Packit Service ac7b0b
				indent, "", vfName);
Packit Service ac7b0b
	PrintFunc(dest, "%*sNumber ports: %u\n",
Packit Service ac7b0b
				indent, "", numRecords);
Packit Service ac7b0b
	for (i = 0; i < numRecords; i++) {
Packit Service ac7b0b
		PrintFunc(dest, "%*s%u:LID:0x%.*x Port:%u  GUID:0x%016"PRIx64"  NodeDesc: %.*s\n",
Packit Service ac7b0b
				indent, "", i+1, (pVFConfig[i].nodeLid <= IB_MAX_UCAST_LID ? 4:8),
Packit Service ac7b0b
				pVFConfig[i].nodeLid,
Packit Service ac7b0b
				pVFConfig[i].portNumber,
Packit Service ac7b0b
				pVFConfig[i].nodeGUID,
Packit Service ac7b0b
			   	(int)sizeof(pVFConfig[i].nodeDesc),
Packit Service ac7b0b
			   	pVFConfig[i].nodeDesc);
Packit Service ac7b0b
	}
Packit Service ac7b0b
	PrintStlPAImageId(dest, indent, &pVFConfig->imageId);
Packit Service ac7b0b
Packit Service ac7b0b
	return;
Packit Service ac7b0b
}
Packit Service ac7b0b
Packit Service ac7b0b
void PrintStlPAVFPortCounters(PrintDest_t *dest, int indent, const STL_PA_VF_PORT_COUNTERS_DATA *pVFPortCounters, const STL_LID nodeLid, const uint32 portNumber, const uint32 flags)
Packit Service ac7b0b
{
Packit Service ac7b0b
	PrintFunc(dest, "%*s%s Controlled VF Port Counters (%s) for node LID 0x%.*x, port number %u%s:\n", indent, "",
Packit Service ac7b0b
			  (flags & STL_PA_PC_FLAG_USER_COUNTERS) ? "User" : "PM",
Packit Service ac7b0b
			  (flags & STL_PA_PC_FLAG_DELTA) ? "delta" : "total",
Packit Service ac7b0b
			  (nodeLid <= IB_MAX_UCAST_LID ? 4:8),
Packit Service ac7b0b
			  nodeLid, portNumber,
Packit Service ac7b0b
			  (flags & STL_PA_PC_FLAG_UNEXPECTED_CLEAR) ? " (Unexpected Clear)" : "");
Packit Service ac7b0b
	PrintFunc(dest, "%*sVF name: %s\n",
Packit Service ac7b0b
				indent, "", pVFPortCounters->vfName);
Packit Service ac7b0b
	PrintFunc(dest, "%*sPerformance: Transmit\n", indent, "");
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Xmit Data             %20"PRIu64" MB (%"PRIu64" Flits)\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
 			pVFPortCounters->portVFXmitData/FLITS_PER_MB,
Packit Service ac7b0b
			pVFPortCounters->portVFXmitData);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Xmit Pkts             %20"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pVFPortCounters->portVFXmitPkts);
Packit Service ac7b0b
	PrintFunc(dest, "%*sPerformance: Receive\n",
Packit Service ac7b0b
			indent, "");
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Rcv Data              %20"PRIu64" MB (%"PRIu64" Flits)\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
 			pVFPortCounters->portVFRcvData/FLITS_PER_MB,
Packit Service ac7b0b
			pVFPortCounters->portVFRcvData);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Rcv Pkts              %20"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
			pVFPortCounters->portVFRcvPkts);
Packit Service ac7b0b
	PrintFunc(dest, "%*sRouting and Other Errors:   \n",
Packit Service ac7b0b
			indent, "");
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Xmit Discards         %20"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
	   		pVFPortCounters->portVFXmitDiscards);
Packit Service ac7b0b
	PrintFunc(dest, "%*sCongestion:                          \n",
Packit Service ac7b0b
			indent, "");
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Congestion Discards   %20"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
	   		pVFPortCounters->swPortVFCongestion);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Rcv FECN              %20"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
	   		pVFPortCounters->portVFRcvFECN);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Rcv BECN              %20"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
	   		pVFPortCounters->portVFRcvBECN);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Mark FECN             %20"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
	   		pVFPortCounters->portVFMarkFECN);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Xmit Time Cong        %20"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
	   		pVFPortCounters->portVFXmitTimeCong);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Xmit Wait             %20"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
	   		pVFPortCounters->portVFXmitWait);
Packit Service ac7b0b
	PrintFunc(dest, "%*sBubbles:                            \n",
Packit Service ac7b0b
			indent, "");
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Xmit Wasted BW        %20"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
	   		pVFPortCounters->portVFXmitWastedBW);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Xmit Wait Data        %20"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
	   		pVFPortCounters->portVFXmitWaitData);
Packit Service ac7b0b
	PrintFunc(dest, "%*s    Rcv Bubble            %20"PRIu64"\n",
Packit Service ac7b0b
			indent, "",
Packit Service ac7b0b
	   		pVFPortCounters->portVFRcvBubble);
Packit Service ac7b0b
	if (flags & STL_PA_PC_FLAG_SHARED_VL) {
Packit Service ac7b0b
		PrintFunc(dest, "\nCounters may be shared between Virtual Fabrics\n\n");
Packit Service ac7b0b
	}
Packit Service ac7b0b
	if (flags & STL_PA_PC_FLAG_CLEAR_FAIL) {
Packit Service ac7b0b
		PrintFunc(dest, "\nPort Counter Clear was Unsuccessful\n\n");
Packit Service ac7b0b
	}
Packit Service ac7b0b
	PrintStlPAImageId(dest, indent, &pVFPortCounters->imageId);
Packit Service ac7b0b
Packit Service ac7b0b
	return;
Packit Service ac7b0b
}
Packit Service ac7b0b
Packit Service ac7b0b
void PrintStlPAVFFocusPorts(PrintDest_t *dest, int indent, const char *vfName, const int numRecords, const uint32 select, const uint32 start, const uint32 range,
Packit Service ac7b0b
	const STL_PA_VF_FOCUS_PORTS_RSP *pVFFocusPorts)
Packit Service ac7b0b
{
Packit Service ac7b0b
	int i;
Packit Service ac7b0b
Packit Service ac7b0b
	PrintFunc(dest, "%*sVF name: %s\n", indent, "", vfName);
Packit Service ac7b0b
	PrintFunc(dest, "%*sNumber links: %u\n", indent, "", numRecords);
Packit Service ac7b0b
	PrintFunc(dest, "%*sFocus select: %s\n", indent, "", StlFocusAttributeToText(select));
Packit Service ac7b0b
	PrintFunc(dest, "%*sFocus start:  %u\n", indent, "", start);
Packit Service ac7b0b
	PrintFunc(dest, "%*sFocus range:  %u\n", indent, "", range);
Packit Service ac7b0b
	for (i = 0; i < numRecords; i++) {
Packit Service ac7b0b
		PrintFunc(dest, "%*s%u:LID:0x%04x  Port:%u  Rate: %4s MTU: %5s nbrLID:0x%04x  nbrPort:%u\n",
Packit Service ac7b0b
				indent, "", i+start, pVFFocusPorts[i].nodeLid, pVFFocusPorts[i].portNumber,
Packit Service ac7b0b
				StlStaticRateToText(pVFFocusPorts[i].rate), IbMTUToText(pVFFocusPorts[i].maxVlMtu),
Packit Service ac7b0b
				pVFFocusPorts[i].neighborLid, pVFFocusPorts[i].neighborPortNumber);
Packit Service ac7b0b
Packit Service ac7b0b
		if (IS_FOCUS_SELECT_UTIL(select)) {
Packit Service ac7b0b
			PrintFunc(dest, "%*s   Value:  %16.1f   nbrValue:  %16.1f\n",
Packit Service ac7b0b
				indent, "", (float)pVFFocusPorts[i].value/10.0, (float)pVFFocusPorts[i].neighborValue/10.0);
Packit Service ac7b0b
		} else if (IS_FOCUS_SELECT_NO_VAL(select)) {
Packit Service ac7b0b
			// Skip print of Values
Packit Service ac7b0b
		} else {
Packit Service ac7b0b
			PrintFunc(dest, "%*s   Value:  %16"PRIu64"   nbrValue:  %16"PRIu64"\n",
Packit Service ac7b0b
				indent, "", pVFFocusPorts[i].value, pVFFocusPorts[i].neighborValue);
Packit Service ac7b0b
		}
Packit Service ac7b0b
		PrintFunc(dest, "%*s   GUID: 0x%016"PRIx64"   nbrGuid: 0x%016"PRIx64"\n",
Packit Service ac7b0b
				indent, "", pVFFocusPorts[i].nodeGUID, pVFFocusPorts[i].neighborGuid);
Packit Service ac7b0b
		PrintFunc(dest, "%*s   Status: %s Name: %.*s\n",
Packit Service ac7b0b
				indent, "",
Packit Service ac7b0b
				StlFocusStatusToText(pVFFocusPorts[i].localStatus),
Packit Service ac7b0b
				(int)sizeof(pVFFocusPorts[i].nodeDesc),
Packit Service ac7b0b
				pVFFocusPorts[i].nodeDesc);
Packit Service ac7b0b
		PrintFunc(dest, "%*s   Status: %s Neighbor Name: %.*s\n",
Packit Service ac7b0b
				indent, "",
Packit Service ac7b0b
				StlFocusStatusToText(pVFFocusPorts[i].neighborStatus),
Packit Service ac7b0b
				(int)sizeof(pVFFocusPorts[i].neighborNodeDesc),
Packit Service ac7b0b
				pVFFocusPorts[i].neighborNodeDesc);
Packit Service ac7b0b
	}
Packit Service ac7b0b
	PrintStlPAImageId(dest, indent, &pVFFocusPorts[0].imageId);
Packit Service ac7b0b
Packit Service ac7b0b
	return;
Packit Service ac7b0b
}