summaryrefslogtreecommitdiffstats
path: root/src/vnet/l2tp
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2018-07-23 12:20:09 -0400
committerFlorin Coras <florin.coras@gmail.com>2018-07-23 18:28:43 +0000
commit66446b9888e7507929f1665fda0308b86fe7e70b (patch)
treebea830c3cf8735556a3c8809eb971e85d7cceadc /src/vnet/l2tp
parentcd30774fa9280736ffaea3e9a51948593e8eebc2 (diff)
Update pipeline.h: use vlib_get_buffers
It's not clear that fine-graind pipelining will ever produce optimal performance. That having been written, it's an easier coding model for folks interesting in decent results without having to manually implement 2 or 4 way fine-grained parallelism. Change-Id: Ida877292832eaf759ffbb6d2e16012f8fbd427e5 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vnet/l2tp')
-rw-r--r--src/vnet/l2tp/decap.c9
-rw-r--r--src/vnet/l2tp/encap.c9
2 files changed, 6 insertions, 12 deletions
diff --git a/src/vnet/l2tp/decap.c b/src/vnet/l2tp/decap.c
index 304862b5ee6..334f1feca4a 100644
--- a/src/vnet/l2tp/decap.c
+++ b/src/vnet/l2tp/decap.c
@@ -56,18 +56,16 @@ typedef enum
#define NSTAGES 3
static inline void
-stage0 (vlib_main_t * vm, vlib_node_runtime_t * node, u32 buffer_index)
+stage0 (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_buffer_t * b)
{
- vlib_buffer_t *b = vlib_get_buffer (vm, buffer_index);
vlib_prefetch_buffer_header (b, STORE);
/* l2tpv3 header is a long way away, need 2 cache lines */
CLIB_PREFETCH (b->data, 2 * CLIB_CACHE_LINE_BYTES, STORE);
}
static inline void
-stage1 (vlib_main_t * vm, vlib_node_runtime_t * node, u32 bi)
+stage1 (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_buffer_t * b)
{
- vlib_buffer_t *b = vlib_get_buffer (vm, bi);
l2t_main_t *lm = &l2t_main;
ip6_header_t *ip6 = vlib_buffer_get_current (b);
u32 session_index;
@@ -116,9 +114,8 @@ stage1 (vlib_main_t * vm, vlib_node_runtime_t * node, u32 bi)
}
static inline u32
-last_stage (vlib_main_t * vm, vlib_node_runtime_t * node, u32 bi)
+last_stage (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_buffer_t * b)
{
- vlib_buffer_t *b = vlib_get_buffer (vm, bi);
l2t_main_t *lm = &l2t_main;
ip6_header_t *ip6 = vlib_buffer_get_current (b);
vlib_node_t *n = vlib_get_node (vm, node->node_index);
diff --git a/src/vnet/l2tp/encap.c b/src/vnet/l2tp/encap.c
index dcdfde4b564..44641d99019 100644
--- a/src/vnet/l2tp/encap.c
+++ b/src/vnet/l2tp/encap.c
@@ -62,18 +62,16 @@ vlib_node_registration_t l2t_encap_node;
#define NSTAGES 3
static inline void
-stage0 (vlib_main_t * vm, vlib_node_runtime_t * node, u32 buffer_index)
+stage0 (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_buffer_t * b)
{
- vlib_buffer_t *b = vlib_get_buffer (vm, buffer_index);
vlib_prefetch_buffer_header (b, STORE);
CLIB_PREFETCH (b->data, 2 * CLIB_CACHE_LINE_BYTES, STORE);
}
static inline void
-stage1 (vlib_main_t * vm, vlib_node_runtime_t * node, u32 bi)
+stage1 (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_buffer_t * b)
{
l2tp_encap_runtime_t *rt = (void *) node->runtime_data;
- vlib_buffer_t *b = vlib_get_buffer (vm, bi);
vnet_hw_interface_t *hi;
u32 sw_if_index = vnet_buffer (b)->sw_if_index[VLIB_TX];
@@ -94,9 +92,8 @@ stage1 (vlib_main_t * vm, vlib_node_runtime_t * node, u32 bi)
}
static inline u32
-last_stage (vlib_main_t * vm, vlib_node_runtime_t * node, u32 bi)
+last_stage (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_buffer_t * b)
{
- vlib_buffer_t *b = vlib_get_buffer (vm, bi);
l2t_main_t *lm = &l2t_main;
vlib_node_t *n = vlib_get_node (vm, l2t_encap_node.index);
u32 node_counter_base_index = n->error_heap_index;