summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2020-10-13Generate VPE HTTP handlerVladimir Lavor3-1/+247
* This should fix GoVPP build Change-Id: If53177253ad4a6616860aad50ce54e5944bbea6e Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2020-10-10Updated multi-vpp exampleVladimir Lavor2-90/+273
* In addition to configuring multiple VPPs it now also shows how to connect and read stats from several VPPs at once * Added a brief readme * More readable example log output * May run in a loop Change-Id: Ifa5d54e954557e7b6569826a48c526185ec751a3 Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2020-10-02Check retval value and convert to error in generated RPC client codeOndrej Fabry299-13337/+882
Change-Id: I816b4802cb5fc46239f6db0480fa4cf3645fe2f0 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-10-01Updated changelog for v0.4.0Vladimir Lavor1-6/+24
Change-Id: I3290bbc8cbdfb634533ceb4606e4708b1a386dce Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2020-09-22Reload stats socket when VPP restartsVladimir Lavor1-25/+100
The current implementation loads the stats socket and maps it to the memory. If VPP restarts, the socket file is recreated while the mapped data remain unchanged, silently failing since it does not get any updates. This change adds socket file monitoring which reconnects and remaps the socket file in such a case. Change-Id: I061f7400410f4dfe5de66ba7844c4ae1567bbcbe Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2020-09-18binapigen: fix union sizeVladimir Lavor112-468/+404
This change fixes calculated byte size of the union composed from another union(s). Change-Id: I596a3c2a585cc42570b1d00dab3a5ad4993dabfa Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2020-09-07Remove unnecessary allocationVladimir Lavor4-52/+51
Change-Id: If77b7b37ae736fdf21f4c337350905480e6fb011 Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2020-09-07Fix decoding messages of identical types in streamOndrej Fabry1-17/+24
Change-Id: Id6f6bc3de5b9ff7230108a4171810207c94f9a38 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-09-04Increase default health check parametersOndrej Fabry1-2/+2
Change-Id: I0b5fbbd98fc1bb6fc9d86ed81cb1b3f9755fed67 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-09-04Update VPP config warnings and change log level in proxyOndrej Fabry3-4/+4
Change-Id: I8f965a0758c4b7459f27a46c095dad232e331032 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-09-04Stats APIv2Vladimir Lavor7-700/+1045
* Compatible with stats v2 API * Compatibility with stats v1 was persisted * 19.04 (legacy) dropped Change-Id: I91a3ab0c007fed6d972eee01d7caf69af29305d1 Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2020-09-03Improve doc & fix import orderingNathan Skrzypczak206-228/+604
This also updates /binapi and adds a new make command to generate api files out of a local vpp repo clone Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com> Change-Id: Iff7965388a74ecd21af80f10b5a59d4ed8da6340
2020-09-02fixed data race in mock vpp adapterSergey Elantsev1-1/+4
There was a race in reading VppAdapter.mode in SendMsg and writing in MockReply/MockReplyHandler/MockReplyWithContext. All these *Reply* methods hold VppAdapter.repliesLock, so this fix uses this lock to safely read the value of a mode field. Signed-off-by: Sergey Elantsev <elantsev.s@yandex.ru> Change-Id: I6c8873b766df6ea866196a9b96a48ebd08689772
2020-08-28fix(binapigen): Fix name conflict for union field constructorsOndrej Fabry2-8/+19
PROBLEM Issue discovered in flow_types.api on master (20.09-rc0), where generator encountered inconsistent naming for union type Flow, causing name conflicts with their constructors. SOLUTION Previous cases of union types (address, punt) both contain suffix "Union", thus generator now adds "Union" suffix it is not defined. This way we won't break previously generated code for users. Change-Id: Iffadc167774d66d8416fe36485782bb68ca2a70d Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-08-25Binapi generator: improved file inputVladimir Lavor5-29/+44
In addition to the standard file name input (for example "vpe"), binary API generator now again accepts full file path like "/usr/share/vpp/api/core/vpe.api.json" as an input direcotry or argument. Change-Id: I591b5d26e7f101cdcc4af64d3bdabaab48b5b2ef Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2020-08-21Expose version info control flagsNathan Skrzypczak3-8/+15
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com> Change-Id: Ida098149bdf23dccafb7b1f2ac2bb83f21f918c9
2020-08-07Update libmemifVladimir Lavor5-24/+36
Change-Id: I5db0460f375c9e34bc09170a310d52e1a619ed34 Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2020-08-04Add SetLogger for setting global loggerOndrej Fabry3-6/+15
- list prerequisites in README - avoid calling go list by hard-coding module path Change-Id: Ib8af1934f55b7e112a8124a20f1f4d39ce651133 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-07-22Fix binapigen decoding and minor improvementsOndrej Fabry414-27037/+189330
- fixed allocating byte slices before copying decoded data - simplified encoding functions - several minor improvements Change-Id: I6669424b89eb86333805cb1b57e4551169980cc2 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-07-17Added VPP state 'NotResponding'Vladimir Lavor1-14/+30
This change allows informing client about the current VPP state in more detail. * In case the VPP is overloaded but keeps its configuration, client received 'NotResponding' event message * If the VPP process dies (the socket is closed), the client receives 'Disconnected' event message Additional fix: event messages are discarded if the buffer is full. This could cause GoVPP to hang after some time in case the client was not receiveing events. Change-Id: I94a4647f6643f1d97bf52e5d7996d70229b0577d Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2020-07-17Improve binapi generatorOndrej Fabry367-23531/+99477
- simplified Size/Marshal/Unmarshal methods - replace struc in unions with custom marshal/unmarshal - fix imports in generated files - fix mock adapter - generate rpc service using low-level stream API (dumps generate control ping or stream msg..) - move examples/binapi to binapi and generate all API for latest release - add binapigen.Plugin for developing custom generator plugins - optionally generate HTTP handlers (REST API) for RPC services - add govpp program for browsing VPP API Change-Id: I092e9ed2b0c17972b3476463c3d4b14dd76ed42b Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-07-14socket adapter: don't bother sending sockclnt_delete messagesDave Barach1-45/+2
vpp cleans up socket clients when the socket closes. I verified that sending a correctly-marshalled sockclnt_delete message results in duplicate close complaints. The marshalling code wasn't right - the (important) client_index field is in a non-standard position - and there's no point in sending a message we don't need to send. Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ia32980b08a99cc878835f5db21f64de391759fa4
2020-07-10Fix: generate (un)marshall for memory client messagesVladimir Lavor7-283/+33
* use generated Marshall/Unmarshall for socket client connection messages instead of the generic wrapper Change-Id: Ie1049e080630dbc60085debc6875e17962e93a0e Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2020-07-09Removed global binapi VPP adapterVladimir Lavor4-22/+231
* added example showing management of 2 VPP instances with different sockets * updated changelog Change-Id: I531eda8f055cc2a24ba2210217e70a8ad42a47c0 Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2020-07-07Fix README.md quickstart sectionDave Barach1-17/+91
README.md needs further cleanup Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Iee170f909b57548d53f8a5fa67cd387652ccac99
2020-07-02Binary API generator improvementsVladimir Lavor19-687/+951
* Many aliases removed, aliased types reference original types via import instead * Added various helper methods for simpler conversion between go and vpp types Change-Id: I7999ac8d524cece4da03e6447b13421659765095 Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2020-06-25Introduce Stream - experimental API for low-level access to VPP APIOndrej Fabry14-163/+1276
Change-Id: I2698e11b76ff55d9730b47d4fee990be93349516 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-06-24Fix codec fallback and generate type importsOndrej Fabry53-3462/+23535
Change-Id: Idd76c7f19d952939caf153928ac60175845078ff Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-06-22Refactored binapi generator with message encodingOndrej Fabry61-5232/+27510
Change-Id: I5a6abb68b9d058866f94818169300e5c2fc43895 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-06-16Optimize socketclient adapter and add various code improvementsOndrej Fabry17-332/+521
This commit includes: Features - optimized [socketclient](adapter/socketclient) adapter and add method to set client name - added list of compatible messages to `CompatibilityError` Fixes - `MsgCodec` will recover panic occurring during a message decoding - calling `Unsubscibe` will close the notification channel Other - improved log messages to provide more relevant info Examples - added more code samples of working with unions in [union example](examples/union-example) - added profiling mode to [perf bench](examples/perf-bench) example - improved [simple client](examples/simple-client) example to work properly even with multiple runs Dependencies - updated `github.com/sirupsen/logrus` dep to `v1.6.0` - updated `github.com/lunixbochs/struc` dep to `v0.0.0-20200521075829-a4cb8d33dbbe` Change-Id: I136a3968ccf9e93760d7ee2b9902fc7e6390a09d Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-05-18Bump version to v0.3.5v0.3.5Ondrej Fabry2-2/+8
Change-Id: I14aa5446ad218f06a06b9e40e0adde6ca81e4819 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-05-18Fix stats data errors and panic for VPP 20.05Ondrej Fabry2-22/+39
- fixes panic occurring when updating error counters - fixes stat data length errors when updating stats Change-Id: If2d4bcb7df084bf1999ba469f128b7a01aa6be5e Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-04-17Format generated Go source code in-processv0.3.4Ondrej Fabry14-58/+71
This commit: - removes dependency on gofmt tool - cleans up package imports - re-generates binapi for VPP 20.01 Change-Id: Ie4347720f92a87eb278be66c9f9ed9719c7bbbc3 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-04-09proxy: Unexport methods that do not satisfy rpc to remove warningv0.3.3Ondrej Fabry4-14/+31
Change-Id: Icd4173edc55d83b1766f204184eb818b859e648e Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-03-20Fix statsclient for VPP 20.05-rc0 (master)v0.3.2Ondrej Fabry6-75/+102
- this change fixes panic that was occurring with recent VPP that was caused by incorrectly calculated vector length - converting returned vector length from uint64 to uint32 results in correct length value Change-Id: I76a4b9d147c3df3bea9d3e5ef5853e2809dc42e8 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-03-18Fix import path in examples/binapiv0.3.1Ondrej Fabry10-46/+45
Change-Id: I6af1ae2778b73f37be09c64a2948417e576f02ab Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-03-18Release 0.3.0v0.3.0Ondrej Fabry17-3067/+1992
- regenerate examples/binapi for latest VPP from stable/2001 - add import-prefix flag to set custom prefix (fallbacks to using go list) Change-Id: Ib09f134cf9662e348be2575448964de2b9e5c1ee Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-01-31Support imported type aliasesOndrej Fabry4-31/+207
Change-Id: I2e6ad9fb51e1cf55a52267720f2394e792946f7e Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-01-27Update jsongo depOndrej Fabry4-13/+13
Change-Id: I10dfbaa38de67835a84f5112d6b16bbe466c3bfe Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-01-20Fix parsing default meta parameterOndrej Fabry2-2/+2
Change-Id: Ibfc1f97e299256809978cb84f1685aa6729e898c Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2019-11-15Improve compatibility checkingOndrej Fabry8-18/+68
- added CompatibilityError to api package to represent error with list of incompatible messages - added UnknownMsgError to adapter package to represent error for unknown message - added list of registered message types Change-Id: I2623b45135521d52612ba91e4605fc064a7fc76e Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2019-11-05Begin development of next release 0.3.0Ondrej Fabry14-135/+174
- update info in package ./version - update to Go 1.13 - regenerate ./examples/binapi for latest VPP: 19.08.1-release - clean code in proxy - refactor Makefile Change-Id: Ibf5c2682c2f4b3cbbea4aa1e35d3f02175d40a9b Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2019-11-04Update changelog for release 0.2.0v0.2.0Ondrej Fabry2-1/+18
Change-Id: Ifed742e75a48d065987d945c8667af2bdedb876a Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2019-10-30fix data races in proxy serverMatus Mrekaj10-126/+442
Signed-off-by: Matus Mrekaj <matus.mrekaj@pantheon.tech> Change-Id: I932d560548ee816e28683243a7318a2a7fbbb24a
2019-10-17add missing implementation for proxyMatus Mrekaj3-13/+88
Signed-off-by: Matus Mrekaj <matus.mrekaj@pantheon.tech> Change-Id: I1ab9efb9e575e7993501e7774628cbb60d16ec43
2019-10-15fix: Add guards for converting Stat interface (might be nil)Ondrej Fabry1-28/+33
Change-Id: I54cd9ca6fb6607a70031ba5e6318a9ea58db7e6c Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2019-10-10Introduce proxy for VPPOndrej Fabry4-0/+520
- proxy server defines RPC service for proxying binapi/stats to VPP - use cmd/vpp-proxy for proxy server/client Change-Id: I6e698e166ecf6db7109ae5adf8a93f308d3f3f2a Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2019-10-03Optimizations for statsclientOndrej Fabry17-680/+1286
- this dramatically improves performance for stats data collection - memory allocation is now done only when stat dirs change - updating prepared stat dir does not need to allocate memory - created integration test for testing stats client - added NumWorkerThreads and VectorRatePerWorker to SystemStats - added ReduceSimpleCounterStatIndex, ReduceCombinedCounterStatIndex for aggregating specific index Change-Id: I702731a69024ab5dd0832bb5cfe2773a987359e5 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2019-09-09add MockClearReplyHandlers() api for mock vpp adapterRavi Raju1-0/+10
Change-Id: I12285c77c9cf09a24c957a777b26ae54f082f317 Signed-off-by: Ravi Raju <ravir@employees.org>
2019-09-09Fix compatibility with latest master (20.01-rc0)Ondrej Fabry13-574/+1274
- fixed generator for new string types - update simple client example - regenerate examples binapi for VPP 19.08 Change-Id: If4fe78c130d95641f35f75cd0262b35b032acaf8 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>