summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2019-09-27 17:04:47 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-10-03 16:16:17 +0000
commit513a74b855e3564ab7630683a53cafcdfe0d20d7 (patch)
tree013cb9ff45500a94e24ca3d425abe11ab699653e
parentc00898c48536ea68ef51cb0495835cdf1f177dfe (diff)
session: fix io_evt mq locking
Type: fix Change-Id: Iaa8045bba19cc305c84074668a20e1468d431b10 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com> (cherry picked from commit 35174b428b99978503332107a9f330d8b3478bd5)
-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;
}