diff options
Diffstat (limited to 'src/plugins/l3xc')
-rw-r--r-- | src/plugins/l3xc/FEATURE.yaml | 2 | ||||
-rw-r--r-- | src/plugins/l3xc/l3xc.c | 20 | ||||
-rw-r--r-- | src/plugins/l3xc/l3xc_api.c | 12 | ||||
-rw-r--r-- | src/plugins/l3xc/l3xc_node.c | 2 |
4 files changed, 10 insertions, 26 deletions
diff --git a/src/plugins/l3xc/FEATURE.yaml b/src/plugins/l3xc/FEATURE.yaml index 5086fee3c57..0ee8c0c2168 100644 --- a/src/plugins/l3xc/FEATURE.yaml +++ b/src/plugins/l3xc/FEATURE.yaml @@ -4,7 +4,7 @@ maintainer: Neale Ranns <nranns@cisco.com> features: - cross connect all ingress traffic on an L3 interface to an output FIB path. - the path can describe any output (with the exception of MPLS labels) - - The same functions can be acheived by using a dedicated VRF for the table + - The same functions can be achieved by using a dedicated VRF for the table and adding a default route with the same path. However, the L3XC is more efficient in memory and CPU diff --git a/src/plugins/l3xc/l3xc.c b/src/plugins/l3xc/l3xc.c index ac0e4cf0d2c..427c38e9ab5 100644 --- a/src/plugins/l3xc/l3xc.c +++ b/src/plugins/l3xc/l3xc.c @@ -67,11 +67,11 @@ l3xc_stack (l3xc_t * l3xc) */ dpo_id_t via_dpo = DPO_INVALID; - fib_path_list_contribute_forwarding (l3xc->l3xc_pl, - (FIB_PROTOCOL_IP4 == l3xc->l3xc_proto ? - FIB_FORW_CHAIN_TYPE_UNICAST_IP4 : - FIB_FORW_CHAIN_TYPE_UNICAST_IP6), - FIB_PATH_LIST_FWD_FLAG_NONE, &via_dpo); + fib_path_list_contribute_forwarding ( + l3xc->l3xc_pl, + (FIB_PROTOCOL_IP4 == l3xc->l3xc_proto ? FIB_FORW_CHAIN_TYPE_UNICAST_IP4 : + FIB_FORW_CHAIN_TYPE_UNICAST_IP6), + FIB_PATH_LIST_FWD_FLAG_COLLAPSE, &via_dpo); dpo_stack_from_node ((FIB_PROTOCOL_IP4 == l3xc->l3xc_proto ? l3xc_ip4_node.index : @@ -264,7 +264,6 @@ out: return (NULL); } -/* *INDENT-OFF* */ /** * Create an L3XC policy. */ @@ -274,7 +273,6 @@ VLIB_CLI_COMMAND (l3xc_cmd_node, static) = { .short_help = "l3xc [add|del] <INTERFACE> via ...", .is_mp_safe = 1, }; -/* *INDENT-ON* */ static u8 * format_l3xc (u8 * s, va_list * args) @@ -305,13 +303,11 @@ l3xc_walk (l3xc_walk_cb_t cb, void *ctx) { u32 l3xci; - /* *INDENT-OFF* */ pool_foreach_index (l3xci, l3xc_pool) { if (!cb(l3xci, ctx)) break; } - /* *INDENT-ON* */ } static clib_error_t * @@ -320,24 +316,20 @@ l3xc_show_cmd (vlib_main_t * vm, { l3xc_t *l3xc; - /* *INDENT-OFF* */ pool_foreach (l3xc, l3xc_pool) { vlib_cli_output(vm, "%U", format_l3xc, l3xc); } - /* *INDENT-ON* */ return (NULL); } -/* *INDENT-OFF* */ VLIB_CLI_COMMAND (l3xc_show_cmd_node, static) = { .path = "show l3xc", .function = l3xc_show_cmd, .short_help = "show l3xc", .is_mp_safe = 1, }; -/* *INDENT-ON* */ static fib_node_t * l3xc_get_node (fib_node_index_t index) @@ -381,7 +373,7 @@ static const fib_node_vft_t l3xc_vft = { static clib_error_t * l3xc_init (vlib_main_t * vm) { - l3xc_fib_node_type = fib_node_register_new_type (&l3xc_vft); + l3xc_fib_node_type = fib_node_register_new_type ("l3xc", &l3xc_vft); return (NULL); } diff --git a/src/plugins/l3xc/l3xc_api.c b/src/plugins/l3xc/l3xc_api.c index 847acaac331..f09100b3546 100644 --- a/src/plugins/l3xc/l3xc_api.c +++ b/src/plugins/l3xc/l3xc_api.c @@ -37,6 +37,7 @@ */ static u32 l3xc_base_msg_id; +#define REPLY_MSG_ID_BASE (l3xc_base_msg_id) #include <vlibapi/api_helper_macros.h> static void @@ -96,12 +97,7 @@ done: BAD_SW_IF_INDEX_LABEL; - /* *INDENT-OFF* */ - REPLY_MACRO2 (VL_API_L3XC_UPDATE_REPLY + l3xc_base_msg_id, - ({ - rmp->stats_index = 0; - })) - /* *INDENT-ON* */ + REPLY_MACRO2 (VL_API_L3XC_UPDATE_REPLY, ({ rmp->stats_index = 0; })) } static void @@ -116,7 +112,7 @@ vl_api_l3xc_del_t_handler (vl_api_l3xc_del_t * mp) BAD_SW_IF_INDEX_LABEL; - REPLY_MACRO (VL_API_L3XC_DEL_REPLY + l3xc_base_msg_id); + REPLY_MACRO (VL_API_L3XC_DEL_REPLY); } typedef struct l3xc_dump_walk_ctx_t_ @@ -213,12 +209,10 @@ l3xc_api_init (vlib_main_t * vm) VLIB_INIT_FUNCTION (l3xc_api_init); -/* *INDENT-OFF* */ VLIB_PLUGIN_REGISTER () = { .version = VPP_BUILD_VER, .description = "L3 Cross-Connect (L3XC)", }; -/* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON diff --git a/src/plugins/l3xc/l3xc_node.c b/src/plugins/l3xc/l3xc_node.c index 62db8c328b0..0f79bebeff9 100644 --- a/src/plugins/l3xc/l3xc_node.c +++ b/src/plugins/l3xc/l3xc_node.c @@ -199,7 +199,6 @@ static char *l3xc_error_strings[] = { #undef l3xc_error }; -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (l3xc_ip4_node) = { .function = l3xc_input_ip4, @@ -245,7 +244,6 @@ VNET_FEATURE_INIT (l3xc_ip6_feat, static) = .node_name = "l3xc-input-ip6", .runs_after = VNET_FEATURES ("acl-plugin-in-ip6-fa"), }; -/* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON |