@@ -1651,7 +1651,7 @@ MAD_EXPORT ib_mad_dump_fn
mad_dump_linkspeed, mad_dump_linkspeedsup, mad_dump_linkspeeden,
mad_dump_linkspeedext, mad_dump_linkspeedextsup, mad_dump_linkspeedexten,
mad_dump_portstate, mad_dump_portstates,
- mad_dump_physportstate, mad_dump_portcapmask,
+ mad_dump_physportstate, mad_dump_portcapmask, mad_dump_portcapmask2,
mad_dump_mtu, mad_dump_vlcap, mad_dump_opervls,
mad_dump_node_type, mad_dump_sltovl, mad_dump_vlarbitration,
mad_dump_nodedesc, mad_dump_nodeinfo, mad_dump_portinfo,
@@ -616,6 +616,27 @@ void mad_dump_portcapmask(char *buf, int bufsz, void *val, int valsz)
*(--s) = 0;
}
+void mad_dump_portcapmask2(char *buf, int bufsz, void *val, int valsz)
+{
+ int mask = *(int *)val;
+ char *s = buf;
+
+ s += sprintf(s, "0x%x\n", mask);
+ if (mask & (1 << 0))
+ s += sprintf(s, "\t\t\t\tIsSetNodeDescriptionSupported\n");
+ if (mask & (1 << 1))
+ s += sprintf(s, "\t\t\t\tIsPortInfoExtendedSupported\n");
+ if (mask & (1 << 2))
+ s += sprintf(s, "\t\t\t\tIsVirtualizationSupported\n");
+ if (mask & (1 << 3))
+ s += sprintf(s, "\t\t\t\tIsSwitchPortStateTableSupported\n");
+ if (mask & (1 << 4))
+ s += sprintf(s, "\t\t\t\tIsLinkWidth2xSupported\n");
+
+ if (s != buf)
+ *(--s) = 0;
+}
+
void mad_dump_bitfield(char *buf, int bufsz, void *val, int valsz)
{
snprintf(buf, bufsz, "0x%x", *(uint32_t *) val);
@@ -529,7 +529,7 @@ static const ib_field_t ib_mad_f[] = {
/*
* More PortInfo fields
*/
- {BITSOFFS(480, 16), "CapabilityMask2", mad_dump_hex},
+ {BITSOFFS(480, 16), "CapabilityMask2", mad_dump_portcapmask2},
{BITSOFFS(496, 4), "LinkSpeedExtActive", mad_dump_linkspeedext},
{BITSOFFS(500, 4), "LinkSpeedExtSupported", mad_dump_linkspeedextsup},
{BITSOFFS(507, 5), "LinkSpeedExtEnabled", mad_dump_linkspeedexten},
@@ -34,6 +34,7 @@ IBMAD_1.3 {
mad_dump_perfcounters_rcv_err;
mad_dump_physportstate;
mad_dump_portcapmask;
+ mad_dump_portcapmask2;
mad_dump_portinfo;
mad_dump_portsamples_control;
mad_dump_portsamples_result;
IsSetNodeDescriptionSupported and IsPortInfoExtendedSupported are part of IBA 1.3 IsVirtualizationSupported was added by Annex A18: Virtualization IsSwitchPortStateTableSupported was added by MgtWG erratum #9316 IsLinkWidth2xSupported was added by MgtWG erratum #9309 Signed-off-by: Hal Rosenstock <hal@mellanox.com> --- libibmad/include/infiniband/mad.h | 2 +- libibmad/src/dump.c | 21 +++++++++++++++++++++ libibmad/src/fields.c | 2 +- libibmad/src/libibmad.map | 1 + 4 files changed, 24 insertions(+), 2 deletions(-)