Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
docs: Improve new plugin doc & add govpp API doc
[vpp.git]
/
src
/
vnet
/
l2
/
l2_input_classify.c
diff --git
a/src/vnet/l2/l2_input_classify.c
b/src/vnet/l2/l2_input_classify.c
index
ee8042a
..
ffd1078
100644
(file)
--- a/
src/vnet/l2/l2_input_classify.c
+++ b/
src/vnet/l2/l2_input_classify.c
@@
-67,10
+67,12
@@
format_l2_input_classify_trace (u8 * s, va_list * args)
return s;
}
return s;
}
+extern l2_input_classify_main_t l2_input_classify_main;
+
+#ifndef CLIB_MARCH_VARIANT
/** l2 input classifier main data structure. */
l2_input_classify_main_t l2_input_classify_main;
/** l2 input classifier main data structure. */
l2_input_classify_main_t l2_input_classify_main;
-
-vlib_node_registration_t l2_input_classify_node;
+#endif /* CLIB_MARCH_VARIANT */
#define foreach_l2_input_classify_error \
_(MISS, "Classify misses") \
#define foreach_l2_input_classify_error \
_(MISS, "Classify misses") \
@@
-142,9
+144,9
@@
static char *l2_input_classify_error_strings[] = {
* Classifier hits in other than the first table
*/
* Classifier hits in other than the first table
*/
-static uword
-
l2_input_classify_node_fn (vlib_main_t * vm
,
-
vlib_node_runtime_t * node,
vlib_frame_t * frame)
+VLIB_NODE_FN (l2_input_classify_node) (vlib_main_t * vm,
+
vlib_node_runtime_t * node
,
+
vlib_frame_t * frame)
{
u32 n_left_from, *from, *to_next;
l2_input_classify_next_t next_index;
{
u32 n_left_from, *from, *to_next;
l2_input_classify_next_t next_index;
@@
-167,7
+169,7
@@
l2_input_classify_node_fn (vlib_main_t * vm,
/* First pass: compute hash */
/* First pass: compute hash */
- while (n_left_from >
2
)
+ while (n_left_from >
= 4
)
{
vlib_buffer_t *b0, *b1;
u32 bi0, bi1;
{
vlib_buffer_t *b0, *b1;
u32 bi0, bi1;
@@
-182,15
+184,15
@@
l2_input_classify_node_fn (vlib_main_t * vm,
/* prefetch next iteration */
{
/* prefetch next iteration */
{
- vlib_buffer_t *p
1, *p2
;
+ vlib_buffer_t *p
2, *p3
;
- p1 = vlib_get_buffer (vm, from[1]);
p2 = vlib_get_buffer (vm, from[2]);
p2 = vlib_get_buffer (vm, from[2]);
+ p3 = vlib_get_buffer (vm, from[3]);
- vlib_prefetch_buffer_header (p1, STORE);
- CLIB_PREFETCH (p1->data, CLIB_CACHE_LINE_BYTES, STORE);
vlib_prefetch_buffer_header (p2, STORE);
CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, STORE);
vlib_prefetch_buffer_header (p2, STORE);
CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, STORE);
+ vlib_prefetch_buffer_header (p3, STORE);
+ CLIB_PREFETCH (p3->data, CLIB_CACHE_LINE_BYTES, STORE);
}
bi0 = from[0];
}
bi0 = from[0];
@@
-443,7
+445,6
@@
l2_input_classify_node_fn (vlib_main_t * vm,
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (l2_input_classify_node) = {
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (l2_input_classify_node) = {
- .function = l2_input_classify_node_fn,
.name = "l2-input-classify",
.vector_size = sizeof (u32),
.format_trace = format_l2_input_classify_trace,
.name = "l2-input-classify",
.vector_size = sizeof (u32),
.format_trace = format_l2_input_classify_trace,
@@
-467,9
+468,7
@@
VLIB_REGISTER_NODE (l2_input_classify_node) = {
};
/* *INDENT-ON* */
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (l2_input_classify_node,
- l2_input_classify_node_fn);
-
+#ifndef CLIB_MARCH_VARIANT
/** l2 input classsifier feature initialization. */
clib_error_t *
l2_input_classify_init (vlib_main_t * vm)
/** l2 input classsifier feature initialization. */
clib_error_t *
l2_input_classify_init (vlib_main_t * vm)
@@
-577,6
+576,7
@@
vnet_l2_input_classify_set_tables (u32 sw_if_index,
return 0;
}
return 0;
}
+#endif /* CLIB_MARCH_VARIANT */
static clib_error_t *
int_l2_input_classify_command_fn (vlib_main_t * vm,
static clib_error_t *
int_l2_input_classify_command_fn (vlib_main_t * vm,