aboutsummaryrefslogtreecommitdiffstats
path: root/vlib
AgeCommit message (Collapse)AuthorFilesLines
2016-09-20Added volatile to local variables needed by setjmpEyal Bari1-2/+2
Function vlib_main uses nonlocal control transfer (setjmp, longjmp), local variables might be mapped to cpu registers which might be different when longjmp'ing back to it. Added volatile to keep those variables on the stack. to fix vpp crash when exiting via SIGTERM. Change-Id: I03e836966c68a966a84d635bc1f7b3a3c252f3ea Signed-off-by: Eyal Bari <ebari@cisco.com>
2016-09-13Use the correct thread stack alignment constraint, VPP-401Dave Barach1-2/+6
Change-Id: Ia7837dfaa9ed200145aeea19177fe549ab4bd087 Signed-off-by: Dave Barach <dave@barachs.net>
2016-09-07Avoid use of node index 0 by registering null-nodeDamjan Marion1-0/+29
In some cases it is convenient to use 0 as an invalid node index so here we make sure that index 0 is not used. Change-Id: I5af6bef6769d56086ceb343423185f22843732bd Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-09-06Add support for input nodes in interrupt mode on the worker threadsDamjan Marion1-0/+24
Change-Id: Ice2e0e60c801bd6fb67f3a544e95e9ffaa22ca16 Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-09-06VPP-346 More VPP doc fixesChris Luke5-7/+23
- Fix issue in Doxy dependency check when nothing needs to be installed. 'set -e' and plain '[]' logic don't mix well. - Fix Makefile snafu when building Doxy output for a single file. - Include only one of vnet/vnet/buffer.c/dpdk_buffer.c in docs depending on DPDKness. This could do with some improvement in future, eg to properly align the pre-doxy steps with what Doxy does. - Fix rendering of 'inline' tag in Doxygen by having it interpret always_inline as "inline static". - Bunch of duplicate CLI command structure names that confused docs and may one day have caused debugging issues. - Several other Doxygen syntax issues fixed, like documenting non-existant parameters (usually just the wrong parameter name, typos, etc) Change-Id: Ia8cca545e5de9f8750602bffa3c4548acc8971aa Signed-off-by: Chris Luke <chrisy@flirble.org>
2016-08-31VPP-221 CLI auto-documentation infrastructureChris Luke3-40/+149
As a step before Doxygen, extract CLI-related struct initializers from the code and parse that into a summary of the CLI commands available with the provided help text, such as it is. At the moment this only renders this into an indexed Markdown file that Doxygen then picks up but later we can use this information to enrich the existing VLIB_CLI_COMMAND macro documentor as well as provide runtime documentation to VPP that is stored on disk outside the binary image. Additionally support a comment block immediately prior to VLIB_CLI_COMMAND CLI command definitions in the form /*? ... ?*/ that can be used to include long-form documentation without having it compiled into VPP. Examples of documenting CLI commands can be found in vlib/vlib/unix/cli.c which, whilst not perfect, should provide a starting point. Screen captures of sample output can be seen at https://chrisy.flirble.org/vpp/doxy-cli-example.png and https://chrisy.flirble.org/vpp/doxy-cli-index.png . Next, shift the Doxygen root makefile targets to their own Makefile. The primary reason for this is that the siphon targets do dependency tracking which means it needs to generate those dependencies whenever make is run; that is pointless if we're not going to generate any documentation. This includes the package dependencies since they since they sometimes unnecessarily interfere with the code build in some cases at the moment; later we will look to building a Python venv to host the Python modules we use. One final remark: In future we may consider deprecating .long_help in the VLIB_CLI_COMMAND structure entirely but add perhaps .usage_help. .short_help would be reserved for a summary of the command function and .usage_help provide the syntax of that command. These changes would provide great semantic value to the automaticly generated CLI documentation. I could also see having .long_help replaced by a mechanism that reads it from disk at runtime with a rudimentary Markdown/Doxygen filter so that we can use the same text that is used in the published documentation. Change-Id: I80d6fe349b47dce649fa77d21ffec0ddb45c7bbf Signed-off-by: Chris Luke <chrisy@flirble.org>
2016-08-23Fix PCI vendor_id/device_id detection for SR-IOV devicesDamjan Marion3-12/+25
Change-Id: I06ae392c7c8c3b4be7fd46560add442f42927c22 Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-08-17Coding standards cleanup - remove trailing whitespace, fixes VPP-332Damjan Marion2-10/+10
Change-Id: I649a17f8fa47599faf438b2e596f53761790d10c Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-08-12VPP-237: indent fixes in prep for checkstyleEd Warnicke10-99/+121
Ran indent *twice* Change-Id: If9c18b81983bb859cc8dc3b415c67cbf318fc618 Signed-off-by: Ed Warnicke <eaw@cisco.com>
2016-08-12VPP-223 Add doxygen tags to counter.hDave Barach1-58/+118
Change-Id: Ifddf37db04b2ecfa7b470cd52e8eaa2211823f3d Signed-off-by: Dave Barach <dave@barachs.net>
2016-08-11VPP-223 Document vlib cooperative multi-tasking threadsDave Barach2-2/+173
Change-Id: I283963b004ed6d91133e7e36811f75834280bbe7 Signed-off-by: Dave Barach <dave@barachs.net>
2016-08-10VPP-189 Fix coverity warningsDave Barach1-0/+1
Change-Id: Iea6d338e60a95f7f30c10c2e751d4827e816f700 Signed-off-by: Dave Barach <dave@barachs.net>
2016-08-09VPP-189 Fix Coverity warningsDave Barach2-5/+12
Remove a bunch of historical SMP code that we're not using; clean up coverity warnings as a side-effect. Change-Id: Ic80d2f87c7fd4e654078cac23ad5ec287a1d7ffe Signed-off-by: Dave Barach <dave@barachs.net>
2016-08-05vpp-189 Clean up more coverity warningsDave Barach1-1/+1
Time to make the donuts Change-Id: I528937800f7daefce19723dda0216e58d857942c Signed-off-by: Dave Barach <dave@barachs.net>
2016-08-03VPP-180 Clean up multi-socket / multi-chunk mempool discoveryDave Barach1-5/+73
Change the default DPDK version to 16.07, and rename the indicated patch directory. Use the native vhost-user driver. Change-Id: Ie3d17e90e363ce86f0233b58c152de683b5d9456 Signed-off-by: Dave Barach <dave@barachs.net>
2016-07-27VPP-189 coverity warning cleanupsDave Barach7-14/+35
Change-Id: Ia4fbf4352119504e022b89d10d44a5259d94f316 Signed-off-by: Dave Barach <dave@barachs.net>
2016-07-26VPP-223 General documentation updatesChris Luke1-17/+17
Per the TWS session... - Some simple treatment of the contents of pool.h - Changing some \brief commands to @brief. (will do a more complete pass at this later.) Change-Id: I050ee69c59c4b572ac295b5f86940b7f4c934cd9 Signed-off-by: Chris Luke <chrisy@flirble.org>
2016-07-26Fix coverity warningsDave Barach1-2/+5
Change-Id: I37131f2d814a608fe9098daff83ff395f7ce99d7 Signed-off-by: Dave Barach <dave@barachs.net>
2016-07-22Add DPDK 16.07 support (rc3 based)Damjan Marion1-0/+5
DPDK vhost-user support is disabled due to significan changes in the DPDK vhost-user code which are not compatible with current VPP code. Change-Id: I3f0d28cb75f6370282ec7e33d57cbfb77e1a3ce1 Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-07-13VPP-189 Addtional fixes for last coverity fix in linux_pci.cJohn Lo1-8/+4
Fix VPP startup problem where it cannot attach to a combination of 3 Intel igb 1GE ports and 2 Intel ixgbe 10GE ports whose PCI addresses are specified in the DPDK section of VPP startup config file as follows: dpdk { dev 0000:02:00.1 dev 0000:02:00.2 dev 0000:02:00.3 dev 0000:05:00.0 dev 0000:05:00.1 } Change-Id: Ibb12f9e9a9184d00da51a49961772ac3a42a2d1d Signed-off-by: John Lo <loj@cisco.com>
2016-07-12Show cli for plugin path, name filter and loaded pluginsShwetha Bhandari1-0/+32
Change-Id: If6ab5f08bcdcf5e24bb8b31926894d2a56cb6c14 Signed-off-by: Shwetha Bhandari <shwethab@cisco.com>
2016-07-08fd-io-styleify passDave Barach64-7913/+9475
Change-Id: If2d57a213fc2fec996db26df332910c3d2105f97 Signed-off-by: Dave Barach <dave@barachs.net>
2016-07-08Remove unnecessary and obsolete configure.ac directivesDamjan Marion1-1/+0
Also enable silent rules where missing Change-Id: Ia521886815c862b013f01df4cc18fd8a298aaaa1 Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-07-08VPP-189 Some bugfixes for issues reported by CoverityChris Luke1-6/+29
CID 130914 Buffer not null terminated CID 130916 Unchecked return value CID 130938 Unchecked return value from library CID 130939 Unchecked return value from library CID 130940 Unchecked return value from library CID 131042 Argument cannot be negative CID 131222 Resource leak CID 131223 Resource leak CID 131334 Double close CID 131335 Read from pointer after free CID 131211 Resource leak CID 131212 Resource leak Change-Id: Idd80b91f621278e0be15911f2ed4354dbe4fc7f2 Signed-off-by: Chris Luke <chrisy@flirble.org>
2016-07-07Remove #if DPDK == 0, to eliminate a data structure size mismatchDave Barach1-2/+2
Otherwise, e.g. the ip4/6_main_t's change size between PLATFORM=vpp and PLATFORM=vpp_lite. That, in turn, makes it far easier to build broken plugins. Change-Id: Ic962d75b170eee698de29c4e29849ce73d27caad Signed-off-by: Dave Barach <dave@barachs.net>
2016-07-07Remove duplicate code buffer_func.hDamjan Marion1-4/+0
Change-Id: I57e442b1f3486c5e8caac9d2e288869ee10f37b8 Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-07-07Add some doxygen tagsDave Barach2-1/+139
Also add an index of node names Change-Id: Id65c2e607976d8bad73deb738035a471be077196 Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: Chris Luke <chrisy@flirble.org>
2016-06-29Decouple worker thread code from dpdk, enable worker threads in vpp_liteDamjan Marion5-54/+584
Change-Id: I28616f1a89f2da95484438ec1a1db64845f15ef6 Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-06-18Move pkt replication counter to the opaque2 cache lineDave Barach3-14/+16
Change-Id: I5e6edfd03ab41949be2c768dfe68aa824bbc1f38 Signed-off-by: Dave Barach <dave@barachs.net>
2016-06-17Dynamically compute ip feature subgraph orderDave Barach1-7/+7
This change-set enables plugins to add themselves to the ip4/ip6 feature subgraphs without having to modify core vpp engine code at all. Add VNET_IP4/IP6_UNICAST/MULTICAST_FEATURE_INIT macros which express the required ordering constraints, and off you go. Along the way, added an implementation of Warshall's algorithm to vppinfra; to compute the positive transitive closure of a relation. In this case, the relation is "feature A runs before feature B." With that in hand, ip_feature_init_cast(...) computes a partial order across the set of configured feature subgraph nodes. In unit-testing, we discovered VPP-145 - ip4/6 inacl wiped out vnet_buffer(b)->ip>current_config_index, which exists in main. So, we fixed that by moving b->trace_index, adding b->current_config_index, and removing the ip opaque union current_config_index. Change-Id: Iff132116f66413dc6b31ac3377198c7a32d51f48 Signed-off-by: Dave Barach <dave@barachs.net>
2016-06-156rd: Move to pluginOle Troan1-3/+8
- Change toplevel plugins make target. Now builds all plugins under plugins/. (Apart from sample-plugin). - Move sixrd code to plugins directory and make necessary changes to make it a plugin - Remove 6rd hooks from IP lookup code Change-Id: I447e92e3bee240cd8de01d0abac2e1708e8c27d1 Signed-off-by: Ole Troan <ot@cisco.com>
2016-06-14Fix node siblingsOle Troan2-51/+44
Siblings did not work at all. Fixed by generating sibling relationships earlier in vlib_node_main_init(). Also adding a node dynamically before nodes were initialised failed for sibling nodes. Change-Id: I2fb73eb33a6f5ee216f566074e18ed495e20634d Signed-off-by: Ole Troan <ot@cisco.com>
2016-06-14Retire io threads and main-thread-io modeDamjan Marion2-6/+1
Change-Id: I64f5ec5e32f200834c63ec3b304f9f20cef332a7 Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-06-09VPP-133: increase size of cli process stacksDave Barach1-1/+1
Change-Id: Ic488b95b54438028940403b02a5916347c53bd05 Signed-off-by: Dave Barach <dave@barachs.net>
2016-06-09Add verbose flag for packet trace, show hexdump in verbose dpdk input traceDamjan Marion2-5/+15
Verbose trace can be enabled with: trace add dpdk-input 1 verbose Change-Id: If58cfc561143d5a44f7d11e61d54b6835692a0e3 Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-06-05Add per-device startup config supportDamjan Marion2-1/+3
This change adds support for providing per-interface parameters in the startup config. Sample configuration: dpdk { dev default { num-rx-queues 3 num-tx-queues 3 } dev 0000:02:00.0 { num-rx-queues 2 num-tx-queues 2 } dev 0000:02:00.1 } Change-Id: Ia7d9ae2ac9c4fd9baaa480d061a395f8a421a722 Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-06-01VPP-83 Allow non-privileged clients to use the vpp binary API.Dave Barach1-3/+6
Use the command line argument "api-segment { uid <nnn> gid <nnn> }" to configure shared memory segment file ownership. Defaults to uid = gid = 0. Shared-memory segments are explicitly set to 0770 mode, aka "rwxrwx---". Change-Id: Ic5d596b68139add61e7de6ace035c57dfd030111 Signed-off-by: Dave Barach <dave@barachs.net>
2016-05-23Native VPP driver for Intel Niantic family of NICsDamjan Marion6-0/+292
Available only in vpp_lite platform Change-Id: I09d112af5f7f4521ec25196ecdd8c02c20eedd5f Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-05-21Add per-thread, per-node runtime stats serializationDave Barach2-0/+4
Change-Id: Ic4009cdbac67b7cd53c88079439496b9d9dfaa35 Signed-off-by: Dave Barach <dave@barachs.net>
2016-05-19VPP-74 Fix signedness issue when terminal resizesChris Luke1-4/+9
When re-locating our current viewport into the pager buffer we need to verify that the new viewport is within the boundaries of the index. This condition is considered very rare, but nontheless the check is needed. Unfortunately I assumed the variable was signed; it is not, and the subtraction can in some cases cause the value to be negative. This is therefore a bonafide semantic error that may cause problems. This patch reworks the logic to avoid having to change it to be signed. Change-Id: I26f0747d38dcc43dd9c092d50f2489b122009e7b Signed-off-by: Chris Luke <chrisy@flirble.org>
2016-05-19Remove unused PCI codeDamjan Marion1-7/+0
Change-Id: I1d91c9982823758059f9d6aa699982253930e7ba Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-05-19Add support for multiple microarchitectures in single binaryDamjan Marion1-0/+27
* compiler -march= parameter is changed from native to corei7 so code is always genereted with instructions which are available on the Nehalem microarchitecture (up to SSE4.2) * compiler -mtune= parameter is added so code is optimized for corei7-avx which equals to Sandy Bridge microarchitecture * set of macros is added which allows run-time detection of available cpu instructions (e.g. clib_cpu_supports_avx()) * set of macros is added which allows us to clone graph node funcitons where cloned function is optmized for different microarchitecture Those macros are using following attributes: __attribute__((flatten)) __attribute__((target("arch=core-avx2))) I.e. If applied to foo_node_fn() macro will generate cloned functions foo_node_fn_avx2() and foo_node_fn_avx512() (future) It will also generate function void * foo_node_fn_multiarch_select() which detects available instruction set and returns pointer to the best matching function clone. Change-Id: I2dce0ac92a5ede95fcb56f47f3d1f3c4c040bac0 Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-05-18Rework of the old PCI codeDamjan Marion10-335/+473
* adds support for VPP native PCI drivers using standard uio_pci_generic kernel driver * adds generic PCI interrupt callback * splits code to generic PCI handling and linux specific * adds new debug cli 'show pci [all]' Change-Id: I447c2285e319e9725d70688c1b70c9dedda51fdc Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-05-17dpdk/build - 32bits compilationChristophe Fontaine1-1/+1
In vnet/vnet/devices/dpdk/device.c, post 2 event data instead of merging them into 1 u64. Change-Id: I8b1d61b894279fb6eb57bb82a05affc14360e6b8 Signed-off-by: Christophe Fontaine <christophe.fontaine@qosmos.com>
2016-05-16VPP-23 Re-work pager line collationChris Luke1-88/+364
To better handle lines longer than the terminal width, re-work how the pager collates lines. We still store each output line in a vector or lines; additionally we index the start and end of displayable lines. The index then becomes the data to work out what to display. If the terminal is resized this index is rebuilt and the current page redisplayed and an attempt made to keep the current top-of-screen line in place. Change-Id: Icc6f4f72dabad89682cd82be88adb03eadb7811d Signed-off-by: Chris Luke <chrisy@flirble.org>
2016-05-16VPP-57 Add missing license headers in doc filesChris Luke3-0/+48
Change-Id: Icd1f8952f66d3cee027c59f3148c67f1839de306 Signed-off-by: Chris Luke <chrisy@flirble.org>
2016-05-13VPP-57 Add Doxygen to VPPChris Luke4-51/+141
- Configures Doxygen. - Adds a source filter to do magic on our use of the preprocessor to do constructor stuff to make Doxygen grok it better. - Adds a convenience helper to the root Makefile. - Adds a README.md to the root directory (and which Doxygem uses as its "mainpage". - Add several other documentative files. - Currently using SVG for call graphs, though this may have a load-time performance impact in browsers. Change-Id: I25fc6fb5bf634319dcb36a7f0e32031921c125ac Signed-off-by: Chris Luke <chrisy@flirble.org>
2016-05-10VPP-46 Fix cut-and-paste in the debug CLIChris Luke1-38/+46
Since the move to line-mode the debug CLI was eating everything in the input_vector but only processing upto the first newline. Cut-and-paste type operations generally send a large block of input with multiple newlines and thus all but the very first line were simply ignored. This patch fixes that and also cleans up the difference between input_vector and current_command which in turn removes a lot of cruft from the keystroke parser. Previously current_command was just the character accumulator inside the char-by-char keystroke parser; complete commands were copied back to input_vector (overwriting anything already in there). Now, in char-by-char mode: - input_vector is the stream of incoming bytes yet to be processed - current_command is the accumulated characters of the next command to be executed; once newline is found, it is the complete command to be executed. In line mode: - input_vector and current_command are the same thing. Change-Id: I72d21f0f3508b413879071ab186a71cef1124a2b Signed-off-by: Chris Luke <chrisy@flirble.org>
2016-05-10Avoid clobbering output_function by concurrent CLI sessions doing ↵Andrew Yourtchenko4-17/+63
vlib_process_wait_for_event*. A problem is easily reproducible by taking the test harness code from the commit, and launching it in two terminals with some time overlap - the outputs will be sent to the wrong session. This commit moves the output_function and argument from a global structure into the process structure, thus the output_function is not clobbered anymore and each session gets only its own output. To ensure the callers can redirect the outputs to different destinations (e.g. the API calls via shared memory, etc.) the existing logic for vlib_cli_input() was retained. To avoid the magic numbers usage in the logic that does the page-alignment of the process stack, there are changes around the stack[] member of vlib_process_t. Also added a compile-time assert to ensure that the stack does indeed start on the page size multiple boundary. Change-Id: I128680ac480735e5f214f81a884e414268e5d652 Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2016-04-29VPP-26 Iterate through empty command line in cli historyChris Luke1-10/+24
When cursoring through the command history in the CLI, when you reach the end of the history (ie, back at "where you started") most CLI's typically show a blank line. This is a visual cue that you are back where you started. Change-Id: I5733dbd0dcdc6deac6a0a856cfadbdb987456ec0 Signed-off-by: Chris Luke <chrisy@flirble.org>