X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fethernet%2Finit.c;h=f78b65c7cc06a3deb598fc0fae213961e11c345c;hb=5fa4525543b212dd04b4f687722bf7feb1eeb6f9;hp=a4689593ad7f6a76062df4f2f37b72320332f278;hpb=756cd9441752fc8f84104c9ee19099506ba89f85;p=vpp.git diff --git a/src/vnet/ethernet/init.c b/src/vnet/ethernet/init.c index a4689593ad7..f78b65c7cc0 100644 --- a/src/vnet/ethernet/init.c +++ b/src/vnet/ethernet/init.c @@ -66,6 +66,7 @@ add_type (ethernet_main_t * em, ethernet_type_t type, char *type_name) VNET_FEATURE_ARC_INIT (ethernet_output, static) = { .arc_name = "ethernet-output", + .last_in_arc = "error-drop", .start_nodes = VNET_FEATURES ("adj-l2-midchain"), .arc_index_ptr = ðernet_main.output_feature_arc_index, }; @@ -82,35 +83,43 @@ static clib_error_t * ethernet_init (vlib_main_t * vm) { ethernet_main_t *em = ðernet_main; - clib_error_t *error; - - /* - * Set up the L2 path now, or we'll wipe out the L2 ARP - * registration set up by ethernet_arp_init. - */ - if ((error = vlib_call_init_function (vm, l2_init))) - return error; em->vlib_main = vm; em->type_info_by_name = hash_create_string (0, sizeof (uword)); em->type_info_by_type = hash_create (0, sizeof (uword)); + /* + * System default ethernet interface MTU, configure via ethernet_config in + * interface.c if desired. + */ + em->default_mtu = 9000; #define ethernet_type(n,s) add_type (em, ETHERNET_TYPE_##s, #s); #include "types.def" #undef ethernet_type - if ((error = vlib_call_init_function (vm, llc_init))) - 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; - + /* + * ethernet_input_init is effectively part of this function. + * Simply ensuring that it happens after we set up the hash tables + * is not sufficient. + */ + ethernet_input_init (vm, em); return 0; } -VLIB_INIT_FUNCTION (ethernet_init); +/* *INDENT-OFF* */ +VLIB_INIT_FUNCTION (ethernet_init) = +{ + /* + * Set up the L2 path before ethernet_init, or we'll wipe out the L2 ARP + * registration set up by ethernet_arp_init. + */ + .init_order = VLIB_INITS("l2_init", + "ethernet_init", + "llc_init", + "vnet_feature_init"), +}; +/* *INDENT-ON* */ ethernet_main_t * ethernet_get_main (vlib_main_t * vm)