quic: Refactor quic rx callback for offload
[vpp.git] / src / plugins / quic / quic.h
index 004e35b..29d5224 100644 (file)
@@ -41,6 +41,9 @@
 #define QUIC_DEFAULT_FIFO_SIZE (64 << 10)
 #define QUIC_SEND_PACKET_VEC_SIZE 16
 
+#define QUIC_SEND_MAX_BATCH_PACKETS 16
+#define QUIC_RCV_MAX_BATCH_PACKETS 16
+
 /* Taken from quicly.c */
 #define QUICLY_QUIC_BIT 0x40
 
@@ -91,6 +94,15 @@ typedef enum quic_ctx_conn_state_
   QUIC_CONN_STATE_ACTIVE_CLOSING,
 } quic_ctx_conn_state_t;
 
+typedef enum quic_packet_type_
+{
+  QUIC_PACKET_TYPE_NONE,
+  QUIC_PACKET_TYPE_RECEIVE,
+  QUIC_PACKET_TYPE_MIGRATE,
+  QUIC_PACKET_TYPE_ACCEPT,
+  QUIC_PACKET_TYPE_RESET,
+  QUIC_PACKET_TYPE_DROP,
+} quic_packet_type_t;
 
 typedef enum quic_ctx_flags_
 {
@@ -161,7 +173,6 @@ typedef struct quic_worker_ctx_
   CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
   int64_t time_now;                               /**< worker time */
   tw_timer_wheel_1t_3w_1024sl_ov_t timer_wheel;           /**< worker timer wheel */
-  u32 *opening_ctx_pool;
 } quic_worker_ctx_t;
 
 typedef struct quic_rx_packet_ctx_
@@ -170,6 +181,14 @@ typedef struct quic_rx_packet_ctx_
   u8 data[QUIC_MAX_PACKET_SIZE];
   u32 ctx_index;
   u32 thread_index;
+  union
+  {
+    struct sockaddr sa;
+    struct sockaddr_in6 sa6;
+  };
+  socklen_t salen;
+  u8 ptype;
+  session_dgram_hdr_t ph;
 } quic_rx_packet_ctx_t;
 
 typedef struct quicly_ctx_data_