X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Feal%2Flinux%2Feal_interrupts.c;h=70060bf3efa1fd4e949660c47d476d973d8b7d77;hb=4042dc2037a1509596f7eb48370185434bad39cc;hp=f72661e1f016425666f6f7f25d09e512a9c71911;hpb=bbbac4cd6ed23426a6ccf362b552537e7d8c3ce2;p=dpdk.git diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c index f72661e1f0..70060bf3ef 100644 --- a/lib/eal/linux/eal_interrupts.c +++ b/lib/eal/linux/eal_interrupts.c @@ -416,7 +416,7 @@ uio_intx_intr_disable(const struct rte_intr_handle *intr_handle) /* use UIO config file descriptor for uio_pci_generic */ uio_cfg_fd = rte_intr_dev_fd_get(intr_handle); - if (pread(uio_cfg_fd, &command_high, 1, 5) != 1) { + if (uio_cfg_fd < 0 || pread(uio_cfg_fd, &command_high, 1, 5) != 1) { RTE_LOG(ERR, EAL, "Error reading interrupts status for fd %d\n", uio_cfg_fd); @@ -442,7 +442,7 @@ uio_intx_intr_enable(const struct rte_intr_handle *intr_handle) /* use UIO config file descriptor for uio_pci_generic */ uio_cfg_fd = rte_intr_dev_fd_get(intr_handle); - if (pread(uio_cfg_fd, &command_high, 1, 5) != 1) { + if (uio_cfg_fd < 0 || pread(uio_cfg_fd, &command_high, 1, 5) != 1) { RTE_LOG(ERR, EAL, "Error reading interrupts status for fd %d\n", uio_cfg_fd); @@ -465,7 +465,8 @@ uio_intr_disable(const struct rte_intr_handle *intr_handle) { const int value = 0; - if (write(rte_intr_fd_get(intr_handle), &value, sizeof(value)) < 0) { + if (rte_intr_fd_get(intr_handle) < 0 || + write(rte_intr_fd_get(intr_handle), &value, sizeof(value)) < 0) { RTE_LOG(ERR, EAL, "Error disabling interrupts for fd %d (%s)\n", rte_intr_fd_get(intr_handle), strerror(errno)); return -1; @@ -478,7 +479,8 @@ uio_intr_enable(const struct rte_intr_handle *intr_handle) { const int value = 1; - if (write(rte_intr_fd_get(intr_handle), &value, sizeof(value)) < 0) { + if (rte_intr_fd_get(intr_handle) < 0 || + write(rte_intr_fd_get(intr_handle), &value, sizeof(value)) < 0) { RTE_LOG(ERR, EAL, "Error enabling interrupts for fd %d (%s)\n", rte_intr_fd_get(intr_handle), strerror(errno)); return -1; @@ -587,7 +589,7 @@ rte_intr_callback_unregister_pending(const struct rte_intr_handle *intr_handle, rte_spinlock_lock(&intr_lock); - /* check if the insterrupt source for the fd is existent */ + /* check if the interrupt source for the fd is existent */ TAILQ_FOREACH(src, &intr_sources, next) { if (rte_intr_fd_get(src->intr_handle) == rte_intr_fd_get(intr_handle)) break; @@ -637,7 +639,7 @@ rte_intr_callback_unregister(const struct rte_intr_handle *intr_handle, rte_spinlock_lock(&intr_lock); - /* check if the insterrupt source for the fd is existent */ + /* check if the interrupt source for the fd is existent */ TAILQ_FOREACH(src, &intr_sources, next) if (rte_intr_fd_get(src->intr_handle) == rte_intr_fd_get(intr_handle)) break; @@ -945,17 +947,14 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds) bytes_read = sizeof(buf.timerfd_num); break; #ifdef VFIO_PRESENT +#ifdef HAVE_VFIO_DEV_REQ_INTERFACE + case RTE_INTR_HANDLE_VFIO_REQ: +#endif case RTE_INTR_HANDLE_VFIO_MSIX: case RTE_INTR_HANDLE_VFIO_MSI: case RTE_INTR_HANDLE_VFIO_LEGACY: bytes_read = sizeof(buf.vfio_intr_count); break; -#ifdef HAVE_VFIO_DEV_REQ_INTERFACE - case RTE_INTR_HANDLE_VFIO_REQ: - bytes_read = 0; - call = true; - break; -#endif #endif case RTE_INTR_HANDLE_VDEV: case RTE_INTR_HANDLE_EXT: