From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 9B58A5A54 for ; Fri, 27 Feb 2015 05:56:45 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 26 Feb 2015 20:56:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,657,1418112000"; d="scan'208";a="533565902" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga003.jf.intel.com with ESMTP; 26 Feb 2015 20:47:29 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t1R4ueMl008757; Fri, 27 Feb 2015 12:56:40 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t1R4ucaP010226; Fri, 27 Feb 2015 12:56:40 +0800 Received: (from cliang18@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t1R4ucna010222; Fri, 27 Feb 2015 12:56:38 +0800 From: Cunming Liang To: dev@dpdk.org Date: Fri, 27 Feb 2015 12:56:09 +0800 Message-Id: <1425012976-10173-2-git-send-email-cunming.liang@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1425012976-10173-1-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> Subject: [dpdk-dev] [PATCH v6 1/8] eal: declare new interrupt api X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Feb 2015 04:56:46 -0000 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