From 8f3147d102a47135f953eeca22375300c8d00dde Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Fri, 28 Jul 2023 09:11:23 -0700 Subject: session: regrab evt llist elt for app transports tx App transports like TLS can close sessions on tx and consequently generate new events. That can realloc the event pool. Type: fix Signed-off-by: Florin Coras Change-Id: I58a97502acc1182b3d051ba1aa9e0e98c16f4593 --- src/vnet/session/session_node.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/vnet/session') diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c index 6d1b6bdf2ae..e15625e37ca 100644 --- a/src/vnet/session/session_node.c +++ b/src/vnet/session/session_node.c @@ -1603,6 +1603,7 @@ session_tx_fifo_dequeue_internal (session_worker_t * wrk, { transport_send_params_t *sp = &wrk->ctx.sp; session_t *s = wrk->ctx.s; + clib_llist_index_t ei; u32 n_packets; if (PREDICT_FALSE (s->session_state >= SESSION_STATE_TRANSPORT_CLOSED)) @@ -1616,9 +1617,14 @@ session_tx_fifo_dequeue_internal (session_worker_t * wrk, sp->max_burst_size = clib_min (SESSION_NODE_FRAME_SIZE - *n_tx_packets, TRANSPORT_PACER_MAX_BURST_PKTS); + /* Grab elt index since app transports can enqueue events on tx */ + ei = clib_llist_entry_index (wrk->event_elts, elt); + n_packets = transport_custom_tx (session_get_transport_proto (s), s, sp); *n_tx_packets += n_packets; + elt = clib_llist_elt (wrk->event_elts, ei); + if (s->flags & SESSION_F_CUSTOM_TX) { session_evt_add_old (wrk, elt); -- cgit 1.2.3-korg