7197 Commits

Author SHA1 Message Date
jaszha03
fb1ccc7c36 vppinfra: refactor clib_spinlock_t to use compare and swap
Tested performance of a CAS implementation (using __atomic_compare_exchange)
against a TAS implementation (using __atomic_exchange) using test_spinlock.c
and found some performance improvement.

Generated assembly for CAS and TAS implementations show that TAS always
executes with a load-store dependency, but CAS moves a branch condition
between the load and store so that only a load occurs when the lock is free.

Benchmarking:
The results below are the cycle counts from test_spinlock.c, configured so
that for 10000 iterations, 12 threads on separate cores are spawned, each of
which increments a global counter 10000 times in each iteration. For
A72, 8 threads are spawned in each test.

x86 Xeon TAS: 7.333e8, 7.605e8, 7.535e8, 7.485e8, 7.321e8
x86 Xeon CAS: 5.842e8, 5.433e8, 5.389e8, 5.983e8, 5.552e8
Aarch64 ThX2* TAS: 9.852e7, 10.209e7, 9.190e7, 9.600e7, 9.224e7
Aarch64 ThX2* CAS: 7.640e7, 7.486e7, 7.425e7, 7.269e7, 7.534e7
A72 TAS: 7.289e6, 6.963e6, 7.208e6, 6.976e6, 7.200e6
A72 CAS: 1.695e6, 1.608e6, 1.600e6, 1.634e6, 1.746e6

*ThunderX2 used additional gcc options "-march=armv8.1-a+crc+crypto+lse"

Type: refactor

Change-Id: Ic5cd97991804f6b012707fad1a5d1a6edb96cd3d
Signed-off-by: Jason Zhang <jason.zhang2@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Lijian Zhang <Lijian.Zhang@arm.com>
2019-08-01 11:54:17 +00:00
Florin Coras
635acbf4b7 tcp: honor snd_wnd in fast rxt
Type:fix

Change-Id: I2f4224a53360f533c086ebde6a3056e60431da87
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-01 11:52:51 +00:00
Neale Ranns
0bff37f74e qos: Uninitialised variable (coverity)
Type: fix
Fixes: 83832e7ced8be8b7de394415feaba70c32e3c38d

Change-Id: I63130c442f71d1aef0d389ab00bac8092224bec2
Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-08-01 11:51:26 +00:00
Vratko Polak
7520e17bfa vppapigen: revert "implement reversible repr's"
The previous change seems to affect all CRCs.

Type: fix
Fixes: b504777e7f1c9728e65b874284b4dfd39359c8a8.

Change-Id: I65e27ce22020e5ebc764b5a51b5fc84992ddb40a
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2019-08-01 10:31:49 +02:00
Hongjun Ni
3efcd0d7c3 lb: vip and as dump/detail api's
- lb_vip_dump/lb_vip_details - get all vip.
- lb_as_dump/lb_as_details - get all as list per vip.
- adds api unit test.
- adds vpp_lb to test framework.

Ticket:
Type: feature

Change-Id: I24be50d62c5234f3535cc840603ddd9df7eb3f07
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
2019-07-31 19:35:13 +00:00
Paul Vinciguerra
515eed4258 api: add prefix matcher typedef
There is a need to be able to specifiy whether a prefix in
a request is to match exactly or if more specific
prefixes are also desired.

Todo: Uncomment defaults, once supported in vppapigen.

Type: feature

Change-Id: I74fdef0e89e3aefda822c7c0a477e22479297a90
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-07-31 19:33:52 +00:00
Filip Varga
e6e09a4ace nat: elog rewrite for multi-worker support
Type: fix

Change-Id: I04f136a04bc022d223e4bcb5c59920bd1f1fd560
Signed-off-by: Filip Varga <filipvarga89@gmail.com>
2019-07-31 17:43:33 +00:00
Mohsin Kazmi
c343a17df5 gso: fix the test case
Type: fix
Fixes: 22e9cfd760be613f33a4135e9247729b64619cc6

Change-Id: Idb198642e439dc3d54c04d8bde9d3e8382ebf830
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-07-31 17:13:13 +00:00
Steven Luong
4208a4ce8d devices interface tests: vhosst GSO support
Add gso option in create vhost interface to support gso and checksum
offload.

Tested with the following startup options in qemu:
csum=on,gso=on,guest_csum=on,guest_tso4=on,guest_tso6=on,guest_ufo=on,
host_tso4=on,host_tso6=on,host_ufo=on

Type: feature

Change-Id: I9ba1ee33677a694c4a0dfe66e745b098995902b8
Signed-off-by: Steven Luong <sluong@cisco.com>
2019-07-31 16:33:15 +00:00
Neale Ranns
83832e7ced qos: Store function
Type: feature

store: write a QoS value into the buffer meta-data
record: Extract a QoS value from a packet header and store it.
mark: Make a change to the content of a packet header by writing a stored
      QoS value

Change-Id: I07d1e87dd1ca90d40ac1ae1774fee1b272cab83f
Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-07-31 16:17:36 +00:00
Paul Vinciguerra
b504777e7f vppapigen: implement reversible repr's
Type: feature

Change-Id: I92757f041cde399229c42e34515ace0fcd37908b
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-07-31 16:14:23 +00:00
YohanPipereau
093dd7fe5a build: Append build number for cpack packages
add_vpp_packaging maccro was circumventing scripts/version causing:
1. build number not being appended to the package
2. invalid package name format (due to cmake cpack module)

Change-Id: I2b9a985357a3f3bd501be6db6ca638d4430f4bbb
Type: make
Fixes: def35a2352c9a54f748d301ffa47a446d25a83e0
Signed-off-by: YohanPipereau <ypiperea@cisco.com>
2019-07-31 16:02:50 +00:00
Andrew Yourtchenko
e3cb1f94ba pg: clarify the text of error message
Enabling capture on pg with the file already existing
results in a misleading error message. Fix the text.

Change-Id: I1aea49cfeda3b4bfe6ed7b18fd543948a078508a
Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-07-31 15:04:09 +00:00
Dave Barach
baba24e136 vlib: fix format_error_trace
Error index calculation is error_code + error_node->error_heap_index.

Type: fix
Fixes: gerrit 20802

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I66cf05a29b3cfd9ef9c5468e399290e862b784af
2019-07-31 14:30:12 +00:00
jaszha03
25ab6cfed6 vppinfra: added performance test for clib_rwlock_t (test_rwlock.c)
Spawns a uniform number of writer and reader threads across a number of
cores where each writer thread increments a global variable a specified
number of times, and the reader threads continually poll the global's
value until the writers complete.

Type: test

Change-Id: I979c3734c6d03139d0802bff1846875d226f6fbb
Signed-off-by: Jason Zhang <jason.zhang2@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Lijian Zhang <Lijian.Zhang@arm.com>
2019-07-31 13:55:12 +00:00
jaszha03
5cdde5c25a vppinfra: refactor test_and_set spinlocks to use clib_spinlock_t
Spinlock performance improved when implemented with compare_and_exchange
instead of test_and_set. All instances of test_and_set locks were refactored
to use clib_spinlock_t when possible. Some locks e.g. ssvm synchronize
between processes rather than threads, so they cannot directly use
clib_spinlock_t.

Type: refactor

Change-Id: Ia16b5d4cd49209b2b57b8df6c94615c28b11bb60
Signed-off-by: Jason Zhang <jason.zhang2@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Lijian Zhang <Lijian.Zhang@arm.com>
2019-07-31 13:53:55 +00:00
jaszha03
9a4e631890 vppinfra: added lock performance test for clib_spinlock_t (test_spinlock.c)
Spawns a uniform number of threads across a number of cores where each
thread increments a global variable a specified number of times.

Type: test

Change-Id: I12b3a37708a199c297d022348d99dbb0e8349a9f
Signed-off-by: Jason Zhang <jason.zhang2@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Lijian Zhang <Lijian.Zhang@arm.com>
2019-07-31 13:47:53 +00:00
Florin Coras
7e5e62bbcb vcl: fix epoll chain validation
Type:fix

Change-Id: I91dfe7e0ae2e632022fbf639ca16c93f570849de
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-31 13:44:34 +00:00
Paul Vinciguerra
a47a5f20a3 api papi: add alias for timestamp(datetime)/timedelta
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>
2019-07-31 13:20:52 +00:00
Paul Vinciguerra
07f87546c2 vppapigen: add endian_string for f64
Type: fix

Change-Id: I35838baea21ead4a3f45d998ff225a513781d7ee
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-07-31 13:20:18 +00:00
Andrew Yourtchenko
cb265c6948 tests: disable pg capture before enabling it
In a lot of places within the unit tests pg_start() starts
the capture with an already existing capture running
for the same test.

If the pcap file already exists, then it is renamed and there
is no problem.

However, there is a potential for race if the previous
pg_start() has enabled the capture, but the check for
renaming it happened just slightly earlier than the first
packet has arrived.

Then a second call to pg_start() will hit a check that
a file exists, and will cause an error. This is especially
visible when running the tests in parallel due to increased
load.

Solution: disable the capture before enabling it.
This will flush the aready running capture and eliminate the race.

The additional delay that flushing of the pcap creates has exposed
several other race conditions:

NAT tests: Some of the NAT reassembly tests
verify that the entries were added to the reassembly data structures,
but do so by comparing the quantities of entries. With the default
timeout being 2s, some of the entries might timeout,
resulting in a bogus test failure.

Solution: Bump the timeout to 20s for the affected tests.

