The patch adds condition check to avoid enable nothing.
In disable state, both max_intr and nb_efd are zero.
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
Acked-by: David Marchand <david.marchand@6wind.com>
*
* @param intr_handle
* Pointer to the interrupt handle.
*
* @param intr_handle
* Pointer to the interrupt handle.
* Number of interrupt vector trying to enable.
* Number of interrupt vector trying to enable.
+ * The value 0 is not allowed.
* @return
* - On success, zero.
* - On failure, a negative value.
* @return
* - On success, zero.
* - On failure, a negative value.
#include <sys/signalfd.h>
#include <sys/ioctl.h>
#include <sys/eventfd.h>
#include <sys/signalfd.h>
#include <sys/ioctl.h>
#include <sys/eventfd.h>
#include <rte_common.h>
#include <rte_interrupts.h>
#include <rte_common.h>
#include <rte_interrupts.h>
int fd;
uint32_t n = RTE_MIN(nb_efd, (uint32_t)RTE_MAX_RXTX_INTR_VEC_ID);
int fd;
uint32_t n = RTE_MIN(nb_efd, (uint32_t)RTE_MAX_RXTX_INTR_VEC_ID);
if (intr_handle->type == RTE_INTR_HANDLE_VFIO_MSIX) {
for (i = 0; i < n; i++) {
fd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
if (intr_handle->type == RTE_INTR_HANDLE_VFIO_MSIX) {
for (i = 0; i < n; i++) {
fd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
int
rte_intr_allow_others(struct rte_intr_handle *intr_handle)
{
int
rte_intr_allow_others(struct rte_intr_handle *intr_handle)
{
- return !!(intr_handle->max_intr - intr_handle->nb_efd);
+ if (!rte_intr_dp_is_en(intr_handle))
+ return 1;
+ else
+ return !!(intr_handle->max_intr - intr_handle->nb_efd);
*
* @param intr_handle
* Pointer to the interrupt handle.
*
* @param intr_handle
* Pointer to the interrupt handle.
* Number of interrupt vector trying to enable.
* Number of interrupt vector trying to enable.
+ * The value 0 is not allowed.
* @return
* - On success, zero.
* - On failure, a negative value.
* @return
* - On success, zero.
* - On failure, a negative value.