aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2024-09-10 15:52:35 -0700
committerDave Barach <vpp@barachs.net>2024-09-11 15:09:40 +0000
commit47968438dc42931952d39300fcc7b5e36239857b (patch)
tree8494d08af31c6d2e72ee6d1c454a121fede2b809
parenta8766ce2d3d0e24ed65c4ad07de1a23f5f8b1369 (diff)
hsa: fix proxy ao tx callback
Reuse existing proxy_force_ack for active open tx callback. This makes sure proxy session is tcp (as opposed to tls) and also makes sure the ack is sent from the thread that owns the proxy session. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I9692fa2c4feefd3db701f9449a35495cf7b3d9dc
-rw-r--r--src/plugins/hs_apps/proxy.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/plugins/hs_apps/proxy.c b/src/plugins/hs_apps/proxy.c
index 5edea0945b0..20110544c04 100644
--- a/src/plugins/hs_apps/proxy.c
+++ b/src/plugins/hs_apps/proxy.c
@@ -418,12 +418,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 +619,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 +635,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);