X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=vnet%2Fvnet%2Fethernet%2Finit.c;h=2d20adc96101c437be022c6f8812b8664a9e56d5;hb=436d06b1c7d00e8c30ab055560724285a017290b;hp=86597c4f66ca2defb70b25b5339548e2bf51261e;hpb=607de1a0638fa45db49295f9ed51a7f9a5e38706;p=vpp.git diff --git a/vnet/vnet/ethernet/init.c b/vnet/vnet/ethernet/init.c index 86597c4f66c..2d20adc9610 100644 --- a/vnet/vnet/ethernet/init.c +++ b/vnet/vnet/ethernet/init.c @@ -39,6 +39,7 @@ #include #include +#include // for feature registration /* Global main structure. */ ethernet_main_t ethernet_main; @@ -60,6 +61,23 @@ add_type (ethernet_main_t * em, ethernet_type_t type, char *type_name) hash_set_mem (em->type_info_by_name, ti->name, i); } +/* Built-in ip4 tx feature path definition */ +/* *INDENT-OFF* */ +VNET_FEATURE_ARC_INIT (ethernet_output, static) = +{ + .arc_name = "ethernet-output", + .start_nodes = VNET_FEATURES ("adj-l2-midchain"), + .arc_index_ptr = ðernet_main.output_feature_arc_index, +}; + +VNET_FEATURE_INIT (ethernet_tx_drop, static) = +{ + .arc_name = "ethernet-output", + .node_name = "error-drop", + .runs_before = 0, /* not before any other features */ +}; +/* *INDENT-ON* */ + static clib_error_t * ethernet_init (vlib_main_t * vm) { @@ -86,8 +104,10 @@ ethernet_init (vlib_main_t * vm) return error; if ((error = vlib_call_init_function (vm, ethernet_input_init))) return error; + if ((error = vlib_call_init_function (vm, vnet_feature_init))) + return error; - return error; + return 0; } VLIB_INIT_FUNCTION (ethernet_init); @@ -99,7 +119,6 @@ ethernet_get_main (vlib_main_t * vm) return ðernet_main; } - /* * fd.io coding-style-patch-verification: ON *