From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cunming Liang Subject: [PATCH v6 1/8] eal: declare new interrupt api Date: Fri, 27 Feb 2015 12:56:09 +0800 Message-ID: <1425012976-10173-2-git-send-email-cunming.liang@intel.com> References: <1424710542-14637-1-git-send-email-danny.zhou@intel.com> <1425012976-10173-1-git-send-email-cunming.liang@intel.com> To: dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1425012976-10173-1-git-send-email-cunming.liang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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 --- 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 + /** Interrupt handle */ struct rte_intr_handle; @@ -54,6 +56,8 @@ typedef void (*rte_intr_callback_fn)(struct rte_intr_handle *intr_handle, #include +#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