X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fsession%2Fsession.c;h=472b38baae17c9bdfbe62e8cf0f9e838919408cb;hb=2179513b71963a0b42ca6f1f2b641e79ce89447b;hp=952a5a90141fa7f06afd690f449ef8c72c776b17;hpb=ab2f6dbf9f7b7164a9810f4c80c8abf8463e42ad;p=vpp.git diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c index 952a5a90141..472b38baae1 100644 --- a/src/vnet/session/session.c +++ b/src/vnet/session/session.c @@ -486,7 +486,7 @@ stream_session_dequeue_drop (transport_connection_t * tc, u32 max_bytes) * @return 0 on success or negative number if failed to send notification. */ static inline int -session_enqueue_notify (stream_session_t * s, u8 lock) +session_enqueue_notify (stream_session_t * s) { app_worker_t *app; @@ -504,10 +504,7 @@ session_enqueue_notify (stream_session_t * s, u8 lock) })); /* *INDENT-ON* */ - if (lock) - return app_worker_lock_and_send_event (app, s, FIFO_EVENT_APP_RX); - - return app_worker_send_event (app, s, FIFO_EVENT_APP_RX); + return app_worker_lock_and_send_event (app, s, FIFO_EVENT_APP_RX); } int @@ -519,10 +516,7 @@ session_dequeue_notify (stream_session_t * s) if (PREDICT_FALSE (!app)) return -1; - if (session_transport_service_type (s) == TRANSPORT_SERVICE_CL) - return app_worker_lock_and_send_event (app, s, FIFO_EVENT_APP_RX); - - return app_worker_send_event (app, s, FIFO_EVENT_APP_TX); + return app_worker_lock_and_send_event (app, s, FIFO_EVENT_APP_TX); } /** @@ -537,14 +531,11 @@ int session_manager_flush_enqueue_events (u8 transport_proto, u32 thread_index) { session_manager_main_t *smm = &session_manager_main; - transport_service_type_t tp_service; - int i, errors = 0, lock; stream_session_t *s; + int i, errors = 0; u32 *indices; indices = smm->session_to_enqueue[transport_proto][thread_index]; - tp_service = transport_protocol_service_type (transport_proto); - lock = tp_service == TRANSPORT_SERVICE_CL; for (i = 0; i < vec_len (indices); i++) { @@ -554,7 +545,7 @@ session_manager_flush_enqueue_events (u8 transport_proto, u32 thread_index) errors++; continue; } - if (PREDICT_FALSE (session_enqueue_notify (s, lock))) + if (PREDICT_FALSE (session_enqueue_notify (s))) errors++; } @@ -838,7 +829,7 @@ stream_session_accept (transport_connection_t * tc, u32 listener_index, /* Find the server */ listener = listen_session_get (listener_index); - app_wrk = app_worker_get (listener->app_wrk_index); + app_wrk = application_listener_select_worker (listener, 0); sm = app_worker_get_listen_segment_manager (app_wrk, listener); if ((rv = session_alloc_and_init (sm, tc, 1, &s))) @@ -984,21 +975,23 @@ session_listen (stream_session_t * ls, session_endpoint_extended_t * sep) { transport_connection_t *tc; transport_endpoint_t *tep; - u32 tc_index; + u32 tc_index, s_index; /* Transport bind/listen */ tep = session_endpoint_to_transport (sep); - tc_index = tp_vfts[sep->transport_proto].bind (ls->session_index, tep); + s_index = ls->session_index; + tc_index = tp_vfts[sep->transport_proto].bind (s_index, tep); if (tc_index == (u32) ~ 0) return -1; /* Attach transport to session */ + ls = listen_session_get (s_index); ls->connection_index = tc_index; /* Add to the main lookup table after transport was initialized */ tc = tp_vfts[sep->transport_proto].get_listener (tc_index); - session_lookup_add_connection (tc, ls->session_index); + session_lookup_add_connection (tc, s_index); return 0; }