summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2019-09-27 17:04:47 +0200
committerFlorin Coras <florin.coras@gmail.com>2019-09-27 16:27:09 +0000
commit35174b428b99978503332107a9f330d8b3478bd5 (patch)
treed3034ee50498040508bc7389207ffaeac18c0cb4
parent694ec926c79b27609ce9f452f8fd6f3f4aa9ff4e (diff)
session: fix io_evt mq locking
Type: fix Change-Id: Iaa8045bba19cc305c84074668a20e1468d431b10 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
-rw-r--r--src/vnet/session/application_interface.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/vnet/session/application_interface.h b/src/vnet/session/application_interface.h
index 637a055b3d8..015a297f852 100644
--- a/src/vnet/session/application_interface.h
+++ b/src/vnet/session/application_interface.h
@@ -495,14 +495,13 @@ app_send_io_evt_to_vpp (svm_msg_q_t * mq, u32 session_index, u8 evt_type,
else
{
svm_msg_q_lock (mq);
- while (svm_msg_q_ring_is_full (mq, SESSION_MQ_IO_EVT_RING))
+ while (svm_msg_q_ring_is_full (mq, SESSION_MQ_IO_EVT_RING)
+ || svm_msg_q_is_full (mq))
svm_msg_q_wait (mq);
msg = svm_msg_q_alloc_msg_w_ring (mq, SESSION_MQ_IO_EVT_RING);
evt = (session_event_t *) svm_msg_q_msg_data (mq, &msg);
evt->session_index = session_index;
evt->event_type = evt_type;
- if (svm_msg_q_is_full (mq))
- svm_msg_q_wait (mq);
svm_msg_q_add_and_unlock (mq, &msg);
return 0;
}