X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fvcl%2Fvppcom.c;h=0060922fea681ccc4f6b1a62c43c2e8399964d60;hb=7cd982d007f9073a301aed5b44d8806bfddd5891;hp=3205a812ce4db7e16f8b0bbdbf49cd5de388c53c;hpb=9fd996275c745faec2843cf3a8b1d15d6f8c9dab;p=vpp.git diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c index 3205a812ce4..0060922fea6 100644 --- a/src/vcl/vppcom.c +++ b/src/vcl/vppcom.c @@ -922,7 +922,7 @@ vppcom_app_exit (void) vcl_set_worker_index (~0); vcl_elog_stop (vcm); if (vec_len (vcm->workers) == 1) - vl_client_disconnect_from_vlib (); + vppcom_disconnect_from_vpp (); else vl_client_send_disconnect (1 /* vpp should cleanup */ ); } @@ -1491,7 +1491,7 @@ vppcom_session_connect (uint32_t session_handle, vppcom_endpt_t * server_ep) clib_memcpy_fast (&session->transport.rmt_ip.ip6, server_ep->ip, sizeof (ip6_address_t)); session->transport.rmt_port = server_ep->port; - session->transport_opts = VCL_INVALID_SESSION_HANDLE; + session->parent_handle = VCL_INVALID_SESSION_HANDLE; VDBG (0, "session handle %u: connecting to server %s %U " "port %d proto %s", session_handle, @@ -1556,7 +1556,7 @@ vppcom_session_stream_connect (uint32_t session_handle, session->transport.is_ip4 = parent_session->transport.is_ip4; session->transport.rmt_ip.ip4.as_u32 = (uint32_t) 1; session->transport.rmt_port = 0; - session->transport_opts = parent_session->vpp_handle; + session->parent_handle = parent_session->vpp_handle; VDBG (0, "session handle %u: connecting to session %u [0x%llx]", session_handle, parent_session_handle, parent_session->vpp_handle); @@ -1570,7 +1570,8 @@ vppcom_session_stream_connect (uint32_t session_handle, session->listener_index = parent_session_index; parent_session = vcl_session_get_w_handle (wrk, parent_session_handle); - parent_session->n_accepted_sessions++; + if (parent_session) + parent_session->n_accepted_sessions++; session = vcl_session_get (wrk, session_index); VDBG (0, "session %u [0x%llx]: connect %s!", session->session_index, @@ -2186,75 +2187,75 @@ check_mq: } static inline void -vep_verify_epoll_chain (vcl_worker_t * wrk, u32 vep_idx) +vep_verify_epoll_chain (vcl_worker_t * wrk, u32 vep_handle) { vcl_session_t *session; vppcom_epoll_t *vep; - u32 sid = vep_idx; + u32 sh = vep_handle; if (VPPCOM_DEBUG <= 2) return; - session = vcl_session_get (wrk, vep_idx); + session = vcl_session_get_w_handle (wrk, vep_handle); if (PREDICT_FALSE (!session)) { - VDBG (0, "ERROR: Invalid vep_idx (%u)!", vep_idx); + VDBG (0, "ERROR: Invalid vep_sh (%u)!", vep_handle); goto done; } if (PREDICT_FALSE (!session->is_vep)) { - VDBG (0, "ERROR: vep_idx (%u) is not a vep!", vep_idx); + VDBG (0, "ERROR: vep_sh (%u) is not a vep!", vep_handle); goto done; } vep = &session->vep; - VDBG (0, "vep_idx (%u): Dumping epoll chain\n" + VDBG (0, "vep_sh (%u): Dumping epoll chain\n" "{\n" " is_vep = %u\n" " is_vep_session = %u\n" - " next_sid = 0x%x (%u)\n" - "}\n", vep_idx, session->is_vep, session->is_vep_session, + " next_sh = 0x%x (%u)\n" + "}\n", vep_handle, session->is_vep, session->is_vep_session, vep->next_sh, vep->next_sh); - for (sid = vep->next_sh; sid != ~0; sid = vep->next_sh) + for (sh = vep->next_sh; sh != ~0; sh = vep->next_sh) { - session = vcl_session_get (wrk, sid); + session = vcl_session_get_w_handle (wrk, sh); if (PREDICT_FALSE (!session)) { - VDBG (0, "ERROR: Invalid sid (%u)!", sid); + VDBG (0, "ERROR: Invalid sh (%u)!", sh); goto done; } if (PREDICT_FALSE (session->is_vep)) { - VDBG (0, "ERROR: sid (%u) is a vep!", vep_idx); + VDBG (0, "ERROR: sh (%u) is a vep!", vep_handle); } else if (PREDICT_FALSE (!session->is_vep_session)) { - VDBG (0, "ERROR: session (%u) is not a vep session!", sid); + VDBG (0, "ERROR: sh (%u) is not a vep session handle!", sh); goto done; } vep = &session->vep; - if (PREDICT_FALSE (vep->vep_sh != vep_idx)) - VDBG (0, "ERROR: session (%u) vep_idx (%u) != vep_idx (%u)!", - sid, session->vep.vep_sh, vep_idx); + if (PREDICT_FALSE (vep->vep_sh != vep_handle)) + VDBG (0, "ERROR: session (%u) vep_sh (%u) != vep_sh (%u)!", + sh, session->vep.vep_sh, vep_handle); if (session->is_vep_session) { - VDBG (0, "vep_idx[%u]: sid 0x%x (%u)\n" + VDBG (0, "vep_sh[%u]: sh 0x%x (%u)\n" "{\n" - " next_sid = 0x%x (%u)\n" - " prev_sid = 0x%x (%u)\n" - " vep_idx = 0x%x (%u)\n" + " next_sh = 0x%x (%u)\n" + " prev_sh = 0x%x (%u)\n" + " vep_sh = 0x%x (%u)\n" " ev.events = 0x%x\n" " ev.data.u64 = 0x%llx\n" " et_mask = 0x%x\n" "}\n", - vep_idx, sid, sid, vep->next_sh, vep->next_sh, vep->prev_sh, + vep_handle, sh, sh, vep->next_sh, vep->next_sh, vep->prev_sh, vep->prev_sh, vep->vep_sh, vep->vep_sh, vep->ev.events, vep->ev.data.u64, vep->et_mask); } } done: - VDBG (0, "vep_idx (%u): Dump complete!\n", vep_idx); + VDBG (0, "vep_sh (%u): Dump complete!\n", vep_handle); } int