* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
{
session_accepted_reply_msg_t *mp = (session_accepted_reply_msg_t *) data;
vnet_disconnect_args_t _a = { 0 }, *a = &_a;
{
session_accepted_reply_msg_t *mp = (session_accepted_reply_msg_t *) data;
vnet_disconnect_args_t _a = { 0 }, *a = &_a;
app_worker_lock_and_send_event (app_wrk, s, FIFO_EVENT_APP_RX);
/* Closed while waiting for app to reply. Resend disconnect */
app_worker_lock_and_send_event (app_wrk, s, FIFO_EVENT_APP_RX);
/* Closed while waiting for app to reply. Resend disconnect */
vnet_disconnect_args_t _a = { 0 }, *a = &_a;
session_reset_reply_msg_t *mp;
app_worker_t *app_wrk;
vnet_disconnect_args_t _a = { 0 }, *a = &_a;
session_reset_reply_msg_t *mp;
app_worker_t *app_wrk;
evt->event_type = SESSION_CTRL_EVT_WORKER_UPDATE_REPLY;
rmp = (session_worker_update_reply_msg_t *) evt->data;
rmp->handle = mp->handle;
evt->event_type = SESSION_CTRL_EVT_WORKER_UPDATE_REPLY;
rmp = (session_worker_update_reply_msg_t *) evt->data;
rmp->handle = mp->handle;
- rmp->rx_fifo = pointer_to_uword (s->server_rx_fifo);
- rmp->tx_fifo = pointer_to_uword (s->server_tx_fifo);
+ rmp->rx_fifo = pointer_to_uword (s->rx_fifo);
+ rmp->tx_fifo = pointer_to_uword (s->tx_fifo);
rmp->segment_handle = session_segment_handle (s);
svm_msg_q_add (app_wrk->event_queue, msg, SVM_Q_WAIT);
/*
* Retransmit messages that may have been lost
*/
rmp->segment_handle = session_segment_handle (s);
svm_msg_q_add (app_wrk->event_queue, msg, SVM_Q_WAIT);
/*
* Retransmit messages that may have been lost
*/
- if (s->server_tx_fifo && !svm_fifo_is_empty (s->server_tx_fifo))
- session_send_io_evt_to_thread (s->server_tx_fifo, FIFO_EVENT_APP_TX);
+ if (s->tx_fifo && !svm_fifo_is_empty (s->tx_fifo))
+ session_send_io_evt_to_thread (s->tx_fifo, FIFO_EVENT_APP_TX);
app_worker_lock_and_send_event (app_wrk, s, FIFO_EVENT_APP_RX);
if (s->session_state >= SESSION_STATE_TRANSPORT_CLOSING)
app_worker_lock_and_send_event (app_wrk, s, FIFO_EVENT_APP_RX);
if (s->session_state >= SESSION_STATE_TRANSPORT_CLOSING)
static void
session_tx_trace_frame (vlib_main_t * vm, vlib_node_runtime_t * node,
u32 next_index, u32 * to_next, u16 n_segs,
static void
session_tx_trace_frame (vlib_main_t * vm, vlib_node_runtime_t * node,
u32 next_index, u32 * to_next, u16 n_segs,
ctx->tx_offset, len_to_deq, data);
ctx->tx_offset += n_bytes_read;
}
ctx->tx_offset, len_to_deq, data);
ctx->tx_offset += n_bytes_read;
}
session_dgram_hdr_t *hdr = &ctx->hdr;
u16 deq_now;
deq_now = clib_min (hdr->data_length - hdr->data_offset,
session_dgram_hdr_t *hdr = &ctx->hdr;
u16 deq_now;
deq_now = clib_min (hdr->data_length - hdr->data_offset,
len_to_deq, data0);
ASSERT (n_bytes_read > 0);
/* Keep track of progress locally, transport is also supposed to
len_to_deq, data0);
ASSERT (n_bytes_read > 0);
/* Keep track of progress locally, transport is also supposed to
u32 max_segs, u8 peek_data)
{
u32 n_bytes_per_buf, n_bytes_per_seg;
u32 max_segs, u8 peek_data)
{
u32 n_bytes_per_buf, n_bytes_per_seg;
- svm_fifo_peek (ctx->s->server_tx_fifo, 0, sizeof (ctx->hdr),
+ svm_fifo_peek (ctx->s->tx_fifo, 0, sizeof (ctx->hdr),
(u8 *) & ctx->hdr);
ASSERT (ctx->hdr.data_length > ctx->hdr.data_offset);
ctx->max_dequeue = ctx->hdr.data_length - ctx->hdr.data_offset;
(u8 *) & ctx->hdr);
ASSERT (ctx->hdr.data_length > ctx->hdr.data_offset);
ctx->max_dequeue = ctx->hdr.data_length - ctx->hdr.data_offset;
/* Check how much we can pull. */
session_tx_set_dequeue_params (vm, ctx, VLIB_FRAME_SIZE - *n_tx_packets,
/* Check how much we can pull. */
session_tx_set_dequeue_params (vm, ctx, VLIB_FRAME_SIZE - *n_tx_packets,
/* If we couldn't dequeue all bytes mark as partially read */
ASSERT (ctx->left_to_snd == 0);
if (ctx->max_len_to_snd < ctx->max_dequeue)
/* If we couldn't dequeue all bytes mark as partially read */
ASSERT (ctx->left_to_snd == 0);
if (ctx->max_len_to_snd < ctx->max_dequeue)
vec_add1 (wrk->pending_event_vector, *e);
if (!peek_data && ctx->transport_vft->tx_type == TRANSPORT_TX_DGRAM)
{
/* Fix dgram pre header */
if (ctx->max_len_to_snd < ctx->max_dequeue)
vec_add1 (wrk->pending_event_vector, *e);
if (!peek_data && ctx->transport_vft->tx_type == TRANSPORT_TX_DGRAM)
{
/* Fix dgram pre header */
if (ctx->max_len_to_snd < ctx->max_dequeue)
- else if (svm_fifo_max_dequeue (ctx->s->server_tx_fifo) > 0)
- if (svm_fifo_set_event (ctx->s->server_tx_fifo))
+ else if (svm_fifo_max_dequeue (ctx->s->tx_fifo) > 0)
+ if (svm_fifo_set_event (ctx->s->tx_fifo))
session_manager_worker_t * wrk,
session_event_t * e, int *n_tx_pkts)
{
session_manager_worker_t * wrk,
session_event_t * e, int *n_tx_pkts)
{
application_t *app;
if (PREDICT_FALSE (s->session_state == SESSION_STATE_CLOSED))
return 0;
app = application_get (s->t_app_index);
application_t *app;
if (PREDICT_FALSE (s->session_state == SESSION_STATE_CLOSED))
return 0;
app = application_get (s->t_app_index);
session_event_get_session (session_event_t * e, u8 thread_index)
{
return session_get_if_valid (e->fifo->master_session_index, thread_index);
session_event_get_session (session_event_t * e, u8 thread_index)
{
return session_get_if_valid (e->fifo->master_session_index, thread_index);
wrk->ctx.max_len_to_snd);
if (PREDICT_FALSE (need_tx_ntf))
session_dequeue_notify (s);
wrk->ctx.max_len_to_snd);
if (PREDICT_FALSE (need_tx_ntf))
session_dequeue_notify (s);
s = session_event_get_session (e, thread_index);
if (PREDICT_FALSE (!s || s->session_state >= SESSION_STATE_CLOSING))
continue;
s = session_event_get_session (e, thread_index);
if (PREDICT_FALSE (!s || s->session_state >= SESSION_STATE_CLOSING))
continue;
app_wrk = app_worker_get (s->app_wrk_index);
app = application_get (app_wrk->app_index);
app->cb_fns.builtin_app_rx_callback (s);
app_wrk = app_worker_get (s->app_wrk_index);
app = application_get (app_wrk->app_index);
app->cb_fns.builtin_app_rx_callback (s);
u32 my_thread_index = vm->thread_index;
session_event_t _e, *e = &_e;
svm_msg_q_ring_t *ring;
u32 my_thread_index = vm->thread_index;
session_event_t _e, *e = &_e;
svm_msg_q_ring_t *ring;