@@ -149,6 +149,7 @@ typedef struct ibnd_fabric {
* or by default the node you ar running on
*/
ibnd_node_t *from_node;
+ int from_port;
/* NULL term list of all nodes in the fabric */
ibnd_node_t *nodes;
/* NULL terminated list of all chassis found in the fabric */
@@ -199,7 +199,7 @@ static int recv_port_info(smp_engine_t * engine, ibnd_smp_t * smp,
if (port_num && mad_get_field(port->info, 0, IB_PORT_PHYS_STATE_F)
== IB_PORT_PHYS_STATE_LINKUP
&& ((node->type == IB_NODE_SWITCH && port_num != local_port) ||
- (node == fabric->from_node && port_num == local_port))) {
+ (node == fabric->from_node && port_num == fabric->from_port))) {
ib_portid_t path = smp->path;
if (extend_dpath(engine, &path, port_num) > 0)
query_node_info(engine, &path, node);
@@ -324,9 +324,10 @@ static int recv_node_info(smp_engine_t * engine, ibnd_smp_t * smp,
dump_endnode(&smp->path, node_is_new ? "new" : "known",
node, port);
- if (rem_node == NULL) /* this is the start node */
+ if (rem_node == NULL) { /* this is the start node */
fabric->from_node = node;
- else {
+ fabric->from_port = port_num;
+ } else {
/* link ports... */
int rem_port_num = get_last_port(&smp->path);