session: fix allocation of proxy fifos
[vpp.git] / src / plugins / quic / quic.c
index 5106031..f94a0c8 100644 (file)
@@ -388,7 +388,8 @@ quic_ctx_alloc (u32 thread_index)
   quic_main_t *qm = &quic_main;
   quic_ctx_t *ctx;
 
-  pool_get (qm->ctx_pool[thread_index], ctx);
+  pool_get_aligned_safe (qm->ctx_pool[thread_index], ctx,
+                        CLIB_CACHE_LINE_BYTES);
 
   clib_memset (ctx, 0, sizeof (quic_ctx_t));
   ctx->c_thread_index = thread_index;
@@ -675,6 +676,7 @@ quic_send_datagram (session_t *udp_session, struct iovec *packet,
   hdr.is_ip4 = tc->is_ip4;
   clib_memcpy (&hdr.lcl_ip, &tc->lcl_ip, sizeof (ip46_address_t));
   hdr.lcl_port = tc->lcl_port;
+  hdr.gso_size = 0;
 
   /*  Read dest address from quicly-provided sockaddr */
   if (hdr.is_ip4)
@@ -782,12 +784,10 @@ quic_on_stream_destroy (quicly_stream_t * stream, int err)
   quic_stream_data_t *stream_data = (quic_stream_data_t *) stream->data;
   quic_ctx_t *sctx = quic_ctx_get (stream_data->ctx_id,
                                   stream_data->thread_index);
-  session_t *stream_session = session_get (sctx->c_s_index,
-                                          sctx->c_thread_index);
   QUIC_DBG (2, "DESTROYED_STREAM: session 0x%lx (%U)",
            session_handle (stream_session), quic_format_err, err);
 
-  stream_session->session_state = SESSION_STATE_CLOSED;
+  session_transport_closing_notify (&sctx->connection);
   session_transport_delete_notify (&sctx->connection);
 
   quic_increment_counter (QUIC_ERROR_CLOSED_STREAM, 1);
@@ -830,7 +830,7 @@ quic_on_receive (quicly_stream_t * stream, size_t off, const void *src,
                 size_t len)
 {
   QUIC_DBG (3, "received data: %lu bytes, offset %lu", len, off);
-  u32 max_enq, rv;
+  u32 max_enq;
   quic_ctx_t *sctx;
   session_t *stream_session;
   app_worker_t *app_wrk;
@@ -895,10 +895,7 @@ quic_on_receive (quicly_stream_t * stream, size_t off, const void *src,
       app_wrk = app_worker_get_if_valid (stream_session->app_wrk_index);
       if (PREDICT_TRUE (app_wrk != 0))
        {
-         rv = app_worker_lock_and_send_event (app_wrk, stream_session,
-                                              SESSION_IO_EVT_RX);
-         if (rv)
-           QUIC_ERR ("Failed to ping app for RX");
+         app_worker_rx_notify (app_wrk, stream_session);
        }
       quic_ack_rx_data (stream_session);
     }
@@ -1156,9 +1153,8 @@ quic_update_timer (quic_ctx_t * ctx)
          quic_session = session_get (ctx->c_s_index, ctx->c_thread_index);
          if (svm_fifo_set_event (quic_session->tx_fifo))
            {
-             rv = session_send_io_evt_to_thread_custom (quic_session,
-                                                        quic_session->thread_index,
-                                                        SESSION_IO_EVT_BUILTIN_TX);
+             rv = session_send_io_evt_to_thread_custom (
+               quic_session, quic_session->thread_index, SESSION_IO_EVT_TX);
              if (PREDICT_FALSE (rv))
                QUIC_ERR ("Failed to enqueue builtin_tx %d", rv);
            }
@@ -1294,6 +1290,7 @@ quic_connect_stream (session_t * quic_session, session_endpoint_cfg_t * sep)
   stream_data->app_rx_data_len = 0;
   stream_data->app_tx_data_len = 0;
   stream_session->session_state = SESSION_STATE_READY;
+  stream_session->opaque = sep->opaque;
 
   /* For now we only reset streams. Cleanup will be triggered by timers */
   if ((rv = app_worker_init_connected (app_wrk, stream_session)))
@@ -2568,6 +2565,7 @@ quic_init (vlib_main_t * vm)
   transport_register_protocol (TRANSPORT_PROTO_QUIC, &quic_proto,
                               FIB_PROTOCOL_IP6, ~0);
 
+  quic_load_openssl3_legacy_provider ();
   clib_bitmap_alloc (qm->available_crypto_engines,
                     app_crypto_engine_n_types ());
   quic_register_cipher_suite (CRYPTO_ENGINE_PICOTLS,