#include <rte_spinlock.h>
#include <rte_common.h>
#include <rte_interrupts.h>
+#include <rte_eal_trace.h>
#include "eal_private.h"
#include "eal_alarm_private.h"
{
struct rte_intr_callback *callback;
struct rte_intr_source *src;
- int ret, add_event = 0;
+ int ret = 0, add_event = 0;
/* first do parameter checking */
if (intr_handle == NULL || intr_handle->fd < 0 || cb == NULL) {
goto fail;
}
}
+ rte_eal_trace_intr_callback_register(intr_handle, cb, cb_arg, ret);
rte_spinlock_unlock(&intr_lock);
return 0;
}
}
free(callback);
+ rte_eal_trace_intr_callback_register(intr_handle, cb, cb_arg, ret);
rte_spinlock_unlock(&intr_lock);
return ret;
}
}
}
out:
+ rte_eal_trace_intr_callback_unregister(intr_handle, cb_fn, cb_arg,
+ ret);
rte_spinlock_unlock(&intr_lock);
return ret;
int
rte_intr_enable(const struct rte_intr_handle *intr_handle)
{
- if (intr_handle && intr_handle->type == RTE_INTR_HANDLE_VDEV)
- return 0;
+ int rc = 0;
- if (!intr_handle || intr_handle->fd < 0 || intr_handle->uio_cfg_fd < 0)
+ if (intr_handle == NULL)
return -1;
+ if (intr_handle->type == RTE_INTR_HANDLE_VDEV) {
+ rc = 0;
+ goto out;
+ }
+
+ if (intr_handle->fd < 0 || intr_handle->uio_cfg_fd < 0) {
+ rc = -1;
+ goto out;
+ }
+
switch (intr_handle->type) {
/* not used at this moment */
case RTE_INTR_HANDLE_ALARM:
- return -1;
+ rc = -1;
+ break;
/* not used at this moment */
case RTE_INTR_HANDLE_DEV_EVENT:
- return -1;
+ rc = -1;
+ break;
/* unknown handle type */
default:
RTE_LOG(ERR, EAL,
"Unknown handle type of fd %d\n",
intr_handle->fd);
- return -1;
+ rc = -1;
+ break;
}
- return 0;
+out:
+ rte_eal_trace_intr_enable(intr_handle, rc);
+ return rc;
}
int
rte_intr_disable(const struct rte_intr_handle *intr_handle)
{
- if (intr_handle && intr_handle->type == RTE_INTR_HANDLE_VDEV)
- return 0;
+ int rc = 0;
- if (!intr_handle || intr_handle->fd < 0 || intr_handle->uio_cfg_fd < 0)
+ if (intr_handle == NULL)
return -1;
+ if (intr_handle->type == RTE_INTR_HANDLE_VDEV) {
+ rc = 0;
+ goto out;
+ }
+
+ if (intr_handle->fd < 0 || intr_handle->uio_cfg_fd < 0) {
+ rc = -1;
+ goto out;
+ }
+
switch (intr_handle->type) {
/* not used at this moment */
case RTE_INTR_HANDLE_ALARM:
- return -1;
+ rc = -1;
+ break;
/* not used at this moment */
case RTE_INTR_HANDLE_DEV_EVENT:
- return -1;
+ rc = -1;
+ break;
/* unknown handle type */
default:
RTE_LOG(ERR, EAL,
"Unknown handle type of fd %d\n",
intr_handle->fd);
- return -1;
+ rc = -1;
+ break;
}
-
- return 0;
+out:
+ rte_eal_trace_intr_disable(intr_handle, rc);
+ return rc;
}
int
return -ENOTSUP;
}
+int
+rte_epoll_wait_interruptible(int epfd, struct rte_epoll_event *events,
+ int maxevents, int timeout)
+{
+ RTE_SET_USED(epfd);
+ RTE_SET_USED(events);
+ RTE_SET_USED(maxevents);
+ RTE_SET_USED(timeout);
+
+ return -ENOTSUP;
+}
+
int
rte_epoll_ctl(int epfd, int op, int fd, struct rte_epoll_event *event)
{