aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/node_funcs.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2020-11-06 23:25:57 +0100
committerDamjan Marion <dmarion@me.com>2021-01-21 13:20:10 +0000
commit941005336ee8cec614a856089f3d873f7d98135c (patch)
tree2a9287e8a16cfbfecac80251637658a4cf93db66 /src/vlib/node_funcs.h
parent1e4309538dd178827fc2a5efb3ceb80a4b1f1a8f (diff)
interface: rx queue infra rework, part one
Type: improvement Change-Id: I4008cadfd5141f921afbdc09a3ebcd1dcf88eb29 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/node_funcs.h')
-rw-r--r--src/vlib/node_funcs.h31
1 files changed, 7 insertions, 24 deletions
diff --git a/src/vlib/node_funcs.h b/src/vlib/node_funcs.h
index b33f4960a90..a12aea4e462 100644
--- a/src/vlib/node_funcs.h
+++ b/src/vlib/node_funcs.h
@@ -47,6 +47,7 @@
#include <vppinfra/fifo.h>
#include <vppinfra/tw_timer_1t_3w_1024sl_ov.h>
+#include <vppinfra/interrupt.h>
#ifdef CLIB_SANITIZE_ADDR
#include <sanitizer/asan_interface.h>
@@ -224,37 +225,19 @@ vlib_node_get_state (vlib_main_t * vm, u32 node_index)
}
always_inline void
-vlib_node_set_interrupt_pending_with_data (vlib_main_t * vm, u32 node_index,
- u32 data)
+vlib_node_set_interrupt_pending (vlib_main_t *vm, u32 node_index)
{
vlib_node_main_t *nm = &vm->node_main;
vlib_node_t *n = vec_elt (nm->nodes, node_index);
- vlib_node_interrupt_t *i;
+
ASSERT (n->type == VLIB_NODE_TYPE_INPUT);
- if (vm == vlib_get_main ())
- {
- /* local thread */
- vec_add2 (nm->pending_local_interrupts, i, 1);
- i->node_runtime_index = n->runtime_index;
- i->data = data;
- }
+ if (vm != vlib_get_main ())
+ clib_interrupt_set_atomic (nm->interrupts, n->runtime_index);
else
- {
- /* remote thread */
- clib_spinlock_lock (&nm->pending_interrupt_lock);
- vec_add2 (nm->pending_remote_interrupts, i, 1);
- i->node_runtime_index = n->runtime_index;
- i->data = data;
- *nm->pending_remote_interrupts_notify = 1;
- clib_spinlock_unlock (&nm->pending_interrupt_lock);
- }
-}
+ clib_interrupt_set (nm->interrupts, n->runtime_index);
-always_inline void
-vlib_node_set_interrupt_pending (vlib_main_t * vm, u32 node_index)
-{
- vlib_node_set_interrupt_pending_with_data (vm, node_index, 0);
+ __atomic_store_n (nm->pending_interrupts, 1, __ATOMIC_RELEASE);
}
always_inline vlib_process_t *