From 66c675e1a514a85ac56faf686fb96b63505c994f Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Thu, 9 Mar 2023 16:43:02 -0800 Subject: vcl: fix select connected deq notification Also make sure that only sessions with fifos try to set deq notification flag on fifo Type: fix Signed-off-by: Florin Coras Change-Id: I878c2d2e18bb98109ee03b42a4f0f8c48aa23e9f --- src/vcl/vppcom.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c index 0f824dcf621..0ba9423ecf0 100644 --- a/src/vcl/vppcom.c +++ b/src/vcl/vppcom.c @@ -2409,11 +2409,17 @@ vcl_select_handle_mq_event (vcl_worker_t * wrk, session_event_t * e, sid = e->session_index; if (sid == VCL_INVALID_SESSION_INDEX) break; - if (sid < n_bits && write_map) - { - clib_bitmap_set_no_check ((uword *) write_map, sid, 1); - *bits_set += 1; - } + if (!(sid < n_bits && write_map)) + break; + clib_bitmap_set_no_check ((uword *) write_map, sid, 1); + *bits_set += 1; + s = vcl_session_get (wrk, sid); + if (!s->tx_fifo) + break; + /* We didn't have a fifo when the event was added */ + svm_fifo_add_want_deq_ntf ( + (vcl_session_is_ct (s) ? s->ct_tx_fifo : s->tx_fifo), + SVM_FIFO_WANT_DEQ_NOTIF_IF_FULL); break; case SESSION_CTRL_EVT_DISCONNECTED: disconnected_msg = (session_disconnected_msg_t *) e->data; @@ -2623,7 +2629,7 @@ vppcom_select (int n_bits, vcl_si_set * read_map, vcl_si_set * write_map, clib_bitmap_set_no_check ((uword *) write_map, sid, 1); bits_set++; } - else + else if (s->tx_fifo) { svm_fifo_t *txf = vcl_session_is_ct (s) ? s->ct_tx_fifo : s->tx_fifo; svm_fifo_add_want_deq_ntf (txf, SVM_FIFO_WANT_DEQ_NOTIF); -- cgit 1.2.3-korg