aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_node.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-07-23 23:54:47 -0700
committerDave Wallace <dwallacelf@gmail.com>2019-07-26 14:39:30 +0000
commit26dd6de91b4d36ac04154c7eb6339684db6684a0 (patch)
tree202ff4daf1747dcf97de0efcae7af74be6f6bc64 /src/vnet/session/session_node.c
parent038e1dfbdfd0bd785852c364011da0a1d828093e (diff)
session tcp: handle rxt and acks as custom events
Type: feature Control ack generation and retransmissions with session layer scheduler. Change-Id: Iacdf9f84ab81f44851980aa45a83e75f29be2b7b Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session_node.c')
-rw-r--r--src/vnet/session/session_node.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index 999776f02bd..1bb5cb2717f 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -618,7 +618,7 @@ session_tx_fifo_read_and_snd_i (session_worker_t * wrk,
session_evt_elt_t * elt,
int *n_tx_packets, u8 peek_data)
{
- u32 next_index, next0, next1, *to_next, n_left_to_next;
+ u32 next_index, next0, next1, *to_next, n_left_to_next, max_burst;
u32 n_trace, n_bufs_needed = 0, n_left, pbi;
session_tx_context_t *ctx = &wrk->ctx;
session_main_t *smm = &session_main;
@@ -637,6 +637,7 @@ session_tx_fifo_read_and_snd_i (session_worker_t * wrk,
next_index = smm->session_type_to_next[ctx->s->session_type];
next0 = next1 = next_index;
+ max_burst = VLIB_FRAME_SIZE - *n_tx_packets;
tp = session_get_transport_proto (ctx->s);
ctx->transport_vft = transport_protocol_get_vft (tp);
@@ -649,6 +650,20 @@ session_tx_fifo_read_and_snd_i (session_worker_t * wrk,
ctx->transport_vft->flush_data (ctx->tc);
}
+ if (ctx->s->flags & SESSION_F_CUSTOM_TX)
+ {
+ u32 n_custom_tx;
+ ctx->s->flags &= ~SESSION_F_CUSTOM_TX;
+ n_custom_tx = ctx->transport_vft->custom_tx (ctx->tc, max_burst);
+ *n_tx_packets += n_custom_tx;
+ max_burst -= n_custom_tx;
+ if (!max_burst)
+ {
+ session_evt_add_old (wrk, elt);
+ return SESSION_TX_OK;
+ }
+ }
+
ctx->snd_space = transport_connection_snd_space (ctx->tc,
wrk->vm->clib_time.
last_cpu_time,
@@ -664,8 +679,7 @@ session_tx_fifo_read_and_snd_i (session_worker_t * wrk,
svm_fifo_unset_event (ctx->s->tx_fifo);
/* Check how much we can pull. */
- session_tx_set_dequeue_params (vm, ctx, VLIB_FRAME_SIZE - *n_tx_packets,
- peek_data);
+ session_tx_set_dequeue_params (vm, ctx, max_burst, peek_data);
if (PREDICT_FALSE (!ctx->max_len_to_snd))
return SESSION_TX_NO_DATA;
@@ -823,7 +837,8 @@ session_tx_fifo_dequeue_internal (session_worker_t * wrk,
if (PREDICT_FALSE (s->session_state >= SESSION_STATE_TRANSPORT_CLOSED))
return 0;
svm_fifo_unset_event (s->tx_fifo);
- return transport_custom_tx (session_get_transport_proto (s), s);
+ return transport_custom_tx (session_get_transport_proto (s), s,
+ VLIB_FRAME_SIZE - *n_tx_packets);
}
always_inline session_t *