diff options
author | Neale Ranns <nranns@cisco.com> | 2019-07-19 11:44:53 +0000 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-07-24 14:42:27 +0000 |
commit | 1dbcf30b7d9691e9223c71c5fa594e7831e4ea32 (patch) | |
tree | d722f71afdac2ef8e86be5501e5fd89fc41e6364 /src/vnet/fib | |
parent | 1e5ca9b918dfe988eb0247ec35fc188bfabb4dcb (diff) |
fib: Support the POP of a Psuedo Wire Control Word
Type: feature
Change-Id: Ib24547a7c4c73ceb5383d1ca8f14ec40e6a90f01
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/fib')
-rw-r--r-- | src/vnet/fib/fib_api.c | 2 | ||||
-rw-r--r-- | src/vnet/fib/fib_path.c | 13 | ||||
-rw-r--r-- | src/vnet/fib/fib_path.h | 8 | ||||
-rw-r--r-- | src/vnet/fib/fib_types.api | 6 | ||||
-rw-r--r-- | src/vnet/fib/fib_types.c | 4 | ||||
-rw-r--r-- | src/vnet/fib/fib_types.h | 5 |
6 files changed, 35 insertions, 3 deletions
diff --git a/src/vnet/fib/fib_api.c b/src/vnet/fib/fib_api.c index e776235bc00..e020b26fd6e 100644 --- a/src/vnet/fib/fib_api.c +++ b/src/vnet/fib/fib_api.c @@ -186,6 +186,8 @@ fib_api_path_decode (vl_api_fib_path_t *in, out->frp_flags |= FIB_ROUTE_PATH_RESOLVE_VIA_HOST; if (in->flags & FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED) out->frp_flags |= FIB_ROUTE_PATH_RESOLVE_VIA_ATTACHED; + if (in->flags & FIB_API_PATH_FLAG_POP_PW_CW) + out->frp_flags |= FIB_ROUTE_PATH_POP_PW_CW; switch (in->type) { diff --git a/src/vnet/fib/fib_path.c b/src/vnet/fib/fib_path.c index eebba1b1548..ed7bc0262fc 100644 --- a/src/vnet/fib/fib_path.c +++ b/src/vnet/fib/fib_path.c @@ -26,6 +26,7 @@ #include <vnet/dpo/dvr_dpo.h> #include <vnet/dpo/ip_null_dpo.h> #include <vnet/dpo/classify_dpo.h> +#include <vnet/dpo/pw_cw.h> #include <vnet/adj/adj.h> #include <vnet/adj/adj_mcast.h> @@ -1233,6 +1234,8 @@ fib_path_route_flags_to_cfg_flags (const fib_route_path_t *rpath) { fib_path_cfg_flags_t cfg_flags = FIB_PATH_CFG_FLAG_NONE; + if (rpath->frp_flags & FIB_ROUTE_PATH_POP_PW_CW) + cfg_flags |= FIB_PATH_CFG_FLAG_POP_PW_CW; if (rpath->frp_flags & FIB_ROUTE_PATH_RESOLVE_VIA_HOST) cfg_flags |= FIB_PATH_CFG_FLAG_RESOLVE_HOST; if (rpath->frp_flags & FIB_ROUTE_PATH_RESOLVE_VIA_ATTACHED) @@ -2381,6 +2384,16 @@ fib_path_stack_mpls_disp (fib_node_index_t path_index, case FIB_PATH_TYPE_DVR: break; } + + if (path->fp_cfg_flags & FIB_PATH_CFG_FLAG_POP_PW_CW) + { + dpo_id_t tmp = DPO_INVALID; + + dpo_copy(&tmp, dpo); + + pw_cw_dpo_create(&tmp, dpo); + dpo_reset(&tmp); + } } void diff --git a/src/vnet/fib/fib_path.h b/src/vnet/fib/fib_path.h index 50aca9e1cf5..76f876d8f10 100644 --- a/src/vnet/fib/fib_path.h +++ b/src/vnet/fib/fib_path.h @@ -96,9 +96,13 @@ typedef enum fib_path_cfg_attribute_t_ { */ FIB_PATH_CFG_ATTRIBUTE_DEAG_SRC, /** + * The path pops a Psuedo Wire Control Word + */ + FIB_PATH_CFG_ATTRIBUTE_POP_PW_CW, + /** * Marker. Add new types before this one, then update it. */ - FIB_PATH_CFG_ATTRIBUTE_LAST = FIB_PATH_CFG_ATTRIBUTE_DEAG_SRC, + FIB_PATH_CFG_ATTRIBUTE_LAST = FIB_PATH_CFG_ATTRIBUTE_POP_PW_CW, } __attribute__ ((packed)) fib_path_cfg_attribute_t; /** @@ -119,6 +123,7 @@ typedef enum fib_path_cfg_attribute_t_ { [FIB_PATH_CFG_ATTRIBUTE_INTF_RX] = "interface-rx", \ [FIB_PATH_CFG_ATTRIBUTE_RPF_ID] = "rpf-id", \ [FIB_PATH_CFG_ATTRIBUTE_DEAG_SRC] = "deag-src", \ + [FIB_PATH_CFG_ATTRIBUTE_POP_PW_CW] = "pop-pw-cw", \ } #define FOR_EACH_FIB_PATH_CFG_ATTRIBUTE(_item) \ @@ -143,6 +148,7 @@ typedef enum fib_path_cfg_flags_t_ { FIB_PATH_CFG_FLAG_INTF_RX = (1 << FIB_PATH_CFG_ATTRIBUTE_INTF_RX), FIB_PATH_CFG_FLAG_RPF_ID = (1 << FIB_PATH_CFG_ATTRIBUTE_RPF_ID), FIB_PATH_CFG_FLAG_DEAG_SRC = (1 << FIB_PATH_CFG_ATTRIBUTE_DEAG_SRC), + FIB_PATH_CFG_FLAG_POP_PW_CW = (1 << FIB_PATH_CFG_ATTRIBUTE_POP_PW_CW), } __attribute__ ((packed)) fib_path_cfg_flags_t; typedef enum fib_path_format_flags_t_ diff --git a/src/vnet/fib/fib_types.api b/src/vnet/fib/fib_types.api index 9073192c3c4..4a5cea79064 100644 --- a/src/vnet/fib/fib_types.api +++ b/src/vnet/fib/fib_types.api @@ -44,9 +44,11 @@ enum fib_path_flags { FIB_API_PATH_FLAG_NONE = 0, /* the path must resolve via an attached route */ - FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED, + FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED = 1, /* the path must resolve via a host route */ - FIB_API_PATH_FLAG_RESOLVE_VIA_HOST, + FIB_API_PATH_FLAG_RESOLVE_VIA_HOST = 2, + /* pop a Pseudo Wire Control Word as well */ + FIB_API_PATH_FLAG_POP_PW_CW = 4, }; /* \brief A description of the 'next-hop' for a path diff --git a/src/vnet/fib/fib_types.c b/src/vnet/fib/fib_types.c index 4b1280f6fa8..386aece8753 100644 --- a/src/vnet/fib/fib_types.c +++ b/src/vnet/fib/fib_types.c @@ -537,6 +537,10 @@ unformat_fib_route_path (unformat_input_t * input, va_list * args) { rpath->frp_flags |= FIB_ROUTE_PATH_RESOLVE_VIA_ATTACHED; } + else if (unformat (input, "pop-pw-cw")) + { + rpath->frp_flags |= FIB_ROUTE_PATH_POP_PW_CW; + } else if (unformat (input, "ip4-lookup-in-table %d", &rpath->frp_fib_index)) diff --git a/src/vnet/fib/fib_types.h b/src/vnet/fib/fib_types.h index 77b133fa9db..980fe3d1d0a 100644 --- a/src/vnet/fib/fib_types.h +++ b/src/vnet/fib/fib_types.h @@ -383,6 +383,11 @@ typedef enum fib_route_path_flags_t_ FIB_ROUTE_PATH_ICMP_UNREACH = (1 << 15), FIB_ROUTE_PATH_ICMP_PROHIBIT = (1 << 16), FIB_ROUTE_PATH_CLASSIFY = (1 << 17), + + /** + * Pop a Psuedo Wire Control Word + */ + FIB_ROUTE_PATH_POP_PW_CW = (1 << 18), } fib_route_path_flags_t; /** |