diff options
author | Florin Coras <fcoras@cisco.com> | 2019-12-27 10:26:56 -0800 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2019-12-30 19:50:38 +0000 |
commit | fea813ae3de5343a2bc91306fddf6dbd1832f93d (patch) | |
tree | abb186eec7f6ed246077f24798ebd7161f731cec /src/svm/message_queue.c | |
parent | 9f3f18f99fd321cdcfc331e92b10b64f0ef590b3 (diff) |
svm: broadcast on raw dequeues and full rings
Type: fix
Change-Id: I0cac9001290e7ed4e2e318ae62c56e97ec75a3db
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/svm/message_queue.c')
-rw-r--r-- | src/svm/message_queue.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/svm/message_queue.c b/src/svm/message_queue.c index 10266a8039c..b381173c70b 100644 --- a/src/svm/message_queue.c +++ b/src/svm/message_queue.c @@ -170,6 +170,7 @@ void svm_msg_q_free_msg (svm_msg_q_t * mq, svm_msg_q_msg_t * msg) { svm_msg_q_ring_t *ring; + int need_signal; ASSERT (vec_len (mq->rings) > msg->ring_index); ring = &mq->rings[msg->ring_index]; @@ -183,7 +184,12 @@ svm_msg_q_free_msg (svm_msg_q_t * mq, svm_msg_q_msg_t * msg) /* for now, expect messages to be processed in order */ ASSERT (0); } + + need_signal = ring->cursize == ring->nitems; clib_atomic_fetch_sub (&ring->cursize, 1); + + if (PREDICT_FALSE (need_signal)) + svm_queue_send_signal (mq->q, 0); } static int |