[dpdk-dev,v6,2/8] eal/linux: add rx queue interrupt FDs to intr handle struct

Message ID 1425012976-10173-3-git-send-email-cunming.liang@intel.com (mailing list archive)
State Changes Requested, archived
Headers

Commit Message

Cunming Liang Feb. 27, 2015, 4:56 a.m. UTC
  Per vector event fd will store in rte_intr_handle during init.
Device drivers take responsibility to fill queue-vec mapping table(vec_num[]).

Signed-off-by: Danny Zhou <danny.zhou@intel.com>
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
---
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 | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Comments

David Marchand Feb. 27, 2015, 10:33 a.m. UTC | #1
Hello,

On Fri, Feb 27, 2015 at 5:56 AM, Cunming Liang <cunming.liang@intel.com>
wrote:

> Per vector event fd will store in rte_intr_handle during init.
> Device drivers take responsibility to fill queue-vec mapping
> table(vec_num[]).
>
> Signed-off-by: Danny Zhou <danny.zhou@intel.com>
> Signed-off-by: Cunming Liang <cunming.liang@intel.com>
> ---
> v6 changes:
>  - add mapping table between irq vector number and queue id.
>


> 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 6a159c7..9f45377 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,9 @@
>  #ifndef _RTE_LINUXAPP_INTERRUPTS_H_
>  #define _RTE_LINUXAPP_INTERRUPTS_H_
>
> +#define VFIO_MAX_RXTX_INTR_ID        32
> +#define VFIO_MAX_QUEUE_ID            VFIO_MAX_RXTX_INTR_ID
> +
>

This is a little weird to talk about vfio here.
This file is "generic".

Ok, you will store vfio eventfds here, but vfio is an implementation, not
the abstraction.
  

Patch

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 6a159c7..9f45377 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,9 @@ 
 #ifndef _RTE_LINUXAPP_INTERRUPTS_H_
 #define _RTE_LINUXAPP_INTERRUPTS_H_
 
+#define VFIO_MAX_RXTX_INTR_ID        32
+#define VFIO_MAX_QUEUE_ID            VFIO_MAX_RXTX_INTR_ID
+
 enum rte_intr_handle_type {
 	RTE_INTR_HANDLE_UNKNOWN = 0,
 	RTE_INTR_HANDLE_UIO,      /**< uio device handle */
@@ -48,6 +51,9 @@  enum rte_intr_handle_type {
 	RTE_INTR_HANDLE_MAX
 };
 
+#define RTE_INTR_EVENT_ADD            1UL
+#define	RTE_INTR_EVENT_DEL            2UL
+
 /** Handle for interrupts. */
 struct rte_intr_handle {
 	union {
@@ -57,6 +63,9 @@  struct rte_intr_handle {
 	};
 	int fd;	 /**< interrupt event file descriptor */
 	enum rte_intr_handle_type type;  /**< handle type */
+	int max_intr;                    /**< max interrupt requested */
+	int efds[VFIO_MAX_RXTX_INTR_ID]; /**< rxtx intr event fd for vfio */
+	uint32_t vec_num[VFIO_MAX_QUEUE_ID]; /**< rxtx intr vector number */
 };
 
 #endif /* _RTE_LINUXAPP_INTERRUPTS_H_ */