aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2019-11-20 07:37:28 -0800
committerSteven Luong <sluong@cisco.com>2019-11-20 07:37:28 -0800
commitac0e98a67553747b823d8398896559bb07cafe3d (patch)
treec8a451e1fb6f9ded081831978ba9cfbcde464cd6 /src/vnet
parent187ddfb653aa24246f30851715b9439972a1c3ba (diff)
vlib: convert frame_index into real pointers
The fast path almost always has to deal with the real pointers. Deriving the frame pointer from a frame_index requires a load of the 32bit frame_index from memory, another 64bit load of the heap base pointer and some calculations. Lets store the full pointer instead and do a single 64bit load only. This helps avoiding problems when the heap is grown and frames are allocated below vm->heap_aligned_base. Type: refactor Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I616fe3fbe501c4e2205cd74840eb95c550603508
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/devices/virtio/vhost_user_input.c2
-rw-r--r--src/vnet/pg/input.c2
-rw-r--r--src/vnet/unix/gdb_funcs.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/src/vnet/devices/virtio/vhost_user_input.c b/src/vnet/devices/virtio/vhost_user_input.c
index 08fc3b1521a..fdfe51356bb 100644
--- a/src/vnet/devices/virtio/vhost_user_input.c
+++ b/src/vnet/devices/virtio/vhost_user_input.c
@@ -396,7 +396,7 @@ vhost_user_if_input (vlib_main_t * vm,
vlib_frame_t *f;
ethernet_input_frame_t *ef;
nf = vlib_node_runtime_get_next_frame (vm, node, next_index);
- f = vlib_get_frame (vm, nf->frame_index);
+ f = vlib_get_frame (vm, nf->frame);
f->flags = ETH_INPUT_FRAME_F_SINGLE_SW_IF_IDX;
ef = vlib_frame_scalar_args (f);
diff --git a/src/vnet/pg/input.c b/src/vnet/pg/input.c
index b69bbab5d83..f4c20a19824 100644
--- a/src/vnet/pg/input.c
+++ b/src/vnet/pg/input.c
@@ -1570,7 +1570,7 @@ pg_generate_packets (vlib_node_runtime_t * node,
pg_interface_t *pi;
vlib_get_new_next_frame (vm, node, next_index, to_next, n_left);
nf = vlib_node_runtime_get_next_frame (vm, node, next_index);
- f = vlib_get_frame (vm, nf->frame_index);
+ f = vlib_get_frame (vm, nf->frame);
f->flags = ETH_INPUT_FRAME_F_SINGLE_SW_IF_IDX;
ef = vlib_frame_scalar_args (f);
diff --git a/src/vnet/unix/gdb_funcs.c b/src/vnet/unix/gdb_funcs.c
index d78773edf07..609f4c4ac9b 100644
--- a/src/vnet/unix/gdb_funcs.c
+++ b/src/vnet/unix/gdb_funcs.c
@@ -111,8 +111,8 @@ vlib_dump_frame_ownership (void)
nm->nodes[this_node_runtime->node_index]->name,
index - first_nf_index,
nm->nodes[owned_runtime->node_index]->name);
- fformat (stderr, " nf index %d nf->frame_index %d\n",
- nf - vm->node_main.next_frames, nf->frame_index);
+ fformat (stderr, " nf index %d nf->frame %p\n",
+ nf - vm->node_main.next_frames, nf->frame);
}
}
}