summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_node.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-01-25 20:31:27 -0800
committerDave Barach <openvpp@barachs.net>2021-02-05 17:28:34 +0000
commit5398dfb2592d525018997a991a4f7bfde515adc4 (patch)
treed986e2bac410e8b630a0d5907b729550a28838da /src/vnet/session/session_node.c
parent2b97f597c6705809201ce6a6846d46c47c0933ba (diff)
session svm: non blocking mq
Avoid synchronizing producers and the consumer. Instead, only use mutex or spinlock (if eventfds are configured) to synchronize producers. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie2aafbdc2e07fced5d5e46ee2df6b30a186faa2f
Diffstat (limited to 'src/vnet/session/session_node.c')
-rw-r--r--src/vnet/session/session_node.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index 37df0c450f8..2c91a2fe092 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -1425,16 +1425,15 @@ session_queue_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
* XXX: we may need priorities here */
mq = wrk->vpp_event_queue;
n_to_dequeue = svm_msg_q_size (mq);
- if (n_to_dequeue && svm_msg_q_try_lock (mq) == 0)
+ if (n_to_dequeue)
{
for (i = 0; i < n_to_dequeue; i++)
{
- svm_msg_q_sub_w_lock (mq, msg);
+ svm_msg_q_sub_raw (mq, msg);
evt = svm_msg_q_msg_data (mq, msg);
session_evt_add_to_list (wrk, evt);
svm_msg_q_free_msg (mq, msg);
}
- svm_msg_q_unlock (mq);
}
SESSION_EVT (SESSION_EVT_DSP_CNTRS, MQ_DEQ, wrk, n_to_dequeue, !i);