Whamcloud - gitweb
LU-12036 ofd: add "no_precreate" mount option
[fs/lustre-release.git] / lnet / klnds / gnilnd / gnilnd_api_wrap.h
index 15be388..b711a0d 100644 (file)
 #define CFS_FAIL_GNI_SCHED_DEADLINE    0xf052
 #define CFS_FAIL_GNI_DGRAM_DEADLINE    0xf053
 #define CFS_FAIL_GNI_DGRAM_DROP_TX     0xf054
+#define CFS_FAIL_GNI_RDMA_CQ_ERROR     0xf055
 
 /* helper macros */
 extern void
@@ -475,7 +476,7 @@ static inline gni_return_t kgnilnd_get_quiesce_status(
 #undef apick_fmt
 
 #define apick_fn "kgnilnd_cq_create"
-#define apick_fmt "0x%p, %u, %u, 0x%p, "LPX64", 0x%p"
+#define apick_fmt "0x%p, %u, %u, 0x%p, %#llx, 0x%p"
 static inline gni_return_t kgnilnd_cq_create(
                IN gni_nic_handle_t     nic_hndl,
                IN uint32_t             entry_count,
@@ -963,7 +964,7 @@ static inline gni_return_t kgnilnd_ep_destroy(
 #undef apick_fmt
 
 #define apick_fn "kgnilnd_ep_postdata_w_id"
-#define apick_fmt "0x%p, 0x%p, %d, 0x%p, %d, "LPU64""
+#define apick_fmt "0x%p, 0x%p, %d, 0x%p, %d, %llu"
 static inline gni_return_t kgnilnd_ep_postdata_w_id(
                IN gni_ep_handle_t ep_hndl,
                IN void            *in_data,
@@ -1009,7 +1010,7 @@ static inline gni_return_t kgnilnd_ep_postdata_w_id(
 #undef apick_fmt
 
 #define apick_fn "kgnilnd_ep_postdata_test_by_id"
-#define apick_fmt "0x%p, "LPU64", 0x%p, 0x%p, 0x%p"
+#define apick_fmt "0x%p, %llu, 0x%p, 0x%p, 0x%p"
 static inline gni_return_t kgnilnd_ep_postdata_test_by_id(
                IN gni_ep_handle_t      ep_hndl,
                IN uint64_t             datagram_id,
@@ -1065,7 +1066,7 @@ static inline gni_return_t kgnilnd_ep_postdata_test_by_id(
 #undef apick_fmt
 
 #define apick_fn "kgnilnd_ep_postdata_cancel_by_id"
-#define apick_fmt "0x%p, "LPU64""
+#define apick_fmt "0x%p, %llu"
 static inline gni_return_t kgnilnd_ep_postdata_cancel_by_id(
                IN gni_ep_handle_t      ep_hndl,
                IN uint64_t             datagram_id
@@ -1216,7 +1217,7 @@ static inline gni_return_t kgnilnd_post_rdma(
 #undef apick_fmt
 
 #define apick_fn "kgnilnd_get_completed"
-#define apick_fmt "0x%p,"LPX64",0x%p"
+#define apick_fmt "0x%p,%#llx,0x%p"
 static inline gni_return_t kgnilnd_get_completed(
                IN gni_cq_handle_t              cq_hndl,
                IN gni_cq_entry_t               event_data,
@@ -1261,7 +1262,7 @@ static inline gni_return_t kgnilnd_get_completed(
 #undef apick_fmt
 
 #define apick_fn "kgnilnd_cq_error_str"
-#define apick_fmt LPX64",0x%p,%d"
+#define apick_fmt "%#llx,0x%p,%d"
 static inline gni_return_t kgnilnd_cq_error_str(
                IN gni_cq_entry_t       entry,
                IN void                *buffer,
@@ -1306,7 +1307,7 @@ static inline gni_return_t kgnilnd_cq_error_str(
 #undef apick_fmt
 
 #define apick_fn "kgnilnd_cq_error_recoverable"
-#define apick_fmt LPX64",0x%p"
+#define apick_fmt "%#llx,0x%p"
 static inline gni_return_t kgnilnd_cq_error_recoverable(
                IN gni_cq_entry_t       entry,
                IN uint32_t            *recoverable
@@ -1391,7 +1392,7 @@ kgnilnd_mem_register_segments(
 #undef apick_fmt
 
 #define apick_fn "kgnilnd_mem_register"
-#define apick_fmt "0x%p,"LPX64","LPX64"0x%p,%u,0x%p"
+#define apick_fmt "0x%p,%#llx,%#llx0x%p,%u,0x%p"
 static inline gni_return_t kgnilnd_mem_register(
                IN gni_nic_handle_t     nic_hndl,
                IN uint64_t             address,
@@ -1415,6 +1416,13 @@ static inline gni_return_t kgnilnd_mem_register(
                        dst_cq_hndl, flags, mem_hndl);
        }
 
+       /* gni_mem_register may return GNI_RC_ERROR_NOMEM under memory
+        * pressure but the upper layers only know about resource errors
+        */
+       if (rrc == GNI_RC_ERROR_NOMEM) {
+               rrc = GNI_RC_ERROR_RESOURCE;
+       }
+
        switch (rrc)  {
        case GNI_RC_SUCCESS:
        case GNI_RC_ERROR_RESOURCE: