Restore show_progress functionality. This output is used by scripts like 'dump_lfts.sh -D', also sometimes useful for debug.
Signed-off-by: Sasha Khapyorsky <[email protected]> --- infiniband-diags/libibnetdisc/src/ibnetdisc.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/infiniband-diags/libibnetdisc/src/ibnetdisc.c b/infiniband-diags/libibnetdisc/src/ibnetdisc.c index 4780810..b438d4f 100644 --- a/infiniband-diags/libibnetdisc/src/ibnetdisc.c +++ b/infiniband-diags/libibnetdisc/src/ibnetdisc.c @@ -270,6 +270,18 @@ static void link_ports(ibnd_node_t * node, ibnd_port_t * port, remoteport->remoteport = port; } +static void dump_endnode(ib_portid_t * path, char *prompt, + ibnd_node_t * node, ibnd_port_t * port) +{ + char type[64]; + mad_dump_node_type(type, sizeof(type), &node->type, sizeof(int)); + printf("%s -> %s %s {%016" PRIx64 "} portnum %d lid %d-%d \"%s\"\n", + portid2str(path), prompt, type, node->guid, + node->type == IB_NODE_SWITCH ? 0 : port->portnum, + port->base_lid, port->base_lid + (1 << port->lmc) - 1, + node->nodedesc); +} + static int recv_node_info(smp_engine_t * engine, ibnd_smp_t * smp, uint8_t * mad, void *cb_data) { @@ -303,6 +315,10 @@ static int recv_node_info(smp_engine_t * engine, ibnd_smp_t * smp, } port->guid = port_guid; + if (show_progress) + dump_endnode(&smp->path, node_is_new ? "new" : "known", + node, port); + if (rem_node == NULL) /* this is the start node */ fabric->from_node = node; else { -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
