[IBAL] fix trap that route to local SM .
authorsleybo <sleybo@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 26 Feb 2007 14:16:06 +0000 (14:16 +0000)
committersleybo <sleybo@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 26 Feb 2007 14:16:06 +0000 (14:16 +0000)
fix prints in ual_mgr.c

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@601 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/al/kernel/al_smi.c
core/al/user/ual_mgr.c

index a2fc5f3..604e179 100644 (file)
@@ -2147,7 +2147,7 @@ __process_subn_mad(
        else\r
        {\r
                AL_PRINT(TRACE_LEVEL_WARNING, AL_DBG_SMI, ("Mkey check failed \n"));\r
-               AL_PRINT(TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("Mkey check SMP= 0x%x:%x  SVC = 0x%x:%x \n",\r
+               AL_PRINT(TRACE_LEVEL_WARNING, AL_DBG_SMI, ("Mkey check SMP= 0x%08x:%08x  SVC = 0x%08x:%08x \n",\r
                                                                        ((uint32_t*)&p_smp->m_key)[0],((uint32_t*)&p_smp->m_key)[1],\r
                                                                        ((uint32_t*)&p_spl_qp_svc->m_key)[0],((uint32_t*)&p_spl_qp_svc->m_key)[1]));\r
 \r
@@ -2344,6 +2344,7 @@ fwd_local_mad(
                                                        p_spl_qp_svc->lmc = ib_port_info_get_lmc( p_port_info );\r
                                                        p_spl_qp_svc->sm_lid = p_port_info->master_sm_base_lid;\r
                                                        p_spl_qp_svc->sm_sl = ib_port_info_get_sm_sl( p_port_info );\r
+\r
                                                        if(p_port_info->m_key)\r
                                                                p_spl_qp_svc->m_key = p_port_info->m_key;\r
                                                        if (p_port_info->subnet_timeout & 0x80)\r
@@ -2904,6 +2905,10 @@ route_recv_smp(
                 * a Trap Repress MAD, the SMA must only use the lower 32-bits of the\r
                 * TID.\r
                 */\r
+               AL_PRINT(TRACE_LEVEL_INFORMATION, AL_DBG_SMI, ("Trap TID = 0x%08x:%08x \n",\r
+                       ((uint32_t*)&p_mad_element->p_mad_buf->trans_id)[0],\r
+                       ((uint32_t*)&p_mad_element->p_mad_buf->trans_id)[1]));\r
+\r
                route = ( p_mad_element->recv_opt & IB_RECV_OPT_FORWARD ) ?\r
                        ROUTE_REMOTE : ROUTE_DISPATCHER;\r
                break;\r
@@ -2915,6 +2920,10 @@ route_recv_smp(
                 * a Trap Repress MAD, the SMA must only use the lower 32-bits of the\r
                 * TID.\r
                 */\r
+               AL_PRINT(TRACE_LEVEL_INFORMATION, AL_DBG_SMI, ("TrapRepress TID = 0x%08x:%08x \n",\r
+                       ((uint32_t*)&p_mad_element->p_mad_buf->trans_id)[0],\r
+                       ((uint32_t*)&p_mad_element->p_mad_buf->trans_id)[1]));\r
+\r
                route = ROUTE_LOCAL;\r
                break;\r
 \r
@@ -3062,6 +3071,9 @@ forward_sm_trap(
                return IB_ERROR;\r
        }\r
 \r
+       if(p_spl_qp_svc->sm_lid == p_spl_qp_svc->base_lid)\r
+               return mad_disp_recv_done(p_spl_qp_svc->h_mad_disp,p_mad_element);\r
+       \r
        /* Create an address vector for the SM. */\r
        cl_memclr( &av_attr, sizeof( ib_av_attr_t ) );\r
        av_attr.port_num = p_spl_qp_svc->port_num;\r
index c1ebe82..09365d0 100644 (file)
@@ -268,7 +268,12 @@ create_al_mgr()
                GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,\r
                NULL, OPEN_EXISTING, 0, NULL );\r
        if( g_al_device == INVALID_HANDLE_VALUE )\r
+       {\r
+               AL_PRINT_EXIT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR,\r
+                       ("CreateFile returned %d.\n", GetLastError()) );\r
                return IB_ERROR;\r
+       }\r
+\r
 \r
        ver = AL_IOCTL_VERSION;\r
 \r
@@ -280,7 +285,7 @@ create_al_mgr()
        gp_al_mgr = cl_zalloc( sizeof( al_mgr_t ) );\r
        if( !gp_al_mgr )\r
        {\r
-               AL_PRINT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR ,\r
+               AL_PRINT_EXIT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR ,\r
                        ("Failed to cl_zalloc ual_mgr_t.\n") );\r
                return IB_INSUFFICIENT_MEMORY;\r
        }\r