29 #include "../session/application_interface.h" 48 s =
format (s,
"UDP4_URI_INPUT: session %d, disposition %d, thread %d",
60 #define _(sym,string) string, 69 u32 n_left_from, *from, *to_next;
75 u32 *session_indices_to_enqueue;
76 static u32 serial_number;
79 my_enqueue_epoch = ++smm->current_enqueue_epoch[my_thread_index];
85 while (n_left_from > 0)
91 while (n_left_from > 0 && n_left_to_next > 0)
96 u32 error0 = SESSION_ERROR_ENQUEUED;
126 SESSION_TYPE_IP4_UDP);
131 error0 = SESSION_ERROR_NO_LISTENER;
135 f0 = s0->server_rx_fifo;
140 udp_len0 = clib_net_to_host_u16 (udp0->
length);
144 error0 = SESSION_ERROR_FIFO_FULL;
154 if (s0->enqueue_epoch != my_enqueue_epoch)
156 s0->enqueue_epoch = my_enqueue_epoch;
158 vec_add1 (smm->session_indices_to_enqueue_by_thread
160 s0 - smm->sessions[my_thread_index]);
169 error0 = SESSION_ERROR_NOT_READY;
174 pool_get (um->udp_sessions[my_thread_index], us);
183 us->c_c_index = us - um->udp_sessions[my_thread_index];
189 SESSION_TYPE_IP4_UDP,
198 error0 = SESSION_ERROR_NOT_READY;
213 t->
session = s0 - smm->sessions[my_thread_index];
220 to_next, n_left_to_next,
229 session_indices_to_enqueue =
230 smm->session_indices_to_enqueue_by_thread[my_thread_index];
232 for (i = 0; i <
vec_len (session_indices_to_enqueue); i++)
234 session_fifo_event_t evt;
241 session_indices_to_enqueue[i]);
247 if (server0->cb_fns.builtin_server_rx_callback)
249 server0->cb_fns.builtin_server_rx_callback (s0);
256 evt.fifo = s0->server_rx_fifo;
258 evt.event_id = serial_number++;
261 q = server0->event_queue;
273 SESSION_ERROR_FIFO_FULL, 1);
281 .format =
"evt-enqueue: id %d length %d",
282 .format_args =
"i4i4",};
288 ed->data[0] = evt.event_id;
297 smm->session_indices_to_enqueue_by_thread[my_thread_index] =
298 session_indices_to_enqueue;
vlib_main_t vlib_global_main
sll srl srl sll sra u16x4 i
int stream_session_accept(transport_connection_t *tc, u32 listener_index, u8 sst, u8 notify)
Accept a stream session.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
struct _vlib_node_registration vlib_node_registration_t
static u32 svm_fifo_max_enqueue(svm_fifo_t *f)
vlib_error_t * errors
Vector of errors for this node.
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
struct _svm_fifo svm_fifo_t
static u32 svm_fifo_max_dequeue(svm_fifo_t *f)
struct _stream_session_t stream_session_t
struct _udp_uri_main udp_uri_main_t
int unix_shared_memory_queue_add(unix_shared_memory_queue_t *q, u8 *elem, int nowait)
static session_manager_main_t * vnet_get_session_manager_main()
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
struct _session_manager_main session_manager_main_t
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
vlib_error_t error
Error code for buffers to be enqueued to error handler.
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
static u8 svm_fifo_set_event(svm_fifo_t *f)
Sets fifo event flag.
The fine-grained event logger allows lightweight, thread-safe event logging at minimum cost...
#define VLIB_BUFFER_IS_TRACED
stream_session_t * stream_session_lookup4(ip4_address_t *lcl, ip4_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto)
Looks up a session based on the 5-tuple passed as argument.
struct _application application_t
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
#define ELOG_TYPE_DECLARE(f)
int svm_fifo_enqueue_nowait(svm_fifo_t *f, u32 max_bytes, u8 *copy_from_here)
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
#define VLIB_NODE_FLAG_TRACE
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
transport_connection_t connection
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
application_t * application_get(u32 index)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define foreach_session_input_error
#define VLIB_REGISTER_NODE(x,...)
u16 flags
Copy of main node flags.
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
static udp_uri_main_t * vnet_get_udp_main()
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
struct _unix_shared_memory_queue unix_shared_memory_queue_t