{
int rc = 0;
- if (intr_handle && intr_handle->type == RTE_INTR_HANDLE_VDEV) {
+ if (intr_handle == NULL)
+ return -1;
+
+ if (intr_handle->type == RTE_INTR_HANDLE_VDEV) {
rc = 0;
goto out;
}
- if (!intr_handle || intr_handle->fd < 0 ||
- intr_handle->uio_cfg_fd < 0) {
+ if (intr_handle->fd < 0 || intr_handle->uio_cfg_fd < 0) {
rc = -1;
goto out;
}
{
int rc = 0;
- if (intr_handle && intr_handle->type == RTE_INTR_HANDLE_VDEV) {
+ if (intr_handle == NULL)
+ return -1;
+
+ if (intr_handle->type == RTE_INTR_HANDLE_VDEV) {
rc = 0;
goto out;
}
- if (!intr_handle || intr_handle->fd < 0 ||
- intr_handle->uio_cfg_fd < 0) {
+ if (intr_handle->fd < 0 || intr_handle->uio_cfg_fd < 0) {
rc = -1;
goto out;
}
return RTE_PER_LCORE(_epfd);
}
-int
-rte_epoll_wait(int epfd, struct rte_epoll_event *events,
- int maxevents, int timeout)
+static int
+eal_epoll_wait(int epfd, struct rte_epoll_event *events,
+ int maxevents, int timeout, bool interruptible)
{
struct epoll_event evs[maxevents];
int rc;
rc = eal_epoll_process_event(evs, rc, events);
break;
} else if (rc < 0) {
- if (errno == EINTR)
- continue;
+ if (errno == EINTR) {
+ if (interruptible)
+ return -1;
+ else
+ continue;
+ }
/* epoll_wait fail */
RTE_LOG(ERR, EAL, "epoll_wait returns with fail %s\n",
strerror(errno));
return rc;
}
+int
+rte_epoll_wait(int epfd, struct rte_epoll_event *events,
+ int maxevents, int timeout)
+{
+ return eal_epoll_wait(epfd, events, maxevents, timeout, false);
+}
+
+int
+rte_epoll_wait_interruptible(int epfd, struct rte_epoll_event *events,
+ int maxevents, int timeout)
+{
+ return eal_epoll_wait(epfd, events, maxevents, timeout, true);
+}
+
static inline void
eal_epoll_data_safe_free(struct rte_epoll_event *ev)
{