aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ethernet
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/ethernet')
-rwxr-xr-xsrc/vnet/ethernet/node.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/vnet/ethernet/node.c b/src/vnet/ethernet/node.c
index 29c0a5b9dee..cc27b6f5da9 100755
--- a/src/vnet/ethernet/node.c
+++ b/src/vnet/ethernet/node.c
@@ -842,18 +842,15 @@ eth_input_process_frame (vlib_main_t * vm, vlib_node_runtime_t * node,
u16 et_vlan = clib_host_to_net_u16 (ETHERNET_TYPE_VLAN);
u16 et_dot1ad = clib_host_to_net_u16 (ETHERNET_TYPE_DOT1AD);
i32 n_left = n_packets;
- vlib_buffer_t *b[20];
- u32 *from;
+ vlib_buffer_t *bufs[VLIB_FRAME_SIZE];
+ vlib_buffer_t **b = bufs;
ethernet_interface_t *ei = ethernet_get_interface (em, hi->hw_if_index);
- from = buffer_indices;
+ vlib_get_buffers (vm, buffer_indices, b, n_left);
while (n_left >= 20)
{
vlib_buffer_t **ph = b + 16, **pd = b + 8;
- vlib_get_buffers (vm, from, b, 4);
- vlib_get_buffers (vm, from + 8, pd, 4);
- vlib_get_buffers (vm, from + 16, ph, 4);
vlib_prefetch_buffer_header (ph[0], LOAD);
vlib_prefetch_buffer_data (pd[0], LOAD);
@@ -874,15 +871,14 @@ eth_input_process_frame (vlib_main_t * vm, vlib_node_runtime_t * node,
eth_input_adv_and_flags_x4 (b, main_is_l3);
/* next */
+ b += 4;
n_left -= 4;
etype += 4;
tag += 4;
dmac += 4;
- from += 4;
}
while (n_left >= 4)
{
- vlib_get_buffers (vm, from, b, 4);
eth_input_get_etype_and_tags (b, etype, tag, dmac, 0, dmac_check);
eth_input_get_etype_and_tags (b, etype, tag, dmac, 1, dmac_check);
eth_input_get_etype_and_tags (b, etype, tag, dmac, 2, dmac_check);
@@ -890,24 +886,23 @@ eth_input_process_frame (vlib_main_t * vm, vlib_node_runtime_t * node,
eth_input_adv_and_flags_x4 (b, main_is_l3);
/* next */
+ b += 4;
n_left -= 4;
etype += 4;
tag += 4;
dmac += 4;
- from += 4;
}
while (n_left)
{
- vlib_get_buffers (vm, from, b, 1);
eth_input_get_etype_and_tags (b, etype, tag, dmac, 0, dmac_check);
eth_input_adv_and_flags_x1 (b, main_is_l3);
/* next */
+ b += 1;
n_left -= 1;
etype += 1;
tag += 1;
dmac += 4;
- from += 1;
}
if (dmac_check)