aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/fib
AgeCommit message (Collapse)AuthorFilesLines
2019-06-18fib: fib api updatesNeale Ranns14-515/+937
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>
2019-06-06IP-Punt-redirect: allow the use of a FIB path to describe how toNeale Ranns1-1/+3
redirect Change-Id: I2a3ba2a3d73ea8511e3a511855b041432328f0a8 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-06-05L3 cross connectNeale Ranns1-4/+8
- all packets input on interface X are load-balanced over the set of paths provided. Change-Id: Ic27cb88c4cd5d6d3462570632daff7a43d5a652d Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-05-30FIB: correctly report IPv6 FIB Unicast and Multicast memory usage (VPP-1578)"Neale Ranns4-13/+26
and document scaling Change-Id: I65d8999e65616d77e525963c770d91e9b0d5e593 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-05-16init / exit function orderingDave Barach2-15/+13
The vlib init function subsystem now supports a mix of procedural and formally-specified ordering constraints. We should eliminate procedural knowledge wherever possible. The following schemes are *roughly* equivalent: static clib_error_t *init_runs_first (vlib_main_t *vm) { clib_error_t *error; ... do some stuff... if ((error = vlib_call_init_function (init_runs_next))) return error; ... } VLIB_INIT_FUNCTION (init_runs_first); and static clib_error_t *init_runs_first (vlib_main_t *vm) { ... do some stuff... } VLIB_INIT_FUNCTION (init_runs_first) = { .runs_before = VLIB_INITS("init_runs_next"), }; The first form will [most likely] call "init_runs_next" on the spot. The second form means that "init_runs_first" runs before "init_runs_next," possibly much earlier in the sequence. Please DO NOT construct sets of init functions where A before B actually means A *right before* B. It's not necessary - simply combine A and B - and it leads to hugely annoying debugging exercises when trying to switch from ad-hoc procedural ordering constraints to formal ordering constraints. Change-Id: I5e4353503bf43b4acb11a45fb33c79a5ade8426c Signed-off-by: Dave Barach <dave@barachs.net>
2019-04-19FIB: recursion casues path reallocNeale Ranns1-1/+12
Change-Id: Ie9c2954eee90ca1a1fc1aa8280f93b2340b544c1 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-04-08fixing typosJim Thompson4-11/+11
Change-Id: I215e1e0208a073db80ec6f87695d734cf40fabe3 Signed-off-by: Jim Thompson <jim@netgate.com>
2019-03-28Typos. A bunch of typos I've been collecting.Paul Vinciguerra10-30/+30
Change-Id: I53ab8d17914e6563110354e4052109ac02bf8f3b Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-26FIB: do debug before remvoing last sourceNeale Ranns1-2/+2
Change-Id: I4e1cde754eb4d6406cd6cd51f37d89552bdb6a53 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-26ADJ: midchain delegate to performing stackingNeale Ranns1-2/+0
this can be used by e.g. tunnels so it doesn't need to be implemented for each tunnel type. Change-Id: I0790f89aa49f83421612b35108cce67693285999 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-22ADJ: more thorough link up checkNeale Ranns1-5/+5
Change-Id: I04dbfb914706b25fcc3bd6ee0d19cfdc810234ae Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-12FIB: path parsing, table-id not fib-index (VPP-1586)Neale Ranns1-1/+11
Change-Id: Ib27952935393163eaabf005c69b1cbc2feca2b98 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-12FIB: crash when deleting default routeNeale Ranns1-9/+0
when adding a recursive path the table is locked so that it can be removed when the last recursive path is removed. however, not all RR source'd prefixs use a recursive path. so flushing the table of all RR source'd entries is not correct. Change-Id: Id4010774011046e66ddc443ac83cb8e9245313dd Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-02-19VPP-1568:when entry src cover change, recursive-loop fib still can not work.mu.duojiao1-0/+9
Change-Id: I90762b59f94175f278380c95776471a30bc94d34 Signed-off-by: mu.duojiao <mu.duojiao@zte.com.cn>
2019-02-15FIB: pass a copy the walk contextNeale Ranns1-1/+3
since it can realloc when new ctx are added. If not we can get some nasty memory corruption. Change-Id: I617709c3013acbcb8aee07dc147894f0de896555 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-02-07IPSEC: no second lookup after tunnel encapNeale Ranns1-1/+3
in the same maaner as with other tunnel tyeps we use the FIB to cache and track the destination used to reach the tunnel endpoint. Post encap we can then ship the packet straight to this adjacency and thus elide the costly second lookup. - SA add and del function so they can be used both directly from the API and for tunnels. - API change for the SA dump to use the SA type - ipsec_key_t type for convenience (copying, [un]formating) - no matching tunnel counters in ipsec-if-input Change-Id: I9d144a59667f7bf96442f4ca66bef5c1d3c7f1ea Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-01-24add "Mtrie mheap usage" in "show ip fib memory"Lollita Liu1-2/+9
Adding "Mtrie mheap usage" in output of "show ip fib memory" command, for displaying the total Mtrie Mheap usage together with memery usage of each node and each table Change-Id: I2bcc570924e44a2b406f69cfc2f2f8d5abb61a39 Signed-off-by: Lollita Liu <lollita.liu@ericsson.com> Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-01-07VOM: mroutesNeale Ranns1-0/+4
- fixes in ip.api for dumping mroute path flags Change-Id: I13b0cfb15d374250ed71bd4e13dda9b798c18204 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-12-24FIB: adj src assert fix part 2Neale Ranns1-1/+8
Change-Id: Ic112180e53a55993b06ba18102202d6ac5854def Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-12-23FIB: remove assert from adj srcNeale Ranns1-1/+0
this is the case when the ADJ fib is in the non-forwarding trie Change-Id: I7bcda475b3b1e142d16363147dba3a1e2c5a07f9 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-12-20FIB: encode the label stack in the FIB path during table dumpNeale Ranns8-16/+134
Change-Id: I28e8a99b980ad343a4209e673201791b91ceab4e Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-12-16IP6-MFIB: replace the radix tree with bihash (VPP-1526)Neale Ranns2-19/+22
Change-Id: I7a48890c075826fbd8c75436dfdc5ffff230a693 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-12-07FIB recusrion loop checks traverse midchain adjacenciesNeale Ranns1-2/+14
if a tunnel's destination address is reachable through the tunnel (see example config belwo) then search for and detect a recursion loop and don't stack the adjacency. Otherwise this results in a nasty surprise. DBGvpp# loop cre DBGvpp# set int state loop0 up DBGvpp# set int ip addr loop0 10.0.0.1/24 DBGvpp# create gre tunnel src 10.0.0.1 dst 1.1.1.1 DBGvpp# set int state gre0 up DBGvpp# set int unnum gre0 use loop0 DBGvpp# ip route 1.1.1.1/32 via gre0 DBGvpp# sh ip fib 1.1.1.1 ipv4-VRF:0, fib_index:0, flow hash:[src dst sport dport proto ] locks:[src:plugin-hi:2, src:default-route:1, ] 1.1.1.1/32 fib:0 index:11 locks:4 <<< this is entry #11 src:CLI refs:1 entry-flags:attached, src-flags:added,contributing,active, path-list:[14] locks:2 flags:shared,looped, uPRF-list:12 len:1 itfs:[2, ] path:[14] pl-index:14 ip4 weight=1 pref=0 attached-nexthop: oper-flags:recursive-loop,resolved, cfg-flags:attached, 1.1.1.1 gre0 (p2p) [@0]: ipv4 via 0.0.0.0 gre0: mtu:9000 4500000000000000fe2fb0cc0a0000010101010100000800 stacked-on entry:11: <<<< and the midchain forwards via entry #11 [@2]: dpo-drop ip4 src:recursive-resolution refs:1 src-flags:added, cover:-1 forwarding: unicast-ip4-chain [@0]: dpo-load-balance: [proto:ip4 index:13 buckets:1 uRPF:12 to:[0:0]] [0] [@6]: ipv4 via 0.0.0.0 gre0: mtu:9000 4500000000000000fe2fb0cc0a0000010101010100000800 stacked-on entry:11: [@2]: dpo-drop ip4 DBGvpp# sh adj 1 [@1] ipv4 via 0.0.0.0 gre0: mtu:9000 4500000000000000fe2fb0cc0a0000010101010100000800 stacked-on entry:11: [@2]: dpo-drop ip4 flags:midchain-ip-stack midchain-looped <<<<< this is a loop counts:[0:0] locks:4 delegates: children: {path:14} Change-Id: I39b82bd1ea439be4611c88b130d40289fa0c1b59 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-12-03move [m]fib and BIER tests to unittest pluginNeale Ranns1-10551/+0
Change-Id: I9d2f52e756363df011026773bfffa838a557313f Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-10-29Fixing Exclusive dpo path issues added when via rpathVijayabhaskar Katamreddy1-4/+18
Change-Id: I7531a64d7072d85514ca579827b6ea0e9cef6f08 Signed-off-by: Vijayabhaskar Katamreddy <vkatamre@cisco.com>
2018-10-27FIB: Sources must be keep in priority order, so re-sort after a vec_delNeale Ranns1-0/+2
Change-Id: I77af4f3a7e826ea5c1a23ee8b348faefe9f2facc Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-10-25Trivial: Cleanup missing va_ends.Paul Vinciguerra2-5/+9
Change-Id: Ie7827b6a31968a355687d27325c0f30cab1bc890 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-10-23c11 safe string handling supportDave Barach11-20/+20
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
2018-10-16FIB: use vlib-log for debuggingNeale Ranns11-96/+186
Change-Id: I9052202b8cbcf656e61d635253d515f0f3a8d145 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-10-16Sticky Load-balanceNeale Ranns4-16/+367
keep the number of buckets in the load-balanced fixed. If a path goes dwon fill its buckets with those from the next available up path. Change-Id: I15603ccb899fa9b77556b898c99136379cf32eae Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-10-08Adding Multipath support for exclusive DPO based fib path entries via rpathVijayabhaskar Katamreddy2-2/+16
Change-Id: I3c84daf046dbad972b36e48fa2548bbe20c7b338 Signed-off-by: Vijayabhaskar Katamreddy <vkatamre@cisco.com>
2018-10-01Source VRF SelectNeale Ranns2-0/+34
match against a packet's source address to determine the VRF for the subsequent destination address lookup. Change-Id: I48ee0ef54dcb891f0ec7f879e4d3b925a0ed0081 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-10-01mroute routers in the stats segmentNeale Ranns1-2/+2
Change-Id: I798e4fb6470ae9e763f8de1c290ff0fc3c0b7f9e Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-09-25FIB: recusrive paths must lock the table to prevent its deletionNeale Ranns2-0/+9
Change-Id: I958bf057be751dc7b3a0d93080021b3addc405b7 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-09-20UDP-Encap: name counters for the stats segmentNeale Ranns1-1/+1
change the ADD api so that is returns the 'ID' that can be used by the client to read the stats from the stats segment and to delete the object. Previously a similar value used required to be chosen by the client, now VPP allocates one (like it does e.g. for interfaces) Change-Id: I563cf6092276eb990c52d5457c86e72546bcf69e Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-09-20Route counters in the stats segmentNeale Ranns4-0/+31
route ADD API changed to return the stats segment index to use to read the counters Change-Id: I2ef41e01eaa2f9cfaa49d9c88968897793825925 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-09-19GRE: fix 4o6 and 6o4 adj stackingNeale Ranns2-0/+21
Change-Id: I13dc5eab8835c4f3b95906816d42dccfeee8b092 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-09-10vxlan-gbp: Add support for vxlan gbpMohsin Kazmi1-0/+2
This patch implements vxlan with extension of group based policy support. Change-Id: I70405bf7332c02867286da8958d9652837edd3c2 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-08-31FIB path CLI fix for lookup-table IDsNeale Ranns1-0/+12
Change-Id: I8c127d472e0010036061a8a076599d1ff85abab5 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-08-29Consolidate table->index conversion in fib-path CLI processingNeale Ranns1-1/+14
Change-Id: I221cebddc45efbfdec428b7df2af96e2aedff2dd Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-08-2832/64 shmem bihash interoperabilityDave Barach1-4/+5
Move the binary api segment above 4gb Change-Id: I40e8aa7a97722a32397f5a538b5ff8344c50d408 Signed-off-by: Dave Barach <dave@barachs.net>
2018-08-27Adjacency walks protected by 'walk in progress' flagNeale Ranns1-0/+1
Change-Id: I3281f65f7dec792d56de48afb39efcc2fed8578b Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-08-27IGMP: enable command on cliNeale Ranns1-2/+1
Change-Id: I1f741b66ab8e3ecbb5c0d248b72e52c56545d5f3 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-08-22IPIP and SIXRD tunnels create API needs table-IDs not fib-indexesNeale Ranns2-0/+6
Change-Id: Ifaef196a24fa9b6924f2b9692318f69763cee5e1 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-08-10Use IP address types on UDP encap APINeale Ranns2-0/+44
Change-Id: I3c714c519b6d0009329b50947ce250c18ee2a85a Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-07-30FIB: return entry prefix by const reference to avoid the copyNeale Ranns8-48/+31
Change-Id: I09b8406168df4b6b28df3ede24ee839681be0195 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-07-18Add config option to use dlmalloc instead of mheapDave Barach1-0/+8
Configure w/ --enable-dlmalloc, see .../build-data/platforms/vpp.mk src/vppinfra/dlmalloc.[ch] are slightly modified versions of the well-known Doug Lea malloc. Main advantage: dlmalloc mspaces have no inherent size limit. Change-Id: I19b3f43f3c65bcfb82c1a265a97922d01912446e Signed-off-by: Dave Barach <dave@barachs.net>
2018-07-16Adjacency-BFD: assume BFD down on createNeale Ranns1-2/+1
Change-Id: I13279a1a96df457209fb25748a643c01b18ff4e0 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-07-10FIB path dump: fix next-hop-table ID for recursive routesNeale Ranns2-2/+3
Change-Id: I57b4ebca29c0b185770373e8878f89a9bd13b742 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-07-09IGMP improvementsNeale Ranns1-6/+0
- Enable/Disable an interface for IGMP - improve logging - refactor common code - no orphaned timers - IGMP state changes in main thread only - Large groups split over multiple state-change reports - SSM range configuration API. - more tests Change-Id: If5674f1044e7e97274a711f47807c9ba689d7b9a Signed-off-by: Neale Ranns <nranns@cisco.com>