summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2023-03-09 16:43:02 -0800
committerFlorin Coras <fcoras@cisco.com>2023-03-09 16:43:02 -0800
commit66c675e1a514a85ac56faf686fb96b63505c994f (patch)
tree1a8d46f1e4be0b3703581fa2fd8f764a9d57a94c /src
parent436c7badcdd9bcc7047adf1a59ef317a031da413 (diff)
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 <fcoras@cisco.com> Change-Id: I878c2d2e18bb98109ee03b42a4f0f8c48aa23e9f
Diffstat (limited to 'src')
-rw-r--r--src/vcl/vppcom.c18
1 files 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);