[netperf-dev] netperf2 commit notice r362 - trunk/src

raj at netperf.org raj at netperf.org
Fri Oct 22 18:04:27 PDT 2010


Author: raj
Date: 2010-10-22 18:04:26 -0700 (Fri, 22 Oct 2010)
New Revision: 362

Modified:
   trunk/src/netslot_ux1131.c
Log:
return the hw path if we cannot get the slot id

Modified: trunk/src/netslot_ux1131.c
===================================================================
--- trunk/src/netslot_ux1131.c	2010-10-23 00:21:09 UTC (rev 361)
+++ trunk/src/netslot_ux1131.c	2010-10-23 01:04:26 UTC (rev 362)
@@ -1,9 +1,17 @@
 #include <sys/libIO.h>
 #include <stdlib.h>
 #include <sys/types.h>
+#include <string.h>
+#include <strings.h>
+#include <netsh.h>
+#include <netlib.h>
 
 /*
- * No OLAR headerfile on target system! ;-(
+ * No OLAR headerfile on target system! ;-( Yes, this means that these
+ * interfaces are NOT DOCUMENTED FOR PUBLIC USE, which means you don't
+ * really see what you are reading here, and if you attempt to use it
+ * elsewhere, no one will profess any knowledge of what you are doing.
+ * You will be utterly and completely on your own.
  */
 typedef uint64_t olar_io_slot_t;
 
@@ -36,15 +44,35 @@
 
   slot_id = 0;
   if ( olar_path_to_id(hw_str,&slot_id,&oe) == -1 ) {
-    free(hw_str);
-    return strdup("olar_path_to_id");
+    /* since the call failed, lets give them the HW path as a
+       consolation prize. we will ass-u-me that the caller will be
+       freeing the string we give him anyway. */
+    if (debug) {
+      fprintf(where,
+	      "%s olar_path_to_id hw_str %s oe_err %d path %s\n",
+	      __func__,
+	      hw_str,
+	      oe.oe_err,
+	      oe.oe_hwpath);
+      fflush(where);
+    }
+    return hw_str;
   }
 
   if ( olar_slot_id_to_string(slot_id,slot_str,30) == -1 ) {
-    free(hw_str);
-    return strdup("slot_to_string");
+    /* do the same thing here, give them the hw path if this call
+       fails */
+    if (debug) {
+      fprintf(where,
+	      "%s olar_slot_id_to_string slot_id %" PRId64 "\n",
+	      slot_id);
+      fflush(where);
+    }
+    return hw_str;
   }
 
+  /* we can give them the honest to goodness slot id as a string now,
+     so let us free that which we should free */
   free(hw_str);
   
   return strdup(slot_str);



More information about the netperf-dev mailing list