aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/fib
AgeCommit message (Collapse)AuthorFilesLines
2020-03-06fib: path flag FIB_API_PATH_TYPE_INTERFACE_RX not copied to clientIJsbrand Wijnands1-0/+4
This path flag FIB_API_PATH_TYPE_INTERFACE_RX is not copied to the client bin_api. Type: fix Change-Id: Signed-off-by: IJsbrand Wijnands <ice@cisco.com> Change-Id: I612044d2f564c852f83fceb63ce750a6330e1365
2020-02-21fib: Uninitialised pad in the prefix (coverity warning)Neale Ranns1-0/+2
Type: fix Change-Id: Ia61d6fbf6e80977f83f1f6672e5e83b52ddeb0e5 Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-02-20fib: fib path realloc during midchain stackNeale Ranns1-9/+13
Type: fix Change-Id: I0677f46dfa22c8abab7f311230a09ef1cd8ac335 Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit 02d5a67d39cbb8f1865227afdc79533578067b8d)
2020-02-17misc: fix coverity warningsDave Barach1-4/+4
Add an ALWAYS_ASSERT (...) macro, to (a) shut up coverity, and (b) check the indicated condition in production images. As in: p = hash_get(...); ALWAYS_ASSERT(p) /* was ASSERT(p) */ elt = pool_elt_at_index(pool, p[0]); This may not be the best way to handle a specific case, but failure to check return values at all followed by e.g. a pointer dereference isn't ok. Type: fix Ticket: VPP-1837 Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ia97c641cefcfb7ea7d77ea5a55ed4afea0345acb
2020-02-13fib: Fix some more realloc errorsNeale Ranns5-55/+34
Type: fix Change-Id: I6011f5d6eae79019d3c16a260a9bedf0a76d2151 Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-02-11vppinfra: remove the historical mheap memory allocatorDave Barach1-12/+3
The mheap allocator has been turned off for several releases. This commit removes the cmake config parameter, parallel support for dlmalloc and mheap, and the mheap allocator itself. Type: refactor Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I104f88a1f06e47e90e5f7fb3e11cd1ca66467903
2020-02-07fib: fix non-NULL terminated vectors in cli outputBenoît Ganne2-2/+2
Type: fix Change-Id: Idbb3f29b13a5c84a8585c4299e51fdfc35f7e1ad Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-01-27ipip: Multi-point interfaceNeale Ranns1-1/+2
Type: feature plus fixes for gre Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: I0eca5f94b8b8ea0fcfb058162cafea4491708db6
2020-01-22fib: FIB crash removing labelled route (VPP-1818)Neale Ranns1-7/+12
Type: fix The crash occured trying to retreive a NULL path list to walk the path extensions. A walk shoul not be required, because there should be no extensins, since all paths are removed. The problem is that when the paths were added, they were not sorted, hence neither were the extensions and when they were updated, duplicate extensions were added, and hence a path removal did not remove them all. Fix is to make sure paths are sorted. Change-Id: I069d937de8e7bc8aae3d92f588db4daff727d863 Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit 257749c40946a9269140d322e374d74c3b6eefb8)
2020-01-14classify: Reduce the include dependencies on vnet_classify.hNeale Ranns1-0/+1
Type: refactor currently vnet_classify.h is included in ip.h where it's not required. Change-Id: Id55682637601655aa2edda681536a979c8e323bd Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-01-09fib: leverage well-optimized clib_memcpyZhiyong Yang3-6/+6
Type: fix Change-Id: I684910837ca4d9c8a07262459158bbb0423a33af Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
2019-12-22fib: use 32 bits per-source reference counterMiklos Tirpak2-2/+2
The 16 bits reference counter limited the number of interfaces per FIB table to 65K from a given source. Some use cases, for example GTP-U tunnels require much more interfaces than that. This change increases the size of the reference counter to 32 bits. Type: fix Signed-off-by: Miklos Tirpak <miklos.tirpak@gmail.com> Change-Id: I944a98513018840f904f2808c2a1e963b37886cc
2019-12-17ip: Protocol Independent IP NeighborsNeale Ranns7-6/+59
Type: feature - ip-neighbour: generic neighbour handling; APIs, DBs, event handling, aging - arp: ARP protocol implementation - ip6-nd; IPv6 neighbor discovery implementation; separate ND, MLD, RA - ip6-link; manage link-local addresses - l2-arp-term; events separated from IP neighbours, since they are not the same. vnet retains just enough education to perform ND/ARP packet construction. arp and ip6-nd to be moved to plugins soon. Change-Id: I88dedd0006b299344f4c7024a0aa5baa6b9a8bbe Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-12-17fib: Glean on NBMA interface points to dropNeale Ranns2-86/+85
Type: fix Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: Iaae7a9e120bbf8168c581b06d3ac0e124b32e0e7
2019-12-16vppinfra: bihash walk cb typedef and continue/stop controlsNeale Ranns1-2/+4
Type: feature Change-Id: I28f7a658be3f3beec9ea32635b60d1d3a10d9b06 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-12-04fib: Decouple source from priority and behaviourNeale Ranns23-371/+743
Type: feature the fib_source_t enum alone no longer defines the priority and behaviour, instead each source must be allocated these attributes. This allows the creation of other sources by the plugins (and soon over the API). Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: I890ee820fbc16079ee417ea1fbc163192806e853
2019-11-26fib: Fix crash on cover update to non activated adj sourceNeale Ranns1-7/+11
if the adj source is not active then there is no existing cover during a cover update Type: fix Ticket: VPP-1803 Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: Ie912f1c99345de4fb012bdcd97b443098d4a7351
2019-11-26fib: Another realloc burnNeale Ranns1-5/+13
Type: fix harmless this time since it only affects the debug statement, but it still crashes an ASAN image. Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: Ie02e7fe3014b98b9f8c83447f59017a380ab3948
2019-11-26fib: Table ReplaceNeale Ranns7-17/+219
Type: feature from the API doc, a table replace is: " The use-case is that, for some unspecified reason, the control plane has a very different set of entries it wants in the table than VPP currently has. The CP would thus like to 'replace' VPP's current table only by specifying what the new set of entries shall be, i.e. it is not going to delete anything that already eixts. the CP delcartes the start of this procedure with this begin_replace API Call, and when it has populated all the entries it wants, it calls the below end_replace API. From this point on it is of coursce free to add and delete entries as usual. The underlying mechanism by which VPP implements this replace is purposefully left unspecified. " In the FIB, the algorithm is implemented using mark and sweep. Algorithm goes: 1) replace_begin: this marks all the entries in that table as 'stale' 2) download all the entries that should be in this table - this clears the stale flag on those entries 3) signal the table converged: ip_table_replace_end - this removes all entries that are still stale this procedure can be used when an agent first connects to VPP, as an alternative to dump and diff state reconciliation. Change-Id: I168edec10cf7670866076b129ebfe6149ea8222e Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-11-14fib: Copy the prefix before use in case the underlying entry reallocs.Neale Ranns3-6/+19
Type: fix all other uses of the fib_entry_get_preifx in the code base don't pass the prefix into recursive functions. Change-Id: Ic1c56acd406a733b215ee2fd98b6bed58b490a4f Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-10-14fib: recursive calculation leads to delegate pool reallocNeale Ranns1-4/+14
Type: fix Change-Id: Ib7ac53d1b59b641ccd3b1d733107d7f1ba174314 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-10-09fib: P2P interfaces do not need specific multicast adjacenciesNeale Ranns1-3/+18
they can use the 'auto' adj for all traffic Type: fix Change-Id: Id2b9557683252a94badc8f9dfab5f7b2ae26f1ee Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-10-07ip: MFIB CLI fix for parsing path flagsNeale Ranns1-0/+4
Type: fix Change-Id: I7ed9726d8c5ca26715a84b004a18fd7f93142486 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-09-25fib: fix some typos in fib/mtrieLijian.Zhang7-11/+11
Type: fix Change-Id: I1af0e4a9bc23a3b6b6d3a74df093801ab6cae1f8 Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
2019-08-29ip: remove unused function parameterSimon Zhang2-3/+2
Type: refactor Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com> Change-Id: I8674ff5f6f6336b256b7df8187afbb36ddef71fb
2019-07-31fib: Add some path-list flags to its keyNeale Ranns2-1/+11
Type: fix Ticket: 1729 The flags that are permanently set on a path-list should form part of its key in the path-list DB. Otherwise, if shared, they will not behave as expected. Change-Id: I0aa7c7c5d270c97b08014e4a47ddbdcee2358706 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-07-31fib: fix calls to unformat_fib_pathNeale Ranns1-1/+1
Type: fix Ticket: 1728 Change-Id: I679c2b8c5b0f751c9476db3669ab3f6c26dcdd28 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-07-28fib: add invalid source type and fix debug logBenoît Ganne3-19/+22
Add the FIB_SOURCE_INVALID fib source type. This allows to spot uninitialized fib source more easily (0 no longer means special) and we can use it as placeholder when no source is present. Use it to fix FIB_ENTRY_DBG() which was accessing the 1st source, even when no sources were present. Type: fix Fixes: 710071bf0e Change-Id: I980b6a6a07616d4a8d6f2db166a1dd335721c74d Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-07-24fib: Support the POP of a Psuedo Wire Control WordNeale Ranns6-3/+35
Type: feature Change-Id: Ib24547a7c4c73ceb5383d1ca8f14ec40e6a90f01 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-07-19fib: FIB Entry trackingNeale Ranns11-64/+409
Instead of all clients directly RR sourcing the entry they are tracking, use a deidcated 'tracker' object. This tracker object is a entry delegate and a child of the entry. The clients are then children of the tracker. The benefit of this aproach is that each time a new client tracks the entry it doesn't RR source it. When an entry is sourced all its children are updated. Thus, new clients tracking an entry is O(n^2). With the tracker as indirection, the entry is sourced only once. Type: feature Change-Id: I5b80bdda6c02057152e5f721e580e786cd840a3b Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-07-10fib: fib_entry_flags_update takes a vector of pathsNeale Ranns1-5/+1
Type: fix Fixes: 097fa66b Change-Id: I690e31433b64f11399c08b4a0318762916c2c2f0 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-07-09fib: fix urpf_itfs vector overflowBenoît Ganne1-45/+16
When removing duplicates in urpf_itfs vector we search for the 1st next different entry in the vector, but the loop test is in the wrong order: (urpf->furpf_itfs[i] == urpf->furpf_itfs[j] && j < vec_len(urpf->furpf_itfs)) We must check for overflow before checking equality. Type: fix Fixes: 3ee44040c66cbe47ff292ac7fb0badccbe2afe6d Change-Id: I63729aff12057d5abce6c24ec24339cd9cd79494 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-07-03fib: allow route delete with no paths and multipath=0 to remove theNeale Ranns2-33/+43
whole route Type: fix Fixes: 097fa66b Change-Id: I017ab5797670eb278c27c6e306cd8cadaacddf9d Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-06-26fib: default flow hash config for each DPO protocol typeNeale Ranns1-2/+1
Type: fix Fixes: 59fa121f Change-Id: I9eb4fe1612734e54932228527c37bf33b705dbdb Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-06-26fib: adj cover refinement check changeNeale Ranns1-1/+3
Usually the adj cover refinement check which ensures that for any adj sourced prefix its cover is connected, is satified by the presence of the interface source. The interface source has a high priority hence during the adj refinement check get_flags() which uses the best source, usually returns the flags for the interface source. However, in the presence of higher priority sources that interpose get_flags does not return connected and the check fails. With this change add a specific check for the interface source if the best is not connected. Type: feature Change-Id: Iabc3e29fe7c447fc3ef313e40b00d48fab09fba4 Signed-off-by: Neale Ranns <nranns@cisco.com>
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>