X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fbonding%2Fnode.c;h=d9450692138a24fa191d305af701e463861434f2;hb=d30bf015ad3f7fbf206f143ed5d47a9af25148e8;hp=9479fe98dd0d88a125e6e259b038086b1ae3bc24;hpb=f264f0831f2106cf5f5436bf6b08c45a6c86f2f5;p=vpp.git diff --git a/src/vnet/bonding/node.c b/src/vnet/bonding/node.c index 9479fe98dd0..d9450692138 100644 --- a/src/vnet/bonding/node.c +++ b/src/vnet/bonding/node.c @@ -36,7 +36,6 @@ typedef enum BOND_INPUT_N_ERROR, } bond_input_error_t; -#ifndef CLIB_MARCH_VARIANT static char *bond_input_error_strings[] = { #define _(n,s) s, foreach_bond_input_error @@ -60,14 +59,12 @@ format_bond_input_trace (u8 * s, va_list * args) return s; } -#endif - typedef enum { BOND_INPUT_NEXT_DROP, BOND_INPUT_N_NEXT, -} l2output_next_t; +} bond_output_next_t; static_always_inline u8 packet_is_cdp (ethernet_header_t * eth) @@ -138,7 +135,7 @@ bond_update_next (vlib_main_t * vm, vlib_node_runtime_t * node, u32 * bond_sw_if_index, vlib_buffer_t * b, u32 * next_index, vlib_error_t * error) { - u16 thread_index = vlib_get_thread_index (); + u16 thread_index = vm->thread_index; slave_if_t *sif; bond_if_t *bif; @@ -169,14 +166,14 @@ bond_update_next (vlib_main_t * vm, vlib_node_runtime_t * node, *bond_sw_if_index = bif->sw_if_index; *error = 0; - vnet_feature_next ( /* not used */ 0, next_index, b); + vnet_feature_next (next_index, b); } VLIB_NODE_FN (bond_input_node) (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { - u16 thread_index = vlib_get_thread_index (); + u16 thread_index = vm->thread_index; u32 *from, n_left; vlib_buffer_t *bufs[VLIB_FRAME_SIZE], **b; u32 sw_if_indices[VLIB_FRAME_SIZE], *sw_if_index; @@ -205,14 +202,10 @@ VLIB_NODE_FN (bond_input_node) (vlib_main_t * vm, /* Prefetch next iteration */ if (PREDICT_TRUE (n_left >= 16)) { - CLIB_PREFETCH (vlib_buffer_get_current (b[8]), - CLIB_CACHE_LINE_BYTES, LOAD); - CLIB_PREFETCH (vlib_buffer_get_current (b[9]), - CLIB_CACHE_LINE_BYTES, LOAD); - CLIB_PREFETCH (vlib_buffer_get_current (b[10]), - CLIB_CACHE_LINE_BYTES, LOAD); - CLIB_PREFETCH (vlib_buffer_get_current (b[11]), - CLIB_CACHE_LINE_BYTES, LOAD); + vlib_prefetch_buffer_data (b[8], LOAD); + vlib_prefetch_buffer_data (b[9], LOAD); + vlib_prefetch_buffer_data (b[10], LOAD); + vlib_prefetch_buffer_data (b[11], LOAD); vlib_prefetch_buffer_header (b[12], LOAD); vlib_prefetch_buffer_header (b[13], LOAD); @@ -329,7 +322,6 @@ VLIB_NODE_FN (bond_input_node) (vlib_main_t * vm, n_left = frame->n_vectors; /* number of packets to process */ b = bufs; sw_if_index = sw_if_indices; - next = nexts; bond_packet_trace_t *t0; while (n_left) @@ -338,15 +330,14 @@ VLIB_NODE_FN (bond_input_node) (vlib_main_t * vm, { t0 = vlib_add_trace (vm, node, b[0], sizeof (*t0)); t0->sw_if_index = sw_if_index[0]; - clib_memcpy (&t0->ethernet, vlib_buffer_get_current (b[0]), - sizeof (ethernet_header_t)); + clib_memcpy_fast (&t0->ethernet, vlib_buffer_get_current (b[0]), + sizeof (ethernet_header_t)); t0->bond_sw_if_index = vnet_buffer (b[0])->sw_if_index[VLIB_RX]; } /* next */ n_left--; b++; sw_if_index++; - next++; } } @@ -362,7 +353,6 @@ VLIB_NODE_FN (bond_input_node) (vlib_main_t * vm, return frame->n_vectors; } -#ifndef CLIB_MARCH_VARIANT static clib_error_t * bond_input_init (vlib_main_t * vm) { @@ -459,7 +449,6 @@ bond_hw_interface_up_down (vnet_main_t * vnm, u32 hw_if_index, u32 flags) } VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION (bond_hw_interface_up_down); -#endif /* * fd.io coding-style-patch-verification: ON