vfio: fix maximum number of interrupt for MSI-X
authorQi Zhang <qi.z.zhang@intel.com>
Thu, 9 Feb 2017 19:59:43 +0000 (14:59 -0500)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 13 Feb 2017 21:25:04 +0000 (22:25 +0100)
The max number of interrupt request is possible
be changed after rte_intr_callback_register, so
in get_max_intr, we need to check if necessary to
update the max_intr.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
lib/librte_eal/linuxapp/eal/eal_interrupts.c

index b5b3f2b..92a19cb 100644 (file)
@@ -287,6 +287,8 @@ get_max_intr(const struct rte_intr_handle *intr_handle)
                if (src->intr_handle.fd != intr_handle->fd)
                        continue;
 
+               if (src->intr_handle.max_intr < intr_handle->max_intr)
+                       src->intr_handle.max_intr = intr_handle->max_intr;
                if (!src->intr_handle.max_intr)
                        src->intr_handle.max_intr = 1;
                else if (src->intr_handle.max_intr > RTE_MAX_RXTX_INTR_VEC_ID)