[dpdk-dev] [PATCH v6 1/8] eal: declare new interrupt api
Cunming Liang
cunming.liang at intel.com
Fri Feb 27 05:56:09 CET 2015
Add two API *rte_intr_rx_wait* and *rte_intr_rx_set* for RX interrupt.
They're only available in VFIO_MSIX.
Signed-off-by: Cunming Liang <cunming.liang at intel.com>
---
lib/librte_eal/common/include/rte_interrupts.h | 38 ++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/lib/librte_eal/common/include/rte_interrupts.h b/lib/librte_eal/common/include/rte_interrupts.h
index 609c34b..6e31f1d 100644
--- a/lib/librte_eal/common/include/rte_interrupts.h
+++ b/lib/librte_eal/common/include/rte_interrupts.h
@@ -45,6 +45,8 @@
extern "C" {
#endif
+#include <stdint.h>
+
/** Interrupt handle */
struct rte_intr_handle;
@@ -54,6 +56,8 @@ typedef void (*rte_intr_callback_fn)(struct rte_intr_handle *intr_handle,
#include <exec-env/rte_interrupts.h>
+#define RTE_EPOLL_FD_ANY -1 /**< to hint using per thread epfd */
+
/**
* It registers the callback for the specific interrupt. Multiple
* callbacks cal be registered at the same time.
@@ -113,6 +117,40 @@ int rte_intr_enable(struct rte_intr_handle *intr_handle);
*/
int rte_intr_disable(struct rte_intr_handle *intr_handle);
+/**
+ * @param intr_handle
+ * pointer to the interrupt handle.
+ * @param fd
+ * event fd the thread wait for.
+ * @param vec
+ * array for all the ready vectors.
+ * @param num
+ * the max number of vector array.
+ * @return
+ * - On success, returns the number of available vectors.
+ * - On failure, a negative value.
+ */
+int
+rte_intr_rx_wait(struct rte_intr_handle *intr_handle,
+ int fd, uint32_t *vec, uint16_t num);
+
+/**
+ * @param intr_handle
+ * pointer to the interrupt handle.
+ * @param fd
+ * event fd which the intr vector associated to.
+ * @param op
+ * operation type of {ADD, DEL}.
+ * @param vec
+ * vector number added to the event wait list.
+ * @return
+ * - On success, zero.
+ * - On failure, a negative value.
+ */
+int
+rte_intr_rx_set(struct rte_intr_handle *intr_handle,
+ int fd, int op, uint32_t vec);
+
#ifdef __cplusplus
}
#endif
--
1.8.1.4
More information about the dev
mailing list