public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] - Fix discover of nearest cpu node to IO node
@ 2006-04-22 14:36 Jack Steiner
  0 siblings, 0 replies; only message in thread
From: Jack Steiner @ 2006-04-22 14:36 UTC (permalink / raw)
  To: linux-ia64

Fix a bug that causes discovery of the nearest node/cpu to
a TIO (IO node) to fail. 

	Signed-off-by: Jack Steiner <steiner@sgi.com>



Index: linux/arch/ia64/sn/kernel/sn2/sn_hwperf.c
=================================--- linux.orig/arch/ia64/sn/kernel/sn2/sn_hwperf.c	2006-04-22 08:50:14.571000439 -0500
+++ linux/arch/ia64/sn/kernel/sn2/sn_hwperf.c	2006-04-22 09:24:01.969360448 -0500
@@ -284,6 +284,8 @@ static int sn_hwperf_get_nearest_node_ob
 	/* find nearest node with cpus and nearest memory */
 	for (router=NULL, j=0; j < op->ports; j++) {
 		dest = sn_hwperf_findobj_id(objbuf, nobj, ptdata[j].conn_id);
+		if (dest && SN_HWPERF_IS_ROUTER(dest))
+			router = dest;
 		if (!dest || SN_HWPERF_FOREIGN(dest) ||
 		    !SN_HWPERF_IS_NODE(dest) || SN_HWPERF_IS_IONODE(dest)) {
 			continue;
@@ -299,8 +301,6 @@ static int sn_hwperf_get_nearest_node_ob
 				*near_mem_node = c;
 			found_mem++;
 		}
-		if (SN_HWPERF_IS_ROUTER(dest))
-			router = dest;
 	}
 
 	if (router && (!found_cpu || !found_mem)) {
Index: linux/include/asm-ia64/sn/sn2/sn_hwperf.h
=================================--- linux.orig/include/asm-ia64/sn/sn2/sn_hwperf.h	2006-04-22 08:50:19.858482442 -0500
+++ linux/include/asm-ia64/sn/sn2/sn_hwperf.h	2006-04-22 09:24:01.973360043 -0500
@@ -45,8 +45,12 @@ struct sn_hwperf_object_info {
 #define SN_HWPERF_IS_NODE(x)		((x) && strstr((x)->name, "SHub"))
 #define SN_HWPERF_IS_NODE_SHUB2(x)	((x) && strstr((x)->name, "SHub 2."))
 #define SN_HWPERF_IS_IONODE(x)		((x) && strstr((x)->name, "TIO"))
-#define SN_HWPERF_IS_ROUTER(x)		((x) && strstr((x)->name, "Router"))
 #define SN_HWPERF_IS_NL3ROUTER(x)	((x) && strstr((x)->name, "NL3Router"))
+#define SN_HWPERF_IS_NL4ROUTER(x)	((x) && strstr((x)->name, "NL4Router"))
+#define SN_HWPERF_IS_OLDROUTER(x)	((x) && strstr((x)->name, "Router"))
+#define SN_HWPERF_IS_ROUTER(x)		(SN_HWPERF_IS_NL3ROUTER(x) || 		\
+					 	SN_HWPERF_IS_NL4ROUTER(x) || 	\
+					 	SN_HWPERF_IS_OLDROUTER(x))
 #define SN_HWPERF_FOREIGN(x)		((x) && !(x)->sn_hwp_this_part && !(x)->sn_hwp_is_shared)
 #define SN_HWPERF_SAME_OBJTYPE(x,y)	((SN_HWPERF_IS_NODE(x) && SN_HWPERF_IS_NODE(y)) ||\
 					(SN_HWPERF_IS_IONODE(x) && SN_HWPERF_IS_IONODE(y)) ||\

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-22 14:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-22 14:36 [PATCH] - Fix discover of nearest cpu node to IO node Jack Steiner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox