-static void
-quic_transfer_connection_rpc (void *arg)
-{
- u64 arg_int = (u64) arg;
- u32 ctx_index, dest_thread;
-
- ctx_index = (u32) (arg_int >> 32);
- dest_thread = (u32) (arg_int & UINT32_MAX);
- quic_transfer_connection (ctx_index, dest_thread);
-}
-
-/*
- * This assumes that the connection is not yet associated to a session
- * So currently it only works on the client side when receiving the first packet
- * from the server
- */
-static void
-quic_move_connection_to_thread (u32 ctx_index, u32 owner_thread,
- u32 to_thread,
- quicly_decoded_packet_t * packet)
-{
- clib_bihash_kv_16_8_t kv;
- clib_bihash_16_8_t *h;
-
- if (owner_thread == UINT32_MAX)
- {
- QUIC_DBG (3, "Connection already moving to right thread");
- return;
- }
-
- /* Mark connection as moving in the conn map */
- h = &quic_main.connection_hash;
- quic_make_connection_key (&kv, &packet->cid.dest.plaintext);
- if (clib_bihash_search_16_8 (h, &kv, &kv) != 0)
- {
- QUIC_DBG (0, "Bug: conn to move not found");
- return;
- }
- kv.value |= (u64) UINT32_MAX << 32;
- if (clib_bihash_add_del_16_8
- (&quic_main.connection_hash, &kv, /* is_add */ 1))
- {
- QUIC_DBG (0, "Bug: cannot update conn in lookup hash");
- return;
- }
-
- /* Send rpc to owner thread to move conn */
- QUIC_DBG (2, "Requesting transfer of conn %u from thread %u", ctx_index,
- owner_thread);
- u64 arg = ((u64) ctx_index) << 32 | to_thread;
- session_send_rpc_evt_to_thread (owner_thread, quic_transfer_connection_rpc,
- (void *) arg);
-}
-