[HCA] Fix async event handling.
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 19 Sep 2005 07:14:09 +0000 (07:14 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 19 Sep 2005 07:14:09 +0000 (07:14 +0000)
Signed-off-by: Yossi Leybovich (sleybo@mellanox.co.il)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@74 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/al/kernel/al_proxy_verbs.c
hw/mt23108/kernel/hca_data.c
tests/alts/multisendrecv.c

index 6916021..2652bcd 100644 (file)
@@ -246,6 +246,8 @@ proxy_queue_cb_buf(
        cl_ioctl_handle_t                       *ph_ioctl, h_ioctl;\r
        uintn_t                                         ioctl_size;\r
 \r
+       AL_ENTER( AL_DBG_DEV );\r
+       \r
        /* Set up the appropriate callback list. */\r
        switch( cb_type )\r
        {\r
@@ -311,6 +313,7 @@ proxy_queue_cb_buf(
        }\r
        cl_spinlock_release( &p_context->cb_lock );\r
 \r
+       AL_EXIT(AL_DBG_DEV);\r
        return TRUE;\r
 }\r
 \r
@@ -962,6 +965,8 @@ proxy_qp_err_cb(
        al_dev_open_context_t   *p_context = h_qp->obj.h_al->p_context;\r
        misc_cb_ioctl_info_t    cb_info;\r
 \r
+       AL_ENTER( AL_DBG_DEV | AL_DBG_QP );\r
+\r
        /*\r
         * If we're already closing the device - do not queue a callback, since\r
         * we're cleaning up the callback lists.\r
@@ -986,6 +991,8 @@ proxy_qp_err_cb(
                UAL_GET_MISC_CB_INFO, p_context, &cb_info, &h_qp->obj );\r
 \r
        proxy_context_deref( p_context );\r
+\r
+       AL_EXIT( AL_DBG_DEV | AL_DBG_QP );\r
 }\r
 \r
 \r
index 029813b..6d1075c 100644 (file)
@@ -812,7 +812,7 @@ mlnx_async_dpc(
 \r
        case E_EV_QP:\r
                {\r
-                       obj_idx = hh_er_p->event_modifier.qpn;\r
+                       obj_idx = hh_er_p->event_modifier.qpn & hobul_p->qp_idx_mask;\r
                        if (obj_idx < hobul_p->max_qp)\r
                                event_r.context = (void *)hobul_p->qp_info_tbl[obj_idx].qp_context;\r
                        else\r
@@ -825,7 +825,7 @@ mlnx_async_dpc(
 \r
        case E_EV_CQ:\r
                {\r
-                       obj_idx = hh_er_p->event_modifier.cq;\r
+                       obj_idx = hh_er_p->event_modifier.cq & hobul_p->cq_idx_mask;\r
                        if (obj_idx < hobul_p->max_cq)\r
                                event_r.context = (void *)hobul_p->cq_info_tbl[obj_idx].cq_context;\r
                        else\r
index 78dcaa0..6c1ca0d 100644 (file)
@@ -1,4 +1,5 @@
 /*\r
+* Copyright (c) 2005 Mellanox Technologies.  All rights reserved.\r
  * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.\r
  * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. \r
  *\r
@@ -751,7 +752,7 @@ multisend_post_sends(
                p_s_wr->remote_ops.rkey = 0;\r
 \r
                ALTS_PRINT(ALTS_DBG_VERBOSE,\r
-                       ("******vaddr(x%"PRIx64") lkey(x%x) len(%d)*****\n",\r
+                       ("***** Send ******vaddr(0x%"PRIx64") lkey(0x%x) len(%d)*****\n",\r
                        (void*)(uintn_t)p_s_wr->ds_array[0].vaddr,\r
                        p_s_wr->ds_array[0].lkey,\r
                        p_s_wr->ds_array[0].length));\r
@@ -806,7 +807,7 @@ multisend_post_recvs(
                p_r_wr->wr_id = i+reg_index;\r
 \r
                ALTS_PRINT(ALTS_DBG_VERBOSE,\r
-                       ("******vaddr(x%"PRIx64") lkey(x%x) len(%d)*****\n",\r
+                       ("***** Recv ******vaddr(0x%"PRIx64") lkey(0x%x) len(%d)*****\n",\r
                        (void*)(uintn_t)p_r_wr->ds_array[0].vaddr,\r
                        p_r_wr->ds_array[0].lkey,\r
                        p_r_wr->ds_array[0].length));\r
@@ -922,7 +923,7 @@ alts_activate_qp(
        qp_mod_attr.state.init.access_ctrl = IB_AC_LOCAL_WRITE | IB_AC_MW_BIND;\r
 \r
        ALTS_PRINT(ALTS_DBG_VERBOSE,\r
-               ("******** port num = %d ***************\n",\r
+               ("****INIT***** port num = %d \n",              \r
                qp_mod_attr.state.init.primary_port));\r
 \r
        qp_mod_attr.req_state = IB_QPS_INIT;\r
@@ -997,7 +998,7 @@ alts_activate_qp(
        qp_mod_attr.state.rtr.rnr_nak_timeout = 7;\r
 \r
        ALTS_PRINT(ALTS_DBG_VERBOSE,\r
-               ("****RTR***** dlid = x%x (x%x) *port_num = %d *dest_qp = %d ***\n",\r
+               ("****RTR***** dlid = x%x (x%x) port_num = %d dest_qp = %d \n",\r
                qp_mod_attr.state.rtr.primary_av.dlid,\r
                CL_NTOH16(qp_mod_attr.state.rtr.primary_av.dlid),\r
                qp_mod_attr.state.rtr.primary_av.port_num,\r
@@ -1031,6 +1032,8 @@ alts_activate_qp(
        qp_mod_attr.state.rts.init_depth = 3;           //3;\r
 \r
        qp_mod_attr.req_state = IB_QPS_RTS;\r
+       ALTS_PRINT(ALTS_DBG_VERBOSE,\r
+               ("****RTS*****  \n"));\r
        ib_status = ib_modify_qp(h_qp, &qp_mod_attr);\r
 \r
        CL_ASSERT(ib_status == IB_SUCCESS);\r
@@ -1112,7 +1115,7 @@ alts_check_active_ports(alts_multisr_ca_obj_t *p_ca_obj)
                p_ca_obj->src_port_num = p_src_port_attr->port_num;\r
 \r
                ALTS_PRINT(ALTS_DBG_VERBOSE,\r
-                       ("**** slid = x%x (x%x) ***dlid = x%x (x%x) ***************\n",\r
+                       ("****** slid = x%x (x%x) ***dlid = x%x (x%x) ***************\n",\r
                        p_ca_obj->slid,\r
                        CL_NTOH16(p_ca_obj->slid),\r
                        p_ca_obj->dlid,\r
@@ -1311,58 +1314,70 @@ poll_loop:
        while(p_done_cl)\r
        {\r
 \r
-               /*\r
-                *  print output\r
-                */\r
-               ALTS_PRINT(ALTS_DBG_VERBOSE,\r
-                       ("Got a completion:\n"\r
-                       "\ttype....:%s\n"\r
-                       "\twr_id...:%"PRIx64"\n",\r
-                       ib_get_wc_type_str(p_done_cl->wc_type),\r
-                       p_done_cl->wr_id ));\r
-\r
-\r
-               if (p_done_cl->wc_type == IB_WC_RECV)\r
+               if(p_done_cl->status != IB_WCS_SUCCESS)\r
+               {\r
+                       ALTS_PRINT(ALTS_DBG_VERBOSE,\r
+                       ("Got a completion with error !!!!!!!! status = %s type=%s\n",\r
+                               ib_get_wc_status_str(p_done_cl->status),\r
+                               ib_get_wc_type_str( p_done_cl->wc_type)));\r
+                       \r
+               }\r
+               else\r
                {\r
+                       /*\r
+                        *  print output\r
+                        */\r
                        ALTS_PRINT(ALTS_DBG_VERBOSE,\r
-                               ("message length..:%d bytes\n",\r
-                               p_done_cl->length ));\r
+                               ("Got a completion:\n"\r
+                               "\ttype....:%s\n"\r
+                               "\twr_id...:%"PRIx64"\n",\r
+                               ib_get_wc_type_str(p_done_cl->wc_type),\r
+                               p_done_cl->wr_id ));\r
 \r
-                       id = (uint32_t)p_done_cl->wr_id;\r
-                       buff = (char *)p_ca_obj->mem_region[id].buffer;\r
-                       if (qp_type == IB_QPT_UNRELIABLE_DGRM)\r
-                       {\r
-                               ALTS_PRINT(ALTS_DBG_VERBOSE,\r
-                                       ("---MSG--->%s\n",&buff[40]));\r
-                               ALTS_PRINT(ALTS_DBG_VERBOSE,\r
-                                       ("RecvUD info:\n"\r
-                                       "\trecv_opt...:x%x\n"\r
-                                       "\timm_data...:x%x\n"\r
-                                       "\tremote_qp..:x%x\n"\r
-                                       "\tpkey_index.:%d\n"\r
-                                       "\tremote_lid.:x%x\n"\r
-                                       "\tremote_sl..:x%x\n"\r
-                                       "\tpath_bits..:x%x\n"\r
-                                       "\tsrc_lid....:x%x\n",\r
-                                       p_done_cl->recv.ud.recv_opt,\r
-                                       p_done_cl->recv.ud.immediate_data,\r
-                                       CL_NTOH32(p_done_cl->recv.ud.remote_qp),\r
-                                       p_done_cl->recv.ud.pkey_index,\r
-                                       CL_NTOH16(p_done_cl->recv.ud.remote_lid),\r
-                                       p_done_cl->recv.ud.remote_sl,\r
-                                       p_done_cl->recv.ud.path_bits,\r
-                                       CL_NTOH16(p_ca_obj->mem_region[id].my_lid)));\r
-                       }\r
-                       else\r
+                       \r
+                               \r
+                       if (p_done_cl->wc_type == IB_WC_RECV)\r
                        {\r
                                ALTS_PRINT(ALTS_DBG_VERBOSE,\r
-                                       ("RecvRC info:\n"\r
-                                       "\trecv_opt...:x%x\n"\r
-                                       "\timm_data...:x%x\n",\r
-                                       p_done_cl->recv.conn.recv_opt,\r
-                                       p_done_cl->recv.ud.immediate_data ));\r
-                       }\r
+                                       ("message length..:%d bytes\n",\r
+                                       p_done_cl->length ));\r
+\r
+                               id = (uint32_t)p_done_cl->wr_id;\r
+                               buff = (char *)p_ca_obj->mem_region[id].buffer;\r
+                               if (qp_type == IB_QPT_UNRELIABLE_DGRM)\r
+                               {\r
+                                       ALTS_PRINT(ALTS_DBG_VERBOSE,\r
+                                               ("---MSG--->%s\n",&buff[40]));\r
+                                       ALTS_PRINT(ALTS_DBG_VERBOSE,\r
+                                               ("RecvUD info:\n"\r
+                                               "\trecv_opt...:x%x\n"\r
+                                               "\timm_data...:x%x\n"\r
+                                               "\tremote_qp..:x%x\n"\r
+                                               "\tpkey_index.:%d\n"\r
+                                               "\tremote_lid.:x%x\n"\r
+                                               "\tremote_sl..:x%x\n"\r
+                                               "\tpath_bits..:x%x\n"\r
+                                               "\tsrc_lid....:x%x\n",\r
+                                               p_done_cl->recv.ud.recv_opt,\r
+                                               p_done_cl->recv.ud.immediate_data,\r
+                                               CL_NTOH32(p_done_cl->recv.ud.remote_qp),\r
+                                               p_done_cl->recv.ud.pkey_index,\r
+                                               CL_NTOH16(p_done_cl->recv.ud.remote_lid),\r
+                                               p_done_cl->recv.ud.remote_sl,\r
+                                               p_done_cl->recv.ud.path_bits,\r
+                                               CL_NTOH16(p_ca_obj->mem_region[id].my_lid)));\r
+                               }\r
+                               else\r
+                               {\r
+                                       ALTS_PRINT(ALTS_DBG_VERBOSE,\r
+                                               ("RecvRC info:\n"\r
+                                               "\trecv_opt...:x%x\n"\r
+                                               "\timm_data...:x%x\n",\r
+                                               p_done_cl->recv.conn.recv_opt,\r
+                                               p_done_cl->recv.ud.immediate_data ));\r
+                               }\r
 \r
+                       }\r
                }\r
 \r
                p_free_wcl = p_done_cl;\r
@@ -1422,6 +1437,8 @@ multisend_cq_err_cb(
 \r
        UNUSED_PARAM( p_err_rec );\r
 \r
+       ALTS_PRINT(ALTS_DBG_VERBOSE,("ERROR: Async CQ error  !!!!!!!!!\n"));\r
+\r
        ALTS_EXIT( ALTS_DBG_VERBOSE);\r
 }\r
 \r
@@ -1434,6 +1451,8 @@ multisend_qp_err_cb(
 \r
        UNUSED_PARAM( p_err_rec );\r
 \r
+       ALTS_PRINT(ALTS_DBG_VERBOSE,("ERROR: Async QP error  !!!!!!!!!\n"));\r
+       \r
        ALTS_EXIT( ALTS_DBG_VERBOSE);\r
 }\r
 \r