Whamcloud - gitweb
Branch b1_4_bug3389
authoradilger <adilger>
Wed, 27 Jul 2005 18:18:31 +0000 (18:18 +0000)
committeradilger <adilger>
Wed, 27 Jul 2005 18:18:31 +0000 (18:18 +0000)
Fix portals_nid2str() to print something reasonable for Cray NALs.
b=6902
r=bogl

lnet/include/libcfs/kp30.h
lnet/libcfs/debug.c

index f4652b9..1327d4f 100644 (file)
@@ -424,6 +424,9 @@ enum {
 };
 
 #define PTL_NALFMT_SIZE             32 /* %u:%u.%u.%u.%u,%u (10+4+4+4+3+5+1) */
+#ifndef CRAY_PORTALS
+#define NALID_FROM_IFACE(nal) (nal)
+#endif
 
 #define NAL_MAX_NR (NAL_ENUM_END_MARKER - 1)
 
index 9f0ce91..3ef33d8 100644 (file)
@@ -202,7 +202,7 @@ char *portals_nid2str(int nal, ptl_nid_t nid, char *str)
                 return str;
         }
 
-        switch(nal){
+        switch(NALID_FROM_IFACE(nal)){
 /* XXX this could be a nal method of some sort, 'cept it's config
  * dependent whether (say) socknal NIDs are actually IP addresses... */
 #if !CRAY_PORTALS
@@ -230,6 +230,11 @@ char *portals_nid2str(int nal, ptl_nid_t nid, char *str)
                 snprintf(str, PTL_NALFMT_SIZE, "%u:%u",
                          (__u32)(nid >> 32), (__u32)nid);
                 break;
+#else
+        case PTL_IFACE_SS:
+        case PTL_IFACE_SS_ACCEL:
+                snprintf(str, PTL_NALFMT_SIZE, "%u", (__u32)nid);
+                break;
 #endif
         default:
                 snprintf(str, PTL_NALFMT_SIZE, "?%x? %llx",