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->rx_fifo);
- rmp->tx_fifo = pointer_to_uword (s->tx_fifo);
+ rmp->rx_fifo = fifo_segment_fifo_offset (s->rx_fifo);
+ rmp->tx_fifo = fifo_segment_fifo_offset (s->tx_fifo);
rmp->segment_handle = session_segment_handle (s);
svm_msg_q_add_and_unlock (app_wrk->event_queue, msg);
return SESSION_TX_NO_BUFFERS;
}
- transport_connection_update_tx_bytes (ctx->tc, ctx->max_len_to_snd);
+ if (transport_connection_is_tx_paced (ctx->tc))
+ transport_connection_tx_pacer_update_bytes (ctx->tc, ctx->max_len_to_snd);
ctx->left_to_snd = ctx->max_len_to_snd;
n_left = ctx->n_segs_per_evt;
if (!peek_data)
{
- if (svm_fifo_needs_deq_ntf (ctx->s->tx_fifo, ctx->max_len_to_snd))
+ u32 n_dequeued = ctx->max_len_to_snd;
+ if (ctx->transport_vft->transport_options.tx_type == TRANSPORT_TX_DGRAM)
+ n_dequeued += ctx->n_segs_per_evt * SESSION_CONN_HDR_LEN;
+ if (svm_fifo_needs_deq_ntf (ctx->s->tx_fifo, n_dequeued))
session_dequeue_notify (ctx->s);
}
return SESSION_TX_OK;
* XXX: we may need priorities here */
mq = wrk->vpp_event_queue;
n_to_dequeue = svm_msg_q_size (mq);
- if (n_to_dequeue && svm_msg_q_try_lock (mq) == 0)
+ if (n_to_dequeue)
{
for (i = 0; i < n_to_dequeue; i++)
{
- svm_msg_q_sub_w_lock (mq, msg);
+ svm_msg_q_sub_raw (mq, msg);
evt = svm_msg_q_msg_data (mq, msg);
session_evt_add_to_list (wrk, evt);
svm_msg_q_free_msg (mq, msg);
}
- svm_msg_q_unlock (mq);
}
SESSION_EVT (SESSION_EVT_DSP_CNTRS, MQ_DEQ, wrk, n_to_dequeue, !i);