summaryrefslogtreecommitdiffstats
path: root/src/vnet/fib/fib_types.api
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2018-05-01 05:17:55 -0700
committerOle Trøan <otroan@employees.org>2019-06-18 13:31:39 +0000
commit097fa66b986f06281f603767d321ab13ab6c88c3 (patch)
treeed052819615d08ee4bd0afbc34de7e64e4598105 /src/vnet/fib/fib_types.api
parent39baa32186fd3e4b20d9f58afbbfe7b8daebed62 (diff)
fib: fib api updates
Enhance the route add/del APIs to take a set of paths rather than just one. Most unicast routing protocols calcualte all the available paths in one run of the algorithm so updating all the paths at once is beneficial for the client. two knobs control the behaviour: is_multipath - if set the the set of paths passed will be added to those that already exist, otherwise the set will replace them. is_add - add or remove the set is_add=0, is_multipath=1 and an empty set, results in deleting the route. It is also considerably faster to add multiple paths at once, than one at a time: vat# ip_add_del_route 1.1.1.1/32 count 100000 multipath via 10.10.10.11 100000 routes in .572240 secs, 174751.80 routes/sec vat# ip_add_del_route 1.1.1.1/32 count 100000 multipath via 10.10.10.12 100000 routes in .528383 secs, 189256.54 routes/sec vat# ip_add_del_route 1.1.1.1/32 count 100000 multipath via 10.10.10.13 100000 routes in .757131 secs, 132077.52 routes/sec vat# ip_add_del_route 1.1.1.1/32 count 100000 multipath via 10.10.10.14 100000 routes in .878317 secs, 113854.12 routes/sec vat# ip_route_add_del 1.1.1.1/32 count 100000 multipath via 10.10.10.11 via 10.10.10.12 via 10.10.10.13 via 10.10.10.14 100000 routes in .900212 secs, 111084.93 routes/sec Change-Id: I416b93f7684745099c1adb0b33edac58c9339c1a Signed-off-by: Neale Ranns <neale.ranns@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'src/vnet/fib/fib_types.api')
-rw-r--r--src/vnet/fib/fib_types.api127
1 files changed, 92 insertions, 35 deletions
diff --git a/src/vnet/fib/fib_types.api b/src/vnet/fib/fib_types.api
index 8268870c0a7..9073192c3c4 100644
--- a/src/vnet/fib/fib_types.api
+++ b/src/vnet/fib/fib_types.api
@@ -1,5 +1,6 @@
+/* Hey Emacs use -*- mode: C -*- */
/*
- * Copyright (c) 2016 Cisco and/or its affiliates.
+ * Copyright (c) 2018 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
@@ -12,10 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+
+option version = "2.0.0";
+import "vnet/ip/ip_types.api";
+
/** \brief MPLS label
*/
-typeonly define fib_mpls_label
+typedef fib_mpls_label
{
u8 is_uniform;
u32 label;
@@ -23,48 +27,101 @@ typeonly define fib_mpls_label
u8 exp;
};
+/** brief A path's nexthop protocol
+ */
+enum fib_path_nh_proto
+{
+ FIB_API_PATH_NH_PROTO_IP4 = 0,
+ FIB_API_PATH_NH_PROTO_IP6,
+ FIB_API_PATH_NH_PROTO_MPLS,
+ FIB_API_PATH_NH_PROTO_ETHERNET,
+ FIB_API_PATH_NH_PROTO_BIER,
+};
+
+/** \brief Flags for the path
+ */
+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,
+ /* the path must resolve via a host route */
+ FIB_API_PATH_FLAG_RESOLVE_VIA_HOST,
+};
+
+/* \brief A description of the 'next-hop' for a path
+ * this can be something that needs resolving like an IP address
+ * (into an adjacency or another FIB entry) or the index of another
+ * VPP object that was previously created (i.e. a UDP encap object)
+ */
+typedef fib_path_nh
+{
+ /* proto = IP[46] */
+ vl_api_address_union_t address;
+ /* proto = MPLS */
+ u32 via_label;
+ /* proto = ANY, determined by path type */
+ u32 obj_id;
+ /* path-type = CLASSIFY */
+ u32 classify_table_index;
+};
+
+enum fib_path_type
+{
+ /* Normal Paths */
+ FIB_API_PATH_TYPE_NORMAL = 0,
+ /* local/for-us/receive = packet sent to VPP's L4 stack */
+ FIB_API_PATH_TYPE_LOCAL,
+ /* packet is dropped */
+ FIB_API_PATH_TYPE_DROP,
+ /* Packet is UDP encapped - set obj_id in fib_path_nh_id */
+ FIB_API_PATH_TYPE_UDP_ENCAP,
+ /* Packet is BIER encapped - set obj_id in fib_path_nh_id */
+ FIB_API_PATH_TYPE_BIER_IMP,
+ /* packet will generated ICMP unreach to sender */
+ FIB_API_PATH_TYPE_ICMP_UNREACH,
+ /* packet will generated ICMP prohibt to sender */
+ FIB_API_PATH_TYPE_ICMP_PROHIBIT,
+ /* perform a lookup based on the packet's source address */
+ FIB_API_PATH_TYPE_SOURCE_LOOKUP,
+ /* Distributed Virtual router, packet is forwarded with the original
+ L2 header unchanged */
+ FIB_API_PATH_TYPE_DVR,
+ /* packet's RX interface is changed */
+ FIB_API_PATH_TYPE_INTERFACE_RX,
+ /* packet will be sent to a classify table */
+ FIB_API_PATH_TYPE_CLASSIFY,
+};
+
/** \brief FIB path
@param sw_if_index - index of the interface
+ @param table_id - The table ID in which to find the next-hop address
+ (for recursive routes, i.e. when the interface is
+ not given)
@param weight - The weight, for UCMP
@param preference - The preference of the path. lowest preference
- is prefered
- @param is_local - local if non-zero, else remote
- @param is_drop - Drop the packet
- @param is_unreach - Drop the packet and rate limit send ICMP unreachable
- @param is_prohibit - Drop the packet and rate limit send ICMP prohibited
- @param is_udp_encap - The path describes a UDP-o-IP encapsulation.
- @param is_dvr - Does the route resolve via a DVR interface.
- @param is_source_lookup - The the path is a deaggregate path (i.e. a lookup
- in another table) is the lookup on the packet's
- source address or destination.
- @param afi - dpo_proto_t protocol that describes the next-hop address
- @param via_label - The next-hop is a resolved via a local label
- @param next_hop[16] - the next hop address
- @param next_hop_id - Used when the path resolves via an object
- that has a unique identifier. e.g. the UDP
- encap object
+ is prefered
+ @param rpf-id - For paths that pop to multicast, this the the
+ RPF ID the packet will be given (0 and ~0 => unset)
+ @param type - the path type
+ @param flags - path flags
+ @param proto - protocol that describes the next-hop address
+ @param nh - the next-hop/net resolving object
+ @param n_labels - the number of labels present in the stack
+ @param label_stack - a stack of MPLS labels
*/
-typeonly define fib_path
+typedef fib_path
{
u32 sw_if_index;
u32 table_id;
+ u32 rpf_id;
u8 weight;
u8 preference;
- u8 is_local;
- u8 is_drop;
- u8 is_udp_encap;
- u8 is_unreach;
- u8 is_prohibit;
- u8 is_resolve_host;
- u8 is_resolve_attached;
- u8 is_dvr;
- u8 is_source_lookup;
- u8 is_interface_rx;
- u8 afi;
- u8 next_hop[16];
- u32 next_hop_id;
- u32 rpf_id;
- u32 via_label;
+
+ vl_api_fib_path_type_t type;
+ vl_api_fib_path_flags_t flags;
+ vl_api_fib_path_nh_proto_t proto;
+ vl_api_fib_path_nh_t nh;
u8 n_labels;
vl_api_fib_mpls_label_t label_stack[16];
};