aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/l2/l2_rw.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-11-18 23:48:43 +0100
committerDamjan Marion <damarion@cisco.com>2018-11-18 23:48:43 +0100
commitd30bf015ad3f7fbf206f143ed5d47a9af25148e8 (patch)
treeb9daeff94c260bd2b0df2b1b68f8bc74ce38c4ff /src/vnet/l2/l2_rw.c
parent384a336849e031883425532029458d0f89a08c09 (diff)
add vlib_prefetch_buffer_data(...) macro
Change-Id: Iba750a41262cc028ad0363fff78cc219e4a33538 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/l2/l2_rw.c')
-rw-r--r--src/vnet/l2/l2_rw.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/vnet/l2/l2_rw.c b/src/vnet/l2/l2_rw.c
index 5b0034ca43e..ac83483002a 100644
--- a/src/vnet/l2/l2_rw.c
+++ b/src/vnet/l2/l2_rw.c
@@ -164,7 +164,6 @@ l2_rw_node_fn (vlib_main_t * vm,
u32 n_left_from, *from, *to_next, next_index;
vnet_classify_main_t *vcm = &vnet_classify_main;
f64 now = vlib_time_now (vlib_get_main ());
- u32 prefetch_size = 0;
from = vlib_frame_vector_args (frame);
n_left_from = frame->n_vectors; /* number of packets to process */
@@ -177,7 +176,7 @@ l2_rw_node_fn (vlib_main_t * vm,
/* get space to enqueue frame to graph node "next_index" */
vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
- while (n_left_from >= 4 && n_left_to_next >= 2)
+ while (n_left_from >= 6 && n_left_to_next >= 2)
{
u32 bi0, next0, sw_if_index0, rwe_index0;
u32 bi1, next1, sw_if_index1, rwe_index1;
@@ -190,14 +189,16 @@ l2_rw_node_fn (vlib_main_t * vm,
l2_rw_entry_t *rwe0, *rwe1;
{
- vlib_buffer_t *p2, *p3;
+ vlib_buffer_t *p2, *p3, *p4, *p5;
p2 = vlib_get_buffer (vm, from[2]);
p3 = vlib_get_buffer (vm, from[3]);
+ p4 = vlib_get_buffer (vm, from[4]);
+ p5 = vlib_get_buffer (vm, from[5]);
- vlib_prefetch_buffer_header (p2, LOAD);
- vlib_prefetch_buffer_header (p3, LOAD);
- CLIB_PREFETCH (vlib_buffer_get_current (p2), prefetch_size, LOAD);
- CLIB_PREFETCH (vlib_buffer_get_current (p3), prefetch_size, LOAD);
+ vlib_prefetch_buffer_header (p4, LOAD);
+ vlib_prefetch_buffer_header (p5, LOAD);
+ vlib_prefetch_buffer_data (p2, LOAD);
+ vlib_prefetch_buffer_data (p3, LOAD);
}
bi0 = from[0];
@@ -220,8 +221,6 @@ l2_rw_node_fn (vlib_main_t * vm,
config1 = l2_rw_get_config (sw_if_index1); /*TODO: check sw_if_index0 value */
t0 = pool_elt_at_index (vcm->tables, config0->table_index);
t1 = pool_elt_at_index (vcm->tables, config1->table_index);
- prefetch_size =
- (t1->skip_n_vectors + t1->match_n_vectors) * sizeof (u32x4);
hash0 = vnet_classify_hash_packet (t0, (u8 *) h0);
hash1 = vnet_classify_hash_packet (t1, (u8 *) h1);