session: move fifo allocation logic to app worker
[vpp.git] / src / vnet / session / session.h
index c622e4e..4de7642 100644 (file)
 
 #define SESSION_PROXY_LISTENER_INDEX ((u8)~0 - 1)
 
-typedef enum
-{
-  FIFO_EVENT_APP_RX,
-  SESSION_IO_EVT_CT_RX,
-  FIFO_EVENT_APP_TX,
-  SESSION_IO_EVT_CT_TX,
-  SESSION_IO_EVT_TX_FLUSH,
-  FIFO_EVENT_DISCONNECT,
-  FIFO_EVENT_BUILTIN_RX,
-  FIFO_EVENT_BUILTIN_TX,
-  FIFO_EVENT_RPC,
-  SESSION_CTRL_EVT_BOUND,
-  SESSION_CTRL_EVT_ACCEPTED,
-  SESSION_CTRL_EVT_ACCEPTED_REPLY,
-  SESSION_CTRL_EVT_CONNECTED,
-  SESSION_CTRL_EVT_CONNECTED_REPLY,
-  SESSION_CTRL_EVT_DISCONNECTED,
-  SESSION_CTRL_EVT_DISCONNECTED_REPLY,
-  SESSION_CTRL_EVT_RESET,
-  SESSION_CTRL_EVT_RESET_REPLY,
-  SESSION_CTRL_EVT_REQ_WORKER_UPDATE,
-  SESSION_CTRL_EVT_WORKER_UPDATE,
-  SESSION_CTRL_EVT_WORKER_UPDATE_REPLY,
-} session_evt_type_t;
-
-static inline const char *
-fifo_event_type_str (session_evt_type_t et)
-{
-  switch (et)
-    {
-    case FIFO_EVENT_APP_RX:
-      return "FIFO_EVENT_APP_RX";
-    case FIFO_EVENT_APP_TX:
-      return "FIFO_EVENT_APP_TX";
-    case FIFO_EVENT_DISCONNECT:
-      return "FIFO_EVENT_DISCONNECT";
-    case FIFO_EVENT_BUILTIN_RX:
-      return "FIFO_EVENT_BUILTIN_RX";
-    case FIFO_EVENT_RPC:
-      return "FIFO_EVENT_RPC";
-    default:
-      return "UNKNOWN FIFO EVENT";
-    }
-}
-
-typedef enum
-{
-  SESSION_MQ_IO_EVT_RING,
-  SESSION_MQ_CTRL_EVT_RING,
-  SESSION_MQ_N_RINGS
-} session_mq_rings_e;
-
 #define foreach_session_input_error                                            \
 _(NO_SESSION, "No session drops")                                       \
 _(NO_LISTENER, "No listener for dst port drops")                        \
@@ -95,57 +43,6 @@ typedef enum
     SESSION_N_ERROR,
 } session_error_t;
 
-typedef struct
-{
-  void *fp;
-  void *arg;
-} session_rpc_args_t;
-
-/* *INDENT-OFF* */
-typedef struct
-{
-  u8 event_type;
-  u8 postponed;
-  union
-  {
-    svm_fifo_t *fifo;
-    session_handle_t session_handle;
-    session_rpc_args_t rpc_args;
-    struct
-    {
-      u8 data[0];
-    };
-  };
-} __clib_packed session_event_t;
-/* *INDENT-ON* */
-
-#define SESSION_MSG_NULL { }
-
-typedef struct session_dgram_pre_hdr_
-{
-  u32 data_length;
-  u32 data_offset;
-} session_dgram_pre_hdr_t;
-
-/* *INDENT-OFF* */
-typedef CLIB_PACKED (struct session_dgram_header_
-{
-  u32 data_length;
-  u32 data_offset;
-  ip46_address_t rmt_ip;
-  ip46_address_t lcl_ip;
-  u16 rmt_port;
-  u16 lcl_port;
-  u8 is_ip4;
-}) session_dgram_hdr_t;
-/* *INDENT-ON* */
-
-#define SESSION_CONN_ID_LEN 37
-#define SESSION_CONN_HDR_LEN 45
-
-STATIC_ASSERT (sizeof (session_dgram_hdr_t) == (SESSION_CONN_ID_LEN + 8),
-              "session conn id wrong length");
-
 typedef struct session_tx_context_
 {
   CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
@@ -257,7 +154,7 @@ typedef struct session_manager_main_
   /** Session ssvm segment configs*/
   uword session_baseva;
   uword session_va_space_size;
-  u32 evt_qs_segment_size;
+  uword evt_qs_segment_size;
   u8 evt_qs_use_memfd_seg;
 
   /** Session table size parameters */
@@ -309,7 +206,6 @@ stream_session_is_valid (u32 si, u8 thread_index)
 }
 
 session_t *session_alloc (u32 thread_index);
-int session_alloc_fifos (segment_manager_t * sm, session_t * s);
 void session_free (session_t * s);
 void session_free_w_fifos (session_t * s);
 
@@ -488,12 +384,12 @@ int session_dgram_connect_notify (transport_connection_t * tc,
 void stream_session_init_fifos_pointers (transport_connection_t * tc,
                                         u32 rx_pointer, u32 tx_pointer);
 
-int stream_session_accept_notify (transport_connection_t * tc);
+int session_stream_accept_notify (transport_connection_t * tc);
 void session_transport_closing_notify (transport_connection_t * tc);
 void session_transport_delete_notify (transport_connection_t * tc);
 void session_transport_closed_notify (transport_connection_t * tc);
 void session_transport_reset_notify (transport_connection_t * tc);
-int stream_session_accept (transport_connection_t * tc, u32 listener_index,
+int session_stream_accept (transport_connection_t * tc, u32 listener_index,
                           u8 notify);
 u32 session_tx_fifo_max_dequeue (transport_connection_t * tc);
 void session_register_transport (transport_proto_t transport_proto,