[IBAL] fix trap that route to local SM .
[mirror/winof/.git] / core / al / kernel / al_smi.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