diff options
Diffstat (limited to 'vnet/vnet/ethernet/init.c')
-rw-r--r-- | vnet/vnet/ethernet/init.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/vnet/vnet/ethernet/init.c b/vnet/vnet/ethernet/init.c index 86597c4f66c..513d9c66c18 100644 --- a/vnet/vnet/ethernet/init.c +++ b/vnet/vnet/ethernet/init.c @@ -39,6 +39,7 @@ #include <vlib/vlib.h> #include <vnet/ethernet/ethernet.h> +#include <vnet/ip/ip.h> // for feature registration /* Global main structure. */ ethernet_main_t ethernet_main; @@ -60,6 +61,34 @@ add_type (ethernet_main_t * em, ethernet_type_t type, char *type_name) hash_set_mem (em->type_info_by_name, ti->name, i); } +static char *feature_start_nodes[] = { + "adj-midchain-tx-no-count", +}; + +/* Built-in ip4 tx feature path definition */ +/* *INDENT-OFF* */ +VNET_ETHERNET_TX_FEATURE_INIT (ethernet_tx_drop, static) = +{ + .node_name = "error-drop", + .runs_before = 0, /* not before any other features */ + .feature_index = ðernet_main.ethernet_tx_feature_drop, +}; +/* *INDENT-ON* */ + +static clib_error_t * +ethernet_feature_init (vlib_main_t * vm) +{ + ip_config_main_t *cm = ðernet_main.feature_config_mains[VNET_IP_TX_FEAT]; + vnet_config_main_t *vcm = &cm->config_main; + + return (ip_feature_init_cast (vm, cm, vcm, + feature_start_nodes, + ARRAY_LEN (feature_start_nodes), + ethernet_main.next_feature[VNET_IP_TX_FEAT], + ðernet_main.feature_nodes + [VNET_IP_TX_FEAT])); +} + static clib_error_t * ethernet_init (vlib_main_t * vm) { @@ -87,7 +116,7 @@ ethernet_init (vlib_main_t * vm) if ((error = vlib_call_init_function (vm, ethernet_input_init))) return error; - return error; + return (ethernet_feature_init (vm)); } VLIB_INIT_FUNCTION (ethernet_init); @@ -99,7 +128,6 @@ ethernet_get_main (vlib_main_t * vm) return ðernet_main; } - /* * fd.io coding-style-patch-verification: ON * |