summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhanlin <hanlin_wang@163.com>2020-05-11 22:20:37 +0800
committerFlorin Coras <florin.coras@gmail.com>2020-05-14 14:36:51 +0000
commitd0e646f6892e9c85278c9538760a8940c86dcdbb (patch)
treed9a836aaedc10e8c0016b2ca109bf10f55fa08fd
parent219fbb228f5274d2db740139a0d3258902370165 (diff)
vcl svm: fix rx event loss
When vcl_epoll_wait_handle_mq handles rx events exceeding maxevents, VPP will not signal because cursize > 0, and the remaining rx events cannot be triggered because the eventfd event has been read. Therefore, we should dequeue all events until cursize = 0. And then handle msg up to maxevents with vcl_epoll_wait_handle_mq_event and those beyond with vcl_handle_mq_event. Type: fix Signed-off-by: hanlin <hanlin_wang@163.com> Change-Id: I8a0c87cb41c837deb8284b40f668cc3c7d9d6e56 Signed-off-by: hanlin <hanlin_wang@163.com>
-rw-r--r--src/vcl/vppcom.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index 2c01589bab5..4fc8bfce581 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -2923,7 +2923,7 @@ vcl_epoll_wait_handle_mq (vcl_worker_t * wrk, svm_msg_q_t * mq,
}
}
ASSERT (maxevents > *num_ev);
- vcl_mq_dequeue_batch (wrk, mq, maxevents - *num_ev);
+ vcl_mq_dequeue_batch (wrk, mq, ~0);
svm_msg_q_unlock (mq);
handle_dequeued:
@@ -2931,7 +2931,10 @@ handle_dequeued:
{
msg = vec_elt_at_index (wrk->mq_msg_vector, i);
e = svm_msg_q_msg_data (mq, msg);
- vcl_epoll_wait_handle_mq_event (wrk, e, events, num_ev);
+ if (*num_ev < maxevents)
+ vcl_epoll_wait_handle_mq_event (wrk, e, events, num_ev);
+ else
+ vcl_handle_mq_event (wrk, e);
svm_msg_q_free_msg (mq, msg);
}
vec_reset_length (wrk->mq_msg_vector);