diff options
author | Florin Coras <fcoras@cisco.com> | 2023-10-07 14:22:52 -0700 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2023-10-09 23:39:49 +0000 |
commit | 1ec3a70f665ec4080e2c1ffa1dc436a04b1a18c7 (patch) | |
tree | 834f46f8b5a5c6105d24c4a0c966fb8ed88acf29 /src | |
parent | 900323337770f2ac000dff8f842ff101f093d188 (diff) |
session: propagate delayed rx evts after connect/accept
Type: fix
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4a2e8f864df7269ec5a3c4fd4d8785a67b687d58
(cherry picked from commit 431b489c5a4f60a82781ace60d07471d003787af)
Diffstat (limited to 'src')
-rw-r--r-- | src/vnet/session/session_input.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/vnet/session/session_input.c b/src/vnet/session/session_input.c index cdd6a884949..404ee8b2d82 100644 --- a/src/vnet/session/session_input.c +++ b/src/vnet/session/session_input.c @@ -112,16 +112,18 @@ app_worker_flush_events_inline (app_worker_t *app_wrk, u32 thread_index, { case SESSION_IO_EVT_RX: s = session_get (evt->session_index, thread_index); - s->flags &= ~SESSION_F_RX_EVT; /* Application didn't confirm accept yet */ - if (PREDICT_FALSE (s->session_state == SESSION_STATE_ACCEPTING)) + if (PREDICT_FALSE (s->session_state == SESSION_STATE_ACCEPTING || + s->session_state == SESSION_STATE_CONNECTING)) break; + s->flags &= ~SESSION_F_RX_EVT; app->cb_fns.builtin_app_rx_callback (s); break; /* Handle sessions that might not be on current thread */ case SESSION_IO_EVT_BUILTIN_RX: s = session_get_from_handle_if_valid (evt->session_handle); - if (!s || s->session_state == SESSION_STATE_ACCEPTING) + if (!s || s->session_state == SESSION_STATE_ACCEPTING || + s->session_state == SESSION_STATE_CONNECTING) break; s->flags &= ~SESSION_F_RX_EVT; app->cb_fns.builtin_app_rx_callback (s); @@ -153,8 +155,16 @@ app_worker_flush_events_inline (app_worker_t *app_wrk, u32 thread_index, s->app_wrk_index = SESSION_INVALID_INDEX; break; } - if (is_builtin && was_closed) - app_worker_close_notify (app_wrk, s); + if (is_builtin) + { + if (s->flags & SESSION_F_RX_EVT) + { + s->flags &= ~SESSION_F_RX_EVT; + app->cb_fns.builtin_app_rx_callback (s); + } + if (was_closed) + app_worker_close_notify (app_wrk, s); + } break; case SESSION_CTRL_EVT_CONNECTED: if (!(evt->as_u64[1] & 0xffffffff)) @@ -177,6 +187,11 @@ app_worker_flush_events_inline (app_worker_t *app_wrk, u32 thread_index, } if (was_closed) app_worker_close_notify (app_wrk, s); + if (s->flags & SESSION_F_RX_EVT) + { + s->flags &= ~SESSION_F_RX_EVT; + app->cb_fns.builtin_app_rx_callback (s); + } break; case SESSION_CTRL_EVT_DISCONNECTED: s = session_get (evt->session_index, thread_index); |