diff options
Diffstat (limited to 'src/plugins/hs_apps/proxy.c')
-rw-r--r-- | src/plugins/hs_apps/proxy.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/plugins/hs_apps/proxy.c b/src/plugins/hs_apps/proxy.c index e8fedf921a5..c7e7b2a653c 100644 --- a/src/plugins/hs_apps/proxy.c +++ b/src/plugins/hs_apps/proxy.c @@ -368,6 +368,13 @@ proxy_rx_callback (session_t * s) u32 max_dequeue, ps_index; int actual_transfer __attribute__ ((unused)); + /* maybe we were already here */ + if (ps->active_open_establishing) + { + clib_spinlock_unlock_if_init (&pm->sessions_lock); + return 0; + } + rx_fifo = s->rx_fifo; tx_fifo = s->tx_fifo; @@ -418,12 +425,12 @@ static void proxy_force_ack (void *handlep) { transport_connection_t *tc; - session_t *ao_s; + session_t *s; - ao_s = session_get_from_handle (pointer_to_uword (handlep)); - if (session_get_transport_proto (ao_s) != TRANSPORT_PROTO_TCP) + s = session_get_from_handle (pointer_to_uword (handlep)); + if (session_get_transport_proto (s) != TRANSPORT_PROTO_TCP) return; - tc = session_get_transport (ao_s); + tc = session_get_transport (s); tcp_send_ack ((tcp_connection_t *) tc); } @@ -619,9 +626,7 @@ static int active_open_tx_callback (session_t * ao_s) { proxy_main_t *pm = &proxy_main; - transport_connection_t *tc; proxy_session_t *ps; - session_t *proxy_s; u32 min_free; min_free = clib_min (svm_fifo_size (ao_s->tx_fifo) >> 3, 128 << 10); @@ -637,14 +642,13 @@ active_open_tx_callback (session_t * ao_s) if (!ps) goto unlock; - if (ps->vpp_server_handle == ~0) + if (ps->vpp_server_handle == SESSION_INVALID_HANDLE) goto unlock; - proxy_s = session_get_from_handle (ps->vpp_server_handle); - /* Force ack on proxy side to update rcv wnd */ - tc = session_get_transport (proxy_s); - tcp_send_ack ((tcp_connection_t *) tc); + void *arg = uword_to_pointer (ps->vpp_server_handle, void *); + session_send_rpc_evt_to_thread ( + session_thread_from_handle (ps->vpp_server_handle), proxy_force_ack, arg); unlock: clib_spinlock_unlock_if_init (&pm->sessions_lock); @@ -915,7 +919,10 @@ proxy_server_create_command_fn (vlib_main_t * vm, unformat_input_t * input, goto done; } - vnet_session_enable_disable (vm, 1 /* turn on session and transport */ ); + session_enable_disable_args_t args = { .is_en = 1, + .rt_engine_type = + RT_BACKEND_ENGINE_RULE_TABLE }; + vnet_session_enable_disable (vm, &args); rv = proxy_server_create (vm); switch (rv) |