diff options
author | Damjan Marion <damarion@cisco.com> | 2020-06-03 12:20:41 +0200 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2020-06-03 13:21:57 +0000 |
commit | 1033b4997e4194e5172b7b12ddf638bfdfdaae22 (patch) | |
tree | 8e7d29685dee34f066688ae4ffe06b29a15f2c5b /src/vlib/node.h | |
parent | ec62d0a436be00bcc084a56548c8c7fa55b2cb61 (diff) |
vlib: improve node interrupt handling
- add ability to pass data together with interrupt
- avoid locking for local interrupts (same thread)
Type: improvement
Change-Id: I73a2ab2e716bb887a1f02c87788ae83e329f9b40
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/node.h')
-rw-r--r-- | src/vlib/node.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/vlib/node.h b/src/vlib/node.h index 1bdb3bb7797..ca7564a13e7 100644 --- a/src/vlib/node.h +++ b/src/vlib/node.h @@ -471,10 +471,6 @@ typedef struct vlib_node_runtime_t vlib_error_t *errors; /**< Vector of errors for this node. */ -#if __SIZEOF_POINTER__ == 4 - u8 pad[8]; -#endif - u32 clocks_since_last_overflow; /**< Number of clock cycles. */ u32 max_clock; /**< Maximum clock cycle for an @@ -512,6 +508,10 @@ typedef struct vlib_node_runtime_t u16 state; /**< Input node state. */ + u32 interrupt_data; /**< Data passed together with interrupt. + Valid only when state is + VLIB_NODE_STATE_INTERRUPT */ + u16 n_next_nodes; u16 cached_next_index; /**< Next frame index that vector @@ -676,6 +676,12 @@ vlib_timing_wheel_data_get_index (u32 d) typedef struct { + u32 node_runtime_index; + u32 data; +} vlib_node_interrupt_t; + +typedef struct +{ /* Public nodes. */ vlib_node_t **nodes; @@ -690,7 +696,8 @@ typedef struct vlib_node_runtime_t *nodes_by_type[VLIB_N_NODE_TYPE]; /* Node runtime indices for input nodes with pending interrupts. */ - u32 *pending_interrupt_node_runtime_indices; + vlib_node_interrupt_t *pending_local_interrupts; + vlib_node_interrupt_t *pending_remote_interrupts; clib_spinlock_t pending_interrupt_lock; /* Input nodes are switched from/to interrupt to/from polling mode |