summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-05-13 11:37:43 -0700
committerDamjan Marion <dmarion@me.com>2021-05-14 08:44:47 +0000
commit374df7a29407b706a5fb4fe6a6f1a7b84ec4a60e (patch)
tree152886657ecb36c90c117338a66684b76be3aab2 /src/vnet/session/session.c
parentbab6c52f4544ebe352a1a9f832137d9b4069ae6c (diff)
session: switch ct to vc and track half-opens
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I7f9c4b9b6e523ab549087ad21724f34f08fca793
Diffstat (limited to 'src/vnet/session/session.c')
-rw-r--r--src/vnet/session/session.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 7aadb2188b4..f6b61abc2e0 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -318,20 +318,19 @@ session_cleanup_half_open (session_handle_t ho_handle)
/* Migrated transports are no longer half-opens */
transport_cleanup (session_get_transport_proto (ho),
ho->connection_index, ho->app_index /* overloaded */);
- return;
}
- transport_cleanup_half_open (session_get_transport_proto (ho),
- ho->connection_index);
+ else
+ transport_cleanup_half_open (session_get_transport_proto (ho),
+ ho->connection_index);
+ session_free (ho);
}
static void
-session_half_open_free (u32 ho_index)
+session_half_open_free (session_t *ho)
{
app_worker_t *app_wrk;
- session_t *ho;
ASSERT (vlib_get_thread_index () <= 1);
- ho = ho_session_get (ho_index);
app_wrk = app_worker_get (ho->app_wrk_index);
app_worker_del_half_open (app_wrk, ho);
session_free (ho);
@@ -340,16 +339,25 @@ session_half_open_free (u32 ho_index)
static void
session_half_open_free_rpc (void *args)
{
- session_half_open_free (pointer_to_uword (args));
+ session_t *ho = ho_session_get (pointer_to_uword (args));
+ session_half_open_free (ho);
}
void
session_half_open_delete_notify (transport_connection_t *tc)
{
- void *args = uword_to_pointer ((uword) tc->s_index, void *);
- u32 ctrl_thread = vlib_num_workers () ? 1 : 0;
- session_send_rpc_evt_to_thread (ctrl_thread, session_half_open_free_rpc,
- args);
+ /* Notification from ctrl thread accepted without rpc */
+ if (tc->thread_index <= 1)
+ {
+ session_half_open_free (ho_session_get (tc->s_index));
+ }
+ else
+ {
+ void *args = uword_to_pointer ((uword) tc->s_index, void *);
+ u32 ctrl_thread = vlib_num_workers () ? 1 : 0;
+ session_send_rpc_evt_to_thread (ctrl_thread, session_half_open_free_rpc,
+ args);
+ }
}
void