Skip to contentSkip to conversation

opensm/osm_mcast_mgr.c: fix osm_mcast_mgr_compute_max_hops for managed switch

PATCH Superseded Yevgeny Kliteynik 2 participants 3 messages Dec 21, 2009 – Dec 23, 2009 1 message not in the archive InfiniBand

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 opensm/osm_mcast_mgr.c: fix osm_mcast_mgr_compute_max_hops for managed switch

If a certain mcast group has only one member, and this member is a switch, OSM fails to select this switch when trying to create spanning tree for this mcast group:

ERR 0A08: Unable to locate a suitable switch for group 0xC000 ERR 0A17: Unable to create spanning tree (IB_ERROR) for mlid 0xc000

---
 opensm/opensm/osm_mcast_mgr.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
opensm/opensm/osm_mcast_mgr.c +10 -6
index 697fb58..16f578b 100644
@@ -204,6 +204,12 @@ static float osm_mcast_mgr_compute_max_hops(osm_sm_t * sm, cl_qlist_t * l,
 
 	OSM_LOG_ENTER(sm->p_log);
 
+	if (cl_qlist_count(l) == 0) {
+		/*  We should be here if there aren't any ports in the group */
+		max_hops = 10001; /* see later - we use it to realize no hops */
+		goto Exit;
+	}
+
 	/*
 	   For each member of the multicast group, compute the
 	   number of hops to its base LID.
@@ -215,12 +221,10 @@ static float osm_mcast_mgr_compute_max_hops(osm_sm_t * sm, cl_qlist_t * l,
 			max_hops = hops;
 	}
 
-	if (max_hops == 0)
-		/*
-		   We should be here if there aren't any ports in the group.
-		 */
-		max_hops = 10001;	/* see later - we use it to realize no hops */
-
+	/* Note that at this point we might get (max_hops == 0),
+	   which means that there's only one member in the mcast
+	   group, and it's the current switch */
+Exit:
 	OSM_LOG_EXIT(sm->p_log);
 	return (float)max_hops;
 }
Signature · 6 lines
1.5.1.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

A message that is not in the archive (sent off-list or not yet received): 4B2F4405.9000300-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org

#2 lore raw

Hi Yevgeny,

Quoted 17 lines · Yevgeny Kliteynik

If a certain mcast group has only one member, and this member is a switch, OSM fails to select this switch when trying to create spanning tree for this mcast group:

ERR 0A08: Unable to locate a suitable switch for group 0xC000 ERR 0A17: Unable to create spanning tree (IB_ERROR) for mlid 0xc000

---
 opensm/opensm/osm_mcast_mgr.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
opensm/opensm/osm_mcast_mgr.c +0 -0
index 697fb58..16f578b 100644

opensm/opensm/osm_mcast_mgr.c static float osm_mcast_mgr_compute_max_hops(osm_sm_t * sm, cl_qlist_t * l, · line 212

Quoted 9 lines
opensm/opensm/osm_mcast_mgr.c +6 -0
@@ -204,6 +204,12 @@ static float osm_mcast_mgr_compute_max_hops(osm_sm_t * sm, cl_qlist_t * l,
 
 	OSM_LOG_ENTER(sm->p_log);
 
+	if (cl_qlist_count(l) == 0) {
+		/*  We should be here if there aren't any ports in the group */
+		max_hops = 10001; /* see later - we use it to realize no hops */
+		goto Exit;
+	}
+

Could we reach this condition?

Quoted 1 line

From the caller code:

	num_ports = cl_qlist_count(&port_list);
	if (num_ports == 0) {
		OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,
			"MLID 0x%X has no members - nothing to do\n",
			mbox->mlid);
		goto Exit;
	}

Sasha

Quoted 28 lines
opensm/opensm/osm_mcast_mgr.c +4 -6
 	/*
 	   For each member of the multicast group, compute the
 	   number of hops to its base LID.
@@ -215,12 +221,10 @@ static float osm_mcast_mgr_compute_max_hops(osm_sm_t * sm, cl_qlist_t * l,
 			max_hops = hops;
 	}
 
-	if (max_hops == 0)
-		/*
-		   We should be here if there aren't any ports in the group.
-		 */
-		max_hops = 10001;	/* see later - we use it to realize no hops */
-
+	/* Note that at this point we might get (max_hops == 0),
+	   which means that there's only one member in the mcast
+	   group, and it's the current switch */
+Exit:
 	OSM_LOG_EXIT(sm->p_log);
 	return (float)max_hops;
 }
Signature · 6 lines
1.5.1.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

--
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

#3 lore raw

Hi Sasha,

Quoted 34 lines · Sasha Khapyorsky

Hi Yevgeny,

Quoted 17 lines · Yevgeny Kliteynik

If a certain mcast group has only one member, and this member is a switch, OSM fails to select this switch when trying to create spanning tree for this mcast group:

ERR 0A08: Unable to locate a suitable switch for group 0xC000 ERR 0A17: Unable to create spanning tree (IB_ERROR) for mlid 0xc000

---
  opensm/opensm/osm_mcast_mgr.c |   16 ++++++++++------
  1 files changed, 10 insertions(+), 6 deletions(-)
opensm/opensm/osm_mcast_mgr.c +0 -0
index 697fb58..16f578b 100644

opensm/opensm/osm_mcast_mgr.c static float osm_mcast_mgr_compute_max_hops(osm_sm_t * sm, cl_qlist_t * l, · line 212

Quoted 9 lines
opensm/opensm/osm_mcast_mgr.c +6 -0
@@ -204,6 +204,12 @@ static float osm_mcast_mgr_compute_max_hops(osm_sm_t * sm, cl_qlist_t * l,
 
  	OSM_LOG_ENTER(sm->p_log);
 
+	if (cl_qlist_count(l) == 0) {
+		/*  We should be here if there aren't any ports in the group */
+		max_hops = 10001; /* see later - we use it to realize no hops */
+		goto Exit;
+	}
+

Could we reach this condition?

Quoted 1 line

From the caller code:

Quoted 7 lines
	num_ports = cl_qlist_count(&port_list);
	if (num_ports == 0) {
		OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,
			"MLID 0x%X has no members - nothing to do\n",
			mbox->mlid);
		goto Exit;
	}

You're fight, we can't reach this condition anyway. So the fix should be just removing the special treatment of the problematic case. Patch shortly.

-- Yevgeny

Quoted 25 lines

Sasha

Quoted 23 lines

/*
For each member of the multicast group, compute the number of hops to its base LID.

opensm/opensm/osm_mcast_mgr.c +4 -7
@@ -215,12 +221,10 @@ static float osm_mcast_mgr_compute_max_hops(osm_sm_t * sm, cl_qlist_t * l,
  			max_hops = hops;
  	}
 
-	if (max_hops == 0)
-		/*
-		   We should be here if there aren't any ports in the group.
-		 */
-		max_hops = 10001;	/* see later - we use it to realize no hops */
-
+	/* Note that at this point we might get (max_hops == 0),
+	   which means that there's only one member in the mcast
+	   group, and it's the current switch */
+Exit:
  	OSM_LOG_EXIT(sm->p_log);
  	return (float)max_hops;
  }
--

1.5.1.4

Quoted 6 lines
Quoted 5 lines

--
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

--
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