summaryrefslogtreecommitdiffstats
path: root/src/plugins/gbp
AgeCommit message (Collapse)AuthorFilesLines
2019-10-22gbp: missing contract hash-mode settingNeale Ranns1-3/+5
Type: fix Change-Id: Ia0f1e88b43e861d3f6965076c73cc48fb9574da3 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-10-15gbp: Add extended SFC unit testsMohsin Kazmi1-2/+459
Type: feature Change-Id: I1218257af0053ae27c4394d7666fde87a732e08c Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-10-14gbp: use correct dst mac for RD-UU forwardBenoît Ganne1-1/+1
Type: fix Change-Id: Ifdd193fab24796346b11a5df81740880f9a50ee8 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-09-27gbp: remove api boilerplateOle Troan4-146/+7
Type: refactor Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I2995413619f5fbe77bbe2df9f5d37db8cc596b73
2019-09-23gbp: fix contract rule handlingBenoît Ganne7-20/+50
Fix a memory leak when removing old GBP contract rules and make sure a GBP contract rule exists when matching the corresponding ACL rule. Type: fix Fixes: 13a08cc098 Change-Id: Iba67d573e69280ad998488a7a3d3462341c68ea4 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-09-23gbp: remove loopback interfaces between testsBenoît Ganne1-0/+3
Type: fix Change-Id: I440f25b95b23b717518d101a1327ecf16d6ba39a Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-09-16api: autogenerate api trace print/endianOle Troan1-0/+5
In addition to the external vppapitrace tool, VPP itself supports dumping of API trace files. In two formats, "custom-dump" and "dump". "dump" gives a human friendly list, and "custom-dump" is meant to give a list of commands that can be fed to VAT. This patch only deals with "dump". Prior to this fix, auto-generation was only done for the basic types. This fix adds support for any type, including lists, and supports pretty-printing of enums, strings, IP addresses, MAC addresses and so on. Usage: api trace dump <api-trace-file> For example Change-Id: I4e485680e6dcfce7489299ae6cf31d835071ac40 ---------- trace 48 ----------- vl_api_sw_interface_set_flags_t: _vl_msg_id: 75 client_index: 0 context: 10 sw_if_index: 1 flags: IF_STATUS_API_FLAG_ADMIN_UP ---------- trace 49 ----------- vl_api_sw_interface_add_del_address_t: _vl_msg_id: 88 client_index: 0 context: 11 sw_if_index: 1 is_add: 1 del_all: 0 prefix: 172.16.1.1/24 ---------- trace 51 ----------- vl_api_cli_inband_t: _vl_msg_id: 819 client_index: 0 context: 13 cmd: packet-generator capture pg0 pcap /tmp/vpp-unittest-TestMAP-YhcmDX/pg0_out.pcap disable ---------- trace 58 ----------- vl_api_ip_neighbor_add_del_t: _vl_msg_id: 199 client_index: 0 context: 20 is_add: 1 neighbor: sw_if_index: 2 flags: IP_API_NEIGHBOR_FLAG_NONE mac_address: 0202.0000.ff02 ip_address: fd01:2::2 Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I5556d06008de2762e7c2d35a8b0963ae670b3db1 Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com>
2019-09-03gbp: fix set_mac() in unit testsBenoît Ganne1-6/+2
Do not use low-level sw_interface_set_mac_address() directly and use higher-level set_mac() instead, otherwise interface local_mac and configured mac are out-of-sync Type: fix Fixes: 25b049484f Change-Id: I9366e7afb95ef00e25a94ca3b0e6309871169878 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-08-29ip: remove unused function parameterSimon Zhang1-1/+1
Type: refactor Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com> Change-Id: I8674ff5f6f6336b256b7df8187afbb36ddef71fb
2019-08-22tests: move plugin tests to src/plugins/*/testDave Wallace1-0/+5425
- Relocate plugin tests for 'make test' into src/plugins/*/test so that plugin test cases are co-located with the plugin source code. Type: refactor Signed-off-by: Dave Wallace <dwallacelf@gmail.com> Change-Id: I503e6a43528e14981799b735fa65674155713f67 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2019-08-20vppapigen: remove support for legacy typedefsPaul Vinciguerra1-4/+4
vppapigen has remapped legacy to typedefs behind the scenes for some time now. - update .api files to use new style typedefs. - issue error on 'typeonly define' in .api files - remove unneeded macros redefining vl_noop_handler Type: refactor Change-Id: I7a8c4a6dafacee6a131f95cd0e9b03a8c60dea8b Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-08-14gbp: do not scan gbp bihash if not instantiatedBenoît Ganne1-0/+6
Type: fix Fixes: 32dcd3b2f227dec638c39ade0c58d6741d83ec30 Change-Id: I42550fcc5b3fa486a05770d3e220d7a86315628e Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-08-06gbp: update gbp endpoint cliBenoît Ganne1-5/+6
Type: feature Change-Id: I0afc6eb4765029dc28859c9ac2b0578749a38d3d Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-07-16gbp: fix contracts dpo ACL matchBenoît Ganne1-3/+3
Type: fix Fixes: 1d6d9f021c5a169dedca55b46451ab54728e3ee8 Change-Id: I3912c8bb78d678170bdd86821d2ead3ae0396841 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-07-11gbp: An Endpoint can change sclassNeale Ranns3-17/+38
Type: feature Change-Id: I9d3a73a6a6048fa0189f7fa6306a638279977fcd Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-07-09gbp: Ownership of dynamically created vxlan-gbp tunnels managed via gbp_itfNeale Ranns20-396/+694
Type: fix This solves the ownership of vxlan-gbp tunnels. When the last reference of these goes away they need to be deleted. Currently there are two owners; gbp_itf via gef_itf and the lock held by the gbp_endpoint_location_t. The problem is that the loc removes its reference whilst the fwd still holds the gbp_itf, and things go wrong. This change moves the lifecycle management of the vxlan-gbp tunnel to the gbp_itf. When the last lock of the gbp_itf goes, so does the tunnel. now both the EP's loc and fwd can hold a lock on the gbp_itf and it's only removed when required. The other change is the management of the 'user' of the gbp_itf. Since each user can enable and disable different features, it's the job of the gbp_itf to apply the combined set. determining a unique 'uesr' from the caller was near impossible, so I moved that to the gbp_itf, and return the allocated user, hence the 'handle' that encodes both user and interface. The hash table maps from sw_if_index to pool index. Change-Id: I4c7bf4c0e5dcf33d1c545f262365e69151febcf4 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-07-08map gbp papi: match endianess of f64Paul Vinciguerra1-1/+3
clib_net_to_host_f64, clib_host_to_net_f64 are now implemented as '=', https://gerrit.fd.io/r/#/c/20406/ set papi to match. - all f64 api references are now wrapped with clib_net_to_host_f64 or clib_host_to_net_f64. IEEE f64 endianess is not defined. If clib_net_to_host_f64 and clib_host_to_net_f64 are later defined in VPP as big-endian, it is a single character change in the papi vpp_serializer. Note: This breaks the api in a manner that would not be detected by the flag day initiative. The scope is small. This only impacts map.api, which applied the u64 transformation, while the gbp api uses '='. The implementation of "=" raises issues for the papi socket implementation if used between systems of differing endianess. See Vratko's comments. - Added get_f64_endian_value() to api to allow client to verify endianess of f64's. Type: fix Depends-on: https://gerrit.fd.io/r/#/c/20484/ Change-Id: I00fc64a6557ba0190398df211aa0ea5c7eb101df Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-07-08gbp: More unit testsNeale Ranns1-0/+1
Type: test Change-Id: I0a58cc19bdfb73eabadbf6eb49b57e8db96959b5 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-07-08gbp: refactor policy nodesBenoît Ganne8-406/+301
Refactor both policy and policy-dpo nodes so they share the same code for contract & acl lookup and for tracing. This should help to implement new policy schemes. Type: refactor Change-Id: If5704bda708838eb01516dd39473d9bf248cfdf6 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-07-05gbp: use bd index at ext-itf creation instead of bd idBenoît Ganne1-1/+3
Type: fix Fixes: cfc7a107e6cb8be6e7c53a08e23a146c431c8e90 Change-Id: I341cbc94271ab89c3c643756a9c04b790cef8591 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-07-05gbp: update gbp-ext-itf APIBenoît Ganne5-107/+49
Change gbp-ext-itf API to create anonymous ext-itf through the same API as non-anonymous instead of a new API Type: refactor Change-Id: I381ff2a5bcd55276793df78ca891334c28946cd0 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-07-03gbp: Consider data-plane learnt source better than control-planeNeale Ranns3-4/+16
Type: feature Change-Id: Ice8fc0da6450d2aa8ba63ca1277393ac3605aa2c Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-07-03gbp: improve contract formattingNeale Ranns1-8/+12
Type: feature Change-Id: I04be003bd86f828ec387dd0309bebcbf0a041e3a Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-07-02gbp: add anonymous l3-out subnetsBenoît Ganne4-22/+63
An anonymous l3-out subnet is a locally attached l3-out subnet, and differs from regular l3-out subnets in the way adjacencies are managed. It is required for the anonymous l3-out external interfaces to correctly classify locally attached l3-out hosts. Type: feature Change-Id: Ie7bc88b1f22abc4d0b46db5f3cfbf208bc53ba5f Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-07-02gbp: add anonymous l3-out external interfacesBenoît Ganne12-156/+481
So far, GBP l3-out packets classification & policy relied on programmed EP. All traffic to/from l3-out must go through a known EP. This patch introduces a new feature where l3-out next-hops are only known by their subnets (l3-out prefixes). As there are no longer known EPs to program, an interface must be configured as external anonymous l3-out. Packets classification & policy on this interface will rely on the external subnets programmed in the BD VRF. Note that contrary to all other interfaces in a GBP BD, external anonymous l3-out interfaces have BD L2 learning turned on and rely on ARP/ND. Type: feature Change-Id: Ieedb29dff4e967d08c4301e82d06bff450a63e5f Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-07-02gbp: disable L2 BD learning per-interfaceBenoît Ganne4-37/+51
Disable L2 BD learning for each GBP interface instead of at the bridge level. This does not change the current behavior (learning is disabled for all GBP interfaces) but enables turning it on selectively for future features such as anonymous l3-out. Type: refactor Change-Id: Id88644277941d703600acf97d49cbc3332ae3f68 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-07-01gbp: VRF scoped contractsNeale Ranns15-36/+148
Type: feature Change-Id: I01772cfc3a0118a5c49bf346339788824e6931b2 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-06-26gbp: enforce same endpoint mac and ip srcBenoît Ganne1-6/+15
During packet classification, make sure packets coming from an EP also matches this specific EP IP address and vice-versa. This prevents and EP to send a packet on behalf of another EP. Type: fix Change-Id: I30287644ec73b90d9b6913952a82b2baedf6a5ff Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-06-26api: refactor format_vl_api_prefix_t return keysPaul Vinciguerra1-1/+1
format_vl_api_prefix_t returns a dict with keys 'address' and 'address_length', but other format_vl_api_prefix functions return a dict with 'prefix', and 'len'. Refactor all format_vl_api_prefix_t to return consistent keys 'address' and 'len'. Type: refactor Change-Id: I5f9558fc2da8742a303266e011102f5b2db80aad Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-06-19gbp: Add support for arp unicast forward in gbp bridge domainMohsin Kazmi1-1/+8
Type: feature Change-Id: Id487fe46194d0a89bd5ac53a9f4ff78b5ff6de60 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-06-06gbp: fix lpm classification with vlanBenoît Ganne1-50/+12
Fix GBP LPM packet classification in the presence of a VLAN header. Change-Id: I2ff63b34f7475d696b10b5a245ff802bbb1ff01a Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-06-06gbp: do not classify unknown packet as EP packetsBenoît Ganne1-0/+4
If we fail to classify the packet based on LPM we must not classify it based on the EP sclass. Change-Id: Ie234e0c87bd44976c3c57c818359c93f7d99ab84 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-06-03GBP: add subnet cli commandBenoît Ganne1-2/+85
Change-Id: I0f631da9d13df2d9c32bad879b2a6034cb847378 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-05-16init / exit function orderingDave Barach1-8/+7
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-05-03plugins: clean up plugin descriptionsDave Wallace1-1/+1
- Make plugin descriptions more consistent so the output of "show plugin" can be used in the wiki. Change-Id: I4c6feb11e7dcc5a4cf0848eed37f1d3b035c7dda Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2019-04-18GBP: update cli to reflect API changesBenoît Ganne3-10/+7
Some GBP debug cli short help and commands were not in sync anymore with GBP API. Change-Id: I224bec51fbacd8a3685b70d4e7a52b5803fd3ad4 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-04-16gbp: Add support for allow sclass/dclass 1Mohsin Kazmi3-5/+36
Change-Id: I51f61a399e3eace93011f9431cbd7968e9be627c Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-04-08GBP: drop and contract countersNeale Ranns2-16/+126
Change-Id: Ib436512a26e53f70f7b5e47bf34224ab73e5244e Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-04-07GBP: coverity uninitialised variable warningNeale Ranns1-1/+1
Change-Id: Ic6e23f497fd91dcb1441f9f4d88a182712e69d3f Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-04-06gbp: Add gbp bd flags unit testMohsin Kazmi1-0/+6
Change-Id: I5b18cb84bec88f5514cacd2df61b5ce3c70abd77 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-04-04GBP: Counters per-contractNeale Ranns4-13/+62
Change-Id: I28bb9e3d3ea3a99a9e24801ef5241a0099186108 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-04-04gbp: Add bd flagsMohsin Kazmi4-11/+38
Add flags for unknown unicast drop, multicast and broadcast drop and arp unicast. Change-Id: I1203137510b8bee0a20ecfe5f2efad8043d4bac6 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-04-03GBP: iVXLAN reflection checkNeale Ranns2-12/+42
packets should not egress on an iVXLAN tunnel if they arrived on one. Change-Id: I9adca30252364b4878f99e254aebc73b70a5d4d6 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-28Punt InfraNeale Ranns1-19/+19
A punt/exception path that provides: 1) clients that use the infra 2) clients can create punt reasons 3) clients can register to recieve packets that are punted for a given reason to be sent to the desired node. 4) nodes which punt packets fill in the {reason,protocol} of the buffere (in the meta-data) and send to the new node "punt-dispatch" 5) punt-dispatch sends packets to the registered nodes or drops Change-Id: Ia4f144337f1387cbe585b4f375d0842aefffcde5 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-27GBP: fixes for l3-out routingNeale Ranns2-8/+16
Change-Id: I4d73b712da911588d511a8401b73cdc3c66346fe Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-14GBP: coverity legit bugNeale Ranns1-0/+1
Change-Id: Ia7d98842669c605052371c2bf6a016e4b4f7dc8f Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-14GBP: update semantics for subnetsNeale Ranns1-13/+23
Change-Id: I895c03b365619e6c66613242f4a97c79ce579879 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-14GBP: get source address from ARP packets for LPM classificationNeale Ranns1-43/+69
Change-Id: I1370c1882f8ba9b709e54e62356d2c57d47d20fc Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-12GBP: L3 out fixesNeale Ranns5-25/+129
Change-Id: I0562d597fd45c7ddcb6db42cf17d3ffb569eb140 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-12GBP: custom-dump functionsNeale Ranns5-17/+376
Change-Id: I719882acb59bd069fd88b10989f11085a0c41ae6 Signed-off-by: Neale Ranns <nranns@cisco.com> Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>