From: Florin Coras Date: Mon, 25 Aug 2025 14:39:27 +0000 (-0400) Subject: hsa: fix echo server rx callback crash X-Git-Tag: v26.02-rc0~69 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F34%2F43634%2F2;p=vpp.git hsa: fix echo server rx callback crash Handle rx after close. Type: fix Change-Id: I9507857ba8903b674e249797d2837981382b4aec Signed-off-by: Florin Coras --- diff --git a/src/plugins/hs_apps/echo_server.c b/src/plugins/hs_apps/echo_server.c index 41f5ac8791f..9a0dd284c05 100644 --- a/src/plugins/hs_apps/echo_server.c +++ b/src/plugins/hs_apps/echo_server.c @@ -372,11 +372,15 @@ echo_server_rx_callback (session_t * s) int actual_transfer; svm_fifo_t *tx_fifo, *rx_fifo; echo_server_main_t *esm = &echo_server_main; - clib_thread_index_t thread_index = vlib_get_thread_index (); + clib_thread_index_t thread_index = s->thread_index; es_worker_t *wrk; es_session_t *es; - ASSERT (s->thread_index == thread_index); + ASSERT (thread_index == vlib_get_thread_index ()); + + /* Closes are treated as half-closes by session layer */ + if (PREDICT_FALSE (s->flags & SESSION_F_APP_CLOSED)) + return 0; rx_fifo = s->rx_fifo; tx_fifo = s->tx_fifo;