Punt tests: nr_packets == 3 makes test intermittently fail,
nr_packets > 3 make it reliably fail, and nr_packets = 2 works

Solution: set nr_packets == 2 for the time being

IGMP tests: the leave-group calls get a spurious packet
from the time the new groups were configured

Solution: add 1 second delay before starting to delete the groups

Type: test

Change-Id: I931182a7b2860cf670e030ee7da8038f6e87356d
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-07-31 13:00:35 +00:00
Neale Ranns
00625a64f4 tests: Split IPSec ESP into parameterized tests per engine
Type: feature

Change-Id: Icb1bd3fce768aebf8919c63a104f771ca7fa1d6f
Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-07-31 12:55:46 +00:00
Neale Ranns
1404698df3 ip: Ensure reassembly runs before IPSec decrypt.
Type: fix

Change-Id: I01eeedf8d5015b07b9422c65afe78bfe8177c22c
Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-07-31 10:12:14 +00:00
Neale Ranns
513582c96a fib: Add some path-list flags to its key
Type: fix
Ticket: 1729

The flags that are permanently set on a path-list should form part of
its key in the path-list DB. Otherwise, if shared, they will not behave
as expected.

Change-Id: I0aa7c7c5d270c97b08014e4a47ddbdcee2358706
Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-07-31 10:08:40 +00:00
Neale Ranns
5ca2a8ae19 fib: fix calls to unformat_fib_path
Type: fix
Ticket: 1728

Change-Id: I679c2b8c5b0f751c9476db3669ab3f6c26dcdd28
Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-07-31 10:08:05 +00:00
Neale Ranns
6b43ce57cb ipsec: Typo in flag name
Type: fix

Change-Id: I0c9353598d3c9b7ea587ea8a2b6e1faa5454843d
Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-07-31 01:04:43 -07:00
Nathan Skrzypczak
874a31ea0b quic: fix cert loading
Type: fix

Change-Id: I29d24c8ec7b8e0613d4fbf5eedc72384326dc284
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-07-30 16:29:24 +00:00
Aloys Augustin
1c2af06852 quic: cleanup and refactorisation
Change-Id: I031a60ac010b55110f32f0a08e19b1156aeda268
Type: refactor
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2019-07-30 16:29:05 +00:00
jaszha03
f25e7cfa5c vppinfra: refactor use of CLIB_MEMORY_BARRIER ()
All instances of test_and_set locks used the following sequence
to release the locks:

CLIB_MEMORY_BARRIER ();
p->lock = 0; // p is a generic struct with a TAS lock

Use clib_atomic_release to generate more efficient assembly code.

Type: refactor

Change-Id: Idca3a38b1cf43578108bdd1afe83b6ebc17a4c68
Signed-off-by: Jason Zhang <jason.zhang2@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Lijian Zhang <Lijian.Zhang@arm.com>
2019-07-30 16:22:03 +00:00
Neale Ranns
6b03ab7311 vlib: Fix packet tracing
Type: fix
Fixes: 99536f4

Change-Id: Ica230ec9fa7f6fd36e2754e8b0b9db555460ca55
Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-07-30 15:15:37 +00:00
Mohsin Kazmi
19b697f307 tap: fix segv when host-if-name is not given
Type: fix
Fixes: c30d87e6139c64eceade54972715b402c625763d

Change-Id: I86b606b18ff6a30709b7aff089fd5dd00103bd7f
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-07-30 14:46:11 +00:00
jaszha03
0455c435af vppinfra: conformed spinlocks to use CLIB_PAUSE
Modified test-and-set spin locks to call CLIB_PAUSE () when spinning
for code consistency. Decreases the memory bandwidth consumed.

Type: fix

Change-Id: I1cca4f87f44f23f257c7a35466cd2e7767072f51
Signed-off-by: Jason Zhang <jason.zhang2@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Lijian Zhang <Lijian.Zhang@arm.com>
2019-07-30 11:46:19 +00:00
Dave Barach
d56550c2b6 misc: add vnet/pipeline.h example
To the sample plugin. We should probably suggest that folks use the
pipeline.h coding model more often. It's really easy, and these days
the performance results are similar to quad-single loop coding.

Type: refactor

Change-Id: Ie2caa087972737e6d9c31c4ac79355f3d8ced282
Signed-off-by: Dave Barach <dave@barachs.net>
2019-07-29 22:35:19 +00:00
Florin Coras
2b5fed8696 session: fix vpp to app msg generation
Type:fix

Freeing mq messages in vpp (producer), if enqueueing fails, invalidates
consumer assumption that messages can be freed without a lock.

Change-Id: I748a33b8846597bdad865945d8e899346d482434
Signed-off-by: Florin Coras <fcoras@cisco.com>
Signed-off-by: Tal Saiag <tal.saiag@gmail.com>
2019-07-29 20:46:46 +00:00
Florin Coras
1a3d2370b5 vcl: fix config parsing of hex values
Type:fix

