]> err.no Git - linux-2.6/commitdiff
[IA64-SGI] - Fix discover of nearest cpu node to IO node
authorJack Steiner <steiner@sgi.com>
Sat, 22 Apr 2006 14:36:07 +0000 (09:36 -0500)
committerTony Luck <tony.luck@intel.com>
Thu, 27 Apr 2006 21:28:37 +0000 (14:28 -0700)
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>
Signed-off-by: Tony Luck <tony.luck@intel.com>
arch/ia64/sn/kernel/sn2/sn_hwperf.c
include/asm-ia64/sn/sn2/sn_hwperf.h

index d917afa30b27ef3b6ae5ae8025355951b186b889..7ec65bc0ccf63727b3002dbe4740399ba68c9989 100644 (file)
@@ -284,6 +284,8 @@ static int sn_hwperf_get_nearest_node_objdata(struct sn_hwperf_object_info *objb
        /* 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_objdata(struct sn_hwperf_object_info *objb
                                *near_mem_node = c;
                        found_mem++;
                }
-               if (SN_HWPERF_IS_ROUTER(dest))
-                       router = dest;
        }
 
        if (router && (!found_cpu || !found_mem)) {
index 291ef3d69da225983ebf85dfd2c81523e77e5396..e61ebac38cdd57b32a7529c0ac81e4bcfecfb573 100644 (file)
@@ -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)) ||\