Age | Commit message (Collapse) | Author | Files | Lines |
|
Type: fix
Some simple settings(e.g. bringing up an i40e/ice interface) through
vnat consume more than the currently available stack space.
This root cause of this issue is same with commit
b2dbb36fc265b8996fc7fa310dda447d5b0479cb "vlib: fix startup-config \
-process stack overflow" and commit 2fd44a00aa26188ca75f0accd734f2 \
1758c199bf "vlib: fix cli process stack overflow"
Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: I312e4fed96a679aa68b859e28a90a2a4b6eb0c6e
(cherry picked from commit a488f37559493657b59181c1212e57b3b9cc3689)
|
|
Nominally a bug-fix cherry-pick, but completely manual. Closer to a
full feature backport minus binary api changes.
Send dhcp unicast packets to ip4-lookup. Otherwise, these packets
won't reach a dhcp server on a different subnet.
Do an immediate client scan after processing wakeup events.
Calculate the next process wakeup time by scanning all
clients.
Increase maximum (idle, no-clients-configured) timeout to 1000
seconds.
Reduce log spew.
Type: fix
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I3d10cd4c353298ed0b19e7e30887dc1d8d07b19e
(cherry picked from commit c54162981cdd41d65ed283df36955007552ddffe)
|
|
The function vl_socket_read_ready did contain some comments already,
but as they stated, the logic has to be tricky to cover multiple cases.
Comment:
+ Add function-level comment
+ Add comments to describe some of local variables
+ Add many comments to describe internal state at particular lines.
Simplify:
+ Remov mbp_set as it is never needed.
+ Replace msg_len with msgbuf_len to save "+ sizeof (msgbuf_t)".
Improve:
+ Early exit on EAGAIN.
Fix:
+ "n" now only tracks input_buffer.
Previously, it was entering the detection of additional messages
even for unprocessed_input.
+ Set up msg_buffer (including appending to unprocessed_input)
outside full-message-detection loop now,
so it cannot be executed multiple times as before.
Type: fix
Ticket: VPP-1785
Change-Id: I256e34b435be06844458744a13ea37a0e86a96f9
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
(cherry picked from commit 6a6af6ea1a77b5818e717047b5d01251ef6d024a)
|
|
Add vl_client_connect_to_vlib_thread_fn (...) and export the
memory_client_main_t definition.
If you use this new API, make sure not to miss the setjmp / longjmp
dance shown in .../src/vlibmemory/memory_client.c:rx_thread_fn(...),
which is required for the rx pthread to terminate cleanly; please
process client delete reply messages in the rx thread...
Type: refactor
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ia67038ec59e2e14b174c67afca15b2c3f67a4d20
(cherry picked from commit 920180e5e0722c78c258ff26476fd5efa434032d)
|
|
Binary API trace replay with multiple worker threads depends in many
cases on worker thread graph replica maintenance. If we (implicitly)
assert a worker thread barrier at the debug CLI level, all graph
replica changes are deferred until the replay operation completes. If
an interface is deleted, the wheels may fall off.
Type: fix
Ticket: VPP-1824
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I9b07d43f8501caa5519e5ff9ae4c19dc2661cc84
|
|
Type: fix
On multiworker setup when an app client dies, the
vec_reset_length call fails the assert in
clib_mem_is_heap_object. Same thing might happen for
the clib_warnings
Change-Id: I369f9d2dbe60407c84994a4e8d25f6df7848ca93
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
(cherry picked from commit 5ed3fe3dd4320a7b4080f18de32ef491b5a1c7f0)
|
|
Type: fix
Change-Id: I2a599c22d5770587fdd419e5d212c8527054d2e9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit f26b2511cf661d4ebef32c19f944041637ec5907)
|
|
Type: refactor
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I4b77879b0a84fdec3c1518a972cf003d5135222d
Signed-off-by: Ole Troan <ot@cisco.com>
(cherry picked from commit a8df85ce1fe957efa8301bd5b5ac3c03737d31f1)
|
|
Usage: vppapitrace.py [-h] [--debug] [--apidir APIDIR] {convert,replay} ...
optional arguments:
-h, --help show this help message and exit
--debug enable debug mode
--apidir APIDIR Location of JSON API definitions
subcommands:
valid subcommands
{convert,replay} additional help
convert Convert API trace to JSON or Python and back
replay Replay messages to running VPP instance
To convert an API trace file to JSON:
vppapitrace convert /tmp/api.trace trace.json
To convert an (edited) JSON file back to API trace for replay:
vppapitrace convert trace.json api-edited.trace
To generate a Python file that can be replayed:
vppapitrace convert /tmp/api.trace trace.py
vppapitrace convert trace.json trace.py
Replay it to a running VPP instance:
vppapitrace replay --socket /tmp/api.trace
In VPP that file can be replayed with:
vpp# api trace replay api-edited.trace
This patch also modifies the API binary trace format, to include the
message id to message name table.
Ticket: VPP-1733
Change-Id: Ie6441efb53c1c93c9f778f6ae9c1758bccc8dd87
Type: refactor
Signed-off-by: Ole Troan <ot@cisco.com>
(cherry picked from commit edfe2c0079a756f5fb1108037c39450e3521c8bd)
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
|
|
Type: feature
This is needed when creating pthreads in client applications,
they need a way to set __os_thread_index per thread
that does not conflict with the binary API thread index.
If __os_thread_index is left to 0 in two client pthreads and
they call vl_msg_api_alloc and vec_resize at the same time
it can fail due to them sharing (and push/poping) the same
clib_per_cpu_mheaps slot.
Change-Id: I85d4248a39b641a4d3ad5a1c1bd6e0db5875fab6
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
|
|
A waste of binary API trace space; an otherwise idle control-plane
will eventually fill the api trace buffer with them.
Type: fix
Ticket: VPP-1725
Change-Id: Id8338ea4070cd76481595005986efc558f0694e6
Signed-off-by: Dave Barach <dave@barachs.net>
(cherry picked from commit 996a757ff93233379bf0a464dce6d99f5d622ca4)
|
|
Cleaned up a few instances of side-bet elog_string hash table
usage. Elog_string handles that problem itself.
Add cli commands to vat to initialize, enable/disable, and save an
event log.
Event logging at the same time in both vpp and vat yields a pair
of event logs which can be merged by the "test_elog" tool.
Type: refactor
Change-Id: I8d6a72206f2309c967ea1630077fba31aef47f93
Signed-off-by: Dave Barach <dave@barachs.net>
|
|
The fix uses memset to zero after alloc,
as sizing of source string is not obvious.
Function vl_msg_api_alloc_zero is added (and used),
so similar bugs can be fixed easily.
Type: fix
Ticket: VPP-1716
Change-Id: I3b20040d0de4222686c58779f2c0af78c5543504
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
|
|
Costs nothing, and leaves nothing to the imagination.
Type: fix
Change-Id: I7c9f9fb9325475c268eca062da7bbbf014438cfc
Signed-off-by: Dave Barach <dave@barachs.net>
|
|
Build api trace message print fns into the built-in copy of api_format.c
Optimize memory allocator behavior when the api trace wraps.
Type: Fix
Change-Id: If799d8784a459f981fc9ee3a3ca03d3f63b2bcd0
Signed-off-by: Dave Barach <dave@barachs.net>
|
|
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>
|
|
Wait for init shm reply to be consumed before sending fd over the
socket.
Change-Id: I5cd0246d8debcc3c8a163b7e2dd400ca0050a2fb
Signed-off-by: Florin Coras <fcoras@cisco.com>
|
|
Handle the case where buffer overflows.
Then SOCK_SEQPACKET assumption that multiple API messages
are not returned by recv() is broken. Use SOCK_STREAM for
API exchanges instead.
Add support for running tests over sockets.
make test SOCKET=1
Change-Id: Ibe5fd69b1bf617de4c7ba6cce0a7c2b3f97a2821
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
Especially on a single core setup the RX thread could signal the main thread
that it was done, before main thread listened to the signal.
Change-Id: Ib70337b21bcf77787ce4ee0aa9cf80c6da2215af
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
Some API action handlers called vl_msg_ai_send_shmem()
directly. That breaks Unix domain socket API transport.
A couple (bond / vhost) also tried to send a sw_interface_event
directly, but did not send the message to all that had
registred interest. That scheme never worked correctly.
Refactored and improved the interface event code.
Change-Id: Idb90edfd8703c6ae593b36b4eeb4d3ed7da5c808
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
doxygen-friendly
The current output of the API diff requires some massaging
to appear like a table in the docs generated by doxygen.
This change eliminates this need.
Change-Id: Ic9269a0e5e232e4d01a0695561e4f90eee287327
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
|
|
"defininion changed" output
strncmp() succeeds if the i+1th message is "foo_reply",
because the comparison terminates early after "foo" -
which triggers the "definition changed" rather than
"only in ..." message.
Fix also the case where i+1th element does not exist.
Change-Id: I127136410491d9dd102e160fd831fcf6f0bd3a9f
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
|
|
vpp/src/vlibmemory/vlib_api_cli.c
Fixing the help string for the "set api-trace" command.
Change-Id: I70f85a4f55466d2cc01018c4ad8cbe8332dbb925
Signed-off-by: ezkexma <maqi.z.ke@ericsson.com>
|
|
Coverity complains about resource leak after open when fd gets 0 with below
warning.
off_by_one: Testing whether handle tfd is strictly greater than zero is
suspicious. tfd leaks when it is zero.
It is right. 0 is a valid fd. -1 is not.
Change-Id: I22c2eb75b99bb6209921b9f874190cbbdf10e6ce
Signed-off-by: Steven Luong <sluong@cisco.com>
|
|
Grab the thread barrier across a set of RPCs, to greatly increase
efficiency. Avoids running afoul of the barrier sync holddown
timer.
Change-Id: I782dfdb1bed398b290169c83266681c9edd57a3f
Signed-off-by: Dave Barach <dave@barachs.net>
|
|
Change-Id: I4ba099832b646392c1b6fa34236ca3377c9f786c
Signed-off-by: Neale Ranns <nranns@cisco.com>
|
|
Change-Id: Ia30ff1e62304e65f27497ce05f8e40631c06d69e
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
|
|
Change-Id: Ib3f030e906da9828fdad27e19b9efb0c349b0734
Signed-off-by: Brian Nesbitt <brian.nesbitt@owmobility.com>
|
|
The socket API used the socket index handle directly in the sock_delete handler,
resulting in "unknown client id" warnings, and a failure in return for socket clients.
Change-Id: Ia69f740ce0f834cd9b62b7157243a1f42bcad765
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
* u32/u64/uword mismatches
* pointer-to-int fixes
* printf formatting issues
* issues with incorrect "ULL" and related suffixes
* structure alignment and padding issues
Change-Id: I70b989007758755fe8211c074f651150680f60b4
Signed-off-by: David Johnson <davijoh3@cisco.com>
|
|
Change-Id: I740a7423327b724e88fdfa35d90cb1285e9f9746
Signed-off-by: Dave Barach <dbarach@cisco.com>
|
|
Change-Id: I8e39df129f80c8d3d73181fc5d3ac60ae382a6b6
Signed-off-by: Florin Coras <fcoras@cisco.com>
|
|
A client can send a memclnt delete message and ask vpp to cleanup the
shared memory queue. Obviously, in this case no delete reply is sent
back to the client.
Change-Id: I9c8375093f8607680ad498a6bed0690ba02a7c3b
Signed-off-by: Florin Coras <fcoras@cisco.com>
|
|
Change-Id: Ife05d25fd736ae3064f01e974e5aecc5b48de924
Signed-off-by: Florin Coras <fcoras@cisco.com>
|
|
Should have been done this way years ago. My bad.
Change-Id: Ic7bf937fb6c4dc5c1b6ae64f2ecf8608b62e7039
Signed-off-by: Dave Barach <dave@barachs.net>
|
|
Definitely indicates a client binary API queue handling issue. We
can't simply turf the message, or we'll end up with a more subtle
derivative misbehavior.
Change-Id: I6363fda1430b0a9ec33ad69badc1e0072fe20fa8
Signed-off-by: Dave Barach <dave@barachs.net>
|
|
Change-Id: Id4f37f5d4a03160572954a416efa1ef9b3d79ad1
Signed-off-by: Dave Barach <dave@barachs.net>
|
|
Typically we have scalar_size == 0, so it doesn't matter
but vlib_frame_args was providing pointer to scalar frame
data, not vector data. To avoid future confusion function
is renamed to vlib_frame_scalar_args(...)
Change-Id: I48b75523b46d487feea24f3f3cb10c528dde516f
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Change-Id: I2476e3e916a42b41d1e66bfc1ec4f8c4264c1720
Signed-off-by: Dave Barach <dbarach@cisco.com>
|
|
This reverts commit 71615399e194847d7833b744caedab9b841733e5.
There seems to be an issue with ARPs when running with multiple workers.
Change-Id: Iaa68081512362945a9caf24dcb8d70fc7c5b75df
Signed-off-by: Florin Coras <fcoras@cisco.com>
|
|
Change-Id: Ib5c346641463768cf33eaf8cb5fab5b63171398d
Signed-off-by: Dave Barach <dave@barachs.net>
|
|
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab
Signed-off-by: Dave Barach <dave@barachs.net>
|
|
- When clients connect, instead of returing registration indicies return
handles. By convention socket registrations will have the MSB set to 1.
This makes it easy to distinguish them from shm registrations.
- Fix client reads to allow for messages larger than 4kB (needed for the
creat reply wherein the message table is provided).
Change-Id: I7bc0a072d066dffbf2e3ad9ba3ed50291231af9d
Signed-off-by: Florin Coras <fcoras@cisco.com>
|
|
Adds support for running the API purely across Unix domain sockets.
Usage: vpp = VPP(use_socket=True)
Change-Id: Iafc1301e03dd3edc3f4d702dd6c0b98d3b50b69e
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
Instead of relying on main epoll loop to send messages, try to send as
soon as possible.
Change-Id: I27c0b4076f3599ad6e968df4746881a6717d4299
Signed-off-by: Florin Coras <fcoras@cisco.com>
|
|
On CentOS 7, having libvlibmemoryclient link libvlib causes
a SEGV when a program or library is run which links against
libvlibmemoryclient and dlopen() is called. This is because
dlopen() executes any functions with __attribute((constructor))
set. The VLIB_CLI_COMMAND macro creates CLI registration
functions that have this attribute set. So CLI registration
functions end up being run by applications which are clients
of the VPP API.
This doesn't occur on ubuntu 16.04, because ld seems to
omit shared libraries that were listed on the command line
if they are not used to resolve any symbols.
Removing the link to libvlib on vlibmemoryclient to fix this
problem results in another problem. Tests of libvcl_preload
fail when running 'make test'. This happens because
libvcl_preload calls dlopen but does not link against libdl.
When libvlibmemoryclient had libvlib linked, these errors
did not occur since libvlib links libdl. Adjusted the build
of libvcl_preload to explicitly link libdl.
Change-Id: I271ba2f9226ce1602e1f6c1525f3b093bb0345ed
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
|
|
Change-Id: I1382021a6f616571b4b3243ba8c8999239d10815
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Change-Id: I3a0f48381232fcac1727034aa6d2504a8d1edb04
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Change-Id: Ic18aa0fb42a72b5e0ebbfbebdefc7582cb46b5ea
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
|
|
Change-Id: Ibc59323e849810531dd0963e85493efad3b86857
Signed-off-by: Damjan Marion <damarion@cisco.com>
|