From 2608f1da6c2b4121132f83ecf0e53ca6f9d33429 Mon Sep 17 00:00:00 2001 From: adilger Date: Wed, 27 Jul 2005 18:18:31 +0000 Subject: [PATCH] Branch b1_4_bug3389 Fix portals_nid2str() to print something reasonable for Cray NALs. b=6902 r=bogl --- lnet/include/libcfs/kp30.h | 3 +++ lnet/libcfs/debug.c | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lnet/include/libcfs/kp30.h b/lnet/include/libcfs/kp30.h index f4652b9..1327d4f 100644 --- a/lnet/include/libcfs/kp30.h +++ b/lnet/include/libcfs/kp30.h @@ -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) diff --git a/lnet/libcfs/debug.c b/lnet/libcfs/debug.c index 9f0ce91..3ef33d8 100644 --- a/lnet/libcfs/debug.c +++ b/lnet/libcfs/debug.c @@ -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", -- 1.8.3.1