Updated resize CQ to return detailed status in case of failure.
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 29 Jul 2005 00:25:44 +0000 (00:25 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 29 Jul 2005 00:25:44 +0000 (00:25 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@47 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

hw/mt23108/kernel/hca_verbs.c
hw/mt23108/user/mlnx_ual_cq.c
hw/mt23108/vapi/Hca/hcahal/hhul.h
hw/mt23108/vapi/Hca/hcahal/tavor/cmdif/cmdif.h
hw/mt23108/vapi/Hca/hcahal/tavor/thhul_cqm/thhul_cqm.c
hw/mt23108/vapi/Hca/hcahal/tavor/thhul_cqm/thhul_cqm.h

index b61dc7d..7be9922 100644 (file)
@@ -2065,13 +2065,11 @@ mlnx_resize_cq (
                // for kernel mode calls - obtain the saved app resources. Use prep->call->done sequence\r
                cq_ul_resources_p = hobul_p->cq_info_tbl[cq_idx].cq_ul_resources_p;\r
 \r
-               if (HH_OK != THHUL_cqm_resize_cq_prep(\r
+               status = THHUL_cqm_resize_cq_prep(\r
                        hobul_p->hhul_hndl, hhul_cq_hndl,\r
-                       *p_size, p_size, cq_ul_resources_p))\r
-               {\r
-                       status = IB_ERROR;\r
+                       *p_size, p_size, cq_ul_resources_p );\r
+               if( status != IB_SUCCESS )\r
                        goto cleanup_locked;\r
-               }\r
        }\r
 \r
        if (HH_OK != THH_hob_resize_cq(hobul_p->hh_hndl, cq_num, cq_ul_resources_p)) {\r
index 32473df..bb1ebf8 100644 (file)
@@ -343,14 +343,14 @@ mlnx_pre_resize_cq (
 \r
         CL_TRACE (MLNX_TRACE_LVL_8, mlnx_dbg_lvl,\r
                   ("Before resize_cq_prep *p_size = %d\n", *p_size));\r
-        if (HH_OK != THHUL_cqm_resize_cq_prep ( p_hobul->hhul_hca_hndl,\r
+        status = THHUL_cqm_resize_cq_prep ( p_hobul->hhul_hca_hndl,\r
                                                 p_cq_info->hhul_cq_hndl,\r
                                                 *p_size, p_size,\r
-                                                p_cq_ul_resources))\r
+                                                p_cq_ul_resources);\r
+               if( status != IB_SUCCESS )\r
         {\r
             CL_TRACE (MLNX_TRACE_LVL_1, mlnx_dbg_lvl,\r
                       ("THHUL_cqm_resize_cq_prep failed\n"));\r
-            status = IB_ERROR;\r
             break;\r
         }\r
         CL_TRACE (MLNX_TRACE_LVL_8, mlnx_dbg_lvl,\r
index f8f959b..98409c1 100644 (file)
@@ -34,6 +34,7 @@
 #ifndef H_HHUL_H\r
 #define H_HHUL_H\r
 \r
+#include <iba\ib_types.h>\r
 #include <vapi.h>\r
 #include <hh_common.h>\r
 \r
@@ -204,7 +205,7 @@ typedef struct  HHUL_if_ops_st {
                                      HH_cq_hndl_t     hh_cq,\r
                                      void*            cq_ul_resources_p);\r
 \r
-  HH_ret_t  (*HHULIF_resize_cq_prep)(HHUL_hca_hndl_t  hca_hndl,\r
+  ib_api_status_t (*HHULIF_resize_cq_prep)(HHUL_hca_hndl_t  hca_hndl,\r
                                      HHUL_cq_hndl_t   cq,\r
                                      VAPI_cqe_num_t   num_o_cqes,\r
                                      VAPI_cqe_num_t*  num_o_cqes_p,\r
index 5019c06..947a743 100644 (file)
@@ -173,17 +173,6 @@ HH_ret_t THH_cmd_revoke_ddrmm(THH_cmd_t cmd_if);
 *                                                                            *\r
 ******************************************************************************/\r
 \r
-#ifdef IN\r
-#undef IN\r
-#endif\r
-#define IN\r
-\r
-\r
-#ifdef OUT\r
-#undef OUT\r
-#endif\r
-#define OUT\r
-\r
 /* System commands */\r
 THH_cmd_status_t THH_cmd_SYS_EN(IN THH_cmd_t cmd_if);\r
 THH_cmd_status_t THH_cmd_SYS_DIS(IN THH_cmd_t cmd_if);\r
@@ -296,7 +285,4 @@ THH_cmd_status_t THH_cmd_handle_fatal(IN THH_cmd_t cmd_if);
 const char *str_THH_cmd_status_t(THH_cmd_status_t status);\r
 const char *cmd_str(tavor_if_cmd_t opcode);\r
 \r
-#undef IN\r
-#undef OUT\r
-\r
 #endif /* __cmdif_h */\r
index 942ef9f..7fc764e 100644 (file)
@@ -985,7 +985,7 @@ HH_ret_t THHUL_cqm_destroy_cq_done(
 }\r
 \r
 \r
-HH_ret_t THHUL_cqm_resize_cq_prep(\r
+ib_api_status_t THHUL_cqm_resize_cq_prep(\r
   /*IN*/ HHUL_hca_hndl_t hca_hndl, \r
   /*IN*/ HHUL_cq_hndl_t cq, \r
   /*IN*/ VAPI_cqe_num_t num_o_cqes, \r
@@ -1001,25 +1001,25 @@ HH_ret_t THHUL_cqm_resize_cq_prep(
 \r
   if (cq_p == NULL) {\r
     MTL_ERROR1("%s: NULL CQ handle.\n",__func__);\r
-    return HH_EINVAL;\r
+    return IB_INVALID_CQ_HANDLE;\r
   }\r
   \r
   rc= THHUL_hob_get_hca_ul_res(hca_hndl,&hca_ul_res);\r
   if (rc != HH_OK) {\r
       MTL_ERROR2("THHUL_cqm_create_cq_prep: Failed THHUL_hob_get_hca_ul_res (err=%d).\n",rc);\r
-      return rc;\r
+      return IB_ERROR;\r
   }\r
 \r
   if (num_o_cqes > hca_ul_res.max_num_ent_cq) {\r
     MTL_ERROR2("THHUL_cqm_create_cq_prep: cq_num_of_entries requested exceeds hca cap\n");\r
-    return HH_E2BIG_CQE_NUM;\r
+    return IB_INVALID_CQ_SIZE;\r
   }\r
 \r
   rc= cqe_buf_alloc(&new_buf,num_o_cqes);\r
   if (rc != HH_OK) {\r
     MTL_ERROR2(MT_FLFMT("%s: Allocating buffer for resized CQ 0x%X has failed"),__func__,\r
                 cq_p->cq_num);\r
-    return rc;\r
+    return IB_INSUFFICIENT_MEMORY;\r
   }\r
   \r
   MOSAL_spinlock_dpc_lock(&(cq_p->cq_lock));\r
@@ -1028,7 +1028,7 @@ HH_ret_t THHUL_cqm_resize_cq_prep(
                cq_p->cq_state,cq_state_str(cq_p->cq_state));\r
     MOSAL_spinlock_unlock(&(cq_p->cq_lock));\r
     cqe_buf_free(&new_buf);\r
-    return HH_EBUSY;\r
+    return IB_INVALID_STATE;\r
   }\r
   memcpy(&cq_p->resized_buf, &new_buf, sizeof(THHUL_cqe_buf_t));\r
 \r
@@ -1049,7 +1049,7 @@ HH_ret_t THHUL_cqm_resize_cq_prep(
   ul_res_p->cqe_buf_sz= (1U<<cq_p->resized_buf.log2_num_o_cqes) * CQE_SZ ;  \r
   *num_o_cqes_p= (1U<<cq_p->resized_buf.log2_num_o_cqes) - 1 - cq_p->resized_buf.spare_cqes;\r
 \r
-  return HH_OK; \r
+  return IB_SUCCESS;\r
 }\r
 \r
 \r
index f027168..4ce3a0a 100644 (file)
@@ -36,6 +36,7 @@
 #include <mtl_common.h>\r
 #include <hhul.h>\r
 #include <thhul.h>\r
+#include <iba/ib_types.h>\r
 \r
 \r
 DLL_API HH_ret_t THHUL_cqm_create( \r
@@ -71,7 +72,7 @@ DLL_API HH_ret_t THHUL_cqm_destroy_cq_done(
 );\r
 \r
 \r
-DLL_API HH_ret_t THHUL_cqm_resize_cq_prep(\r
+DLL_API ib_api_status_t THHUL_cqm_resize_cq_prep(\r
   /*IN*/ HHUL_hca_hndl_t hca_hndl, \r
   /*IN*/ HHUL_cq_hndl_t cq, \r
   /*IN*/ VAPI_cqe_num_t num_o_cqes, \r
@@ -95,7 +96,6 @@ DLL_API HH_ret_t THHUL_cqm_cq_cleanup(
 );\r
 \r
 #ifdef WIN32\r
-#include <iba/ib_types.h>\r
 DLL_API ib_api_status_t\r
 THHUL_cqm_poll4wc( \r
        IN                              HHUL_hca_hndl_t                         hca_hndl, \r