- ipsec_main_t *im = &ipsec_main;
- u32 *from, n_left;
- vnet_interface_output_runtime_t *rd = (void *) node->runtime_data;
- const ipsec_tunnel_if_t *t0;
- vlib_buffer_t *bufs[VLIB_FRAME_SIZE], **b;
- u16 nexts[VLIB_FRAME_SIZE];
-
- from = vlib_frame_vector_args (frame);
- t0 = pool_elt_at_index (im->tunnel_interfaces, rd->dev_instance);
- n_left = frame->n_vectors;
- b = bufs;
-
- /* All going to encrypt */
- clib_memset (nexts, 0, sizeof (nexts));
-
- if (node->flags & VLIB_NODE_FLAG_TRACE)
- ipsec_output_trace (vm, node, frame, t0);
-
- vlib_get_buffers (vm, from, bufs, n_left);
-
- while (n_left >= 8)
- {
- /* Prefetch the buffer header for the N+2 loop iteration */
- vlib_prefetch_buffer_header (b[4], STORE);
- vlib_prefetch_buffer_header (b[5], STORE);
- vlib_prefetch_buffer_header (b[6], STORE);
- vlib_prefetch_buffer_header (b[7], STORE);
-
- vnet_buffer (b[0])->ipsec.sad_index = t0->output_sa_index;
- vnet_buffer (b[1])->ipsec.sad_index = t0->output_sa_index;
- vnet_buffer (b[2])->ipsec.sad_index = t0->output_sa_index;
- vnet_buffer (b[3])->ipsec.sad_index = t0->output_sa_index;
-
- n_left -= 4;
- b += 4;
- }
- while (n_left > 0)
- {
- vnet_buffer (b[0])->ipsec.sad_index = t0->output_sa_index;
-
- n_left -= 1;
- b += 1;
- }
-
- vlib_buffer_enqueue_to_next (vm, node, from, nexts, frame->n_vectors);