From 2cc8c0a8db227996bd2ee624f480f6674e25b6f0 Mon Sep 17 00:00:00 2001 From: Mohammed Hawari Date: Mon, 27 Feb 2023 15:33:30 +0100 Subject: udp: fix optimistic assert for UDP RX Change-Id: I431c4a6f409b129e4290dba2e1acadea460ac797 Signed-off-by: Mohammed Hawari Type: improvement --- src/vnet/udp/udp_error.def | 1 + src/vnet/udp/udp_input.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/vnet/udp') diff --git a/src/vnet/udp/udp_error.def b/src/vnet/udp/udp_error.def index 717285d9b76..ef19970ce72 100644 --- a/src/vnet/udp/udp_error.def +++ b/src/vnet/udp/udp_error.def @@ -21,6 +21,7 @@ udp_error (LENGTH_ERROR, length_error, ERROR, "Packets with length errors") udp_error (PUNT, punt, ERROR, "No listener punt") udp_error (ENQUEUED, enqueued, INFO, "Packets enqueued") udp_error (FIFO_FULL, fifo_full, ERROR, "Fifo full") +udp_error (FIFO_NOMEM, fifo_nomem, ERROR, "Fifo no mem") udp_error (NOT_READY, not_ready, ERROR, "Connection not ready") udp_error (ACCEPT, accept, INFO, "Accepted session") udp_error (CREATE_SESSION, create_session, ERROR, "Failed to create session") diff --git a/src/vnet/udp/udp_input.c b/src/vnet/udp/udp_input.c index d5dd159c4b2..6e5ed158d56 100644 --- a/src/vnet/udp/udp_input.c +++ b/src/vnet/udp/udp_input.c @@ -161,7 +161,11 @@ udp_connection_enqueue (udp_connection_t * uc0, session_t * s0, TRANSPORT_PROTO_UDP, queue_event); } - ASSERT (wrote0 > 0); + + /* In some rare cases, session_enqueue_dgram_connection can fail because a + * chunk cannot be allocated in the RX FIFO */ + if (PREDICT_FALSE (wrote0 == 0)) + *error0 = UDP_ERROR_FIFO_NOMEM; unlock_rx_lock: -- cgit 1.2.3-korg