[ofa-general] [PATCH 3/7][v1.2] dapl: add opcode to string function to report opcode during failures.

Davis, Arlin R arlin.r.davis at intel.com
Fri Jun 20 11:48:18 PDT 2008


Need to use cookie opcode during failures in lieu of cqe opcode.

Signed-off by: Arlin Davis ardavis at ichips.intel.com
---
 dapl/common/dapl_evd_util.c |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/dapl/common/dapl_evd_util.c b/dapl/common/dapl_evd_util.c
index 41c128c..f3c05b2 100644
--- a/dapl/common/dapl_evd_util.c
+++ b/dapl/common/dapl_evd_util.c
@@ -42,6 +42,10 @@
 #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);
 
@@ -485,6 +489,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
@@ -1158,10 +1175,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));
     }
 }
 
-- 
1.5.2.5




More information about the general mailing list