[ofw] RE: [ofa-general] [PATCH 2/3 v2] field.c, remove c99 definitions, better portability with WinOF.
Sean Hefty
sean.hefty at intel.com
Mon Jan 19 09:40:41 PST 2009
adding ofw mail list
>- Remove c99 definitions in the ib_mad_f structure.
>- Remove unnecessary include file
>- _mad_dump: remove c99 structure initialization.
>
>Signed-off-by: Arlin Davis <ardavis at ichips.intel.com>
>---
> libibmad/src/fields.c | 430 +++++++++++++++++++++++++-----------------------
> 1 files changed, 224 insertions(+), 206 deletions(-)
>
>diff --git a/libibmad/src/fields.c b/libibmad/src/fields.c
>index 5cebd01..17d0a03 100644
>--- a/libibmad/src/fields.c
>+++ b/libibmad/src/fields.c
>@@ -37,7 +37,6 @@
>
> #include <stdio.h>
> #include <stdlib.h>
>-#include <unistd.h>
> #include <string.h>
>
> #include <mad.h>
>@@ -54,10 +53,10 @@
> #define BE_TO_BITSOFFS(o, w) (((o) & ~31) | ((32 - ((o) & 31) - (w))))
>
> static const ib_field_t ib_mad_f [] = {
>- [0] {0, 0}, /* IB_NO_FIELD - reserved as invalid */
>+ {0, 0}, /* IB_NO_FIELD - reserved as invalid */
>
>- [IB_GID_PREFIX_F] {0, 64, "GidPrefix", mad_dump_rhex},
>- [IB_GID_GUID_F] {64, 64, "GidGuid", mad_dump_rhex},
>+ {0, 64, "GidPrefix", mad_dump_rhex},
>+ {64, 64, "GidGuid", mad_dump_rhex},
>
> /*
> * MAD: common MAD fields (IB spec 13.4.2)
>@@ -67,300 +66,316 @@ static const ib_field_t ib_mad_f [] = {
> */
>
> /* first MAD word (0-3 bytes) */
>- [IB_MAD_METHOD_F] {BE_OFFS(0, 7), "MadMethod",
>mad_dump_hex}, /* TODO: add dumper */
>- [IB_MAD_RESPONSE_F] {BE_OFFS(7, 1), "MadIsResponse",
>mad_dump_uint}, /* TODO: add dumper */
>- [IB_MAD_CLASSVER_F] {BE_OFFS(8, 8), "MadClassVersion",
>mad_dump_uint},
>- [IB_MAD_MGMTCLASS_F] {BE_OFFS(16, 8), "MadMgmtClass",
>mad_dump_uint}, /* TODO: add dumper */
>- [IB_MAD_BASEVER_F] {BE_OFFS(24, 8), "MadBaseVersion",
>mad_dump_uint},
>+ {BE_OFFS(0, 7), "MadMethod", mad_dump_hex}, /* TODO: add dumper */
>+ {BE_OFFS(7, 1), "MadIsResponse", mad_dump_uint}, /* TODO: add dumper */
>+ {BE_OFFS(8, 8), "MadClassVersion", mad_dump_uint},
>+ {BE_OFFS(16, 8), "MadMgmtClass", mad_dump_uint}, /* TODO: add dumper
>*/
>+ {BE_OFFS(24, 8), "MadBaseVersion", mad_dump_uint},
>
> /* second MAD word (4-7 bytes) */
>- [IB_MAD_STATUS_F] {BE_OFFS(48, 16), "MadStatus",
>mad_dump_hex}, /* TODO: add dumper */
>+ {BE_OFFS(48, 16), "MadStatus", mad_dump_hex}, /* TODO: add dumper */
>
> /* DR SMP only */
>- [IB_DRSMP_HOPCNT_F] {BE_OFFS(32, 8), "DrSmpHopCnt",
>mad_dump_uint},
>- [IB_DRSMP_HOPPTR_F] {BE_OFFS(40, 8), "DrSmpHopPtr",
>mad_dump_uint},
>- [IB_DRSMP_STATUS_F] {BE_OFFS(48, 15), "DrSmpStatus",
>mad_dump_hex}, /* TODO: add dumper */
>- [IB_DRSMP_DIRECTION_F] {BE_OFFS(63, 1), "DrSmpDirection",
>mad_dump_uint}, /* TODO: add dumper */
>+ {BE_OFFS(32, 8), "DrSmpHopCnt", mad_dump_uint},
>+ {BE_OFFS(40, 8), "DrSmpHopPtr", mad_dump_uint},
>+ {BE_OFFS(48, 15), "DrSmpStatus", mad_dump_hex}, /* TODO: add dumper */
>+ {BE_OFFS(63, 1), "DrSmpDirection", mad_dump_uint}, /* TODO: add dumper
>*/
>
> /* words 3,4,5,6 (8-23 bytes) */
>- [IB_MAD_TRID_F] {64, 64, "MadTRID", mad_dump_hex},
>- [IB_MAD_ATTRID_F] {BE_OFFS(144, 16), "MadAttr",
>mad_dump_hex}, /* TODO: add dumper */
>- [IB_MAD_ATTRMOD_F] {160, 32, "MadModifier", mad_dump_hex},
>/* TODO: add dumper */
>+ {64, 64, "MadTRID", mad_dump_hex},
>+ {BE_OFFS(144, 16), "MadAttr", mad_dump_hex}, /* TODO: add dumper */
>+ {160, 32, "MadModifier", mad_dump_hex}, /* TODO: add dumper */
>
> /* word 7,8 (24-31 bytes) */
>- [IB_MAD_MKEY_F] {196, 64, "MadMkey", mad_dump_hex},
>+ {196, 64, "MadMkey", mad_dump_hex},
>
> /* word 9 (32-37 bytes) */
>- [IB_DRSMP_DRDLID_F] {BE_OFFS(256, 16), "DrSmpDLID",
>mad_dump_hex},
>- [IB_DRSMP_DRSLID_F] {BE_OFFS(272, 16), "DrSmpSLID",
>mad_dump_hex},
>+ {BE_OFFS(256, 16), "DrSmpDLID", mad_dump_hex},
>+ {BE_OFFS(272, 16), "DrSmpSLID", mad_dump_hex},
>+
>+ /* word 10,11 (36-43 bytes) */
>+ {0, 0}, /* IB_SA_MKEY_F - reserved as invalid */
>
> /* word 12 (44-47 bytes) */
>- [IB_SA_ATTROFFS_F] {BE_OFFS(46*8, 16), "SaAttrOffs",
>mad_dump_uint},
>+ {BE_OFFS(46*8, 16), "SaAttrOffs", mad_dump_uint},
>
> /* word 13,14 (48-55 bytes) */
>- [IB_SA_COMPMASK_F] {48*8, 64, "SaCompMask", mad_dump_hex},
>+ {48*8, 64, "SaCompMask", mad_dump_hex},
>
> /* word 13,14 (56-255 bytes) */
>- [IB_SA_DATA_F] {56*8, (256-56)*8, "SaData",
>mad_dump_hex},
>-
>- [IB_DRSMP_PATH_F] {1024, 512, "DrSmpPath", mad_dump_hex},
>- [IB_DRSMP_RPATH_F] {1536, 512, "DrSmpRetPath",
>mad_dump_hex},
>-
>- [IB_GS_DATA_F] {64*8, (256-64) * 8, "GsData",
>mad_dump_hex},
>-
>+ {56*8, (256-56)*8, "SaData", mad_dump_hex},
>+
>+ /* bytes 64 - 127 */
>+ {0, 0}, /* IB_SM_DATA_F - reserved as invalid */
>+
>+ /* bytes 64 - 256 */
>+ {64*8, (256-64) * 8, "GsData", mad_dump_hex},
>+
>+ /* bytes 128 - 191 */
>+ {1024, 512, "DrSmpPath", mad_dump_hex},
>+
>+ /* bytes 192 - 255 */
>+ {1536, 512, "DrSmpRetPath", mad_dump_hex},
>+
> /*
> * PortInfo fields:
> */
>- [IB_PORT_MKEY_F] {0, 64, "Mkey", mad_dump_hex},
>- [IB_PORT_GID_PREFIX_F] {64, 64, "GidPrefix", mad_dump_hex},
>- [IB_PORT_LID_F] {BITSOFFS(128, 16), "Lid",
>mad_dump_hex},
>- [IB_PORT_SMLID_F] {BITSOFFS(144, 16), "SMLid",
>mad_dump_hex},
>- [IB_PORT_CAPMASK_F] {160, 32, "CapMask",
>mad_dump_portcapmask},
>- [IB_PORT_DIAG_F] {BITSOFFS(192, 16), "DiagCode",
>mad_dump_hex},
>- [IB_PORT_MKEY_LEASE_F] {BITSOFFS(208, 16), "MkeyLeasePeriod",
>mad_dump_uint},
>- [IB_PORT_LOCAL_PORT_F] {BITSOFFS(224, 8), "LocalPort",
>mad_dump_uint},
>- [IB_PORT_LINK_WIDTH_ENABLED_F] {BITSOFFS(232, 8), "LinkWidthEnabled",
>mad_dump_linkwidthen},
>- [IB_PORT_LINK_WIDTH_SUPPORTED_F] {BITSOFFS(240, 8),
>"LinkWidthSupported", mad_dump_linkwidthsup},
>- [IB_PORT_LINK_WIDTH_ACTIVE_F] {BITSOFFS(248, 8), "LinkWidthActive",
>mad_dump_linkwidth},
>- [IB_PORT_LINK_SPEED_SUPPORTED_F] {BITSOFFS(256, 4),
>"LinkSpeedSupported", mad_dump_linkspeedsup},
>- [IB_PORT_STATE_F] {BITSOFFS(260, 4), "LinkState",
>mad_dump_portstate},
>- [IB_PORT_PHYS_STATE_F] {BITSOFFS(264, 4), "PhysLinkState",
>mad_dump_physportstate},
>- [IB_PORT_LINK_DOWN_DEF_F] {BITSOFFS(268, 4), "LinkDownDefState",
>mad_dump_linkdowndefstate},
>- [IB_PORT_MKEY_PROT_BITS_F] {BITSOFFS(272, 2), "ProtectBits",
>mad_dump_uint},
>- [IB_PORT_LMC_F] {BITSOFFS(277, 3), "LMC",
>mad_dump_uint},
>- [IB_PORT_LINK_SPEED_ACTIVE_F] {BITSOFFS(280, 4), "LinkSpeedActive",
>mad_dump_linkspeed},
>- [IB_PORT_LINK_SPEED_ENABLED_F] {BITSOFFS(284, 4), "LinkSpeedEnabled",
>mad_dump_linkspeeden},
>- [IB_PORT_NEIGHBOR_MTU_F] {BITSOFFS(288, 4), "NeighborMTU",
>mad_dump_mtu},
>- [IB_PORT_SMSL_F] {BITSOFFS(292, 4), "SMSL",
>mad_dump_uint},
>- [IB_PORT_VL_CAP_F] {BITSOFFS(296, 4), "VLCap",
>mad_dump_vlcap},
>- [IB_PORT_INIT_TYPE_F] {BITSOFFS(300, 4), "InitType",
>mad_dump_hex},
>- [IB_PORT_VL_HIGH_LIMIT_F] {BITSOFFS(304, 8), "VLHighLimit",
>mad_dump_uint},
>- [IB_PORT_VL_ARBITRATION_HIGH_CAP_F] {BITSOFFS(312, 8),
>"VLArbHighCap", mad_dump_uint},
>- [IB_PORT_VL_ARBITRATION_LOW_CAP_F] {BITSOFFS(320, 8),
>"VLArbLowCap", mad_dump_uint},
>-
>- [IB_PORT_INIT_TYPE_REPLY_F] {BITSOFFS(328, 4), "InitReply",
>mad_dump_hex},
>- [IB_PORT_MTU_CAP_F] {BITSOFFS(332, 4), "MtuCap",
>mad_dump_mtu},
>- [IB_PORT_VL_STALL_COUNT_F] {BITSOFFS(336, 3), "VLStallCount",
>mad_dump_uint},
>- [IB_PORT_HOQ_LIFE_F] {BITSOFFS(339, 5), "HoqLife",
>mad_dump_uint},
>- [IB_PORT_OPER_VLS_F] {BITSOFFS(344, 4), "OperVLs",
>mad_dump_opervls},
>- [IB_PORT_PART_EN_INB_F] {BITSOFFS(348, 1), "PartEnforceInb",
>mad_dump_uint},
>- [IB_PORT_PART_EN_OUTB_F] {BITSOFFS(349, 1), "PartEnforceOutb",
>mad_dump_uint},
>- [IB_PORT_FILTER_RAW_INB_F] {BITSOFFS(350, 1), "FilterRawInb",
>mad_dump_uint},
>- [IB_PORT_FILTER_RAW_OUTB_F] {BITSOFFS(351, 1), "FilterRawOutb",
>mad_dump_uint},
>- [IB_PORT_MKEY_VIOL_F] {BITSOFFS(352, 16), "MkeyViolations",
>mad_dump_uint},
>- [IB_PORT_PKEY_VIOL_F] {BITSOFFS(368, 16), "PkeyViolations",
>mad_dump_uint},
>- [IB_PORT_QKEY_VIOL_F] {BITSOFFS(384, 16), "QkeyViolations",
>mad_dump_uint},
>- [IB_PORT_GUID_CAP_F] {BITSOFFS(400, 8), "GuidCap",
>mad_dump_uint},
>- [IB_PORT_CLIENT_REREG_F] {BITSOFFS(408, 1), "ClientReregister",
>mad_dump_uint},
>- [IB_PORT_SUBN_TIMEOUT_F] {BITSOFFS(411, 5), "SubnetTimeout",
>mad_dump_uint},
>- [IB_PORT_RESP_TIME_VAL_F] {BITSOFFS(419, 5), "RespTimeVal",
>mad_dump_uint},
>- [IB_PORT_LOCAL_PHYS_ERR_F] {BITSOFFS(424, 4), "LocalPhysErr",
>mad_dump_uint},
>- [IB_PORT_OVERRUN_ERR_F] {BITSOFFS(428, 4), "OverrunErr",
>mad_dump_uint},
>- [IB_PORT_MAX_CREDIT_HINT_F] {BITSOFFS(432, 16), "MaxCreditHint",
>mad_dump_uint},
>- [IB_PORT_LINK_ROUND_TRIP_F] {BITSOFFS(456, 24), "RoundTrip",
>mad_dump_uint},
>+ {0, 64, "Mkey", mad_dump_hex},
>+ {64, 64, "GidPrefix", mad_dump_hex},
>+ {BITSOFFS(128, 16), "Lid", mad_dump_hex},
>+ {BITSOFFS(144, 16), "SMLid", mad_dump_hex},
>+ {160, 32, "CapMask", mad_dump_portcapmask},
>+ {BITSOFFS(192, 16), "DiagCode", mad_dump_hex},
>+ {BITSOFFS(208, 16), "MkeyLeasePeriod", mad_dump_uint},
>+ {BITSOFFS(224, 8), "LocalPort", mad_dump_uint},
>+ {BITSOFFS(232, 8), "LinkWidthEnabled", mad_dump_linkwidthen},
>+ {BITSOFFS(240, 8), "LinkWidthSupported", mad_dump_linkwidthsup},
>+ {BITSOFFS(248, 8), "LinkWidthActive", mad_dump_linkwidth},
>+ {BITSOFFS(256, 4), "LinkSpeedSupported", mad_dump_linkspeedsup},
>+ {BITSOFFS(260, 4), "LinkState", mad_dump_portstate},
>+ {BITSOFFS(264, 4), "PhysLinkState", mad_dump_physportstate},
>+ {BITSOFFS(268, 4), "LinkDownDefState", mad_dump_linkdowndefstate},
>+ {BITSOFFS(272, 2), "ProtectBits", mad_dump_uint},
>+ {BITSOFFS(277, 3), "LMC", mad_dump_uint},
>+ {BITSOFFS(280, 4), "LinkSpeedActive", mad_dump_linkspeed},
>+ {BITSOFFS(284, 4), "LinkSpeedEnabled", mad_dump_linkspeeden},
>+ {BITSOFFS(288, 4), "NeighborMTU", mad_dump_mtu},
>+ {BITSOFFS(292, 4), "SMSL", mad_dump_uint},
>+ {BITSOFFS(296, 4), "VLCap", mad_dump_vlcap},
>+ {BITSOFFS(300, 4), "InitType", mad_dump_hex},
>+ {BITSOFFS(304, 8), "VLHighLimit", mad_dump_uint},
>+ {BITSOFFS(312, 8), "VLArbHighCap", mad_dump_uint},
>+ {BITSOFFS(320, 8), "VLArbLowCap", mad_dump_uint},
>+ {BITSOFFS(328, 4), "InitReply", mad_dump_hex},
>+ {BITSOFFS(332, 4), "MtuCap", mad_dump_mtu},
>+ {BITSOFFS(336, 3), "VLStallCount", mad_dump_uint},
>+ {BITSOFFS(339, 5), "HoqLife", mad_dump_uint},
>+ {BITSOFFS(344, 4), "OperVLs", mad_dump_opervls},
>+ {BITSOFFS(348, 1), "PartEnforceInb", mad_dump_uint},
>+ {BITSOFFS(349, 1), "PartEnforceOutb", mad_dump_uint},
>+ {BITSOFFS(350, 1), "FilterRawInb", mad_dump_uint},
>+ {BITSOFFS(351, 1), "FilterRawOutb", mad_dump_uint},
>+ {BITSOFFS(352, 16), "MkeyViolations", mad_dump_uint},
>+ {BITSOFFS(368, 16), "PkeyViolations", mad_dump_uint},
>+ {BITSOFFS(384, 16), "QkeyViolations", mad_dump_uint},
>+ {BITSOFFS(400, 8), "GuidCap", mad_dump_uint},
>+ {BITSOFFS(408, 1), "ClientReregister", mad_dump_uint},
>+ {BITSOFFS(411, 5), "SubnetTimeout", mad_dump_uint},
>+ {BITSOFFS(419, 5), "RespTimeVal", mad_dump_uint},
>+ {BITSOFFS(424, 4), "LocalPhysErr", mad_dump_uint},
>+ {BITSOFFS(428, 4), "OverrunErr", mad_dump_uint},
>+ {BITSOFFS(432, 16), "MaxCreditHint", mad_dump_uint},
>+ {BITSOFFS(456, 24), "RoundTrip", mad_dump_uint},
>+ {0, 0}, /* IB_PORT_LAST_F */
>
> /*
> * NodeInfo fields:
> */
>- [IB_NODE_BASE_VERS_F] {BITSOFFS(0,8), "BaseVers",
>mad_dump_uint},
>- [IB_NODE_CLASS_VERS_F] {BITSOFFS(8,8), "ClassVers",
>mad_dump_uint},
>- [IB_NODE_TYPE_F] {BITSOFFS(16,8), "NodeType",
>mad_dump_node_type},
>- [IB_NODE_NPORTS_F] {BITSOFFS(24,8), "NumPorts",
>mad_dump_uint},
>- [IB_NODE_SYSTEM_GUID_F] {32, 64, "SystemGuid", mad_dump_hex},
>- [IB_NODE_GUID_F] {96, 64, "Guid", mad_dump_hex},
>- [IB_NODE_PORT_GUID_F] {160, 64, "PortGuid", mad_dump_hex},
>- [IB_NODE_PARTITION_CAP_F] {BITSOFFS(224,16), "PartCap",
>mad_dump_uint},
>- [IB_NODE_DEVID_F] {BITSOFFS(240,16), "DevId",
>mad_dump_hex},
>- [IB_NODE_REVISION_F] {256, 32, "Revision", mad_dump_hex},
>- [IB_NODE_LOCAL_PORT_F] {BITSOFFS(288,8), "LocalPort",
>mad_dump_uint},
>- [IB_NODE_VENDORID_F] {BITSOFFS(296,24), "VendorId",
>mad_dump_hex},
>+ {BITSOFFS(0,8), "BaseVers", mad_dump_uint},
>+ {BITSOFFS(8,8), "ClassVers", mad_dump_uint},
>+ {BITSOFFS(16,8), "NodeType", mad_dump_node_type},
>+ {BITSOFFS(24,8), "NumPorts", mad_dump_uint},
>+ {32, 64, "SystemGuid", mad_dump_hex},
>+ {96, 64, "Guid", mad_dump_hex},
>+ {160, 64, "PortGuid", mad_dump_hex},
>+ {BITSOFFS(224,16), "PartCap", mad_dump_uint},
>+ {BITSOFFS(240,16), "DevId", mad_dump_hex},
>+ {256, 32, "Revision", mad_dump_hex},
>+ {BITSOFFS(288,8), "LocalPort", mad_dump_uint},
>+ {BITSOFFS(296,24), "VendorId", mad_dump_hex},
>+ {0, 0}, /* IB_NODE_LAST_F */
>+
>
> /*
> * SwitchInfo fields:
> */
>- [IB_SW_LINEAR_FDB_CAP_F] {BITSOFFS(0, 16), "LinearFdbCap",
>mad_dump_uint},
>- [IB_SW_RANDOM_FDB_CAP_F] {BITSOFFS(16, 16), "RandomFdbCap",
>mad_dump_uint},
>- [IB_SW_MCAST_FDB_CAP_F] {BITSOFFS(32, 16), "McastFdbCap",
>mad_dump_uint},
>- [IB_SW_LINEAR_FDB_TOP_F] {BITSOFFS(48, 16), "LinearFdbTop",
>mad_dump_uint},
>- [IB_SW_DEF_PORT_F] {BITSOFFS(64, 8), "DefPort",
>mad_dump_uint},
>- [IB_SW_DEF_MCAST_PRIM_F] {BITSOFFS(72, 8), "DefMcastPrimPort",
>mad_dump_uint},
>- [IB_SW_DEF_MCAST_NOT_PRIM_F] {BITSOFFS(80, 8),
>"DefMcastNotPrimPort", mad_dump_uint},
>- [IB_SW_LIFE_TIME_F] {BITSOFFS(88, 5), "LifeTime",
>mad_dump_uint},
>- [IB_SW_STATE_CHANGE_F] {BITSOFFS(93, 1), "StateChange",
>mad_dump_uint},
>- [IB_SW_LIDS_PER_PORT_F] {BITSOFFS(96,16), "LidsPerPort",
>mad_dump_uint},
>- [IB_SW_PARTITION_ENFORCE_CAP_F] {BITSOFFS(112, 16), "PartEnforceCap",
>mad_dump_uint},
>- [IB_SW_PARTITION_ENF_INB_F] {BITSOFFS(128, 1), "InboundPartEnf",
>mad_dump_uint},
>- [IB_SW_PARTITION_ENF_OUTB_F] {BITSOFFS(129, 1), "OutboundPartEnf",
>mad_dump_uint},
>- [IB_SW_FILTER_RAW_INB_F] {BITSOFFS(130, 1), "FilterRawInbound",
>mad_dump_uint},
>- [IB_SW_FILTER_RAW_OUTB_F] {BITSOFFS(131, 1), "FilterRawOutbound",
>mad_dump_uint},
>- [IB_SW_ENHANCED_PORT0_F] {BITSOFFS(132, 1), "EnhancedPort0",
>mad_dump_uint},
>+ {BITSOFFS(0, 16), "LinearFdbCap", mad_dump_uint},
>+ {BITSOFFS(16, 16), "RandomFdbCap", mad_dump_uint},
>+ {BITSOFFS(32, 16), "McastFdbCap", mad_dump_uint},
>+ {BITSOFFS(48, 16), "LinearFdbTop", mad_dump_uint},
>+ {BITSOFFS(64, 8), "DefPort", mad_dump_uint},
>+ {BITSOFFS(72, 8), "DefMcastPrimPort", mad_dump_uint},
>+ {BITSOFFS(80, 8), "DefMcastNotPrimPort", mad_dump_uint},
>+ {BITSOFFS(88, 5), "LifeTime", mad_dump_uint},
>+ {BITSOFFS(93, 1), "StateChange", mad_dump_uint},
>+ {BITSOFFS(96,16), "LidsPerPort", mad_dump_uint},
>+ {BITSOFFS(112, 16), "PartEnforceCap", mad_dump_uint},
>+ {BITSOFFS(128, 1), "InboundPartEnf", mad_dump_uint},
>+ {BITSOFFS(129, 1), "OutboundPartEnf", mad_dump_uint},
>+ {BITSOFFS(130, 1), "FilterRawInbound", mad_dump_uint},
>+ {BITSOFFS(131, 1), "FilterRawOutbound", mad_dump_uint},
>+ {BITSOFFS(132, 1), "EnhancedPort0", mad_dump_uint},
>+ {0, 0}, /* IB_SW_LAST_F */
>
> /*
> * SwitchLinearForwardingTable fields:
> */
>- [IB_LINEAR_FORW_TBL_F] {0, 512, "LinearForwTbl",
>mad_dump_array},
>+ {0, 512, "LinearForwTbl", mad_dump_array},
>
> /*
> * SwitchMulticastForwardingTable fields:
> */
>- [IB_MULTICAST_FORW_TBL_F] {0, 512, "MulticastForwTbl",
>mad_dump_array},
>+ {0, 512, "MulticastForwTbl", mad_dump_array},
>
> /*
>- * Notice/Trap fields
>+ * NodeDescription fields:
> */
>- [IB_NOTICE_IS_GENERIC_F] {BITSOFFS(0, 1), "NoticeIsGeneric",
>mad_dump_uint},
>- [IB_NOTICE_TYPE_F] {BITSOFFS(1, 7), "NoticeType",
>mad_dump_uint},
>- [IB_NOTICE_PRODUCER_F] {BITSOFFS(8, 24), "NoticeProducerType",
>mad_dump_node_type},
>- [IB_NOTICE_TRAP_NUMBER_F] {BITSOFFS(32, 16), "NoticeTrapNumber",
>mad_dump_uint},
>- [IB_NOTICE_ISSUER_LID_F] {BITSOFFS(48, 16), "NoticeIssuerLID",
>mad_dump_uint},
>- [IB_NOTICE_TOGGLE_F] {BITSOFFS(64, 1), "NoticeToggle",
>mad_dump_uint},
>- [IB_NOTICE_COUNT_F] {BITSOFFS(65, 15), "NoticeCount",
>mad_dump_uint},
>- [IB_NOTICE_DATA_DETAILS_F] {80, 432, "NoticeDataDetails",
>mad_dump_array},
>- [IB_NOTICE_DATA_LID_F] {BITSOFFS(80, 16), "NoticeDataLID",
>mad_dump_uint},
>- [IB_NOTICE_DATA_144_LID_F] {BITSOFFS(96, 16),
>"NoticeDataTrap144LID", mad_dump_uint},
>- [IB_NOTICE_DATA_144_CAPMASK_F] {BITSOFFS(128, 32),
>"NoticeDataTrap144CapMask", mad_dump_uint},
>+ {0, 64*8, "NodeDesc", mad_dump_string},
>
> /*
>- * NodeDescription fields:
>+ * Notice/Trap fields
> */
>- [IB_NODE_DESC_F] {0, 64*8, "NodeDesc", mad_dump_string},
>+ {BITSOFFS(0, 1), "NoticeIsGeneric", mad_dump_uint},
>+ {BITSOFFS(1, 7), "NoticeType", mad_dump_uint},
>+ {BITSOFFS(8, 24), "NoticeProducerType", mad_dump_node_type},
>+ {BITSOFFS(32, 16), "NoticeTrapNumber", mad_dump_uint},
>+ {BITSOFFS(48, 16), "NoticeIssuerLID", mad_dump_uint},
>+ {BITSOFFS(64, 1), "NoticeToggle", mad_dump_uint},
>+ {BITSOFFS(65, 15), "NoticeCount", mad_dump_uint},
>+ {80, 432, "NoticeDataDetails", mad_dump_array},
>+ {BITSOFFS(80, 16), "NoticeDataLID", mad_dump_uint},
>+ {BITSOFFS(96, 16), "NoticeDataTrap144LID", mad_dump_uint},
>+ {BITSOFFS(128, 32), "NoticeDataTrap144CapMask", mad_dump_uint},
>
> /*
> * Port counters
> */
>- [IB_PC_PORT_SELECT_F] {BITSOFFS(8, 8), "PortSelect",
>mad_dump_uint},
>- [IB_PC_COUNTER_SELECT_F] {BITSOFFS(16, 16), "CounterSelect",
>mad_dump_hex},
>- [IB_PC_ERR_SYM_F] {BITSOFFS(32, 16), "SymbolErrors",
>mad_dump_uint},
>- [IB_PC_LINK_RECOVERS_F] {BITSOFFS(48, 8), "LinkRecovers",
>mad_dump_uint},
>- [IB_PC_LINK_DOWNED_F] {BITSOFFS(56, 8), "LinkDowned",
>mad_dump_uint},
>- [IB_PC_ERR_RCV_F] {BITSOFFS(64, 16), "RcvErrors",
>mad_dump_uint},
>- [IB_PC_ERR_PHYSRCV_F] {BITSOFFS(80, 16),
>"RcvRemotePhysErrors", mad_dump_uint},
>- [IB_PC_ERR_SWITCH_REL_F] {BITSOFFS(96, 16), "RcvSwRelayErrors",
>mad_dump_uint},
>- [IB_PC_XMT_DISCARDS_F] {BITSOFFS(112, 16), "XmtDiscards",
>mad_dump_uint},
>- [IB_PC_ERR_XMTCONSTR_F] {BITSOFFS(128, 8),
>"XmtConstraintErrors", mad_dump_uint},
>- [IB_PC_ERR_RCVCONSTR_F] {BITSOFFS(136, 8),
>"RcvConstraintErrors", mad_dump_uint},
>- [IB_PC_COUNTER_SELECT2_F] {BITSOFFS(144, 8), "CounterSelect2",
>mad_dump_uint},
>- [IB_PC_ERR_LOCALINTEG_F] {BITSOFFS(152, 4),
>"LinkIntegrityErrors", mad_dump_uint},
>- [IB_PC_ERR_EXCESS_OVR_F] {BITSOFFS(156, 4),
>"ExcBufOverrunErrors", mad_dump_uint},
>- [IB_PC_VL15_DROPPED_F] {BITSOFFS(176, 16), "VL15Dropped",
>mad_dump_uint},
>- [IB_PC_XMT_BYTES_F] {192, 32, "XmtData", mad_dump_uint},
>- [IB_PC_RCV_BYTES_F] {224, 32, "RcvData", mad_dump_uint},
>- [IB_PC_XMT_PKTS_F] {256, 32, "XmtPkts", mad_dump_uint},
>- [IB_PC_RCV_PKTS_F] {288, 32, "RcvPkts", mad_dump_uint},
>- [IB_PC_XMT_WAIT_F] {320, 32, "XmtWait", mad_dump_uint},
>+ {BITSOFFS(8, 8), "PortSelect", mad_dump_uint},
>+ {BITSOFFS(16, 16), "CounterSelect", mad_dump_hex},
>+ {BITSOFFS(32, 16), "SymbolErrors", mad_dump_uint},
>+ {BITSOFFS(48, 8), "LinkRecovers", mad_dump_uint},
>+ {BITSOFFS(56, 8), "LinkDowned", mad_dump_uint},
>+ {BITSOFFS(64, 16), "RcvErrors", mad_dump_uint},
>+ {BITSOFFS(80, 16), "RcvRemotePhysErrors", mad_dump_uint},
>+ {BITSOFFS(96, 16), "RcvSwRelayErrors", mad_dump_uint},
>+ {BITSOFFS(112, 16), "XmtDiscards", mad_dump_uint},
>+ {BITSOFFS(128, 8), "XmtConstraintErrors", mad_dump_uint},
>+ {BITSOFFS(136, 8), "RcvConstraintErrors", mad_dump_uint},
>+ {BITSOFFS(144, 8), "CounterSelect2", mad_dump_uint},
>+ {BITSOFFS(152, 4), "LinkIntegrityErrors", mad_dump_uint},
>+ {BITSOFFS(156, 4), "ExcBufOverrunErrors", mad_dump_uint},
>+ {BITSOFFS(176, 16), "VL15Dropped", mad_dump_uint},
>+ {192, 32, "XmtData", mad_dump_uint},
>+ {224, 32, "RcvData", mad_dump_uint},
>+ {256, 32, "XmtPkts", mad_dump_uint},
>+ {288, 32, "RcvPkts", mad_dump_uint},
>+ {320, 32, "XmtWait", mad_dump_uint},
>+ {0, 0}, /* IB_PC_LAST_F */
>
> /*
> * SMInfo
> */
>- [IB_SMINFO_GUID_F] {0, 64, "SmInfoGuid", mad_dump_hex},
>- [IB_SMINFO_KEY_F] {64, 64, "SmInfoKey", mad_dump_hex},
>- [IB_SMINFO_ACT_F] {128, 32, "SmActivity", mad_dump_uint},
>- [IB_SMINFO_PRIO_F] {BITSOFFS(160, 4), "SmPriority",
>mad_dump_uint},
>- [IB_SMINFO_STATE_F] {BITSOFFS(164, 4), "SmState",
>mad_dump_uint},
>+ {0, 64, "SmInfoGuid", mad_dump_hex},
>+ {64, 64, "SmInfoKey", mad_dump_hex},
>+ {128, 32, "SmActivity", mad_dump_uint},
>+ {BITSOFFS(160, 4), "SmPriority", mad_dump_uint},
>+ {BITSOFFS(164, 4), "SmState", mad_dump_uint},
>
> /*
> * SA RMPP
> */
>- [IB_SA_RMPP_VERS_F] {BE_OFFS(24*8+24, 8), "RmppVers",
>mad_dump_uint},
>- [IB_SA_RMPP_TYPE_F] {BE_OFFS(24*8+16, 8), "RmppType",
>mad_dump_uint},
>- [IB_SA_RMPP_RESP_F] {BE_OFFS(24*8+11, 5), "RmppResp",
>mad_dump_uint},
>- [IB_SA_RMPP_FLAGS_F] {BE_OFFS(24*8+8, 3), "RmppFlags",
>mad_dump_hex},
>- [IB_SA_RMPP_STATUS_F] {BE_OFFS(24*8+0, 8), "RmppStatus",
>mad_dump_hex},
>+ {BE_OFFS(24*8+24, 8), "RmppVers", mad_dump_uint},
>+ {BE_OFFS(24*8+16, 8), "RmppType", mad_dump_uint},
>+ {BE_OFFS(24*8+11, 5), "RmppResp", mad_dump_uint},
>+ {BE_OFFS(24*8+8, 3), "RmppFlags", mad_dump_hex},
>+ {BE_OFFS(24*8+0, 8), "RmppStatus", mad_dump_hex},
>
> /* data1 */
>- [IB_SA_RMPP_D1_F] {28*8, 32, "RmppData1", mad_dump_hex},
>- [IB_SA_RMPP_SEGNUM_F] {28*8, 32, "RmppSegNum",
>mad_dump_uint},
>+ {28*8, 32, "RmppData1", mad_dump_hex},
>+ {28*8, 32, "RmppSegNum", mad_dump_uint},
> /* data2 */
>- [IB_SA_RMPP_D2_F] {32*8, 32, "RmppData2", mad_dump_hex},
>- [IB_SA_RMPP_LEN_F] {32*8, 32, "RmppPayload",
>mad_dump_uint},
>- [IB_SA_RMPP_NEWWIN_F] {32*8, 32, "RmppNewWin",
>mad_dump_uint},
>-
>+ {32*8, 32, "RmppData2", mad_dump_hex},
>+ {32*8, 32, "RmppPayload", mad_dump_uint},
>+ {32*8, 32, "RmppNewWin", mad_dump_uint},
>+
> /*
>- * SA Path rec
>+ * SA Get Multi Path
> */
>- [IB_SA_PR_DGID_F] {64, 128, "PathRecDGid",
>mad_dump_array},
>- [IB_SA_PR_SGID_F] {192, 128, "PathRecSGid",
>mad_dump_array},
>- [IB_SA_PR_DLID_F] {BITSOFFS(320,16), "PathRecDLid",
>mad_dump_hex},
>- [IB_SA_PR_SLID_F] {BITSOFFS(336,16), "PathRecSLid",
>mad_dump_hex},
>- [IB_SA_PR_NPATH_F] {BITSOFFS(393,7), "PathRecNumPath",
>mad_dump_uint},
>+ {BITSOFFS(41,7), "MultiPathNumPath", mad_dump_uint},
>+ {BITSOFFS(120,8), "MultiPathNumSrc", mad_dump_uint},
>+ {BITSOFFS(128,8), "MultiPathNumDest", mad_dump_uint},
>+ {192, 128, "MultiPathGid", mad_dump_array},
>
> /*
>- * SA Get Multi Path
>+ * SA Path rec
> */
>- [IB_SA_MP_NPATH_F] {BITSOFFS(41,7), "MultiPathNumPath",
>mad_dump_uint},
>- [IB_SA_MP_NSRC_F] {BITSOFFS(120,8), "MultiPathNumSrc",
>mad_dump_uint},
>- [IB_SA_MP_NDEST_F] {BITSOFFS(128,8), "MultiPathNumDest",
>mad_dump_uint},
>- [IB_SA_MP_GID0_F] {192, 128, "MultiPathGid",
>mad_dump_array},
>+ {64, 128, "PathRecDGid", mad_dump_array},
>+ {192, 128, "PathRecSGid", mad_dump_array},
>+ {BITSOFFS(320,16), "PathRecDLid", mad_dump_hex},
>+ {BITSOFFS(336,16), "PathRecSLid", mad_dump_hex},
>+ {BITSOFFS(393,7), "PathRecNumPath", mad_dump_uint},
>
> /*
> * MC Member rec
> */
>- [IB_SA_MCM_MGID_F] {0, 128, "McastMemMGid",
>mad_dump_array},
>- [IB_SA_MCM_PORTGID_F] {128, 128, "McastMemPortGid",
>mad_dump_array},
>- [IB_SA_MCM_QKEY_F] {256, 32, "McastMemQkey",
>mad_dump_hex},
>- [IB_SA_MCM_MLID_F] {BITSOFFS(288, 16), "McastMemMLid",
>mad_dump_hex},
>- [IB_SA_MCM_MTU_F] {BITSOFFS(306, 6), "McastMemMTU",
>mad_dump_uint},
>- [IB_SA_MCM_TCLASS_F] {BITSOFFS(312, 8), "McastMemTClass",
>mad_dump_uint},
>- [IB_SA_MCM_PKEY_F] {BITSOFFS(320, 16), "McastMemPkey",
>mad_dump_uint},
>- [IB_SA_MCM_RATE_F] {BITSOFFS(338, 6), "McastMemRate",
>mad_dump_uint},
>- [IB_SA_MCM_SL_F] {BITSOFFS(352, 4), "McastMemSL",
>mad_dump_uint},
>- [IB_SA_MCM_FLOW_LABEL_F] {BITSOFFS(356, 20), "McastMemFlowLbl",
>mad_dump_uint},
>- [IB_SA_MCM_JOIN_STATE_F] {BITSOFFS(388, 4), "McastMemJoinState",
>mad_dump_uint},
>- [IB_SA_MCM_PROXY_JOIN_F] {BITSOFFS(392, 1), "McastMemProxyJoin",
>mad_dump_uint},
>+ {0, 128, "McastMemMGid", mad_dump_array},
>+ {128, 128, "McastMemPortGid", mad_dump_array},
>+ {256, 32, "McastMemQkey", mad_dump_hex},
>+ {BITSOFFS(288, 16), "McastMemMLid", mad_dump_hex},
>+ {BITSOFFS(352, 4), "McastMemSL", mad_dump_uint},
>+ {BITSOFFS(306, 6), "McastMemMTU", mad_dump_uint},
>+ {BITSOFFS(338, 6), "McastMemRate", mad_dump_uint},
>+ {BITSOFFS(312, 8), "McastMemTClass", mad_dump_uint},
>+ {BITSOFFS(320, 16), "McastMemPkey", mad_dump_uint},
>+ {BITSOFFS(356, 20), "McastMemFlowLbl", mad_dump_uint},
>+ {BITSOFFS(388, 4), "McastMemJoinState", mad_dump_uint},
>+ {BITSOFFS(392, 1), "McastMemProxyJoin", mad_dump_uint},
>
> /*
> * Service record
> */
>- [IB_SA_SR_ID_F] {0, 64, "ServRecID", mad_dump_hex},
>- [IB_SA_SR_GID_F] {64, 128, "ServRecGid",
>mad_dump_array},
>- [IB_SA_SR_PKEY_F] {BITSOFFS(192, 16), "ServRecPkey",
>mad_dump_hex},
>- [IB_SA_SR_LEASE_F] {224, 32, "ServRecLease",
>mad_dump_hex},
>- [IB_SA_SR_KEY_F] {256, 128, "ServRecKey", mad_dump_hex},
>- [IB_SA_SR_NAME_F] {384, 512, "ServRecName",
>mad_dump_string},
>- [IB_SA_SR_DATA_F] {896, 512, "ServRecData",
>mad_dump_array}, /* ATS for example */
>+ {0, 64, "ServRecID", mad_dump_hex},
>+ {64, 128, "ServRecGid", mad_dump_array},
>+ {BITSOFFS(192, 16), "ServRecPkey", mad_dump_hex},
>+ {224, 32, "ServRecLease", mad_dump_hex},
>+ {256, 128, "ServRecKey", mad_dump_hex},
>+ {384, 512, "ServRecName", mad_dump_string},
>+ {896, 512, "ServRecData", mad_dump_array}, /* ATS for example */
>
> /*
> * ATS SM record - within SA_SR_DATA
> */
>- [IB_ATS_SM_NODE_ADDR_F] {12*8, 32, "ATSNodeAddr",
>mad_dump_hex},
>- [IB_ATS_SM_MAGIC_KEY_F] {BITSOFFS(16*8, 16), "ATSMagicKey",
>mad_dump_hex},
>- [IB_ATS_SM_NODE_TYPE_F] {BITSOFFS(18*8, 16), "ATSNodeType",
>mad_dump_hex},
>- [IB_ATS_SM_NODE_NAME_F] {32*8, 32*8, "ATSNodeName",
>mad_dump_string},
>+ {12*8, 32, "ATSNodeAddr", mad_dump_hex},
>+ {BITSOFFS(16*8, 16), "ATSMagicKey", mad_dump_hex},
>+ {BITSOFFS(18*8, 16), "ATSNodeType", mad_dump_hex},
>+ {32*8, 32*8, "ATSNodeName", mad_dump_string},
>
> /*
> * SLTOVL MAPPING TABLE
> */
>- [IB_SLTOVL_MAPPING_TABLE_F] {0, 64, "SLToVLMap", mad_dump_hex},
>+ {0, 64, "SLToVLMap", mad_dump_hex},
>
> /*
> * VL ARBITRATION TABLE
> */
>- [IB_VL_ARBITRATION_TABLE_F] {0, 512, "VLArbTbl", mad_dump_array},
>+ {0, 512, "VLArbTbl", mad_dump_array},
>
> /*
> * IB vendor classes range 2
> */
>- [IB_VEND2_OUI_F] {BE_OFFS(36*8, 24), "OUI",
>mad_dump_array},
>- [IB_VEND2_DATA_F] {40*8, (256-40)*8, "Vendor2Data",
>mad_dump_array},
>+ {BE_OFFS(36*8, 24), "OUI", mad_dump_array},
>+ {40*8, (256-40)*8, "Vendor2Data", mad_dump_array},
>
> /*
> * Extended port counters
> */
>- [IB_PC_EXT_PORT_SELECT_F] {BITSOFFS(8, 8), "PortSelect",
>mad_dump_uint},
>- [IB_PC_EXT_COUNTER_SELECT_F] {BITSOFFS(16, 16), "CounterSelect",
>mad_dump_hex},
>- [IB_PC_EXT_XMT_BYTES_F] {64, 64, "PortXmitData",
>mad_dump_uint},
>- [IB_PC_EXT_RCV_BYTES_F] {128, 64, "PortRcvData",
>mad_dump_uint},
>- [IB_PC_EXT_XMT_PKTS_F] {192, 64, "PortXmitPkts",
>mad_dump_uint},
>- [IB_PC_EXT_RCV_PKTS_F] {256, 64, "PortRcvPkts",
>mad_dump_uint},
>- [IB_PC_EXT_XMT_UPKTS_F] {320, 64, "PortUnicastXmitPkts",
>mad_dump_uint},
>- [IB_PC_EXT_RCV_UPKTS_F] {384, 64, "PortUnicastRcvPkts",
>mad_dump_uint},
>- [IB_PC_EXT_XMT_MPKTS_F] {448, 64, "PortMulticastXmitPkts",
>mad_dump_uint},
>- [IB_PC_EXT_RCV_MPKTS_F] {512, 64, "PortMulticastRcvPkts",
>mad_dump_uint},
>+ {BITSOFFS(8, 8), "PortSelect", mad_dump_uint},
>+ {BITSOFFS(16, 16), "CounterSelect", mad_dump_hex},
>+ {64, 64, "PortXmitData", mad_dump_uint},
>+ {128, 64, "PortRcvData", mad_dump_uint},
>+ {192, 64, "PortXmitPkts", mad_dump_uint},
>+ {256, 64, "PortRcvPkts", mad_dump_uint},
>+ {320, 64, "PortUnicastXmitPkts", mad_dump_uint},
>+ {384, 64, "PortUnicastRcvPkts", mad_dump_uint},
>+ {448, 64, "PortMulticastXmitPkts", mad_dump_uint},
>+ {512, 64, "PortMulticastRcvPkts", mad_dump_uint},
>+ {0, 0}, /* IB_PC_EXT_LAST_F */
>
> /*
> * GUIDInfo fields
> */
>- [IB_GUID_GUID0_F] {0, 64, "GUID0", mad_dump_hex},
>+ {0, 64, "GUID0", mad_dump_hex},
>+ {0, 0} /* IB_FIELD_LAST_ */
>
> };
>
>@@ -561,9 +576,12 @@ static char *_mad_dump_field(const ib_field_t *f, const
>char *name, char *buf, i
>
> static int _mad_dump(ib_mad_dump_fn *fn, const char *name, void *val, int
>valsz)
> {
>- ib_field_t f = { .def_dump_fn = fn, .bitlen = valsz * 8};
>+ ib_field_t f;
> char buf[512];
>
>+ f.def_dump_fn = fn;
>+ f.bitlen = valsz * 8;
>+
> return printf("%s\n", _mad_dump_field(&f, name, buf, sizeof buf, val));
> }
>
>--
>1.5.2.5
>
>_______________________________________________
>general mailing list
>general at lists.openfabrics.org
>http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
>
>To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
More information about the ofw
mailing list