From: Matus Fabian Date: Thu, 17 Apr 2025 08:45:54 +0000 (-0400) Subject: http: http_app_worker_rx_notify improvement X-Git-Tag: v25.10-rc0~79 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=f8a7509322baa1440ddaefdf00517b00f7003fff;p=vpp.git http: http_app_worker_rx_notify improvement Do not send rx event to app worker if there is already pending one Type: improvement Change-Id: I76c7e222ba13932be2079b5135ffadf5c98155e7 Signed-off-by: Matus Fabian --- diff --git a/src/plugins/http/http_private.h b/src/plugins/http/http_private.h index cee60a49481..45faeceeab2 100644 --- a/src/plugins/http/http_private.h +++ b/src/plugins/http/http_private.h @@ -449,9 +449,15 @@ http_app_worker_rx_notify (http_req_t *req) app_worker_t *app_wrk; as = session_get_from_handle (req->hr_pa_session_handle); - app_wrk = app_worker_get_if_valid (as->app_wrk_index); - if (app_wrk) - app_worker_rx_notify (app_wrk, as); + if (!(as->flags & SESSION_F_RX_EVT)) + { + app_wrk = app_worker_get_if_valid (as->app_wrk_index); + if (app_wrk) + { + as->flags |= SESSION_F_RX_EVT; + app_worker_rx_notify (app_wrk, as); + } + } } /** @@ -574,9 +580,9 @@ always_inline void http_io_as_write (http_req_t *req, u8 *data, u32 len) { int n_written; - session_t *ts = session_get_from_handle (req->hr_pa_session_handle); + session_t *as = session_get_from_handle (req->hr_pa_session_handle); - n_written = svm_fifo_enqueue (ts->tx_fifo, len, data); + n_written = svm_fifo_enqueue (as->rx_fifo, len, data); ASSERT (n_written == len); } diff --git a/src/plugins/http_static/static_server.c b/src/plugins/http_static/static_server.c index 4478fa4553e..9914becee58 100644 --- a/src/plugins/http_static/static_server.c +++ b/src/plugins/http_static/static_server.c @@ -611,7 +611,7 @@ url_handler_wait_body (hss_session_t *hs, session_t *ts) if (svm_fifo_max_dequeue (ts->rx_fifo) < hs->left_recv) { clib_warning ("not all data in fifo, max deq %u, left recv %u", - ts->rx_fifo, hs->left_recv); + svm_fifo_max_dequeue (ts->rx_fifo), hs->left_recv); hs->left_recv = 0; start_send_data (hs, HTTP_STATUS_INTERNAL_ERROR); hss_session_disconnect_transport (hs);