2021-10-23 02:19 (UTC+0530), Harman Kalra:
> Moving interrupt handle structure definition inside the c file
> to make its fields totally opaque to the outside world.
> 
> Dynamically allocating the efds and elist array os intr_handle
> structure, based on size provided by user. Eg size can be
> MSIX interrupts supported by a PCI device.
> 
> Signed-off-by: Harman Kalra <hka...@marvell.com>
> ---
>  drivers/bus/pci/linux/pci_vfio.c       |   7 +
>  lib/eal/common/eal_common_interrupts.c | 190 +++++++++++++++++++++++--
>  lib/eal/include/meson.build            |   1 -
>  lib/eal/include/rte_eal_interrupts.h   |  72 ----------
>  lib/eal/include/rte_interrupts.h       |  22 ++-
>  5 files changed, 209 insertions(+), 83 deletions(-)
>  delete mode 100644 lib/eal/include/rte_eal_interrupts.h

> diff --git a/drivers/bus/pci/linux/pci_vfio.c 
> b/drivers/bus/pci/linux/pci_vfio.c
> [...]
> diff --git a/lib/eal/include/rte_interrupts.h 
> b/lib/eal/include/rte_interrupts.h
> index a29232e16a..fc6b2d1210 100644
> --- a/lib/eal/include/rte_interrupts.h
> +++ b/lib/eal/include/rte_interrupts.h
> @@ -33,7 +33,27 @@ struct rte_intr_handle;
>  /** Interrupt instance could be shared within primary secondary process. */
>  #define RTE_INTR_INSTANCE_F_SHARED   0x00000002
>  
> -#include "rte_eal_interrupts.h"
> +#define RTE_MAX_RXTX_INTR_VEC_ID      512
> +#define RTE_INTR_VEC_ZERO_OFFSET      0
> +#define RTE_INTR_VEC_RXTX_OFFSET      1
> +
> +/**
> + * The interrupt source type, e.g. UIO, VFIO, ALARM etc.
> + */
> +enum rte_intr_handle_type {
> +     RTE_INTR_HANDLE_UNKNOWN = 0,  /**< generic unknown handle */
> +     RTE_INTR_HANDLE_UIO,          /**< uio device handle */
> +     RTE_INTR_HANDLE_UIO_INTX,     /**< uio generic handle */
> +     RTE_INTR_HANDLE_VFIO_LEGACY,  /**< vfio device handle (legacy) */
> +     RTE_INTR_HANDLE_VFIO_MSI,     /**< vfio device handle (MSI) */
> +     RTE_INTR_HANDLE_VFIO_MSIX,    /**< vfio device handle (MSIX) */
> +     RTE_INTR_HANDLE_ALARM,        /**< alarm handle */
> +     RTE_INTR_HANDLE_EXT,          /**< external handler */
> +     RTE_INTR_HANDLE_VDEV,         /**< virtual device */
> +     RTE_INTR_HANDLE_DEV_EVENT,    /**< device event handle */
> +     RTE_INTR_HANDLE_VFIO_REQ,     /**< VFIO request handle */
> +     RTE_INTR_HANDLE_MAX           /**< count of elements */

Wasn't this member going to be removed since v1?

Ray, do you agree?
MAX enum members have been scheduled for removal long ago.
This one even seems unlikely to be used as array size and break anything.

> +};
>  
>  /** Function to be registered for the specific interrupt */
>  typedef void (*rte_intr_callback_fn)(void *cb_arg);

Reply via email to