Change-Id: I31f35dd86fb6efb04d4a449f7fc834296baaa043
Signed-off-by: Tal Saiag <tal.saiag@gmail.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-29 20:46:32 +00:00
Paul Vinciguerra
bb2e5221a7 api acl: breakout acl_types.api for reuse by others
Type: refactor

Change-Id: I40518ccddcb78e58f7e6a098c27d9ec53e5a1146
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-07-29 07:19:40 +00:00
Benoît Ganne
99c358d62a fib: add invalid source type and fix debug log
Add the FIB_SOURCE_INVALID fib source type. This allows to spot
uninitialized fib source more easily (0 no longer means special) and we
can use it as placeholder when no source is present.
Use it to fix FIB_ENTRY_DBG() which was accessing the 1st source, even
when no sources were present.

Type: fix
Fixes: 710071bf0e

Change-Id: I980b6a6a07616d4a8d6f2db166a1dd335721c74d
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-07-28 14:24:29 +00:00
Paul Vinciguerra
3cf9e67f59 api: add vl_api_version_t type
Type: feature
Depends-on: https://gerrit.fd.io/r/20484

Change-Id: Ifc8d7e00d7254db40856a088fdd352d9773f71d5
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-07-28 14:22:11 +00:00
Paul Vinciguerra
2648e4474e build: add option to wipe/rebuild papi
Previously, the only option was to wipe/rebuild all the test dependencies.

Type: make

Change-Id: Ia95d6e800f67bef033dcf614dbfa249c3e43159d
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-07-28 14:21:05 +00:00
Mohsin Kazmi
22e9cfd760 pg: add GSO support
Type: feature

Change-Id: I72676495a85fbecc946aa266a75234cce70c3a5e
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-07-28 14:20:06 +00:00
Ahmed Abdelsalam
be83704c5b sr: ipv6 segment routing header (srh) update
SRH has passed WG review in IETF and currently an IESG document.
This patch updates the SRH definition to be compliant with IETF.
 - Change "first_segment" to "last_entry"
 - Change "reserved" to "tag"

Change-Id: I1765c968671655c5646f6de478d1f7196abbc040
Type: fix
Signed-off-by: Ahmed Abdelsalam <ahabdels@cisco.com>
2019-07-28 14:17:52 +00:00
Ahmed Abdelsalam
0ae1d80f9a sr: fix srv6 end.t behavior
Update the sr_localsid code to set the DPO for SRv6 End.T behavior.

Change-Id: I17e102a419eb2b4fdd1de7a672b109e4ff7e1dc2
Type: fix
Signed-off-by: Ahmed Abdelsalam <ahabdels@cisco.com>
2019-07-28 14:17:44 +00:00
Florin Coras
854e0a214d session: define connection id length
Type:feature

To be used by transports overwriting the connection id.

Change-Id: Ia5dbd9dccc2e3eb62e602514b24882ddc12ff1f2
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-27 16:49:57 +00:00
Florin Coras
b0ffbee67b session: separate ctrl, new and old events
Type: feature

Change-Id: I5e030b23943c012d8191ff657165055d33ec87a2
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-26 16:18:50 -07:00
Florin Coras
1f42101f27 tcp: count resets sent
Type:feature

Change-Id: Ie1ab4b24af9c654d5e0ed94b7fa96ca195b01c56
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-26 20:54:17 +00:00
Nathan Skrzypczak
559ee0f54c quic: coverity fixes
Type: fix

Change-Id: I93c083ee78168ed2da283fe4873ca022766fe861
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-07-26 18:27:11 +00:00
Jakub Grajciar
272e2e456d libmemif: fix autoconnect
Type: fix

Change-Id: I426e210c47869904a01712b765db2356439f706f
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-07-26 14:51:59 +00:00
Dave Barach
af57799fde docs: add binary api trace replay details
Folks need to know that they MUST carefully control the set of plugins
to avoid feeding messages to the wrong binary API message handlers.

Change-Id: Iefeeda6670aae4627446caee21717b847305c9b5
Signed-off-by: Dave Barach <dave@barachs.net>
2019-07-26 14:46:17 +00:00
Florin Coras
26dd6de91b session tcp: handle rxt and acks as custom events
Type: feature

Control ack generation and retransmissions with session layer scheduler.

Change-Id: Iacdf9f84ab81f44851980aa45a83e75f29be2b7b
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-26 14:39:30 +00:00
Neale Ranns
038e1dfbdf dhcp ip: DSCP settings for transmitted DHCP packets
Type: feature

- Define the ip_dscp_t and use in the IP headers
- Add DSCP setting to the DHCP client for use with packet TX

Change-Id: If220dde0017ea78793747d65f53e11daf23a28fa
Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-07-26 13:27:14 +00:00