aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp/vnet/main.c
AgeCommit message (Collapse)AuthorFilesLines
7 daysvlib: improvement to automatic core pinninghsandid1-0/+4
Type: feature If 'main-core' is not specified, the main thread is pinned by default to the cpu it is running on during initialization. This change does not impact manual core-pinning, which requires the 'main-core' argument e.g. 'cpu {main-core x corelist-workers n}. Change-Id: I874034591bf0acf4d71b231dfbbb0f6de8fe6060 Signed-off-by: hsandid <halsandi@cisco.com>
2024-04-24vppinfra: Add method for getting current executable nameTom Jones1-10/+16
Add a unix method for getting the current executable name. This is implemented to match the readlink api for existing calls. Type: improvement Change-Id: Id06a55892d09d0b305a56b55a424f53ffb685a72 Signed-off-by: Tom Jones <thj@freebsd.org> Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-03-12misc: remove GNU Indent directivesDamjan Marion1-2/+0
Type: refactor Change-Id: I5235bf3e9aff58af6ba2c14e8c6529c4fc9ec86c Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-02-18vnet: Add required header for pthread_npTom Jones1-0/+3
Type: improvement Change-Id: Ia9295b79340a18de6eb5fe80877dcf4ce97b35eb Signed-off-by: Tom Jones <thj@freebsd.org>
2023-12-22vlib: add error checks to thread pinninghsandid1-1/+7
Type: fix Added error checks around pthread_setaffinity_np calls to stop vpp launch if pinning fails. Change-Id: Iec391c485d1832b6c2ff20fbf789608f6bcf7b57 Signed-off-by: hsandid <halsandi@cisco.com>
2023-08-04vpp: detect early nosyslog and interactive flagsDamjan Marion1-0/+4
So error logs are displayed on console earlier.... Type: improvement Change-Id: If31b76c9d06254b0fec5b5b3f4e92a881b4cf786 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-10-11vppinfra: fix AddressSanitizerBenoît Ganne1-0/+1
When checking for CLIB_SANITIZE_ADDR to enable specific behavior for AddressSanitizer, we must have vppinfra/clib.h included as it is defined there. Type: fix Change-Id: I9060c3c29c1289d28596c215a1d1709b2ea7c84e Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-04-14vlib: disable cpu pinning if not configuredBenoît Ganne1-4/+7
In some environment like when running a lot of functional tests, it can be useful to run more VPP instances than CPU and let the Linux scheduler decide what to do. This change disable cpu pinning altogether in the single-threaded case, provided that no main-core is explicitely specified in the config Type: improvement Change-Id: I8c2f36fdd49c00f9adaaeb4c81aefb27c3420a9b Signed-off-by: Benoît Ganne <bganne@cisco.com> Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2021-10-05build: don't hardcode triplet, allow specifying custom lib dirDamjan Marion1-4/+2
Type: fix Change-Id: I33f364fda88914f88f9b976cb83e6d3ff466f0bb Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
2021-09-28misc: vpe.api messages dynamically allocatedOle Troan1-2/+2
This is the last in the series of moving API messages from vpp/api/vpe.api to vlibmemory/memclnt.api. This patch makes the remaining vpe.api messages dynamic, to help VAT2 binary-api command. Moves the VAT test code to a separate file and removes the now unnused API meta files. Type: improvement Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I01dd78eaff1d3715dff17d2643bf0f7f0089935b Signed-off-by: Ole Troan <ot@cisco.com>
2021-09-22vppinfra: make default hugepage size configurableDamjan Marion1-0/+8
i.e. memory { default-hugepage-size 1G } Type: improvement Change-Id: I822afb51712ae92f4e4992b8ffa33dcb15ccaef1 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-26vlib: split vlib_main_t into global and per-threadDamjan Marion1-4/+2
Type: refactor Change-Id: I8b273bc3bf16aa360f031f1b2692f766e5fc4613 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-11-04vlib: add postmortem pcap dispatch traceDave Barach1-3/+3
Inspired by a real-life conundrum: scenario X involves a vpp crash in ip4-load-balance because vnet_buffer(b)->ip.adj_index[VLIB_TX] is (still) set to ~0. The problem takes most of a day to occur, and we need to see the broken packet's graph trajectory, metadata, etc. to understand the problem. Fix a signed/unsigned ASSERT bug in vlib_get_trace_count(). Rename elog_post_mortem_dump() -> vlib_post_mortem_dump(), add dispatch trace post-mortem dump. Add FILTER_FLAG_POST_MORTEM so we can (putatively) capture a ludicrous number of buffer traces, without actually using more than one dispatch cycle's worth of memory. Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: If093202ef071df46e290370bd9b33bf6560d30e6
2020-09-30vpp: update 'show bihash' commandDamjan Marion1-51/+1
Type: improvement Change-Id: I6d00ba840d2168af0658f97c45a42d39be7cbbad Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-18vpp: make main heap page size configurable from startup.confDamjan Marion1-15/+56
Type: improvement Change-Id: I190c6896152c626aa7cb1055cfce5d9cfcd5b68b Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-16vpp: fix main heap initBenoît Ganne1-4/+1
NUMA node parsing with vlib_get_thread_core_numa() can failed on single socket systems. Use clib_get_current_numa_node() instead as we already pinned the main thread to the requested core. Type: fix Change-Id: I22339516d0305689a58584c92ded7c96eb53be39 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-08-06misc: harmonize namesDave Barach1-3/+3
Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ibad744788e200ce012ad88ff59c2c34920742454
2020-05-27dhcp: vat support for the dhcp_client_dump APIDave Barach1-0/+4
Also: permanently solve ordering issues with the vpp builtin vat plugin loader, by explicitly loading vat plugins once we're sure that all data plane plugins have registered their APIs / API message handlers. Fix compilation / link errors when the vpp builtin vat plugin loader is disbled by cmake configuration. Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Id553c63ae860ebfc196c5ad4b55c19e08fec2c9e Signed-off-by: Ole Troan <ot@cisco.com>
2020-05-27build: make address sanitizer options configurable with cmakeDamjan Marion1-2/+2
Type: improvement Change-Id: I9ee0407e0634f773862dd65ff5d5594814294c2c Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-04-22misc: asan: disable leak sanitizer by defaultBenoît Ganne1-1/+2
Leak Sanitizer is not stable yet with VPP. It can always be enabled at runtime with ASAN_OPTIONS=detect_leaks=1. Type: fix Change-Id: Ieff01091e2976e127783ebd331cd0e50a1dbca12 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-02-05vppinfra: numa vector placement supportDave Barach1-1/+12
Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I7e7d95a089dd849c1f01ecea84529d8dbf239f21
2019-11-27misc: add address sanitizer heap instrumentationBenoît Ganne1-0/+9
Introduce AddressSanitizer support: https://github.com/google/sanitizers/ This starts with heap instrumentation. vlib_buffer, bihash and stack instrumentation should follow. Type: feature Change-Id: I7f20e235b2f79db72efd0e756f22c75f717a9884 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-07-09vppinfra: allocate bihash virtual space on demandDave Barach1-0/+81
Reduces the vpp image virtual size by multiple gigabytes Add a "show bihash" command which displays configured and current virtual space in use by bihash tables. Modify the .py test framework to call "show bihash" on test tear-down Type: refactor Change-Id: Ifc1b7e2c43d29bbef645f6802fa29ff8ef09940c Signed-off-by: Dave Barach <dave@barachs.net>
2019-05-09add mactime plugin unit / code coverage testsDave Barach1-1/+21
The unit and code coverage tests are boring. The rest of the patch involves test and packet-generator infra cleanups. Teach the "make test-xxx" family of targets to set the api test plugin path correctly, to make "binary-api <api-message-name> <args>" debug CLI commands work correctly in the "make test" environment. Unfortunately involves both the top-level and test Makefiles. Add a minor pg cli feature, a CLI to manually set s->sw_if_index[VLIB_TX]. Consider the case where one configures an interface with both a device-input and an output feature. To test the output feature using the pg, it's necessary to inject packets into the interface output node with both b->sw_if_index[VLIB_TX] and b->sw_if_index[VLIB_RX] set correctly. For example: packet-generator new { name tx limit 15 size 128-128 interface local0 # rx: device input feature not configured on local0 tx-interface loop0 # tx: output node requires b->sw_if_index[VLIB_TX] node loop0-output data { hex 0x01005e7ffffa000dead0000008000102030405060708090a0b0c0d0e0f0102030405 } } Fix a longstanding bug in the packet generator stream setup. Remove kludges which set b->sw_if_index[VLIB_TX] to ~0 [in multiple places] instead of using the stream value s->sw_if_index[VLIB_TX], and setting THAT datum correctly. Change-Id: I1097a18e8db73661ded6b822c1d718f7e5cf36ed Signed-off-by: Dave Barach <dave@barachs.net>
2019-01-18Look for plugins in target triplet subdirDamjan Marion1-2/+4
Change-Id: I3bab0ab05b4f552ad64392439fb48409ab0ab8c0 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-11-05Don't autodetect plugin path if set on cmdlineKlement Sekera1-2/+3
Change-Id: Idf79f261a7590038c1813d3996f4644e3d7e0cbe Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-10-24Trivial: vpp/vnet/main.c fix resource leakPaul Vinciguerra1-2/+9
Change-Id: Ia6cadec8117d2cc35c9329910bb403bcd1b048ce Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-09-12Always use 'lib' instead of 'lib64'Damjan Marion1-6/+0
It is packaging responsibility to put libs in the right place. Use of lib64 resulted in huge amount of files with hardcoded lib64. This patch simplifies things... Change-Id: Iab0dea0583e480907732c5d2379eb951a00fa9e6 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-07-24Create a unit-test pluginDave Barach1-30/+0
Move the tcp unit test to the plugin Add a bihash unit test and a "make test" program to call it Adjust framework.py to load the plugin, which is disabled by default Change-Id: Ic229d386a56a9d28dbd54974f231149053ca8f93 Signed-off-by: Dave Barach <dave@barachs.net>
2018-07-18Add config option to use dlmalloc instead of mheapDave Barach1-1/+1
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-03Set main thread affinity before main heap is allocatedDamjan Marion1-0/+21
Change-Id: I524909570fc1736f51fd437d6d30566c461139bd Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-04-09Autodetect plugin pathDamjan Marion1-6/+48
dpdk plugin self-disables if there are no hugepages available Change-Id: Ib286e1a370deeb21248e6e961573ef9c68759b4c Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Dave Barach <dave@barachs.net>
2017-09-11Recombine diags and minimum barrier open time changes (VPP-968)Colin Tregenza Dancer1-0/+8
Support logging to both syslog and elog Also include DaveB is_mp_safe fix, which had been lost Change-Id: If82f7969e2f43c63c3fed5b1a0c7434c90c1f380 Signed-off-by: Colin Tregenza Dancer <ctd@metaswitch.com>
2017-08-31Set runtime_path properly when running non-rootDamjan Marion1-1/+1
non-root users should use /run/user/$PID/... Change-Id: I1ca136df7a339eff193ed9c9a396d6965b192d0e Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-08-24Make VPP runtime directory configurableDamjan Marion1-0/+5
New startup config command: unix { runtime-dir /run/vpp } Also, adds recursive mkdir funtion for use in deifferent places like cli-config socket path and dpdk hugepage directory path. Change-Id: I1446ceab9c220c25804e73a743a3ebb383450124 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-05-16VPP-845: add configurable elog post-mortem dumpDave Barach1-0/+9
Off by default. Enable via cmdline "... vlib { elog-post-mortem-dump } ..." Change-Id: I2056b9de9b37475f2bfeeb5404da838f1b42645a Signed-off-by: Dave Barach <dave@barachs.net>
2017-03-10Retire vpp_liteDamjan Marion1-3/+0
vpp_lite platform is not needed anymore as same efect can be achieved with following startup.conf config: plugins { plugin dpdk_plugin.so { disable } } Change-Id: I690ea8ceb1c6e1fe32e01e7da54e9958019a93bf Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-03-07Missing plugin binary API command fns found after brief searchDave Barach1-0/+6
Create hash tables before loading plugins. Previous init sequence wiped out most if not all of them. Change-Id: I5dd628895f68f740d525951511a9fef1822d39da Signed-off-by: Dave Barach <dave@barachs.net>
2017-02-03Plugin infrastructure improvementsDamjan Marion1-13/+2
This patch replaces requirement for vlib_plugin_register function in the plugin so file and introduces new macro: VLIB_PLUGIN_REGISTER () = { .version = "version string", .version_required = "requred version", .default_disabled = 1, .early_init = "early_init_function_name", }; Plugin will nor be loaded if .default_disabled is set to 1 unless explicitely enabled in startup.conf. If .verstion_required is set, plugin will not be loaded if there is version mismatch between plugin and vpp. This can be bypassed by setting "skip-version-check" for specific plugin. If .early-init string is present, plugin loader will try to resolve this specific symbol in the plugin namespace and make a function call. Following startup.conf configuration is added: plugins { path /path/to/plugin/directory plugin ila_plugin.so { enable skip-version-check } plugin acl_plugin.so { disable } } Change-Id: I706c691dd34d94ffe9e02b59831af8859a95f061 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-01-16dpdk: register rte_delay_us callback from vnetDamjan Marion1-62/+0
Change-Id: Ibf7fc9a54d3fbee431b4814fa8abc5ba29ed9eef Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-12-28Reorganize source tree to use single autotools instanceDamjan Marion1-0/+415
Change-Id: I7b51f88292e057c6443b12224486f2d0c9f8ae23 Signed-off-by: Damjan Marion <damarion@cisco.com>