summaryrefslogtreecommitdiffstats
path: root/src/vcl/vppcom.c
diff options
context:
space:
mode:
authorwanghanlin <wanghanlin@corp.netease.com>2021-03-18 20:00:41 +0800
committerFlorin Coras <florin.coras@gmail.com>2021-03-22 14:23:06 +0000
commit8919fec5acb14d176b992b71108f9a912d98161e (patch)
treeb99473dbba9e6d91c1cc6285ec35c256373aa749 /src/vcl/vppcom.c
parent156158f06d725d9301940783dff8ccdcc4a01b9b (diff)
vcl: fix libc epoll pwait starved
We call vls_epoll_wait with 0 timeout to process unhandled_evts_vector in ldp_epoll_pwait_eventfd. But vls_epoll_wait will then call vppcom_epoll_wait_eventfd to process events in event queue. If there are continuous events to be handled, then libc_epoll_pwait have no chance to be called. Type: fix Signed-off-by: wanghanlin <wanghanlin@corp.netease.com> Change-Id: Ia4f61d0d438a3475bfde9f6715805274671d4e75
Diffstat (limited to 'src/vcl/vppcom.c')
-rw-r--r--src/vcl/vppcom.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index cc4464b162e..3e4ba2fb953 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -3042,6 +3042,9 @@ vppcom_epoll_wait (uint32_t vep_handle, struct epoll_event *events,
}
vec_reset_length (wrk->unhandled_evts_vector);
}
+ /* Request to only drain unhandled */
+ if ((int) wait_for_time == -2)
+ return n_evts;
if (vcm->cfg.use_mq_eventfd)
return vppcom_epoll_wait_eventfd (wrk, events, maxevents, n_evts,