]> git.openfabrics.org - ~ardavis/dapl.git/commitdiff
dapl: add opcode to string function to report opcode during failures.
authorArlin Davis <arlin.r.davis@intel.com>
Wed, 11 Jun 2008 17:43:24 +0000 (10:43 -0700)
committerArlin Davis <arlin.r.davis@intel.com>
Mon, 16 Jun 2008 22:01:09 +0000 (15:01 -0700)
Need to use cookie opcode during failures in lieu of cqe opcode.

Signed-off by: Arlin Davis ardavis@ichips.intel.com

dapl/common/dapl_evd_util.c [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 87a0194..ea3e27c
 #include "dapl_cookie.h"
 #include "dapl.h"
 
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
 STATIC _INLINE_ void dapli_evd_eh_print_cqe (
        IN  ib_work_completion_t        *cqe);
 
@@ -543,6 +547,19 @@ bail:
     return dat_status;
 }
 
+STATIC _INLINE_ char * DAPL_GET_DTO_OP_STR(int op)
+{
+    static char *dto_ops[] =
+    {
+        "OP_SEND",
+        "OP_RECEIVE",
+        "OP_RDMA_WRITE",
+        "OP_RDMA_READ",
+        0
+    };
+    return ((op < 0 || op > 3) ? "Invalid DTO OP?" : dto_ops[op]);
+}
+
 #if !defined(DAPL_GET_CQE_OP_STR)
 #define DAPL_GET_CQE_OP_STR(e) "Unknown CEQ OP String?"
 #endif
@@ -1210,10 +1227,11 @@ dapli_evd_cqe_to_event (
        }
 
        dapl_log(DAPL_DBG_TYPE_ERR,
-                "DTO completion ERR: status %d, opcode %s, vendor_err 0x%x\n",
+                "DTO completion ERR: status %d, op %s, vendor_err 0x%x - %s\n",
                 DAPL_GET_CQE_STATUS(cqe_ptr),
-                DAPL_GET_CQE_OP_STR(cqe_ptr),
-                DAPL_GET_CQE_VENDOR_ERR(cqe_ptr));
+                DAPL_GET_DTO_OP_STR(cookie->val.dto.type),
+                DAPL_GET_CQE_VENDOR_ERR(cqe_ptr),
+                inet_ntoa(((struct sockaddr_in *)&ep_ptr->remote_ia_address)->sin_addr));
     }
 }