From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <cliang18@shecgisg004.sh.intel.com>
Received: from mga02.intel.com (mga02.intel.com [134.134.136.20])
 by dpdk.org (Postfix) with ESMTP id 9C64FBE12
 for <dev@dpdk.org>; Tue,  2 Jun 2015 08:53:43 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga101.jf.intel.com with ESMTP; 01 Jun 2015 23:53:42 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.13,538,1427785200"; d="scan'208";a="719140367"
Received: from shvmail01.sh.intel.com ([10.239.29.42])
 by fmsmga001.fm.intel.com with ESMTP; 01 Jun 2015 23:53:41 -0700
Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com
 [10.239.29.89])
 by shvmail01.sh.intel.com with ESMTP id t526raub022163;
 Tue, 2 Jun 2015 14:53:36 +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
 t526rXLm024720; Tue, 2 Jun 2015 14:53:35 +0800
Received: (from cliang18@localhost)
 by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t526rWao024716;
 Tue, 2 Jun 2015 14:53:32 +0800
From: Cunming Liang <cunming.liang@intel.com>
To: dev@dpdk.org
Date: Tue,  2 Jun 2015 14:53:14 +0800
Message-Id: <1433228006-24661-2-git-send-email-cunming.liang@intel.com>
X-Mailer: git-send-email 1.7.4.1
In-Reply-To: <1433228006-24661-1-git-send-email-cunming.liang@intel.com>
References: <1432889125-20255-1-git-send-email-cunming.liang@intel.com>
 <1433228006-24661-1-git-send-email-cunming.liang@intel.com>
Cc: shemming@brocade.com, liang-min.wang@intel.com
Subject: [dpdk-dev] [PATCH v10 01/13] eal/linux: add interrupt vectors
	support in intr_handle
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 02 Jun 2015 06:53:44 -0000

The patch adds interrupt vectors support in rte_intr_handle.
'vec_en' is set when interrupt vectors are detected and associated event fds are set.
Those event fds are stored in efds[].
'intr_vec' is reserved for device driver to initialize the vector mapping table.
When the event fds add to a specified epoll instance, 'eptrs' will hold the rte_epoll_event object pointer.

Signed-off-by: Danny Zhou <danny.zhou@intel.com>
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
---
v7 changes:
 - add eptrs[], it's used to store the register rte_epoll_event instances.
 - add vec_en, to log the vector capability status.

v6 changes:
 - add mapping table between irq vector number and queue id.

v5 changes:
 - Create this new patch file for changed struct rte_intr_handle that
   other patches depend on, to avoid breaking git bisect.

 lib/librte_eal/linuxapp/eal/include/exec-env/rte_interrupts.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_interrupts.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_interrupts.h
index bdeb3fc..9c86a15 100644
--- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_interrupts.h
+++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_interrupts.h
@@ -38,6 +38,8 @@
 #ifndef _RTE_LINUXAPP_INTERRUPTS_H_
 #define _RTE_LINUXAPP_INTERRUPTS_H_
 
+#define RTE_MAX_RXTX_INTR_VEC_ID     32
+
 enum rte_intr_handle_type {
 	RTE_INTR_HANDLE_UNKNOWN = 0,
 	RTE_INTR_HANDLE_UIO,          /**< uio device handle */
@@ -49,6 +51,8 @@ enum rte_intr_handle_type {
 	RTE_INTR_HANDLE_MAX
 };
 
+struct rte_epoll_event;
+
 /** Handle for interrupts. */
 struct rte_intr_handle {
 	union {
@@ -58,6 +62,12 @@ struct rte_intr_handle {
 	};
 	int fd;	 /**< interrupt event file descriptor */
 	enum rte_intr_handle_type type;  /**< handle type */
+	uint32_t max_intr;               /**< max interrupt requested */
+	uint32_t nb_efd;                 /**< number of available efds */
+	int efds[RTE_MAX_RXTX_INTR_VEC_ID];  /**< intr vectors/efds mapping */
+	struct rte_epoll_event *elist[RTE_MAX_RXTX_INTR_VEC_ID];
+					 /**< intr vector epoll event ptr */
+	int *intr_vec;                   /**< intr vector number array */
 };
 
 #endif /* _RTE_LINUXAPP_INTERRUPTS_H_ */
-- 
1.8.1.4