eal: emit warning for unused trylock return value
[dpdk.git] / lib / eal / include / rte_interrupts.h
index 3c17492..edbf0fa 100644 (file)
@@ -35,6 +35,28 @@ struct rte_intr_handle;
 /** Interrupt instance will be shared between primary and secondary processes. */
 #define RTE_INTR_INSTANCE_F_SHARED      RTE_BIT32(0)
 
+#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 */
+};
+
 /** Function to be registered for the specific interrupt */
 typedef void (*rte_intr_callback_fn)(void *cb_arg);
 
@@ -45,8 +67,6 @@ typedef void (*rte_intr_callback_fn)(void *cb_arg);
 typedef void (*rte_intr_unregister_callback_fn)(struct rte_intr_handle *intr_handle,
                                                void *cb_arg);
 
-#include "rte_eal_interrupts.h"
-
 /**
  * It registers the callback for the specific interrupt. Multiple
  * callbacks can be registered at the same time.
@@ -735,6 +755,28 @@ __rte_internal
 void
 rte_intr_vec_list_free(struct rte_intr_handle *intr_handle);
 
+/**
+ * @internal
+ * Reallocates the size efds and elist array based on size provided by user.
+ * By default efds and elist array are allocated with default size
+ * RTE_MAX_RXTX_INTR_VEC_ID on interrupt handle array creation. Later on device
+ * probe, device may have capability of more interrupts than
+ * RTE_MAX_RXTX_INTR_VEC_ID. Using this API, PMDs can reallocate the arrays as
+ * per the max interrupts capability of device.
+ *
+ * @param intr_handle
+ *  pointer to the interrupt handle.
+ * @param size
+ *  efds and elist array size.
+ *
+ * @return
+ *  - On success, zero
+ *  - On failure, a negative value and rte_errno is set.
+ */
+__rte_internal
+int
+rte_intr_event_list_update(struct rte_intr_handle *intr_handle, int size);
+
 /**
  * @internal
  * This API returns the Windows handle of the given interrupt instance.