Age | Commit message (Collapse) | Author | Files | Lines |
|
File "/vpp/src/vpp-api/python/vpp_papi/vpp_serializer.py", line 512, in __init__
'Unknown message type {}'.format(f_type))
vpp_papi.vpp_serializer.VPPSerializerValueError: Unknown message type i16
Type: fix
Change-Id: Ibf73dc8df90153db586afe614e47be49739bac2f
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
(cherry picked from commit ba2c7fad1d1448b40ea78f36e833821e9ab84687)
|
|
The BaseTypers object were reused, so a default for anyother mesage
would be inherited in new messages.
Type: fix
Fixes: 85465588b18fef9c4712f864f512e00741e2d4f2
Change-Id: Ie1efb85a76b088653eb9ea4b88540c98b6b0aad0
Signed-off-by: Ole Troan <ot@cisco.com>
(cherry picked from commit 40dc4b35e3d946efbc5c2b8b0af5e52d67b7fe6c)
|
|
No point in checking the return value,
as .sendall() raises on error
(and the previous check was missing "not").
Type: fix
Change-Id: I9e07709ddd7093f91ffef87808abbab264b8aa5a
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
(cherry picked from commit 8921dc675458b238fc03c5aed53d3462bcdbdb3c)
|
|
In the previous implementation of socket transport for PAPI,
socket methods .send and .recv_into were used.
But they are not guaranteed to send/receive all the data
for the full message. The receive part contained a loop,
but it handled only the main message, not the header.
This patch replaces .send with .sendall
and uses newly defined _read_fixed method.
Also, removed Paul from maintainers,
as he is not active much, lately.
Type: fix
Change-Id: Iae1a68bf8f9e666856b7c7d62ebfe22defc5dfe1
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
(cherry picked from commit 6df2c7954126a316f86908526c3bb4d649f06597)
|
|
Previously, self.transport.q got the messages
(at least for socket transport), stored in the encoded (packed) form.
In order to avoid accessing internals for async reads,
a new method is introduced, to perform
blocking reads of decoded (unpacked) messages.
The method is also used in _call_vpp(),
so sync and async reads are kept compatible.
Type: feature
Change-Id: Id49792dfa57c00b1a14a198031c5398d09a9ba20
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
(cherry picked from commit 0938547eaaf5440de28877fa4f873c21bcb8cfbf)
|
|
Dumping whole cli_inband output causes huge unformatted messages written
to logger, so truncate these to avoid that.
Type: fix
Change-Id: I59565a98e3595cbfe4971cc346e104cb198d8f24
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit 5e2f84d2cf97a6efa89c1c4bbf80de6a8f03d2a8)
|
|
Callback receives "reply" messages containing context,
but previously there was no easy way
to get the automatically generated context value
of the originally sent "command" message.
With this, the caller can store the contexts,
so the callback knows which command got replied to.
Type: feature
Change-Id: I58ca812d20b03916f74096c396126710115a747c
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
(cherry picked from commit 2f6e0c6002f732b7f938a0f770f19c9dec9269f1)
|
|
One type for address with prefix and one type for prefix.
Ticket: VPP-1769
Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Icfec51d9b7d5cde1d69fbecdd97498688ab7b295
Signed-off-by: Klement Sekera <ksekera@cisco.com>
|
|
Enforce that variable length fields are the last element of API messages.
Add a 'fixed' version of string type, since dealing with
multiple variable length strings turned out too painful
for the C language bindings.
The string type is now:
{
string name[64]; // NUL terminated C-string. Essentially decays to u8 name[64]
string name[]; // Variable length string with embedded len field (vl_api_string_t)
};
The latter notation could be made available to other types as well.
e.g.
{
vl_api_address_t addresses[];
}
instead of
{
u32 n_addr;
vl_api_address_t addresses[n_addr];
};
Type: fix
Change-Id: I18fa17ef47227633752ab50453e8d20a652a9f9b
Signed-off-by: Ole Troan <ot@cisco.com>
(cherry picked from commit e5ff5a36dd126ee57dca4e0b03da2f7704e0a4f5)
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
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>
|
|
Now that we have support for f64:
- create explicit types for timestamp(datetime)/timedelta
- update log_details to use timestamp and remove redundant string representation.
If you need the string representation, in python do str(timestamp).
If you prefer the raw f64 value, the client can pass in the
_no_type_conversion option.
Type: feature
Change-Id: I547b5fa7122d2afa12628b7db0192c23babbbae8
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
|
|
vppapigen supports additional types not handled by the papi seializer.
This adds the types for the sake of parity.
Change-Id: Id8efad7f169b5023879935575ace2cc3e9c291d4
Type: feature
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
|
|
As the injected logger is already expected
to be used everywhere, this is a fix.
The few lines in vpp_serializer.py are not fixed,
but they are not encountered in CSIT testing.
Functions call_logger and return_logger
have single call site each (and confusing names, as they do not log),
so saved few lines by inlining them.
Type: fix
Change-Id: I7dd1e610ef6b885943708bf78bddedfbcf4daa1a
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
|
|
cherry picking fix for bug introduced by https://gerrit.fd.io/r/#/c/20011/
- also fixes unit tests.
Type: fix
Fixes: ab05508e1eb96749b68de8ccd2f6f88ff3e64fad
Change-Id: I8287385f094911ea70de4751a716a7e0e6521b64
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
|
|
Python3 uses __bool__ instead of __nonzero__
Type: fix
Depends-on: https://gerrit.fd.io/r/#/c/20484/
Change-Id: I7dd13d0508ab18d6c50c235f4186006799e92b45
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
|
|
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>
|
|
Assuming 2500 50 char lines:
string_concat elapsed: 5.919933e-04
string_join elapsed: 2.830029e-04
string_concat size: 156,312,500
string_join size: 125,000
Type: refactor
Change-Id: I0a400265426bde492e9a651d24996ddcfe954aa1
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
|
|
Socket transport is maintaining message_table to map
message name to index. After disconnect and re-connect,
the VPP may have been restarted with different set of plugins,
so message_table has to be wiped.
+ Edited MAINTAINERS to recognize "papi" as a separate component.
Type: fix
Change-Id: I1f16ad7ee0886e03bbc6a17bcddbfcaa322354e5
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
|
|
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>
|
|
- vac_read was returning the same code for multiple errors.
- Refactor VppTransportShmemIOError to capture rv and description.
Type: refactor
Change-Id: Ifb8ca5ff679f658bcd92a43ecddaffd2fc18dbd5
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
|
|
Eases troubleshooting.
Changes:
<FuncWrapper object at 0x7fa7402de790>
to
<FuncWrapper(func=<want_ip6_ra_events(u16 _vl_msg_id, u32 client_index, u32 context, u8 enable_disable, u32 pid)>)>
Type: refactor
Change-Id: I3a893090e024a63a0b3b0de51cb3bb2d2a1678c5
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
|
|
Type: test
Change-Id: Ic81bd4a9eba3c89a746e7a9b9e471b59cd87fa40
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
|
|
Show the constructor of the object instead of the memory location.
api client: <VPPApiClient apifiles=None, testmode=False,
async_thread=True, logger=<logging.Logger object at 0x7f35d1bd2590>,
read_timeout=1, use_socket=False,
server_address='/tmp/vpp-unittest-TestGbpApi-pOKbWg/api.sock'>
vs.
api client: <vpp_papi.vpp_papi.VPPApiClient object at 0x7fa0003df750>
Type: feature
Change-Id: I1460d76f6796776dd525c0844e9e426ec2d52398
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
|
|
Add a version in the base header of the stat segment
To make support for multiple reader implementations safer.
Change-Id: I6816e2a51a98c2df1e621e80d4ef0b4ba4e9f47b
Type: feature
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
Previusly, read error could happen before message_thread starts,
so do not attempt to join in that case.
Change-Id: Ie119916831e320e38eb02e48515b4c6a9cb937e5
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
|
|
Add support in the API language for specifying a field default.
Add default support in Python binding.
define foo {
u16 mtu [default = 1500];
};
This is client side only. I.e. if the mtu argument is not passed to the foo function,
the client language binding will set it default to 1500.
Change-Id: I5df43f3cd87cb300b40ca38e15dcab25b40e424a
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
When running forked, distinct copies of the 'get_context'
singleton are created for each process. To run under forked processes,
(as with make test TEST_JOBS=10), we need to use a shared
memory value across the processes.
Type: fix
Change-Id: I9eab8ce46ec23584e5bd651735ad75fd3f018e1a
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
|
|
Since we test vpp_papi as part of tests, the need for
ipaddress under python2.7 is masked.
Add ipaddress to setup.py for python <=3.3.
Change-Id: I01c2f5560eeb740e546024e84028d5a2fb2ace45
Type: fix
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
|
|
Under PY3, inet_pton returns OSError, not socket.error.
Type: fix
Change-Id: Id270a684c0ab124cbe1ddcb7123e14e85af844b8
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
|
|
vl_api_prefix_t returns ipaddress.<IPv[46]>Network objects.
Accept Network objects as well as existing string format.
Type: refactor.
Change-Id: Iba5403724a7b3e1da3b3740027fccd43631bf31e
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
|
|
Traceback (most recent call last):
File "/vpp/test/framework.py", line 521, in setUpClass
cls.quit()
File "/vpp/test/framework.py", line 556, in quit
cls.vapi.disconnect()
File "/vpp/test/vpp_papi_provider.py", line 308, in disconnect
self.vpp.disconnect()
File "/vpp/src/vpp-api/python/vpp_papi/vpp_papi.py", line 500, in disconnect
if self.event_thread is not None:
AttributeError: 'VPPApiClient' object has no attribute 'event_thread'
Type: fix
Change-Id: I7a8db08b0922bf92ab42df121b1707073af9cedf
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
|
|
Type: fix
Change-Id: I9b6bdacdb9a0750834de9a93d8c3f7ed827ce3c8
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
Change-Id: I331efb20b98a7e3c507d9158d0221ee7d5353b18
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
|
|
The change https://gerrit.fd.io/r/18352 has introduced a check
which raises when neither apifiles nor apidir are set.
This change removes that check, as it broke CSIT.
If such a check is intended, find_api_dir() should be removed.
Also, make sure you do not break CSIT next time.
Change-Id: I0faab7c41d199e3aa5d5bc6aab0defd1ab9e10da
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
|
|
The current code only allowed access to the main thread error counters.
That is not so useful for a multi worker instance.
No return a vector indexed by thread of counter_t values.
Type: fix
Change-Id: Ie322c8889c0c8175e1116e71de04a2cf453b9ed7
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
Change-Id: I9e3af8674e8aae27079fd03f6286f165d777814f
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
|
|
This should make connect() partially retriable,
at least against "No such file or directory on socket",
and when disconnect() is called before retrying connect().
Added TODOs for future improvements.
Change-Id: I5ee727fbc17d66446589b8c781f270055187db68
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
|
|
Added TODOs for further improvements.
Change-Id: I6724dd8b3de5537518a5c6e0ee9abe72f57b273e
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
|
|
Change-Id: I80e6ccd6f63e3eca2ba723f3b39a47475ae9aed0
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
|
|
Change-Id: I80ef74abcb14136984a4c94ba60414a1348015d3
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
|
|
The previous implementation fails with
RuntimeError("cannot set daemon status of active thread")
when a second connect() follows first disconnect().
Change-Id: I671005923eb020130a57b0b484a3386a05d7be33
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
|
|
string name [limit = 64];
Meta-data to do argument validation.
Change-Id: I1f3e0f09b2d5285224399413d25206f77bd3f4b1
Signed-off-by: Ole Troan <ot@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>
|
|
Change-Id: Ic62dfa0bf3e082a0b999026830c64a9c543da586
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
Change-Id: If20d2fbab9b854b7db276c81918fdff6abcb8385
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
|
|
Change-Id: I7aba1760f68798fc5bea1244ce798e4b528a4df4
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
|
|
py2 defaults to 'ascii', py3 defaults to 'utf-8'.
Change-Id: Ib76d0ec56f24535e4bafd397cc6fb5e85967d508
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
|
|
The stdlib introduced IntEnum in python 3.4 and IntFlag in python 3.6.
Change-Id: I3ac278a9d5a97eefa9fc4f1491f0cd030e40c3b2
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
|
|
Change-Id: I77a43bfb37d827727c331cd65eee77536cc15953
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
This is the first step to be able to remove all the API message
wrappers in vpp_papi_provider.py. This allows to remove all
functions that do not override parameters (different from zero),
and a separate dictionary for messages requiring different defaults.
The general requirement is that all new tests should use named
arguments directly. Not positional arguments through the wrapper.
Note when removing functions, the calls in vpp_papi_provider
wrappers do not necessarily follow message order.
Change-Id: If64916c07f8622c138db3a9d7c4a98b93a058e68
Signed-off-by: Ole Troan <ot@cisco.com>
|