37 #error files which #include <vnet/pipeline.h> must define NSTAGES 41 #define STAGE_INLINE inline 73 u32 n_left_from, n_left_to_next, * to_next, next_index, next0;
79 while (n_left_from > 0)
83 pi_limit =
clib_min (n_left_from, n_left_to_next);
85 for (pi = 0; pi <
NSTAGES-1; pi++)
89 stage0 (vm, node, from[pi]);
92 for (; pi < pi_limit; pi++)
94 stage0 (vm, node, from[pi]);
95 to_next[0] = from [pi - 1];
100 to_next, n_left_to_next,
101 from[pi - 1], next0);
103 if ((
int) n_left_to_next < 0 && n_left_from > 0)
108 for (; pi < (pi_limit + (NSTAGES-1)); pi++)
110 if (((pi - 1) >= 0) && ((pi - 1) < pi_limit))
112 to_next[0] = from [pi - 1];
117 to_next, n_left_to_next,
118 from[pi - 1], next0);
120 if ((
int) n_left_to_next < 0 && n_left_from > 0)
139 u32 n_left_from, n_left_to_next, * to_next, next_index, next0;
145 while (n_left_from > 0)
149 pi_limit =
clib_min (n_left_from, n_left_to_next);
151 for (pi = 0; pi <
NSTAGES-1; pi++)
155 stage0 (vm, node, from[pi]);
157 stage1 (vm, node, from[pi-1]);
160 for (; pi < pi_limit; pi++)
162 stage0 (vm, node, from[pi]);
163 stage1 (vm, node, from[pi-1]);
164 to_next[0] = from [pi - 2];
169 to_next, n_left_to_next,
170 from[pi - 2], next0);
172 if ((
int) n_left_to_next < 0 && n_left_from > 0)
178 for (; pi < (pi_limit + (NSTAGES-1)); pi++)
180 if (((pi - 1) >= 0) && ((pi - 1) < pi_limit))
181 stage1 (vm, node, from[pi-1]);
182 if (((pi - 2) >= 0) && ((pi - 2) < pi_limit))
184 to_next[0] = from[pi - 2];
189 to_next, n_left_to_next,
190 from[pi - 2], next0);
192 if ((
int) n_left_to_next < 0 && n_left_from > 0)
212 u32 n_left_from, n_left_to_next, * to_next, next_index, next0;
218 while (n_left_from > 0)
222 pi_limit =
clib_min (n_left_from, n_left_to_next);
224 for (pi = 0; pi <
NSTAGES-1; pi++)
228 stage0 (vm, node, from[pi]);
230 stage1 (vm, node, from[pi-1]);
232 stage2 (vm, node, from[pi-2]);
235 for (; pi < pi_limit; pi++)
237 stage0 (vm, node, from[pi]);
238 stage1 (vm, node, from[pi-1]);
239 stage2 (vm, node, from[pi-2]);
240 to_next[0] = from [pi - 3];
245 to_next, n_left_to_next,
246 from[pi - 3], next0);
248 if ((
int) n_left_to_next < 0 && n_left_from > 0)
254 for (; pi < (pi_limit + (NSTAGES-1)); pi++)
256 if (((pi - 1) >= 0) && ((pi - 1) < pi_limit))
257 stage1 (vm, node, from[pi-1]);
258 if (((pi - 2) >= 0) && ((pi - 2) < pi_limit))
259 stage2 (vm, node, from[pi-2]);
260 if (((pi - 3) >= 0) && ((pi - 3) < pi_limit))
262 to_next[0] = from[pi - 3];
267 to_next, n_left_to_next,
268 from[pi - 3], next0);
270 if ((
int) n_left_to_next < 0 && n_left_from > 0)
291 u32 n_left_from, n_left_to_next, * to_next, next_index, next0;
297 while (n_left_from > 0)
301 pi_limit =
clib_min (n_left_from, n_left_to_next);
303 for (pi = 0; pi <
NSTAGES-1; pi++)
307 stage0 (vm, node, from[pi]);
309 stage1 (vm, node, from[pi-1]);
311 stage2 (vm, node, from[pi-2]);
313 stage3 (vm, node, from[pi-3]);
316 for (; pi < pi_limit; pi++)
318 stage0 (vm, node, from[pi]);
319 stage1 (vm, node, from[pi-1]);
320 stage2 (vm, node, from[pi-2]);
321 stage3 (vm, node, from[pi-3]);
322 to_next[0] = from [pi - 4];
327 to_next, n_left_to_next,
328 from[pi - 4], next0);
330 if ((
int) n_left_to_next < 0 && n_left_from > 0)
336 for (; pi < (pi_limit + (NSTAGES-1)); pi++)
338 if (((pi - 1) >= 0) && ((pi - 1) < pi_limit))
339 stage1 (vm, node, from[pi-1]);
340 if (((pi - 2) >= 0) && ((pi - 2) < pi_limit))
341 stage2 (vm, node, from[pi - 2]);
342 if (((pi - 3) >= 0) && ((pi - 3) < pi_limit))
343 stage3 (vm, node, from[pi - 3]);
344 if (((pi - 4) >= 0) && ((pi - 4) < pi_limit))
346 to_next[0] = from[pi - 4];
351 to_next, n_left_to_next,
352 from[pi - 4], next0);
354 if ((
int) n_left_to_next < 0 && n_left_from > 0)
374 u32 n_left_from, n_left_to_next, * to_next, next_index, next0;
380 while (n_left_from > 0)
384 pi_limit =
clib_min (n_left_from, n_left_to_next);
386 for (pi = 0; pi <
NSTAGES-1; pi++)
390 stage0 (vm, node, from[pi]);
392 stage1 (vm, node, from[pi-1]);
394 stage2 (vm, node, from[pi-2]);
396 stage3 (vm, node, from[pi-3]);
398 stage4 (vm, node, from[pi-4]);
401 for (; pi < pi_limit; pi++)
403 stage0 (vm, node, from[pi]);
404 stage1 (vm, node, from[pi-1]);
405 stage2 (vm, node, from[pi-2]);
406 stage3 (vm, node, from[pi-3]);
407 stage4 (vm, node, from[pi-4]);
408 to_next[0] = from [pi - 5];
413 to_next, n_left_to_next,
414 from[pi - 5], next0);
416 if ((
int) n_left_to_next < 0 && n_left_from > 0)
422 for (; pi < (pi_limit + (NSTAGES-1)); pi++)
424 if (((pi - 1) >= 0) && ((pi - 1) < pi_limit))
425 stage1 (vm, node, from[pi-1]);
426 if (((pi - 2) >= 0) && ((pi - 2) < pi_limit))
427 stage2 (vm, node, from[pi - 2]);
428 if (((pi - 3) >= 0) && ((pi - 3) < pi_limit))
429 stage3 (vm, node, from[pi - 3]);
430 if (((pi - 4) >= 0) && ((pi - 4) < pi_limit))
431 stage4 (vm, node, from[pi - 4]);
432 if (((pi - 5) >= 0) && ((pi - 5) < pi_limit))
434 to_next[0] = from[pi - 5];
439 to_next, n_left_to_next,
440 from[pi - 5], next0);
442 if ((
int) n_left_to_next < 0 && n_left_from > 0)
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
static u32 last_stage(vlib_main_t *vm, vlib_node_runtime_t *node, u32 bi)
always_inline void * vlib_frame_vector_args(vlib_frame_t *f)
static void stage1(vlib_main_t *vm, vlib_node_runtime_t *node, u32 bi)
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
#define CLIB_PREFETCH(addr, size, type)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
#define CLIB_CACHE_LINE_BYTES
always_inline vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static STAGE_INLINE void generic_stage0(vlib_main_t *vm, vlib_node_runtime_t *node, u32 buffer_index)