#define SOCKADDR_GET_SA(__addr) _addr;
#endif
+#ifndef UDP_SEGMENT
+#define UDP_SEGMENT 103
+#endif
+
typedef struct ldp_worker_ctx_
{
u8 *io_buffer;
epfd = vls_attr (vlsh, VPPCOM_ATTR_GET_LIBC_EPFD, 0, 0);
if (epfd > 0)
{
+ ldp_worker_ctx_t *ldpw = ldp_worker_get_current ();
+ u32 size = sizeof (epfd);
+
LDBG (0, "fd %d: calling libc_close: epfd %u", fd, epfd);
- rv = libc_close (epfd);
- if (rv < 0)
- {
- u32 size = sizeof (epfd);
- epfd = 0;
+ libc_close (epfd);
+ ldpw->mq_epfd_added = 0;
- (void) vls_attr (vlsh, VPPCOM_ATTR_SET_LIBC_EPFD, &epfd, &size);
- }
+ epfd = 0;
+ (void) vls_attr (vlsh, VPPCOM_ATTR_SET_LIBC_EPFD, &epfd, &size);
}
else if (PREDICT_FALSE (epfd < 0))
{
int maxevents, int timeout, const sigset_t * sigmask)
{
ldp_worker_ctx_t *ldpw;
- int libc_epfd, rv = 0, num_ev;
+ int libc_epfd, rv = 0, num_ev, vcl_wups = 0;
vls_handle_t ep_vlsh;
ldp_init_check ();
goto done;
}
+epoll_again:
rv = libc_epoll_pwait (libc_epfd, events, maxevents, timeout, sigmask);
if (rv <= 0)
goto done;
num_ev = vls_epoll_wait (ep_vlsh, &events[rv], maxevents - rv, 0);
if (PREDICT_TRUE (num_ev > 0))
rv += num_ev;
+ /* Woken up by vcl but no events generated. Accept it once */
+ if (rv == 0 && vcl_wups++ < 1)
+ goto epoll_again;
break;
}
}