Compare commits

...

760 Commits

Author SHA1 Message Date
594a4a5129 ipsec: fix AES CBC IV generation (CVE-2022-46397)
For AES-CBC, the IV must be unpredictable (see NIST SP800-38a Appendix
C). Chaining IVs like is done by ipsecmb and native backends for the
VNET_CRYPTO_OP_FLAG_INIT_IV is fully predictable.
Encrypt a counter as part of the message, making the (predictable)
counter-generated IV unpredictable.

Fixes: VPP-2037
Type: fix

Change-Id: If4f192d62bf97dda553e7573331c75efa11822ae
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-02-06 16:08:09 +01:00
babecb4132 tcp: fix bt acked_sacked on recovery
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I2e2d76661fbb07dd8c6afa3583bb18e01b7a7fb6
(cherry picked from commit 3e2ec42a07)
2020-10-14 14:15:59 +00:00
2a33546579 virtio: fix the tcp/udp checksum offloads
Some vhost-backend calculates the wrong checksum in
case of tcp/udp offload when driver resets tcp/udp
checksum field to '0'.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I3c45df487f00d7e3d949b4efb32d7f7e01d1108b
2020-10-12 12:27:25 -07:00
37e99c22df misc: 19.08.3 Release Notes
Change-Id: I809f417fabea96df506886ae6576b6e8c1b72caf
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-08-25 13:20:31 +00:00
407b4fc3d4 ipsec: fix esp padding
Type: fix
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Change-Id: Ic8db52b41d7e5af3425099f008984e50afb3da74
2020-08-20 13:59:44 +00:00
9c4d10c7ae ikev2: use remote proposals when installing tunnel
Type: fix

Change-Id: Ia1556aa854fa83fb5340308c4eec868b7b4f8351
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-08-20 13:40:16 +00:00
fcb03a0ea5 ikev2: announce both 'ESN' and 'No ESN'
Type: fix

Change-Id: If73b88b9478b9314df6d9163c3a13724d4253c80
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit fbd47cf835)
2020-08-20 09:54:39 +00:00
c8b09a2d40 ikev2: fix wrong index computation
Type: fix

Change-Id: Ia7b07b4ec9e5681946f3f5c01c230c1f814e2cf6
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit c17d6cfaf4)
2020-08-20 09:54:39 +00:00
f77f8e2909 ikev2: fix incorrect reply messages
Type: fix

Change-Id: Idd679885f42de45429a1dcbf3b0af1037dc54d2b
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit fe7b8c2b4a)
2020-08-20 09:54:39 +00:00
bf03bfa801 http_static: fix session cleanup
While cherry-picking: Fix extras/scripts/check_commit_msg so it accepts '_' characters in
feature names.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ibb380eecca76ed9c00ed14c167dfcf576f943db0
(cherry picked from commit 0f4e3c22ed)
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-08-20 09:54:39 +00:00
a4a6ce66f5 dns: fix coverity warnings
Type: fix
Ticket: VPP-1837

Partial cherry-pick from a357a93801

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I0d164147173b452fee7e720e01e6a9991f43b64a
2020-08-20 09:53:29 +00:00
cfd710d2fc memif: wrong interface counter is incremented
vlib_increment_combined_counter takes sw_if_index, not hw_if_index.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Iecde2697ed490940f0eff796d28d15381405b895
(cherry picked from commit 35050289e6)
2020-08-19 15:05:14 +00:00
1fa4b3a4bc vppinfra: fix clib_count_equal_u8/16/32/64 overflow
Type: fix

Change-Id: Id5ca868cd7a2abc9320206f0336aa3348f5906e3
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 2a0bd4a7d1)
2020-08-18 19:47:21 +00:00
f3e7275743 ip: fix punt cli to only consumes a line of input
Type: fix

Change-Id: Idb6f82e08b29e3805ed2133acb5fd7226148f672
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 9ae3c6a40f)
2020-08-18 19:47:21 +00:00
b2d6edce86 hsa: fix http server session cleanup
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6832e3f24a56e043415a32eb4072d0bfb7697251
(cherry picked from commit 7d941d45bc)
2020-08-18 19:47:21 +00:00
1cadeaab98 lisp: fix cli locator-set name null termination
Type: fix

Change-Id: I5f550bd6a03f47b829ef99803cb6b9ac86329450
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 39771adc1d)
2020-08-18 19:47:21 +00:00
554159af58 lisp: fix lisp/one enable/disable
Type: fix

Change-Id: Iefe6b3a1a0a999d89ef9812fc14d31159043e60c
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 508dc51bd0)
2020-08-18 19:47:21 +00:00
0e67a25052 lacp: fix vector overflow
Type: fix

Change-Id: I8f776ce10ee8c29689db5ceef70df42dfb6b747c
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit c72995dd79)
2020-08-18 19:47:21 +00:00
7e9f66ec40 interface: fix show/clear hardware-interfaces string overflow
Type: fix

Change-Id: Iab99bc1f6c309fae6eaa714b484274fe7072a4cb
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 17814d74db)
2020-08-18 19:47:21 +00:00
09da69951b pci: fix non NULL-terminated vector used as C string overflow
Type: fix

Change-Id: Iab512ba8c72c9e20aeba2d4265276bcabf095d46
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit e3a24300d0)
2020-08-18 19:47:21 +00:00
27901c9952 session: cleanup lookup table for rejected session
Type: fix

Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id20f693a5acdee74ab534e9964418973537b977f
(cherry picked from commit c7fd24e30b)
2020-08-18 19:47:21 +00:00
cafaac98e7 feature: fix feature config data initialization overflow
Copy only exactly the data provided by the user even when it is not a
4-bytes multiple.

Type: fix

Change-Id: I2ef987c37e58523a38b46b09227529db2c26aa55
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit c79a14f13a)
2020-08-18 19:47:21 +00:00
76797dc615 pppoe: fix uninitialized memory bug
In pppoe_cp_node.c, node->errors[error0] was accessed without
node->errors being initialized.

Found with AFL + ASAN.

Type: fix
Signed-off-by: TimotheeChauvin <timchauv@cisco.com>
Change-Id: Ide8a60021b2d47b5e2fce7062d8f12c7f4d225f7
(cherry picked from commit 2887159a1a)
2020-08-18 19:47:21 +00:00
5269067510 vppinfra: fix format_c_identifier vector overflow
In case of vector, we must check length before trying to access element.
Also fix wrong DPDK plugin workaround.

Type: fix

Change-Id: I2ecef1c88ebef2362f48cab0d462699aa43cd4b9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 1bd6f61820)
2020-08-18 19:47:21 +00:00
d48d51df23 vppinfra: enable STATIC_ASSERT with clang
For some reason clang does not support &((struct foo*)0)->field in
static assertion contrary to gcc.
Use offsetof() macro implementation provided by both compilers instead.

Type: fix

Change-Id: I3311cdd29c5861e45dc0ef92f2bbd66242ca73b8
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 5e60c17f49)
2020-08-18 19:47:21 +00:00
edec3f6041 ip: fix format_ip6_address_and_mask() bug
Previously there's a format_ip4_address in format_ip6...
This patch fixes this typo

Type: fix

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: Ice124db6594720ed35a992d069341f399c331e1d
(cherry picked from commit e30f9c5c63)
2020-08-18 19:47:21 +00:00
806f3f6177 ip: set ip4 mask for ip_copy and ip_set when dealing with ip4 type
Type: fix

Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com>
Change-Id: I3ace7dfe3ddacb4f7fa7a974a2ffe2b3cf902ff9
(cherry picked from commit 9268b5823f)
2020-08-18 19:47:21 +00:00
15c9670d9d ip: fix the order in ip4 punt redirect
Type: fix
Fixes: a84cb715f5

Change-Id: Id448d6ae9cfdd3122e8187121c509412835117c5
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit c6eae9c079)
2020-08-18 19:47:21 +00:00
64c2689c3e classify: fix debug CLI
unformat_ip6_mask wasn't accounting for customized field names
when deciding if it managed to parse at least one field.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I26cab4c6828b510e277079628af5115ac43af3ff
(cherry picked from commit 126c885441)
2020-08-18 19:47:21 +00:00
1ff8a6c32a tcp: avoid rcv wnd more than RX fifo can enqueue
Type: fix

Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie358b731f8ecb1fcaebd6e79f5ce5c10802c2814
(cherry picked from commit cc1085647b)
2020-08-18 19:47:21 +00:00
347a225866 udp: align udp_encap_t_ to 2 cachelines
Based on the comments in the struct, udp_encap_t_ is meant to span 2
cachelines. Due to the 64 bit alignment of dpo_id_t, the struct spanned
3 cachelines. This caused fetching ue_ip_proto to trigger an additional
cache miss. This patch rearranges the ordering of the struct fields
so that udp_encap_t_ only spans 2 cachelines as intended.

before:
(gdb) print (int)&((struct udp_encap_t_*)0)->cacheline1
$8 = 128

after:
(gdb) print (int)&((struct udp_encap_t_*)0)->cacheline1
$1 = 64

Type: fix
Signed-off-by: Vadym Martsynovskyy <vmartsyn@fb.com>
Change-Id: I066c08654d4a8ef3e2d3954e957d4c5d382b209f
(cherry picked from commit 42386fc974)
2020-08-18 19:47:21 +00:00
86a5a5d5c2 ip: fix the punt redirect for ip4
Type: fix

Change-Id: I39341f201209931392f315ead5adfddd8b567caf
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit a84cb715f5)
2020-08-18 19:47:21 +00:00
4784b2a696 nat: avoid division by zero
Return error instead of dividing by zero.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I9f6a942e87ab87e8f1921e744ec1add45884e74a
(cherry picked from commit fe77bdc190)
2020-08-18 19:47:21 +00:00
bef1019aa3 nat: deterministic: disallow invalid config
Prevent overflow if input network prefix is too small and crash on
packet #1 due to vector not being allocated/initialized.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I3494cc62ce889df48cc59cc9340b5dd70338c3a8
(cherry picked from commit f3d7bd9d4d)
2020-08-18 19:47:21 +00:00
ccaef621a8 vppinfra: fix u32x4_gather definition
Type: fix
Change-Id: I3df8d3f277bfadee95bfc329e8ce8b929a986af6
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 97b9e008b9)
2020-08-18 19:47:21 +00:00
3180fe5651 misc: fix sonarclound warnings
Type: fix
Ticket: VPP-1888
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I9c2fb926a5e010658088a74051c8c3462ff61734
(cherry picked from commit 1af730d0df)
2020-08-18 19:47:21 +00:00
6ed8162090 api: check id is valid for bounce checking
If the id is invalid we cannot check whether we must free the message or
not, free it anyway.

Type: fix

Change-Id: Ie4426f601390d1e5e14c739f670e8c1e6e3aaf1e
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit ff13e46215)
2020-08-18 19:47:21 +00:00
7f0abd5bd5 buffers: fix non-default sized buffers initialization
Type: fix

Change-Id: I4a93e1d9936414c514cb237a22624986b3ef5b3d
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit c16fe46890)
2020-08-18 19:47:21 +00:00
aa62162cbc vlib: node recyling and node deletion missing triggering graph node sync
When recycling a graph node vnet_register_interface, it is missing an
explicit call to vlib_worker_thread_node_runtime_update(). However,
there is an implicit call to vlib_worker_thread_node_runtime_update()
via vnet_sw_interface_set_flags_helper() if it enables a new feature on
the interface for the first time. But that implicit call is not
guaranteed. For example, if an interface is created, deleted, and
created, then it may skip the implicit call to
vlib_worker_thread_node_runtime_update(). When that happens, the graph
nodes on thread 0 are not sync'ed to the worker threads. So the worker
thread's graph nodes are out of sync momentarily with the main thread's
graph nodes until some other event happens which calls for a sync is
needed. During this window, the worker thread's graph node is
vulnerable and may experience a crash.

When deleting a graph node, we never trigger a sync to the worker
thread. A patch was committed 3 years ago via
https://gerrit.fd.io/r/c/vpp/+/7523 to fix a show run crash. In
hindsight, the approach taken by 7523 is not orthogonal. While at it,
let's fix it right for both issues with a call to
vlib_worker_thread_node_runtime_update() in the appropriate place and
remove 7523.

Type: fix
Ticket: VPPSUPP-86
Fixes: gerrit 7523 / 19e9d954bd

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ic9472bd2d3a212dbfeceb526506ed0400983a142
(cherry picked from commit 1eae8ecb7a)
2020-08-18 19:47:21 +00:00
3c450d3a3e mactime: print error if feature not enabled
Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I8fbc4baefecf512573126c5085ed7a6e2e360fbe
(cherry picked from commit c1f0d9c105)
2020-08-18 19:47:21 +00:00
29e70a6eb1 fib: fix multiple dpo pool expand cases
Add dpo_pool_barrier_sync/release, use them to clean up
thread-unsafe pool expansion cases.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I09299124a25f8d541e3bb4b75375568990e9b911
(cherry picked from commit 26d890eb4b)
2020-08-18 19:47:21 +00:00
1c39c6556d fib: fix adj pool expand cases
adj_alloc (...) is not thread safe when the adj pool or combined
counter vectors expand.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I55710de6ecc083b7434e11798659cca9250c9131
(cherry picked from commit c2d2228e92)
2020-08-18 19:47:21 +00:00
1c73742cb3 fib: add barrier sync, pool/vector expand cases
load_balance_alloc_i(...) is not thread safe when the
load_balance_pool or combined counter vectors expand.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I7f295ed77350d1df0434d5ff461eedafe79131de
(cherry picked from commit 8341f76fd1)
2020-08-18 19:47:21 +00:00
77335de45a nat: fix coverity warning
Type: fix

Change-Id: I0e87021b11009a955f5839bdb68af897145816c1
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit c39c79c5aa)
2020-08-18 19:47:21 +00:00
a4a794d152 misc: ipfix-export unformat u16 collector_port fix
Use %U and unformat_udp_port instead of %u for unformat() call for
u16 collector_port number in set_ipfix_exporter_command_fn() to
avoid corruption of other variables which can happen if unformat()
with %u is used with a 16-bit variable. This avoids crash due to
corrupted fib_index value.

Type: fix

Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Change-Id: Id54273fcc458a7f9c5aa4025aa91711f160c1c1a
(cherry picked from commit 2dca180db9)
2020-08-18 19:47:21 +00:00
895c37fb8a tap: fix rx queue index
Type: fix

Change-Id: I5601bdeb47d08118476ff7bd29435d2c1dba34b9
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 04f4d91c9f)
2020-08-18 19:47:21 +00:00
1e02f19305 dhcp: use per-thread vlib main instead of global one
Type: fix

Change-Id: I8890aa5cc3c576fc9fb68735549dfab721714310
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit dcd4aa2110)
2020-08-18 19:47:21 +00:00
2da3548777 nat: fix regarding vm arg for vlib_time_now call
Change in snat_ipfix_header_create() to use thread-specific
vlib_main_t *vm pointer to avoid problems with different threads
accessing the same vlib_main_t data structure. This avoids
assertion failure when vlib_time_now() is called with a vm
corresponding to a different thread.

Type: fix

Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Change-Id: I2096c1debb5688d3b97e5ed9a0ea78d94053d8b7
(cherry picked from commit 5556813fb6)
2020-08-18 19:47:21 +00:00
915c3d9058 fib: Fix interpose source reactivate
Type: fix

when the interpose is on an adj-fib and the cover is removed the adj
source will not install. this lead to no path list being found for the
interpose source and a crash. pick a drop path list in this case.

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Ied217da043926c913657080f5ffb151201225d23
(cherry picked from commit 1bf6df4ff9)
2020-08-18 19:47:21 +00:00
8149d3427d dpdk: fix pktmbuf pool private data init
Type: fix

Change-Id: I7349840af48eec209532dab43a8ad0bd68993268
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit c32a84c70e)
2020-08-18 19:47:21 +00:00
3736bbbbf4 l2: L2/L3 mode swicth cleanup and l2-patch fix
Cleanup L2/L3 mode switch to not redirect to/from ethernet-input node
as it is no longer necessary.
L2 patch should use sw_if_index for device feature enable/disable.

Type: fix

Signed-off-by: John Lo <loj@cisco.com>
Change-Id: I0f24161d027b07c188fd1e05276146f94c075710
(cherry picked from commit f415a3b53a)
2020-08-18 19:47:21 +00:00
3c0ea3ddea misc: fix typo in set-ipfix-exporter CLI short_help
Type: fix
Change-Id: Id6687780b9a740323bd2eef58447864e70dc0235
Signed-off-by: Ignas Bacius <ignas@noia.network>
(cherry picked from commit f3a522fb3f)
2020-08-18 19:47:21 +00:00
449f50555d vlib: restore commands for non-interactive sessions
'quit' and 'show terminal' are valid for non-interactive sessions too.

Type: fix
Fixes: a58be82dda

Change-Id: Ib63244c7b64ad2e30c257ed19e982295f59bfffa
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 10a22a6294)
2020-08-18 19:47:21 +00:00
b1a7f68b22 g2: fix the g2 build for Ubuntu 20.04
Shut off deprecated declaration warnings

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I65ea4bbc4d5ee5a11d4e8f554f414f57944c7e1c
(cherry picked from commit 18a86c6e60)
2020-08-18 19:47:21 +00:00
acf0bd5567 vcl svm: fix rx event loss
When vcl_epoll_wait_handle_mq handles rx events exceeding maxevents, VPP will not signal because cursize > 0, and the remaining rx events cannot be triggered because the eventfd event has been read. Therefore, we should dequeue all events until cursize = 0. And then handle msg up to maxevents with vcl_epoll_wait_handle_mq_event and those beyond with vcl_handle_mq_event.

Type: fix
Signed-off-by: hanlin <hanlin_wang@163.com>
Change-Id: I8a0c87cb41c837deb8284b40f668cc3c7d9d6e56
Signed-off-by: hanlin <hanlin_wang@163.com>
(cherry picked from commit d0e646f689)
2020-08-18 19:47:21 +00:00
f89bbaac78 vlib: fix unix cli commands crash without session
If a cli command is run while there are no cli session, then
cm->cli_file_pool will not be initialized and we should not try to
operate on it.

Type: fix

Change-Id: Iaea15a23f7efd5b17fab13e6c1cbb3a9a34080e0
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit a58be82dda)
2020-08-18 19:47:21 +00:00
d8c4326aae dpdk: fix crash with chelsio pmd
cxgbe PMD initializes its control channel as part of dev_configure(),
and trying to get link status prior to it will lead to a crash.

DPDK documentation loosely hints that we should not call any device
function before dev_start(), call link_state() only for the relevant
PMDs.

From DPDK API documentation:
The functions exported by the application Ethernet API to setup a device
designated by its port identifier must be invoked in the following
order:
    rte_eth_dev_configure()
    rte_eth_tx_queue_setup()
    rte_eth_rx_queue_setup()
    rte_eth_dev_start()
Then, the network application can invoke, in any order, the functions
exported by the Ethernet API to get the MAC address of a given device,
to get the speed and the status of a device physical link, to
receive/transmit [burst of] packets, and so on.

Type: fix

Change-Id: I12d2ab4d84e6bd72a9f695447e86f3222929c804
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 31eb471d0c)
2020-08-18 19:47:21 +00:00
8563b52376 sr: fix srv6/srv6-ad/srv6-as promisc mode switch
Calling ethernet_set_flags() to switch interface to/from promiscuous
mode must use use hw_if_index instead of sw_if_index.

Type: fix

Signed-off-by: John Lo <loj@cisco.com>
Change-Id: I72da286b913893227e32193ee11fbbc56e04804d
(cherry picked from commit 5b960c60f6)
2020-08-18 19:47:21 +00:00
ec77742de7 misc: remove useless assignment
Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I7708587804bc979fa9c46fb11f96d264821e2357
(cherry picked from commit 9a099b6e50)
2020-08-18 09:54:56 +00:00
96fdd790f3 vcl: de-init vcl on destroy
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: If3372e3edd403240c2c9da746246170549a3e644
(cherry picked from commit 69d97256d5)
2020-08-18 09:54:56 +00:00
a316c17d9e tcp: avoid rcv wnd less than mss
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I84ec1c91a3a7b2195aad58923fa6f17f551444cb
(cherry picked from commit f2fe353cc8)
2020-08-18 09:54:56 +00:00
f812f51873 lacp: missing endian conversions for trace packet format
Fix a couple endian conversions for displaying Marker Protocol packet
in the trace

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I746a67fb6143b5ad52bc4af9604ff8760dbdec9b
(cherry picked from commit 9a244b0a29)
2020-08-18 09:54:56 +00:00
55e4f87b79 vlib: fix u64 error counter cli printing
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie35dc623394cfb6c358740361fd85aa0924ab187
(cherry picked from commit 1ae16c8f3b)
2020-08-18 09:54:56 +00:00
704a2c452e vppinfra: set explicit found in search_free_list loop
While https://gerrit.fd.io/r/c/vpp/+/26948 fixed avoid using -1 to
index into h->free_lists[b][l] by changing the loop counter, the
check for the value of the loop counter (l < 0) cannot be trusted
to decide whether we've found a large enough object within the bin
or not. When the loop is terminated, the value of the variable l
could be ambiguous if it equals to 0 and it is never less than 0,
ie, when we bail out of the loop, we don't know if it was due to the
breaking out of the condition in
  if ((s = f_size - size) >= 0)
     break;
or
  while (l > 0);

The fix is to explicitly set a variable when we have found a large enough
object inside the loop to be used to test whether the loop was prematurely
terminated (found == 1) or the loop just ran exhausted (found == 0)

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I0161813fbd44dcba8982a767eac2e0930e9d77e3
(cherry picked from commit a5436ae251)
2020-08-18 09:54:56 +00:00
4cdca2fc20 ethernet: fix coverity warning
Type: fix
Ticket: VPP-1837

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I20daa023eed50f8b42e8dc2d17e47a54aa16ae31
(cherry picked from commit 13f64ce227)
2020-08-18 09:54:56 +00:00
d37ce966a3 dpdk: fix compiling issue with clang
When building vpp image with below command, clang reports warnings/errors
on the unused option '-L', as it's not linking stage, and does not require
linking libraries.

In dpdk.mk, the linking library path should be attached to
DPDK_EXTRA_LDFLAGS, instead of DPDK_EXTRA_CFLAGS

$ make build-release CC=clang V=1

clang -Wp,-MD,./.ark_ddm.o.d.tmp  -fPIE -fPIC -pthread -I/root/origin/build-root/build-vpp-native/external/dpdk-20.02/lib/librte_eal/linux/eal/include  -march=armv8-a+crc -DRTE_MACHINE_CPUFLAG_NEON -DRTE_MACHINE_CPUFLAG_CRC32  -I/root/origin/build-root/build-vpp-native/external/dpdk-20.02/arm64-armv8a-linuxapp-clang/include -DRTE_USE_FUNCTION_VERSIONING -include /root/origin/build-root/build-vpp-native/external/dpdk-20.02/arm64-armv8a-linuxapp-clang/include/rte_config.h
-D_GNU_SOURCE -O3 -I./ -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wpointer-arith -Wnested-externs -Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef -Wwrite-strings -Wdeprecated -Wno-missing-field-initializers -Wno-address-of-packed-member -Werror   -g -mtune=generic -L/root/origin/build-root/install-vpp-native/external/lib -I/root/origin/build-root/install-vpp-native/external/include -o ark_ddm.o -c
/root/origin/build-root/build-vpp-native/external/dpdk-20.02/drivers/net/ark/ark_ddm.c
== Build drivers/vdpa/ifc
clang: warning: argument unused during compilation: '-L/root/origin/build-root/install-vpp-native/external/lib' [-Wunused-command-line-argument]
clang: error: argument unused during compilation: '-L/root/origin/build-root/install-vpp-native/external/lib' [-Werror,-Wunused-command-line-argument]

Type: fix

Change-Id: If8fd9b19d0aff9d3c27d77e78cd3064bb1ad6565
Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
Reviewed-by: Jieqiang Wang <Jieqiang.Wang@arm.com>
Reviewed-by: Govindarajan Mohandoss <Govindarajan.Mohandoss@arm.com>
(cherry picked from commit 88d6ce2bee)
2020-08-18 09:54:56 +00:00
0efdd24d0d vppinfra: loop counter off by 1 in search_free_list()
In search_free_list(), we have this do while loop.
	do
	  {
	    l--;
	    f_index = h->free_lists[b][l];
	    f = elt_at (h, f_index);
	    f_size = heap_elt_size (v, f);
	    if ((s = f_size - size) >= 0)
	      break;
	  }
	while (l >= 0);

When (l == 0), we still go back up to execute l--. Then l become -1. The
next statement is we index h->free_lists[b][-1]. After that, elt_at() would
probably cause a crash in the ASSERT.

Type: fix
Ticket: VPPSUPP-63

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I617d122aa221cfdfe38f8be50f4e0f0e76e11bb5
(cherry picked from commit ec7012e51e)
2020-08-18 09:54:56 +00:00
d63d353faa misc: fix coverity warnings
Type: fix
Ticket: VPP-1837

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I51660e4b02f449bd2db12a8cfd395c6c343d2dee
(cherry picked from commit c72950e811)
2020-08-18 09:54:56 +00:00
6e25cf6505 rdma: fix clang build
Type: fix

Change-Id: I9b613f0af484f601dd20a851e2f59ee5e06b5c37
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 971c5be279)
2020-08-18 09:54:56 +00:00
84c13e6b02 vcl: allow vcl worker index to be set by applications
When using vppcom_session* apis to setup TCP sessions in applications build outside of the VPP repository, it is necessary to set the worker_index explicitly when these apis are called from the none-VCL worker threads. An example is when data is to be sent to the TCP session that is originated from a different thread, like the main program thread or from the bin api thread. This change allows the application to set it.

Type: fix

Signed-off-by: IJsbrand Wijnands <ice@cisco.com>
Change-Id: I37f3654a49ea9a8cf3a0d3d0e672583018c12299
(cherry picked from commit 6017ff0dd7)
2020-08-18 09:54:33 +00:00
a3ac7bc3c8 api: fix include_guard when path contains a plus
The path to VPP source might contain a '+' when building it
with Yocto/OpenEmbedded.

Type: fix

Signed-off-by: Ruslan Babayev <ruslan@babayev.com>
Change-Id: I205ac0de7d8726724af0e30f5b199391e05dc615
(cherry picked from commit 7f286f720d)
2020-08-18 08:50:04 +00:00
8cc6689f69 misc: add Matt Smith to the committer list
In hopes of restoring his +2 button...

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I2600daab5afa4334713695d1074706fbb287832f
(cherry picked from commit e891ac2f19)
2020-08-18 08:50:04 +00:00
b2ed95896f vcl: disconnect both flavors of bapi transport on destroy
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6697296b45c5816a31535b0cf44b8e726292b8bb
(cherry picked from commit dc0ded7dd7)
2020-08-18 08:50:04 +00:00
9ba15e2b68 vcl: add separate fcntl64 ldp handler
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Idb81e2901398dd6ae94931c705a704c7b52bbb36
(cherry picked from commit d7586d50f6)
2020-08-18 08:50:04 +00:00
1a81cf3b82 vlib: use flexible array in vlib_buffer for GCC-10
GCC-10 increase overflows-related warnings but gets confused by 0-length
arrays. Use C99 flexible length array instead.

Type: fix

Change-Id: Ie62cfa8faaa408479a598785fd3f06ffd0233c7a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 049d0b438e)
2020-08-18 08:50:04 +00:00
6a974ff25e stats: add apis to delete simple/combined counters
vlib_free_simple_counter()
vlib_free_combined_counter()

Frees the name and two dimensional vector from the stats segment.

Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: If1becf7d09520ba41a3d59e2df94958ecfcf6948
(cherry picked from commit a568a19b29)
2020-08-18 08:50:04 +00:00
16845adf79 ioam: do not reuse existing vnet symbol
vxlan_gpe_init() is already defined in libvnet. When loading ioam plugin
we end up having 2 different objects using the same symbol.
ASan in GCC-10 started to enforce the One-Definition-Rule and it seems
like good hygiene anyway.

Type: fix

Change-Id: I2ea9af1821bca6482a290742e9a109fc25692f37
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 83ceffcd98)
2020-08-18 08:49:56 +00:00
aa6207f44b vppinfra: harmonize function names
Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Icce7eab4510785e15bdcf97e4d1881b0f46f6899
(cherry picked from commit d4a639bbd2)
2020-08-16 10:42:19 +00:00
88d730c09e vppinfra: selectively disable false-positive GCC-10 warnings
GCC-10 increase overflows-related warnings but is confused by SIMD
operations.

Type: fix

Change-Id: Iafde754c2fbec60e2d0a328f295b1f5c156d8234
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit a66971f980)
2020-08-13 17:20:47 +00:00
bfbbb1855e ip: reassembly: fix one possible use-after-free
When use the kv->v.memory_owner_thread_index as the index to get the
reass in pool, maybe this element is freed by the owner thread because
of timeout, too many fragments, and so on.

So we should check if do_handoff with kv->v.memory_owner_thread_index
before get the reass from pool.

Type: fix

Signed-off-by: Gao Feng <davidfgao@tencent.com>
Change-Id: Ie0f1dc368f86d0fd65292ca0c5e1908348015e09
(cherry picked from commit 9165e0365c)
2020-08-13 17:20:47 +00:00
d549129538 vppinfra: selectively disable false-positive GCC-10 warnings
GCC-10 increase overflows-related warnings but failed to infer that
b->n_cached_bytes is always < sizeof(uword).

Type: fix

Change-Id: I956ae609abc9e39d4a932e5801510999d7d27b79
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit ffbcf61788)
2020-08-13 17:20:47 +00:00
44d5dd7c1e build: add vppinfra/warnings.h to exported headers list
To allow the use of WARN_ON/OFF macros to selectively disable build
warnings.

Type: fix

Change-Id: Iceb9d28b2b80c373afb51900880c23041be836db
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit be7dbbbfdd)
2020-08-13 17:20:47 +00:00
069411cd5e devices: allow link state down with netlink
Type: fix

Use the up parameter in vnet_netlink_set_link_state(). It was
ignoring the parameter and always setting IFF_UP on an interface.

Change-Id: I0d44406d982afbdc43bc6b26d0f22c0bdd47abdc
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit 81284163a2)
2020-08-13 17:20:47 +00:00
138d43ce77 vcl: generate select events on read/write errors
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3429f9d0406b6d710846fc82d77400f26f77fdf4
(cherry picked from commit 5e6222a033)
2020-08-13 17:20:47 +00:00
3b49dc6cc8 vppinfra: finish deprecating qsort.c
Minor change to vec_sort_with_function(...): don't depend on the qsort
implementation to deal with null, zero-long, or 1-long vectors

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I7bd7b0421673d2a025363089562aa7c6266fba66
(cherry picked from commit f593b57920)
2020-08-13 17:20:47 +00:00
eaef2de7f9 nat: fix extended unit tests
Type: fix
Fixes: b86437b79b

Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I2c833928dcdceb4d23dfc161bcc3358272076980
(cherry picked from commit e7f4201776)
2020-08-13 17:20:47 +00:00
66cb17227c vapi: packed enum type generation
Type: fix

if the ,api/.json specifies that a enum should be u8/u16 that the
generated c enum needs to be packed.

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Ia0497b45e4c510a5c63cd02e966769bf20686838
(cherry picked from commit b5c0d35f94)
2020-08-13 17:20:47 +00:00
4e138bf173 misc: update INFO.yaml
Add Benoit Ganne to the committer list, remove committers who have
resigned, list committers in alphabetical order.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ic51092df774464e228cd875acf118827e9cd1923
(cherry picked from commit 0e2751cc1d)
2020-08-13 17:20:47 +00:00
b7bbd6a1fe session: fix session_table_get_or_alloc
Extending the fib_index_to_table_index could leave entries uninitialized,
pointing to the session tables at index 0. That session index exists by
default, but it is a IPv4 session table. That would break all IPv6 on
the unitilized fib indexes.

Type: fix

Change-Id: Ie3f0a87a7f829ceb39f75ec06658b0ad1d3813ae
Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
(cherry picked from commit 30a28c187b)
2020-08-13 17:20:47 +00:00
b72e494f39 tcp: avoid bt sample access after possible pool realloc
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I98f943c8862fa74fb576f9ec1fb9186289b1216b
(cherry picked from commit c17ff6ec3b)
2020-08-13 17:20:47 +00:00
0115d1b511 vcl: fix use-after-free
Make sure we disconnect from vlib prior to free-ing the last worker, as
we'll need to access it.

Type: fix

Change-Id: Id5bdd17f0f5efa1ce52021b4270eb4f1e95cc61d
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 38ab5672b5)
2020-08-13 17:20:47 +00:00
2c801f7ffb tcp: fix use-after-free
bts can be freed by the call to bt_fix_overlapped(). Save flags for
later use.

Type: fix

Change-Id: If8b48c96ce39e38f2ed7f4db2815122523eb2e05
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit a04adbf536)
2020-08-13 17:20:47 +00:00
367d6d86b6 vat: fix increment_address(...)
vl_api_address_t uses a packed enum for the address family, compare
a->af directly with ADDRESS_IP4 / ADDRESS_IP6 instead of running a->af
through clib_host_to_net_u32(...) before compare.

Indirectly fixes api_ip_route_add_del(...) w/ count > 1.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ib7f562ec9e92ee63e52a338d318fcf1ce6221755
(cherry picked from commit 54582663ab)
2020-08-13 17:20:47 +00:00
99c6344d75 vlib: queue_hi_thresh fix to avoid deadlock
Adapt queue_hi_thresh value using num_threads to avoid risk of deadlock
between threads which could happen for example when different NAT
threads try to handoff work to each other at the same time when their
frame queues are congested. This change ensures that each thread can
reserve a queue entry without causing problems even in the most extreme
case when all threads attempt to add to the same queue simultaneously
when the queue is nearly full.

Type: fix

Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Change-Id: I9e02f753bd00833d8dd500d181b0d4f9a454d703
(cherry picked from commit 368104d06a)
2020-08-13 17:20:47 +00:00
2bd7f560c6 sr: fix non-NULL terminated string overflow
Type: fix

Change-Id: Ia5ae0e893a5358f61353d20f444d88d79953e482
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit b9753540d2)
2020-08-13 17:20:47 +00:00
36f12ac682 session: fix use-after-free in input node
Type: fix

Change-Id: Ie60b07abe76ad166f048f5885accd7038d8153b2
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 7ce23f25bb)
2020-08-13 17:20:47 +00:00
3ef5447282 session: avoid rx notifications on accepting sessions
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iba37e528e968104c3ba9c8324438ba695ddddfd1
(cherry picked from commit da302e4fce)
2020-08-13 17:20:47 +00:00
188d2c481e vcl: ensure sessions are open on select events
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4d56b61af574dfdaf6028160ce331606bdf65609
(cherry picked from commit f49cf470c5)
2020-08-13 17:20:47 +00:00
00eac4a8f8 vcl: expand vcl select maps in ldp if needed
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I56c487821233cebf2146745a4706cb573cc088a5
(cherry picked from commit cbce80aaa3)
2020-08-13 17:20:47 +00:00
a9a33884d2 gbp: fix l3-out anonymous test cleanup
Type: fix

Change-Id: Ib455b0a57f9b4f9cb82bb295c220270d0c6e5fe5
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 040d47c2cc)
2020-08-13 17:20:47 +00:00
cc16d5eb8a lisp: fix use-after-free
Type: fix

Change-Id: I42c3e3514ba50d40e09ee688d083f3e78fa0713a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 101fc278c3)
2020-08-13 17:20:47 +00:00
8c35542aa4 vat: fix static analysis warning
replace hand crafted version with existing vector function

Type: fix

Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
Change-Id: I94834852469ed316c7bdbd48bb7f479648b2c8e5
(cherry picked from commit 63551351b7)
2020-08-13 17:20:47 +00:00
ec50d9ff1e dpdk: fix udp-encap for esp in transport mode
Now UDP encapsulation doesn't work in transport mode because:
 - the encrypt node misses filling of UDP header and it gets sent with
   all zeros;
 - the decrypt node misses filling of new IP header and it contains
   garbage data.

With this commit, fill UDP header during encryption and fill IP header
during decryption.

Change-Id: I87a7bd594f0e312b16d3e5eb19e568b4e3164d36
Type: fix
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
(cherry picked from commit 82fc98fa45)
2020-08-13 17:20:47 +00:00
8f8c625f21 vcl: fix app destroy
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I21daa87b1a301142270a1bf20680dd9e9395aac9
(cherry picked from commit ce815deb72)
2020-08-13 17:20:47 +00:00
5854884d54 fib: fix use-after-free
Type: fix

Change-Id: Ie7081d977dd0d3e7d09bc0d1b4d53863288e443b
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 95eb01fdc6)
2020-08-13 17:20:47 +00:00
346e6e186a bier: fix vector size confusing ASan
The vector is initialized to 1024 entries which is guaranteed to be
enough, but as its size can shrink between calls, make sure ASan is
aware of the expected size before using it.

Type: fix

Change-Id: I4bcc39867a886b3cb463854d2cda0b32155650e9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 77100efb37)
2020-08-13 17:20:47 +00:00
8453fb7509 igmp: fix igmp proxy group merge
When merging proxy groups in igmp_proxy_device_merge_group(), the call
to igmp_proxy_device_merge_src() can end up removing the current proxy
group via igmp_group_clear(). When that happens, it must returns NULL so
that igmp_proxy_device_merge_config() does not send a IGMPv3 report for
a dead proxy group.
Make igmp_group_clear() reset the group pointer to NULL to fix this bug
and to detect similar bugs more easily.

Type: fix

Change-Id: I229e55b5bfa71734d7844893f5209a66fa3cc8ae
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit bd7f3422bb)
2020-08-13 17:20:47 +00:00
7e5733ad17 session: detach session from app on cleanup
Type: fix

Avoids unwanted notifications.

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ifff27fb0d3644194e3bb3f91d7ed1fd02c6730cd
(cherry picked from commit 77ea42b31a)
2020-08-13 17:20:47 +00:00
c36a90318c fib: fix accessing empty dpo pool elements
Type: fix

Signed-off-by: ShivaShankarK <shivaashankar1204@gmail.com>
Change-Id: Iee88a2101ce42d7f1cdb65df532c349d14829e4c
(cherry picked from commit 35acaac184)
2020-08-13 17:20:47 +00:00
e8a333e2f2 udp: fix local node no port error counter
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie0c5a86aedfa38fdcbb835aee7c9e91d59b222d6
(cherry picked from commit bc1a1a7347)
2020-08-13 17:20:47 +00:00
c9750bfcaf fib: fix adjacency cli command issue
Type: fix

Signed-off-by: ShivaShankarK <shivaashankar1204@gmail.com>
Change-Id: I193023705003e664c50487fdfaa42b813604a078
(cherry picked from commit ae9c45938b)
2020-08-13 17:20:47 +00:00
83be6cb790 misc: fix error handling in punt_replicate
If vlib_buffer_clone (...) fails due to a buffer allocation error, update
*n_dispatched with the actual number of clones, not the requested
number of clones.

Punt_replicate(...) should not set *to_next[0] = bi0. The original
buffer is enqueued separately in punt_dispatch_node(...)

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I774ad8f8c1a0633de4cf8ae5530629201c229347
(cherry picked from commit 1adc7e78ad)
2020-08-13 17:20:47 +00:00
22fb6e6ef8 vat: fix vat strncpy stringop-overflow
Fix GCC 9.0 barf on vat strncpy.

Type: fix

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I5e41225d6ac9673a9d953046720df55e7b69c479
Signed-off-by: Dave Barach <dave@barachs.net>
(cherry picked from commit b1bb513792)
2020-08-13 17:20:47 +00:00
25e24e522d vat: fix static analysis warning
Type: fix
Ticket: VPP-1837

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ia46f865082dcf0cf06af99a7c958c4a5b02193ce
(cherry picked from commit 032a5e3da0)
2020-08-13 17:20:47 +00:00
3d57cfdfb5 misc: strcpy be gone
Causes static analysis "vulnerability" warnings

Type: fix
Ticket: VPP-1837

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I272fa69251d70f62178e6dff0423c16f99937af1
(cherry picked from commit 0250090fc0)
2020-08-13 17:20:47 +00:00
d13034a6d1 misc: sprintf be gone
Along with related static analysis warnings...

Type: fix
Ticket: VPP-1837
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I2c6949c7a2250b8f76a63508c7c210daecfe0f91
(cherry picked from commit 3e07a4a1e8)
2020-08-13 17:20:36 +00:00
11903b8db6 misc: fix sonarcloud html issue
Type: fix

Change-Id: I3691c310fa6336bf2c103c42bccd94c27aab4878
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
(cherry picked from commit 39aa7a5202)
2020-08-13 10:39:40 +00:00
69d79baa08 dpdk: VM VHOST tests with rxq>1 failing
DPDK recently added a check in the virtio driver to make sure that
rxmode->mq_mode == ETH_MQ_RX_NONE. We were passing ETH_MQ_RX_RSS
and the device initialization was not accepted.

The reason for the change in DPDK was that there is no controls
(algorithm, redirection table, hash function). So they thought ETH_MQ_RX_NONE
was the best choice for the value of mq_mode.

Type: fix
Ticket: VPP-1853

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ifa0fc4206cedc56a851f94f6434a2a7500bbd419
(cherry picked from commit b32436aab9)
2020-08-13 10:39:40 +00:00
fd24cea65c misc: fix static analysis warnings
One actual bugfix.

Type: fix
Ticket: VPP-1837

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Icef25167f97a70cc795c0a481174de319ed79ad5
(cherry picked from commit c35f3e835b)
2020-08-13 10:39:40 +00:00
3c3d43b950 session: fix fifos display
This prevents a crash with quic listeners, and enables the display
of udp fifo status.

Change-Id: Ib9f48818ee3e51a3fa43ad8ab175e8aa7750df8f
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
(cherry picked from commit 6eef40bce3)
2020-08-13 10:39:40 +00:00
faab8a17b8 udp: validate input data length
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3f34011ca61ded310d0411e7b50548982bd164ac
(cherry picked from commit 936197467a)
2020-08-13 10:39:40 +00:00
df16414818 ipsec: use id in ipsec_tunnel_protect_details
Type: fix

The data populated into an ipsec_tunnel_protect_details message includes
an outbound SA and a list of inbound SAs for a tunnel interface. These
are populated with SA indices. The values used by an API client
to refer to an SA in other messages is the SA id rather than the index.
Use the SA id instead of the index.

Change-Id: Ifaad32801092a7f87bd0dcf19de418d36613f8dd
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit 5cee0bca5d)
2020-08-13 10:39:40 +00:00
08c6ea544f session: fix coverity warning
Type: fix
Ticket: VPP-1837

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ib5da600b7a40f775de7dc5b9aaa8d967e49e8632
(cherry picked from commit 4897d77c6d)
2020-08-13 10:39:40 +00:00
deafa73731 ip: Adding IP tables is no MP safe
Type: fix

it was marked MP safe in the CLI (which it shouldn't be) but
it it not marked MP safe on the API.

Change-Id: I4bdea498a510a8b406d13d62a899b6d03656f7e8
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 31d6c738c2)
2020-08-13 10:39:40 +00:00
1c8b63069c avf: fix rx queue refill on buffer alloc failure
If buffer alloc fails, it may happend that rx queue will be stuck
as old code only refills if at least one packet is received.

Type: fix
Change-Id: I388c4f8a9fb2c208bdc222e31b443cbe6b94af82
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit e7f7190381)
2020-08-13 10:39:40 +00:00
8d3ba7eab4 vcl: fix ldp recv return on error
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I0875705d3a0c95f2781b0595ef27a30486438aae
(cherry picked from commit 2a6642e95d)
2020-08-13 10:39:40 +00:00
a086cb8674 vcl: fix ldp writev 0 vecs
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iec5db8dcf3a019b731e15fd79d0208d6eb10943b
(cherry picked from commit eda1b8c32f)
2020-08-13 10:39:40 +00:00
e896fcf610 avf: proper promisc handling
Type: fix
Change-Id: Id20a0fe77372602fd211156ccee01c18d829d8df
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 1839fe165c)
2020-08-13 10:39:40 +00:00
203fe37125 virtio: vhost gso checksum error when both indirect and mrg_rxbuf are off
Turn on gso, turn off both indirect and mrg_rxbuf caused traffic received
and sent with checksum error. The problem is we are not mapping the hdr
correctly in the shared memory address.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I7ef3bc2755544167b0e624365988111b17399e89
(cherry picked from commit b232d192f2)
2020-08-13 10:39:40 +00:00
dcd3cefd74 dpdk: false link down issue with ixgbe NIC
This issue is observed with X520-2 NICs on FD.io lab Taishan server.
After VPP booting up and bringing up  the interfaces with command "set
interface state <interface> up", it still shows link down status from
the command "show hardware-interfaces". However, the hardware link
status is actually up. dpdk_process() cannot get the hardware link
status correctly via rte_eth_link_get_nowait().

In ixgbe_dev_link_update_share(), if the media type is fiber and the
link is down, a flag (IXGBE_FLAG_NEED_LINK_CONFIG) is set. A callback to
ixgbe_dev_setup_link_alarm_handler() is scheduled trying to set up the
link and clear the flag afterwards.

If the device is started or stopped before the flag is cleared, the
scheduled callback is canceled. This causes the flag to remain set and
subsequent calls to ixgbe_dev_link_update_share() return without trying
to retrieve the link state because the flag is set.

When the callback is canceled by either interface start or stop
operation, in ixgbe_dev_cancel_link_thread(), after cancelling the
callback/thread, unset the flag on the device to avoid this condition.

Type: fix

Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
Reviewed-by: Jieqiang Wang <Jieqiang.Wang@arm.com>
Change-Id: I04de377dc048307a78a5b7109ebdfaf376d5e029
(cherry picked from commit 1690dcb495)
2020-08-13 10:39:40 +00:00
704ebc1f89 vlib: complain if workers are configured twice
Right now following configuration leads to crash:
cpu {
    corelist-workers 2
    workers 2
}

because threads count will be set to 2, but we have only
one core in coremask.

Type: fix
Signed-off-by: Vladimir Isaev <visaev@netgate.com>
Change-Id: Ia93b892733971e7c8ddfceaaec5f4eb8bf9063ac
(cherry picked from commit 18a4a37164)
2020-08-13 10:39:40 +00:00
c81ba3d6a6 vlib: fix error when creating avf interface on SMP system
On SMP architecture, '/sys/bus/pci/devices/<devices id>/numa_node' file
will return -1 as a valid value if it does not have any NUMA node information.
Using -1 as a valid node id to access data structures will cause memory issue.
Fix the error by setting the value of numa_node to 0 if '/sys/bus/pci/devices/
<devices id>/numa_node' returns -1 and it is a SMP system.

Type: fix

Change-Id: Ib60e79c3656fe5b17e08fd9011122683e8b08b6f
Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
(cherry picked from commit 76c6159d83)
2020-08-13 10:39:40 +00:00
7c8260196a ip: provide extern declaration for ip punt nodes
Type: fix

Signed-off-by: Jawahar Santosh Gundapaneni <jgundapa@cisco.com>
Change-Id: Ife0f7749a72cc834a3d811f8cf6b5a0840157014
(cherry picked from commit 62ad2aaff3)
2020-08-13 10:39:40 +00:00
b0a568a376 tcp: count dupacks with no sacks
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia2e29b4776c0f8df666da39a14c5ef2fa1693c21
(cherry picked from commit 7fd59cc79c)
2020-08-13 10:39:40 +00:00
8c6b575634 ethernet: Copy only 6 bytes of mac address into a u64
Rather than leaving 2 bytes of junk in the upper word
of a mac address represented as a u64, zero them out.
That way later compairsons stand a chance of matching
when deleting a bridge's arp termination entries.

The volatile qualifier shouldn't be needed here, but
without it the compiler removes the clib_memcpy() at -O2.
Bad compiler.  No biscuit.

Type: fix
commit: faf22cb303

Change-Id: Iebcf35fdd421293dccbcaefadef767f7e139438e
Signed-off-by: Jon Loeliger <jdl@netgate.com>
(cherry picked from commit 6a32ce3264)
2020-08-13 10:39:40 +00:00
0088c6875f pg: update packet generator test scripts
update packet generator test scripts to reflect latest code changes

Type: fix

Signed-off-by: ShivaShankarK <shivaashankar1204@gmail.com>
Change-Id: I048a5e8b9b0506dcb0b664e5549d13f51b2e2ea6
(cherry picked from commit b0f956c255)
2020-08-13 10:39:40 +00:00
69f3a473bc lb: fix coverity warning
Type: fix
Ticket: VPP-1837
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I357eb72d478d8175ab9c7cf502d312ab3112213e
(cherry picked from commit a53068905e)
2020-08-13 08:12:25 +00:00
458ab69af3 udp: fix UDP socket byte order in lookup
The port registry uses host byte order for while the session API
uses network order. In a single place the conversion was missing.

Type: fix
Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
Change-Id: Ic8cfe2cb4e0711b3e0614060ff6b4f2fe4ed4391
(cherry picked from commit 49a11cff8e)
2020-08-13 08:12:25 +00:00
5d83b56e24 misc: Fix vpp-selinux-policy dependency on CentOS 8
policycoreutils-python is now called python3-policycoreutils on
CentOS 8.

Type: fix

Signed-off-by: Renato Botelho do Couto <renato@netgate.com>
Change-Id: I46264c66a2a719d546e0926f3bd716e986461963
(cherry picked from commit 1d94ab5f1b)
2020-08-13 08:12:25 +00:00
cd243dea97 fib: path flag FIB_API_PATH_TYPE_INTERFACE_RX not copied to client
This path flag FIB_API_PATH_TYPE_INTERFACE_RX is not copied to the client bin_api.

Type: fix

Change-Id:

Signed-off-by: IJsbrand Wijnands <ice@cisco.com>
Change-Id: I612044d2f564c852f83fceb63ce750a6330e1365
(cherry picked from commit 79437c8dbc)
2020-08-13 08:12:25 +00:00
3f8c381bfc vppapigen: crc is a negative value for some messages when using python 2.7
Type: fix

Signed-off-by: Mark Nelson <manelso2@cisco.com>
Change-Id: I4f121e49d3c05c21eed3fed2469bd88fc84e2271
(cherry picked from commit ea2abbaeaf)
2020-08-13 08:12:25 +00:00
ea8852991f ebuild: fix the distclean target
Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I32142962cb70ea0d92cda1b0ffaac42b7de15974
(cherry picked from commit 952ec0e0a6)
2020-08-13 08:12:25 +00:00
e3891696b9 vppapigen: list imports in JSON
Type: fix

Change-Id: If50477f2487d8c13f91c119a1492370e6e937904
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
(cherry picked from commit eec5d48040)
2020-08-13 08:12:25 +00:00
c285f384ff lb: Fix generating illegal key in per-port vip
VIP prefix index becomes always 0 when adding a VIP which is already registered different port, causing LB config crash.
This change assigns the same VIP prefix index to the same VIP.

Ticket: https://jira.fd.io/browse/VPP-1834
Type: fix

Signed-off-by: Yasuhiro Nakamura <yanakamu@yahoo-corp.jp>
Change-Id: Ib63b3e58db9bd85714d68cd1292aadd0c8580da8
(cherry picked from commit 551775eaaa)
2020-08-13 08:12:25 +00:00
5a9769c159 vat: add ip api types parser definitions
build vat with src/vnet/ip/ip_types_api.c

Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: Iab0f18bf7a89cf9512beab0629bc3a349edec383
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
(cherry picked from commit 23a386b71b)
2020-08-13 08:12:25 +00:00
b745d7b21d map: handle IPv6 extension headers for TCP/UDP
Without this patch offset for TCP/UDP headers was not calculated
correctly if there is one or more IPv6 extension headers.

Type: fix
Signed-off-by: Vladimir Isaev <visaev@netgate.com>
Change-Id: I04d6f5e42f8f072987192d6236085afbd74a4420
(cherry picked from commit 7d4cd0cf6f)
2020-08-13 08:12:25 +00:00
df76172d8a unittest: Skip string test case for sizeof (src) > sizeof (dst)
coverity complains that the subject test may cause dst buffer overrun
problem and it is right. The problem is when __builtin_constant_p (n)
returns true, memcpy_s_inline skips all the errors checking and does the
copy blindly. Please see the code in memcpy_s_inline.

The fix is to skip the subject test when the aformentioned builtin function
returns true.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I50de91cc0c853a134b3bcf3b0cd8d45d7668b092
(cherry picked from commit 2da39718f5)
2020-08-13 08:12:25 +00:00
f17be8ae96 crypto-openssl: fix coverity warnings
Type: fix

Change-Id: Ia42ff39a0a33f89901b8333a9e6ca82ca9805cc6
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit 41e831f558)
2020-08-12 23:37:19 +00:00
2d4628633a tcp: remove useless prediction
Type: fix

Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
Change-Id: Ie2dc2653baec92347eb2cbcd197a2e5ec6a80c79
(cherry picked from commit 487507f40f)
2020-08-12 23:33:50 +00:00
ea9d86e749 gbp: Coverity warnings for unitialized variables
Type: fix

Change-Id: If74ad528e68f45b00719295388e0e1399452ef93
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit e9a630a524)
2020-08-12 23:32:24 +00:00
d243b03eef fib: Uninitialised pad in the prefix (coverity warning)
Type: fix

Change-Id: Ia61d6fbf6e80977f83f1f6672e5e83b52ddeb0e5
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit ea96e92361)
2020-08-12 23:27:46 +00:00
b96c1c4569 ipip: Unintialized return variable (coverity warning)
Type: fix

Change-Id: I008f23b5f0c7269ddd35cc747a867240fbe9c49b
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit d057625d49)
2020-08-12 23:23:28 +00:00
08653d9d6c ip: Unintialized variables in prefx setup (coverity warning)
Type: fix

Change-Id: I048c9ed423ca2993d2179cdce364ac98980311bb
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 39a233a0aa)
2020-08-12 23:18:24 +00:00
ee0c564c31 tcp: fix coverity warning in bt
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4153a9a377b8b1da1366a94ff791ad99617b7a6d
(cherry picked from commit 62a7fe2893)
2020-08-12 23:15:37 +00:00
f1f51770f3 lisp: fix coverity warnings
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie060b25b5e8c85d9b2037e300723a2b6023c65d1
(cherry picked from commit 6ce954f8e4)
2020-08-12 23:14:21 +00:00
e1341468e6 fib: adjacency midchain teardown (VPP-1841)
Type: fix

Change-Id: I57f8bfbce4feed9d2775875cb8b1b729a47900a4
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 24064d02aa)
(cherry picked from commit 3ebebc3a2f)
2020-08-12 23:11:03 +00:00
caa082a106 map: honor pre-resolve param in map-t
With this commit, forward the translated packet directly to the
specified next-hop if pre-resolve param is enabled in MAP-T.

Type: fix

Change-Id: Ie26080c7820318c7982599577a4af6e4d01a0574
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
(cherry picked from commit f145c15631)
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2020-08-12 23:01:47 +00:00
18d2d6bd4a misc: fix coverity warnings
Add an ALWAYS_ASSERT (...) macro, to (a) shut up coverity, and (b)
check the indicated condition in production images.

As in:
 p = hash_get(...);
 ALWAYS_ASSERT(p) /* was ASSERT(p) */
 elt = pool_elt_at_index(pool, p[0]);

This may not be the best way to handle a specific case, but failure to
check return values at all followed by e.g. a pointer dereference
isn't ok.

Type: fix
Ticket: VPP-1837
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ia97c641cefcfb7ea7d77ea5a55ed4afea0345acb
(cherry picked from commit 47d41ad62c)
2020-08-12 15:59:46 +00:00
84918d2554 tls: remove session lookup operation in TLS
Type: fix

Change-Id: I50329bda365d98f9f9d56a58187fb4fb2a4eb461
Signed-off-by: Yu Ping <ping.yu@intel.com>
(cherry picked from commit 985d9293a0)
2020-08-12 15:59:46 +00:00
e0208837b5 vcl: fix ldp read on closing session
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I60be191866d20721951ad22f571a2a3275511e12
(cherry picked from commit 067f9544d5)
2020-08-12 15:59:46 +00:00
0bd543b2a9 dpdk: fix flow(with mark action) deletion crash issue
Type: fix

this patch fixes mark flow deletion crash issue, see below

test flow add src-ip any proto udp src-port 111 dst-port 222 mark 100
test flow enable index 0 1/1
test flow disable index 0 1/1
test flow enable index 0 1/1
test flow disable index 0 1/1 -> [crash]

This is because the code resets a wrong vector in flow lookup entry
recycle logic. See function dpdk_flow_ops_fn().

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: I2b0a1e531931ab25541d672d88da18dc2289f1ce
(cherry picked from commit cd120f9bbb)
2020-08-12 15:59:46 +00:00
d904f803bd nsim: fix quad-loop packet trace
Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I756170bd799d1f482186cbb4b5dff9373ae6e08f
(cherry picked from commit 3be33f17ec)
2020-08-12 15:59:46 +00:00
1189a77578 vcl: clear accept msg flags
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Idb513232e7b091c8f767726bfa1deb10a7e3b751
(cherry picked from commit e88845e4fe)
2020-08-12 15:59:46 +00:00
af0bf322d7 api: do not truncate api dump file size
Type: fix

Change-Id: I5c81d2f55057f5fba780cb12154a3fb1aef79f20
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit aba4983ad4)
2020-08-12 15:59:46 +00:00
e700b5e431 session: avoid scanning new io list under load
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Idaa7cc26ad941be86daec4ed5920727237712f4a
(cherry picked from commit 16d974ec59)
2020-08-12 15:59:46 +00:00
5733ea661a vppinfra: remove unused variable from timing wheel
Type: fix

Change-Id: I77b03efcac04cc46550d03657464ab8de5d7da78
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit 90d28846f9)
2020-08-12 15:59:46 +00:00
0c342eb6ee ip: fix ip-local errors
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie8bc5c9a03e858487cf565b4e9b520e6b496337a
(cherry picked from commit fa2a316663)
2020-08-12 15:59:46 +00:00
954c0bb0cf vlib: Skip core 0 if workers are configured.
According to the description in the startup.conf, the assignment
of worker threads starts with the lcore following the main_lcore.
A non-zero skip_cores will correctly achieve this assignment.
However, prior to this patch when workers are assigned, the code
picks up and assigns core 0 even thought it shouldn't.
This patch determins if a non-zero number of workers are desired
and if so, marks CPU unavailable for a worker assignment.

Type: fix

Change-Id: I1fdf73a6f218dcbf146fda2efc90c553f7cd6d20
Signed-off-by: Jon Loeliger <jdl@netgate.com>
(cherry picked from commit 4a06846dd6)
2020-08-12 15:59:46 +00:00
fe7690230a tcp: fix input error counters
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I87940d02813b66616f1944e41b16c8cc16f5dac0
(cherry picked from commit deb6f784ed)
2020-08-12 15:59:46 +00:00
062357dc6e ipsec: fix AES-GCM block size
Type: fix

Change-Id: I0c9640dab2c0eaba369bc8f3ff7ae56d8e97e170
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit f1ecb65553)
2020-08-12 15:59:46 +00:00
82c4eac772 ip6: fix l4 checksum with hop-by-hop header
L4 checksums for IPv6 should be calculated using a pseudo header that
includes the source/destination addresses, payload length, and payload
protocol.

ip6_tcp_udp_icmp_compute_checksum() was using the payload length and
protocol from the IPv6 header. If there is a hop-by-hop header (or any
other extension header), the payload length used for the pseudo header
should only include the upper layer header and payload and not the
extension header bytes. Same deal with the protocol, the upper layer
next header value should be used instead of the extension header.

Type: fix
Fixes: cb9cadad57

Change-Id: Ifa2c9ad41c0fc4eea674f0671255b637c8e01f71
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit 97677a26f7)
2020-08-12 15:59:46 +00:00
9a91d62793 fib: fix non-NULL terminated vectors in cli output
Type: fix

Change-Id: Idbb3f29b13a5c84a8585c4299e51fdfc35f7e1ad
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 84382ae45c)
2020-08-12 15:59:46 +00:00
caeb90e9ce svm: use default SVM address in fifo unit tests
Using random addresses can confuse AddressSanitizer

Type: fix

Change-Id: I44368093f899672ac4d511cc5a01ed87c988e63a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit dc90c719bc)
2020-08-12 15:59:46 +00:00
cfae0f882e vcl: fix session closing error
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I94f1365569e98d43486d9528faafc6d7c3ad88f7
(cherry picked from commit 190dc1f678)
2020-08-12 15:59:46 +00:00
779ca383b9 stats: fix state counter removal
Avoid using vec_del1() for directory vector to keep indexes valid all
the time.

There are state counters for each slave in LACP bond mode which can be
dynamically created and removed. Vector index is used to access these
counters. But also vec_del1() is used to remove counter from vector.
This function changes the index of the last element, so after this we
are unable to access ex-last element using old index.

As a result it is not possible to add-del-add two interfaces to the LACP
bond:

DBGvpp# create bond mode lacp
BondEthernet0
DBGvpp# create packet-generator interface pg1
DBGvpp# create packet-generator interface pg2
DBGvpp# bond add BondEthernet0 pg1
DBGvpp# bond add BondEthernet0 pg2
DBGvpp# bond del pg1
DBGvpp# bond del pg2
DBGvpp# bond add BondEthernet0 pg1
DBGvpp# bond add BondEthernet0 pg2
bond add: /if/lacp/1/3/partner-state is already register

Type: fix

Signed-off-by: Vladimir Isaev <visaev@netgate.com>
Change-Id: I2c86e13905eefdef6233369cd4ab5c1b53d123bd
(cherry picked from commit 72e31bc2d9)
2020-08-12 15:59:46 +00:00
fd48e5542a dpdk: patch ixgbe driver to solve race condition
Type: fix

Some fiber ports that are managed by the ixgbe PMD have the
possibility to get into a state where link can never be brought up.

This patch should fix it and will be submitted to upstream DPDK.

Change-Id: Ia4d0df2e70d098b2151e513b96e8bd742151e8ce
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit 0860b2e193)
2020-08-12 15:59:46 +00:00
80fab46b81 virtio: vhost gso is broken in some topology
Recent modification added a call to vnet_gso_header_offset_parser in the
beginning of vhost_user_handle_tx_offload. The former routine may set tcp or
udp->checksum to 0. While it is appropriate to set it to 0 for the GSO packet,
it is broken and causes checksum error if the aformentiooned routine is called
by a non-GSO packet. The fix is to not call vhost_user_handle_tx_offload
if the buffer does not indicate checksum offload is needed.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I6e699d7a40b7887ff149cd8f77e8f0fa9374ef19
(cherry picked from commit 564e167291)
2020-08-12 15:59:46 +00:00
b953621405 map: Prevent IPv4 prefix spoofing during IPv6 -> IPv4
Prevent malicious packets with spoofed embedded IPv4 addresses
by limiting the IPv6 ingress packets to known MAP-T domains.
Drop spoofed packets.

Add several tests that ensure spoofing isn't allowed.

Type: fix
Fixes: fc7344f9be

Change-Id: I80a5dd10d5fe7492e3a1b04de389d649a78065e2
Signed-off-by: Jon Loeliger <jdl@netgate.com>
(cherry picked from commit 65866f03d9)
2020-08-12 15:59:46 +00:00
18b3c002bf session tcp: fix packet tracing
Type: fix

Change-Id: Ib823d016c64998779fb1d00b8aad3acb5e8340be
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 30928f87a3)
2020-08-12 15:59:46 +00:00
06c104f4e3 sr: fix possible null-pointer dereference
Steps to reproduce VPP crash:
1. configure localsid End behavior
2. ping the localsid address

Type: fix

Signed-off-by: Ignas Bacius <ignas@noia.network>
Change-Id: Id780e0875ec9cdb25252217990919fb3dddbf06a
(cherry picked from commit bd5c49a161)
2020-08-12 15:59:46 +00:00
5c3aab4212 classify: pcap / packet trace debug CLI bugs
"classify filter trace ... " and "classify filter pcap ..." are
mutually exclusive.

vnet_pcap_dispatch_trace_configure needs to check for
set->table_indices == NULL.

Type: fix
Ticket: VPP-1827

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I43733364087ffb0a43de92e450955033431d559d
(cherry picked from commit 196fce2b62)
2020-08-12 15:59:46 +00:00
b29ebcad59 interface: Add missing ip4 udp->checksum = 0 prior to computing checksum
For ip4 tcp, ip6 tcp, and ip6 udp packet, we set checksum = 0 prior to
computing the checksum. We missed ip4 udp case. This oversight requires all
clients to set udp->checksum = 0 if ip4 udp checksum offload is needed.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ic608811e82099f3bec469e123671e9b281f38d76
(cherry picked from commit 03328ec8bb)
2020-08-12 15:59:46 +00:00
7e8cd07b1f map: api: fix tag overflow and leak
The 'tag' parameter is expected to be a NULL-terminated C-string in
callees:
 - make sure it is null-terminated in both API and CLI cases
 - do not allocate & copy the string into a non-NULL-terminated vector
   in API case
 - fix leak in CLI case

Type: fix

Change-Id: I221a489a226240548cdeb5e3663bbfb94eee4600
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 3b37125bdb)
2020-08-12 15:59:46 +00:00
4e422269f8 session: fix node runtime in pre-input queue handler
Call session queue node with the right node runtime instead of the
pre-input node runtime.

Type: fix

Change-Id: I43d20bed4930fc877b187ce7ecdce62034b393c5
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 2d8829cbb5)
2020-08-12 15:59:46 +00:00
c366be8647 vcl: always report EPOLLHUP/EPOLLRDHUP on close
Type: fix

Change-Id: I3d24a7973c7113ffeb9109e89cda7fa960e73a5b
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit ddb90a063c)
2020-08-12 15:59:46 +00:00
496eba6bfe nsim: enable output scheduling on main thread
Type: fix

Change-Id: I5d47cb9bc7eb7f3c8485e3b42f0701e81d87ba2a
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
(cherry picked from commit c0c4eec3bc)
2020-08-12 15:59:46 +00:00
eee684dd8b classify: fix pcap filter set init
Type: fix

Change-Id: I6a48a6c14bfb84b3460e8211021bc9df6e915dba
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit cd681adab4)
2020-08-12 15:59:46 +00:00
3311a17e40 lb: fix that lb_add_del_vip and lb_add_del_as api doesn't work correctly
Currently if user want to set ip4 address to the api, it must convert to ip6
format, e.g. user want to ip4 "90.1.2.1" but must convert to "::5A01:0201",
it is not acceptable, this fix solved the issue.

Ticket: FDIO-753
Type: fix

Change-Id: I2ffa5a3d38400ee176cf601421074f71fc395f03
Signed-off-by: Yulong Pei <yulong.pei@intel.com>
(cherry picked from commit db43bb6af7)
2020-08-12 15:59:46 +00:00
4362672562 sr: some fixes for SRv6 CLI/API
Return FIB table_id instead of vrf_index to clients

Type: fix
Signed-off-by: Ahmed Abdelsalam <ahabdels@cisco.com>
Change-Id: I76a97bad3ecd3ac8eb045efb1657eaa90c2a57b6
(cherry picked from commit 13e6fce7c5)
2020-08-12 15:59:46 +00:00
4d5da6c5ed tcp: fix rxt delivered without sacks
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I69c245cb0e3f6d599a3270a485fa0a5845cde8eb
(cherry picked from commit 56cef059ef)
2020-08-12 15:59:46 +00:00
0347bf689b vcl: add rx event on epoll ctl if needed
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ib6d0387076a4bb0b52e4cdfdcd62b6060b704fe6
(cherry picked from commit 6e3c1f8ec3)
2020-08-12 15:59:46 +00:00
72c354dcd5 udp: fix ipv6 listen port registration
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I7f2233eb9bf3d81a697f76ba985083cf1040e2e9
(cherry picked from commit ff2fad1701)
2020-08-12 15:59:46 +00:00
5d3e47cdd8 vppinfra: fixing compilation issues in 32-bit
Fixing compilation issuues for 32-bit also setting init flag for shm based bihash

Type: fix
Signed-off-by: Vijayabhaskar Katamreddy <vkatamre@cisco.com>
Change-Id: Ic2072c5ba7fc77d061ca9f1b844a71f6e22e58b2
(cherry picked from commit f0bae64f6f)
2020-08-12 15:59:46 +00:00
5aedb02760 build: Add missing version.h dependency in vnet
Two modules in vnet include vpp/app/version.h but there is
no explicit build dependency for this generated file. This
leaves a race condition in the build system that the Coverity
build has recently started triggering.

Change-Id: I8e2bb32feeb16e1bdd8efb0d2633cfdba60f51aa
Type: fix
Signed-off-by: Chris Luke <chrisy@flirble.org>
(cherry picked from commit c171d01cdb)
2020-08-12 15:59:46 +00:00
4fbd85cd89 tcp: fix tcp check tx offload issue
Type: fix

Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
Change-Id: I3b8755831d762abf51e1cbe1b57024f9297de9a4
Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
(cherry picked from commit 79bfb9e09c)
2020-08-12 15:59:46 +00:00
dfa1eeb158 tls: enable async node on demand
Type: fix

Change-Id: Iab7c65614c94497e8ec5a96624be72c1a139e486
Signed-off-by: Yu Ping <ping.yu@intel.com>
(cherry picked from commit d63b356bdf)
2020-08-12 15:59:46 +00:00
e775016959 ip6: during icmp to icmp6 translation truncate error messages
All translated ICMPv6 packets that exceed the minimal IPv6 MTU get
truncated but according to RFC 4443 2.4 only ICMPv6 error messages
(type < 128) need to be truncated.

With this commit, truncate only ICMPv6 error messages.

Type: fix

Change-Id: Ic455352de2ff4ff6aa3421b46a2a54923f2d3f80
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
(cherry picked from commit 180210f99b)
2020-08-12 15:59:46 +00:00
0cd8e2c59a tcp: handle ack advancement with no holes and reneging
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I9afba8dc9e087b8c436fe568531c02614a577a7c
(cherry picked from commit c95eefb393)
2020-08-12 15:34:35 +00:00
afb4d3ae90 docs: fix vpp-make-test-docs-merge-1908 doc upload
Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I77929b7067b11015e66ee3e24f63a377b1f788e2
2020-08-12 15:28:35 +00:00
029b8c8ee8 dpdk: enforce max tx retries
n_retry was never decremented and so never enforced.

Type: fix

Change-Id: I71d60a72c156286f7e5b82b1c77a723361317c69
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 207a163309)
2020-08-12 15:28:04 +00:00
251c1e73e1 ct6: dst,src copy typo
Type: fix

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: I266fa5dc637383fd8dac6592c9c266a1b70a73e9
(cherry picked from commit 629e268aa1)
2020-08-12 15:28:04 +00:00
fb5ef86105 tls: enable TLS OpenSSL plugin works in 3.0.0
Type: fix

Change-Id: Id1602981fcc6efed1b0efe79a1fc8177457acdb5
Signed-off-by: Yu Ping <ping.yu@intel.com>
(cherry picked from commit 1c6486f7b8)
2020-08-12 15:28:04 +00:00
d07624f149 ip: avoid fib lookup for consecutive pkts having same source IP
Type: fix
Fixes: be2286b0

This patch does following:

- If terminating frame has consecutive packets with same source IP, this patch
  avoids fib lookup for those packets in ip4-local node. This drops cycle count
  for ip4-local node on both ARM and x86. It being done by enabling dead code in
  else {} case of ip4_local_check_src_x2() and ip4_local_check_src() functions.

- In case all packets in terminating frame have unique source IP (e.g:
  incrementing), ip4-local is costlier by 2 cycles (broadwell)

Change-Id: I472ddc324716cec8bfe601568b8aeb7565f97ab3
Signed-off-by: Nitin Saxena <nsaxena@marvell.com>
(cherry picked from commit 2d18d2ea9f)
2020-08-12 15:28:04 +00:00
a4200a6824 fib: leverage well-optimized clib_memcpy
Type: fix

Change-Id: I684910837ca4d9c8a07262459158bbb0423a33af
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
(cherry picked from commit d3d7ef5ec8)
2020-08-12 15:24:14 +00:00
7e8c693f7d session: remove io event dispatch dbg msg
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I166ab7b96444587a3252925d3a28505e0db52d74
(cherry picked from commit 87b0c89294)
2020-08-12 15:24:14 +00:00
71eab61d31 tcp: fix persist assert
Type: fix

Persist and retransmit can pop at the same time.

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia9530645cc84c83a881a75d7b4627197dc50ed29
(cherry picked from commit a6696719cb)
2020-08-12 15:24:14 +00:00
9568a58ee5 tcp: fix scoreboard assert
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3c70b331932708a1b773392e089aed9dba9b3b31
(cherry picked from commit edf1da94dc)
2020-08-12 15:24:14 +00:00
40f1beaae3 tcp: fix last sacked with no holes
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id12b0a9b8bc47aef8b393544e5b4c8228ed6a606
(cherry picked from commit 479f7fec6a)
2020-08-12 15:24:14 +00:00
1bc07facef vppinfra: retry socket connect on EAGAIN
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I93577acf559a8fa639aab7ec3f7cdbe7df9a248d
(cherry picked from commit 42ddf69ed0)
2020-08-12 15:24:14 +00:00
06f4a811a7 svm: fix eventfd signal write error check
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I706c8642ca0877430a42cc0ca5bc61a45428fc98
(cherry picked from commit e4a08c1f3b)
2020-08-12 14:37:52 +00:00
756437e6f2 vlib: fix coverity warning / real bug
The path must be next-to-impossible to hit, because the code has been
wrong for at least 5 years.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I23b8c4e1631827e7931f353c561c1e19c596c598
(cherry picked from commit 5c944eef70)
2020-08-12 14:37:52 +00:00
da99771dfe tls: Make tls CPS test run for a quite long time
Type: fix

Change-Id: I8cfb48bd7f92689b296861dd368186408918061b
Signed-off-by: Yu Ping <ping.yu@intel.com>
(cherry picked from commit a9ed934745)
2020-08-12 14:37:52 +00:00
20ebef4714 tcp: fix duplicate sack whith reneging
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6f7fb91e059996ff702eb9c36e3abaed237fe221
(cherry picked from commit 067f8f963d)
2020-08-12 14:37:52 +00:00
c2130c0102 tcp: fix rate samples for old acks
Type: fix

Change-Id: Ieab35bbfba81faae61b1267d8661df5195877824
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 2f04cb9f14)
2020-08-12 14:37:52 +00:00
a1261bd0b3 build: Fix Subject-line feature list extraction
Bang on sed until a better incantation appears.

Change-Id: Ib8ad0996b6325db0fe983c86dd7dc553c9d388c4
Type: fix
Fixes: 26ce6ca1fe
Signed-off-by: Jon Loeliger <jdl@netgate.com>
(cherry picked from commit 171577e129)
2020-08-12 14:37:52 +00:00
34ccf72c4a svm: broadcast on raw dequeues and full rings
Type: fix

Change-Id: I0cac9001290e7ed4e2e318ae62c56e97ec75a3db
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit fea813ae3d)
2020-08-12 14:37:52 +00:00
1144fb0f98 vcl: hold errno when calling LDBG
Type: fix

Call trace of LDBG:
LDBG->clib_warning->_clib_error->dispatch_message->os_puts->writev
However, writev will hijacked by LDP, and then execute following code:
if ((errno = -ldp_init ()))
    return -1;
Now, errno will be set.

Because we always call LDBG just before return from ldp_accept4, listen,
and etc. So errno will be overwritted after LDBG called.

Signed-off-by: hanlin <hanlin_wang@163.com>
Change-Id: I7a90f3a14772994f11f09650481411796e3f5630
(cherry picked from commit 9f3f18f99f)
2020-08-12 14:37:52 +00:00
6104daa550 vcl: EPOLLOUT should be generated when epoll_ctl called with EPOLLOUT
event

Type: fix

When we call epoll_ctl to add or mod fd with EPOLLOUT event, mostly to
check if we can write. So we expect a EPOLLOUT event should be generated
immediately unless tx queue is full.

Signed-off-by: hanlin <hanlin_wang@163.com>
Change-Id: Ie99986a44dbb07b6ff2fba6512171056f79e77bd
(cherry picked from commit 475c9d7bcd)
2020-08-12 14:37:52 +00:00
c69b18f818 tcp: accept sack reneging as a cc event
Type: fix

Change-Id: Iead1303ca3dec7593eb3ce54f291b82d94c821a4
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 1de7167e7a)
2020-08-12 14:37:52 +00:00
62c6e93d10 interface: Prevent bad inner-dot1q any exact-match configuration
Someone much more knowledgeable than I wrote:

    For L3 IP forwarding, any VLAN tags on a packet must be exact
    match to a sub-interface which means both outer and inner VLAN
    tag IDs must be exact-matched to specific values defined of that
    sub-interface.  Without exact match on a L3 sub-interface, VPP
    has no mechanism to know what VLAN tags to use for packet output,
    such as ARP request packets or IP packets, on that sub-interface.

    Thus, sub-interface with "inner-dot1q any" is not an exact match
    sub-interface by definition since no match is present on inner
    tag.

While in the area, fix a memory leak that would ensue on poorly
configured interfaces.

Change-Id: I8d17a96dbca3e3724c297ecc935ca61764e6ce2e
Type: fix
Signed-off-by: Jon Loeliger <jdl@netgate.com>
(cherry picked from commit b22e1f06bb)
2020-08-12 14:33:06 +00:00
74331c935f build: use cmake build types
Type: make

Change-Id: If822c85d6ff26982516ea1d597ca81aa84773b2b
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 2baa115da3)
2020-08-12 12:46:12 +00:00
5381da1dc6 gtpu: Track the dst FIB entry instead of RR sourcing that
RR sourcing the destination FIB entry limits the number of tunnels
to 255 for a particular destination. This change removes this limit.

Type: fix

The patch is based on 1f50bf8fc5
that introduced the FIB entry tracking but did not update
the gtpu plugin.

Signed-off-by: Miklos Tirpak <miklos.tirpak@gmail.com>
Change-Id: I8a4a87382a6eb5120e2bb65b9bc3c446bbfdbd3b
(cherry picked from commit 75c7236918)
2020-08-12 11:16:27 +00:00
c9563e60fe misc: don't os_exit(1) causing core on SIGINT
It's not typical for a program to core when it receives a SIGINT, so
keep this from happening.

Type: fix
Signed-off-by: Christian E. Hopps <chopps@chopps.org>
Change-Id: I2c15985a57e6ea898ff05c4001e4b30b41154eba
(cherry picked from commit 10a8bda37e)
2020-08-12 11:16:27 +00:00
c7e6b50fdd pg: don't leak open files in packet-generator
Fix pg code to close it's open file descriptors before zero'ing the
pcap_main structure for re-use.

Ticket: VPP-1780
Type: fix
Signed-off-by: Christian E. Hopps <chopps@chopps.org>
Change-Id: I32945c6476ae83b8d210ee67ac78db3e8f786f46
(cherry picked from commit 19871f2539)
2020-08-12 11:16:27 +00:00
99e0ee56eb vpp: fix .short_help for "ip virtual"
Type: fix

"# <feature-name>: <subject>

Change-Id: I8b6b6b8c70faec7cd95e1842259e907fb9587017
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
(cherry picked from commit 0812aea046)
2020-08-12 11:16:27 +00:00
e144c1b9d2 vxlan geneve gtpu: fix short help
Type: fix

Change-Id: Id53eb6ed15f270d747b9831a7b585cbafe515dd2
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
(cherry picked from commit 5fb2278cb8)
2020-08-12 11:16:19 +00:00
ffd24e5243 ip: cleanup punt socket cli help
Make the help string consistent with the cli parser.

Type: fix

Change-Id: I7140bd589c2a94dbf5af5cc633cb495457a6af22
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
(cherry picked from commit 32c4d38f7a)
2020-08-12 07:43:14 +00:00
43deb075fb feature: add descriptive cli command output for 'set interface feature'
DBGvpp# set interface feature local0 arp-foo arc bad-arc
  set interface feature: Unknown arc name (bad-arc)...

  DBGvpp# set interface feature local0 arp-foo arc arp
  set interface feature: Feature (arp-foo) not registered to arc (arp)...
  See 'show features verbose' for valid feature/arc combinations.

  DBGvpp# set interface feature local0 arp-disabled arc arp

Type: fix

Change-Id: I036bb2a75dd2d40f6901e4fde3eb14925238e19b
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
(cherry picked from commit a4e2e7cc95)
2020-08-12 07:43:14 +00:00
67cb0f82a1 feature: add [verbose] to show features help
Type: fix

Change-Id: Idf694477c18852e5541c28a493a56b302122e46c
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
(cherry picked from commit baa171041b)
2020-08-12 07:43:14 +00:00
8ab656321e vlib: fix startup-config-process stack overflow
Type: fix

Startup config setting an i40e/ice interface
up in Debug VPP consumes more than the currently
available stack space.

Signed-off-by: GordonNoonan <gordon.noonan@intel.com>
Change-Id: I98b52c5596799017b97f802a8661b76cd1bb3245
(cherry picked from commit b2dbb36fc2)
2020-08-12 07:43:14 +00:00
a750b7f71f vlib: fix an issue with show pci
The fix has been received over e-mail from Lijian Zhang.
https://lists.fd.io/g/vpp-dev/message/14808

Type: fix
Ticket: VPP-1805

Change-Id: I73e5fe7dcbe2b0b1c639d844f29183eab3b6dd66
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
(cherry picked from commit dea0b23fa7)
2020-08-12 07:43:14 +00:00
55ae848ce4 build: Allow to override build date with SOURCE_DATE_EPOCH
and make host and user overridable
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

Also switch to UTC to be independent of timezone.
Also use ISO 8601 date format to be easier to parse.
This is similar to c9f4022783
and df82ec8fe7
which was lost in the move away from automake.

Note: This date call is designed to work with different flavors
of date (GNU, BSD and others).
If only GNU (Linux) support is needed, the patch can be simplified.

This PR was done while working on reproducible builds for openSUSE.

Type: fix

Change-Id: If4cab12320e6b5fcb1f2842fac5d745b33b01ed7
Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
(cherry picked from commit 3d14f03619)
2020-08-12 07:43:14 +00:00
a699926a0d vlib: fix vector-as-C-string overflow
Type: fix

Change-Id: If0419ff1a82d45e5b3326973008e1b9feb290c5a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 62d9fda8e4)
2020-08-12 07:43:14 +00:00
d8e41e7810 classify: forbid invalid match config
Forbid too long match to be configured.

Type: fix

Change-Id: Icfced0f86821d5febd6a3c81e1315bd9737498c0
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 71a70d73f3)
2020-08-12 07:43:14 +00:00
280079fb99 vppinfra: fix cpu flag string overflow
Type: fix

Change-Id: Idb1fff8a172034044bb33d5b271a84d1fd672ef5
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit a7cb357491)
2020-08-12 07:43:14 +00:00
6051aa4924 l2: fix l2input_feat_names overflow
Type: fix

Change-Id: I59549b3aab5a0ccfe7db02757f78528e028121a5
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 70ef0faea9)
2020-08-12 07:43:14 +00:00
f7b581260f ipsec: Init salt value in SA creation CLI (so it's not random)
Type: fix

Change-Id: Idf4d0b59a1eb2c739a67a4786470884050f81561
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 8dc75c0cc3)
2020-08-12 07:43:14 +00:00
339cad4aaf api: fix sock reg passing on read event
Type: fix

Change-Id: I383242e04a114b69fe247d912842be3560e96c10
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 5224b5cbd5)
2020-08-12 07:43:14 +00:00
299f9caae6 ipsec: make sure pad_bytes does not exceed pad data size
This helps GCC understand the memcpy will not overflow pad_data. GCC-6
(default on Debian 9) in particular got confused.

Type: fix

Change-Id: I176eb01531b9d5c7ebec40f015e510b2d56e77c4
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 4505f0154e)
2020-08-12 07:43:14 +00:00
b04bdd12e6 ip: coverity fix
Delete Null-checking "p0" in function ip6_tcp_udp_icmp_bad_length,
because it's not necessary.

Type: fix

Signed-off-by: johny <jan.cavojsky@pantheon.tech>
Change-Id: I2bf43a60c1c1d76e42581df27f2285c9e9563093
(cherry picked from commit a633a4318b)
2020-08-12 07:43:14 +00:00
3d3c4f0491 api: fix free socket process args
Type: fix

Change-Id: I910be067de6ed65790d25cc95a3d8b5b66680567
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit b0384230d9)
2020-08-12 07:43:14 +00:00
889ea0f54c vcl: RX event may lost when accept session repeatedly
Type: fix

Some applications may call accept repeatedly to process all connect
request until get EAGIAIN error. Subsequent call may get RX event of
previous accepted session, then should process it rather than just
discard it.

Signed-off-by: wanghanlin <wanghanlin@corp.netease.com>
Change-Id: Ice53442de66289a62591b79a9cc31e883e894c23
(cherry picked from commit 96453fd241)
2020-08-12 07:43:14 +00:00
ec12ffe1bd session: close for reset replies independent of state
Type: fix

Change-Id: I8b8875f1dc9203dfbb443ac43df8250cbb0b1edc
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit f1910326d5)
2020-08-12 07:43:14 +00:00
9e51b52bb9 tcp: fix tail rescue with sacks
Type: fix

Change-Id: Iad73f47cef3d29c4b0b7d1f58f2f2b14ba4b1d38
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 3eba7f1575)
2020-08-12 07:43:14 +00:00
25b58c6d21 ip: fix cancel termination after receive malformed ip6 packet
This fix is for cancel termination of vpp after receive malformed
packet type of ip6.To avoid termination of vpp are checked if are
missing data in packet. This occours, when payload length in ip6
header packet is more than real count of data in packet. When
this error occours, packet is ignore.

Type: fix
Ticket: VPP-1693, VPP-1694

Change-Id: I9d9ecea7b75c8702cb31aa8051c8d4d7ce19659d
Signed-off-by: johny <jan.cavojsky@pantheon.tech>
(cherry picked from commit 17478e4eb8)
2020-08-12 07:43:14 +00:00
cba508a212 tests: fix wrong checksum error message
This change fixes the error message, which would previously report
mismatch on IPv6 layer instead of TCP layer.

Type: fix

Change-Id: Ie78779685362a420d155f928b3cdb341bc3fb8bc
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit 66cea092c7)
2020-08-12 07:43:14 +00:00
9e357046a3 vcl: resolve VCL part session cleanup issue
In Nginx performance test, we notice that there are so many session kept
open with the state of TRANSPORT_DELETE, and it is root caused that
vppcom fails to return close state.

Type: fix

Change-Id: Ia30f959e0e5adb5b8bcfa13fb1dd7b2cb410a31b
Signed-off-by: Yu Ping <ping.yu@intel.com>
(cherry picked from commit b2955355cc)
2020-08-12 07:43:14 +00:00
e09a07826e tls: change SSL_has_pending to avoid BIO check error
Type: fix

Change-Id: I454aff1b187b75a1328c90e30b9b487377ae5f68
Signed-off-by: Yu Ping <ping.yu@intel.com>
(cherry picked from commit ce9bdfe5fc)
2020-08-12 07:43:14 +00:00
be4511d318 map: Fix a coverity MAP dead-code issue.
Type: fix

Change-Id: I5467bbe3b25b1ea3fb44157abe6e7bfb3f191e77
Signed-off-by: Jon Loeliger <jdl@netgate.com>
(cherry picked from commit 3aae3dc7ac)
2020-08-12 07:43:14 +00:00
897c941c8d map: Avoid null dereference in 'map show' and 'map del'
If a map domain is created without a tag name, inspecting
the map data will segfault looking for an unset name in
the so-called "domain extras" vector.

Enhance "show map domain" to show all map domains.

Type: fix
Change-Id: Ic55662b84eec58221816da270b2ef9e89c3a31c3
Signed-off-by: Jon Loeliger <jdl@netgate.com>
(cherry picked from commit 4a6d093e7e)
2020-08-12 07:43:14 +00:00
2b9bf4f4a7 ip: init l3_hdr_offset when pushing an ip4 header
Type: fix

Change-Id: I87503b9a981724b1f3ff1c45a4a5f7a43024ca76
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 757de9873b)
2020-08-12 07:43:14 +00:00
c7e400f8af tests: display stdout and stderr when output caching is disabled
Type: fix

Change-Id: I4286ba58bb15dd67c1199f76166bedf3b4e0344c
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 1a7ed5e3e6)
2020-08-12 07:43:14 +00:00
cb3edd53e8 flow: fix several crash issues
Type: fix

This patch fixes crash issues(marked in brackets) in the below test cases

test flow enable index 0 1/1 -> [crash]
test flow disable index 0 1/1 -> [crash]

test flow add src-ip 192.168.8.8 proto udp redirect-to-queue 8
test flow enable index 0 1/1
test flow disable index 0 1/1 - [crash]

test flow add src-ip 192.168.8.8 proto udp redirect-to-queue 8
test flow enable index 0 1/1
test flow enable index 0 1/2
test flow del index 0 -> [crash]

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: I84bc6faa3d93a2cab4c82e8a876a8b1067257b62
(cherry picked from commit be2ad0b474)
2020-08-12 07:43:03 +00:00
cd3a7c9646 map: Fix inverted 'map security check enable' CLI flag.
Type: fix
Fixes: 5a2e278a09

Change-Id: Ibdc2f0be44e382bfa4a8f3e16be8d6239d7a0ec1
Signed-off-by: Jon Loeliger <jdl@netgate.com>
(cherry picked from commit acaa04a22d)
2020-08-12 01:23:50 +00:00
8658b077ae fib: Another realloc burn
Type: fix

harmless this time since it only affects the debug statement, but
it still crashes an ASAN image.

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Ie02e7fe3014b98b9f8c83447f59017a380ab3948
(cherry picked from commit 981a690b7d)
2020-08-12 01:22:20 +00:00
29cd29616d tcp: invalidate expired timer handles before dispatching
Type: fix

Change-Id: Icc8cd05cb9c1844a9f8b0399797ad554f4ccf1a1
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit b72a0ff735)
2020-08-12 01:22:20 +00:00
ec1e751445 vppapigen: fix typo on f64 endian_string
Type: fix

Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Change-Id: Id47e3f2c348f07c84d9c2499122fa25d6c74fb13
(cherry picked from commit 1c200dc492)
2020-08-12 01:22:20 +00:00
51b95951ba papi: add missing base types to serializer
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 ba2c7fad1d)
2020-08-12 01:22:20 +00:00
cf758ecb71 vppinfra: fix coverity issue 205691 in pmalloc
set the address to MMAP_FAILED if mmap has failed,
so that we do not attempt to free it in the error
handling path.

Change-Id: I6e6b51a365fb68086dc20aa40a676a36af59a3ba
Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit 9ce3523365)
2020-08-12 01:22:20 +00:00
a8f870ac34 nat: respect arc features (multi worker)
Type: fix
Ticket: VPP-1747

Change-Id: If282aae3e584d7017c200f897b99c8a37eb1b2e5
Signed-off-by: Filip Varga <fivarga@cisco.com>
(cherry picked from commit 9a6dc8a937)
2020-08-12 01:22:20 +00:00
c2d00e343b ip6: Fix improper MCAST adj test in IPv6 router solicitation
Type: fix
Fixes: cb9cadad57

Change-Id: Id6de9780da41db5d762fe042f533cfaf21ed7b73
Reported-by: Rajith PR <rajith@rtbrick.com>
Signed-off-by: Jon Loeliger <jdl@netgate.com>
(cherry picked from commit a90b26c1ee)
2020-08-12 00:22:25 +00:00
fab234754c build: Separate ip and ip6 maintainers
Boldly assign IPv6 to Neale and to me.
Ole said so.  Really!

Change-Id: Iaa30a57230558dcf3ee016a94479cac95bb2d50d
Type: make
Signed-off-by: Jon Loeliger <jdl@netgate.com>
(cherry picked from commit a6460e46f3)
2020-08-11 23:27:20 +00:00
894447b151 bfd: add missing cast
Add missing cast to time conversion function to to deal with arbitrary
clocks-per-second values.

Type: fix

Change-Id: I5075a823e7a95c972c513ac765252337d5f59fbf
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit 27d12d30cd)
2020-08-07 21:45:43 +00:00
fde70884d4 bfd: allow IPv6 link-local address as local address
Type: fix

Change-Id: Ia3dacd2628591f7ba9710e8e4d68df97ae21935c
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
(cherry picked from commit 845f51ffe2)
2020-08-07 21:45:43 +00:00
47214ee1e0 dhcp: fix dhcpv6 client and dhcpv6 prefix delegation
Keep trying even if the interface in question is not "admin-up,
link-up." In real life, it's normal for link autonegotiation to take a
good fraction of a second. The driver layer takes care of packets sent
to an interface which can't transmit at the moment.

Renew address leases at the preferred renewal time, not at the
expiration time.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I68ec1c52cc1f4a8aa256185820748b845e92f7c1
(cherry picked from commit 20b962d3e4)
2020-08-07 21:45:43 +00:00
201fa41eb5 session: fix session_main_get_worker_if_valid
Type: fix

Change-Id: Ie024792015f3c9c52102c9be03da63c79f3456af
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
(cherry picked from commit 901467ed75)
2020-08-07 21:45:43 +00:00
abfdb9e23b session: fix transport proto unformat
Type: fix

Change-Id: I38a5cbd53b278c21142bac4ee1bbe5dc8bcaaac9
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 3bbbf0dbd3)
2020-08-07 21:45:43 +00:00
4b5723a43e session: Fix out of order mq
Type: fix

Change-Id: I522db62db50fc0fa46a6dd7cddd32e2f09b5e5a6
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
(cherry picked from commit 989bc47d68)
2020-08-07 21:45:43 +00:00
59502edc4f session: session enable in multiworker
Having session enable in config file wasn't
working for multiple workers

Type: fix

Change-Id: Ib29ba540a6e1d714e7e470f4c7518e3d266fe7ca
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
(cherry picked from commit 31bd035621)
2020-08-07 21:45:43 +00:00
215c55ad6d session: fix app attach on error
Type: fix

Change-Id: I57b3c76515544ba3655690b37e0dacb47734ba6d
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
(cherry picked from commit 9d3e1b433f)
2020-08-07 21:45:43 +00:00
2c4ba41bea dhcp: fix proxy dhcpv6 size check
Type: fix

Change-Id: Ibbb25bc530fdeaa3083c9b833a286a5d40e93c1e
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 60ad1a59a3)
2020-08-07 21:45:43 +00:00
818b5bcdf1 ip: fix tracing of packet flags
This fixes incorrect tracing of flags such as MORE_FRAGMENTS.

Type: fix

Change-Id: Ia5698418a7cbb45c18bc9c95f560cea020e63c39
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit ea5cd12d26)
2020-08-07 21:45:43 +00:00
3584f0936c papi: fix default handling
The BaseTypers object were reused, so a default for anyother mesage
would be inherited in new messages.

Type: fix
Fixes: 85465588b1
Change-Id: Ie1efb85a76b088653eb9ea4b88540c98b6b0aad0
Signed-off-by: Ole Troan <ot@cisco.com>
(cherry picked from commit 40dc4b35e3)
2020-08-07 21:45:43 +00:00
48ec77e84e quic: Hotfix crypto context on migrate
Type: fix

quicly_connections have internal references to crypto
contexts which need to be updated when we switch thread
as the supporting pools are thread-based.
This under the assumption that the new contexts will be
exactly identical

Change-Id: I38083e59657ff068e347d9e7b47abe91a1167b6c
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
(cherry picked from commit d9942bcc61)
2020-08-07 21:45:43 +00:00
bb49148160 quic: fix quicly rtt time skew
- This patch to quicly fixes an intermittent failure
  in the rtt calculation when there is a time skew

Type: fix

Change-Id: If89c47401ee75c88f0eb65ae888b6914695b2aec
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
(cherry picked from commit caa52f3f93)
2020-08-07 21:45:43 +00:00
7367691e44 quic: remove redundant function calls
- session_transport_delete_notify() is called before
  and inside quic_connection_delete()

Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I5c79a3269e36c4aab5aa99fdfdac06c1334f0f6f
(cherry picked from commit 34d92ebde6)
2020-08-07 21:45:43 +00:00
6f392fe0ae quic: disable failing test
Type: fix

Disable test until fixed.

Change-Id: I1f03630d126e61578c63a3536a0dd1a7b4da2b92
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 3ad9847329)
2020-08-07 21:45:43 +00:00
99d7480dd8 quic: Add PICOTLS_INCLUDE_DIR var to CMakeLists.
Type: fix

Change-Id: I10ebcc653491d11ca798e0a60be6eeef82c41766
Signed-off-by: Mathias Raoul <mathias.raoul@gmail.com>
(cherry picked from commit 74dcbf97af)
2020-08-07 21:45:43 +00:00
51a6508d2d misc: bond_create is broken for custom dump print
Regression from https://gerrit.fd.io/r/#/c/vpp/+/21508/
The aformentioned patch changed lb and mode to u32. But it does not make the
same change to custom_dump.c

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I2b7d065e21427090af3deb47c8a24c5da679e4f5
(cherry picked from commit b087696489)
2020-08-07 20:49:18 +00:00
69bafd77eb memif: 14 bytes extra overhead issue fixed.
Type: fix

Signed-off-by: Mrityunjay Kumar <kumarnitp@gmail.com>
Change-Id: I31cc5e853b57e285064647503231b251e5152d3f
(cherry picked from commit 3f0579e8df)
2020-08-07 20:49:18 +00:00
fd24264763 libmemif: don't consume rx queue interrupt, if memif_rx_burst fails
Type: fix

Signed-off-by: Jan Cavojsky <jan.cavojsky@pantheon.tech>
Change-Id: Ic6c15c88c80c4045c290cd78533be6f070c7470a
(cherry picked from commit 77a95cdce2)
2020-08-07 20:49:18 +00:00
ffa14d74be libmemif: memif_control_fd_update always pass context from libmemif_main
Event polling instance is always identified by libmemif main private context.
Fixes event polling handled by libmemif.

Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: I51dcdb279b18f8ce97bad3b2695848e0b25a232d
(cherry picked from commit 6f090fa1fa)
2020-08-07 20:49:18 +00:00
be50f64a75 memif: fix zero-copy arg overwrite
Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: I9a34465c85597baecdbc672ce395265f7dbb7f00
(cherry picked from commit 8a1dea4ce6)
2020-08-07 20:49:18 +00:00
8ae62b7123 gbp: More reliable unit-tests
Type: fix

the GBP unit tests would peridocially fail. The reason being that there
is dynamic state whose presence nneds to be created, tested and then
timeed out. The failures occurded when the timeout occured before the
state could be tested. the previous timeout was 2 seconds, this has been
doubled, as a result i saw no faliures running continuously for ~16
hours.
bumping the timer increasing the test run time from ~40 to ~53 seconds,
a small price to pay.

in test cases where the state is not timed out i bumped the timer to 60
seconds.

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: I11b0970570caa8eebf486fe8cd8e44a4b2b1fc36
(cherry picked from commit 8d0d8d2fcc)
2020-08-07 20:49:18 +00:00
193c9e36a4 tests: fix deps pinning / patching
This ensures we don't recompute the requirements-{2,3}.txt on each make
test run, and skips patching scapy if it is already patched instead of
failing.

Change-Id: I3da57182ae49f3dd04db139d96734a5d145fedff
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
(cherry picked from commit 8eca60df74)
2020-08-07 20:49:18 +00:00
ecc98b54f2 interface: add pcap trace data preallocation
Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I2e53fa85a0b4082666f57a3a58a09c04ae2001b5
(cherry picked from commit 586462fabc)
2020-08-06 12:03:05 +00:00
6aaa567959 build: Fix 'make install-deps' errors on aarch64 CentOS 7
On CentOS-7 aarch64, command of 'debuginfo-install -y glibc openssl-libs mbedtls-devel zlib' in 'make install-deps' fails because it tries to install the corresponding *debuginfo* packages from some inaccessible/unmaintained repos on aarch64, e.g., centos-sclo-rh-debuginfo. The error message shows as below.

Using 'debuginfo-install --enablerepo=xxx' also fails because it will still enable all the repos including the broken repos on aarch64. Using 'debuginfo-install --disablerepo=xxx' (xxx is the broken repo) works fine but we are not centain about that if VPP user will install additional broken repos on aarch64 or not. So to fix this error, we install all the *debuginfo* packages for 'glibc openssl-libs mbedtls-devel zlib' packages using 'yum install' instead.

[root@ ~]# debuginfo-install -y glibc openssl-libs mbedtls-devel zlib
Loaded plugins: auto-update-debuginfo, fastestmirror, ovl
enabling epel-debuginfo
enabling base-debuginfo
enabling centos-sclo-rh-debuginfo
Loading mirror speeds from cached hostfile
epel/aarch64/metalink                                                                                                                                                                       | 8.2 kB  00:00:00
epel-debuginfo/aarch64/metalink                                                                                                                                                             | 8.5 kB  00:00:00
 * base: mirror.aktkn.sg
 * centos-sclo-rh: mirror.aktkn.sg
 * epel: mirrors.yun-idc.com
 * epel-debuginfo: mirrors.yun-idc.com
 * extras: mirror.aktkn.sg
 * updates: mirror.xtom.com.hk
http://debuginfo.centos.org/centos/7/sclo/aarch64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below wiki article

https://wiki.centos.org/yum-errors

If above article doesn't help to resolve this issue please use https://bugs.centos.org/.

failure: repodata/repomd.xml from centos-sclo-rh-debuginfo: [Errno 256] No more mirrors to try.
http://debuginfo.centos.org/centos/7/sclo/aarch64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found

Type: fix

Change-Id: I017c3b20a167d8035c3ae617b9ad5ae479e52f57
Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
(cherry picked from commit 81b95c1fe2)
2020-07-30 17:28:17 +00:00
7364e2195c stats: memory leak in stat_validate_counter_vector
Free the existing vectors prior to losing them.

Type: fix
Ticket: VPPSUPP-94

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ic15f1fbc7a0c6c348065fc9759ee5d5c43013b91
Signed-off-by: Ole Troan <ot@cisco.com>
(cherry picked from commit e29fb5bf1b)
2020-07-21 14:18:55 +00:00
64b6dd7f8f interface: shmemioerror while getting name_filter arg
Type: fix

Signed-off-by: Aleksander Djuric <aleksander.djuric@gmail.com>
Change-Id: I5e0eb7024d208040d79e9d6db863f41e2ecf4ee6
Signed-off-by: Ole Troan <ot@cisco.com>
(cherry picked from commit c12eae73f9)
2020-07-03 01:48:33 +00:00
f6a8a3a31c build: backporting a dpdk i40e TSO pkt exceeds buffer size patch
The subject patch appears to be critical. Backport it to DPDK_19.05

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ic25cb8c5798c3218f739c9dd5ce4d70da5782457
2020-07-01 10:04:24 +00:00
4f3db90a6f fib: IPv6 lookup data structure MP safe when prefixes change (VPP-1881)
Type: fix

adding routes should be MP safe. When new prefixes with differrent
prefix lengths are added, adjust the sorted list in an MP safe way.

Change-Id: Ib73a3c84d01eb86d17f8e79ea2bd2505dd9afb3d
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit aecb10b97f)
2020-06-12 08:22:58 +00:00
3aab9be751 ethernet: fix dmac stride error
Type: fix

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Change-Id: I617fb365def22a28d48f75013dea38f8e1703a44
(cherry picked from commit cbe36e47b5)
2020-06-12 05:56:06 +00:00
aa45bd3f66 api: fix vl_api_clnt_node process stack overflow
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
b2dbb36fc2 "vlib: fix startup-config \
-process stack overflow" and commit 2fd44a00aa \
1758c199bf "vlib: fix cli process stack overflow"

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: I312e4fed96a679aa68b859e28a90a2a4b6eb0c6e
(cherry picked from commit a488f37559)
2020-06-11 18:56:54 +00:00
ed42469be2 vppinfra: refactor mpcap.h
vppinfra source files MUST NOT #include <vlib/vlib.h>, <vnet/vnet.h>
or similar. Move mpcap_add_packet(...), mpcap_add_buffer(...) to a new
file: src/vnet/mpcap.h.

Type: refactor
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Id517aef6fe49b618f853ce32940b91ba45a1e60d
(cherry picked from commit 2a41919e39)
2020-06-11 14:39:53 +00:00
615ba7af1a misc: fix the MAKE_PARALLEL_JOBS for 'make verify' target
MAKE_PARALLEL_JOBS was prepending "-j", which in case of nested targets like "verify"
resulted in ninja being executed with "-j -j" flags.

Solution: prepend -j only at the moment of setting the MAKE_PARALLEL_FLAGS variable,
this keeps MAKE_PARALLEL_JOBS intact regardless of depth of the job call tree.

Type: make
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I10a69fe527758e5a862852a9f2102aeaca30e88f
(cherry picked from commit 56ac770df9)
2020-06-09 07:21:07 +00:00
220e40541e bonding: fix the gso flags
Type: fix

Only add GSO and Checksum offload flags when gso is
enabled.

Change-Id: I58945a4ffbb9a0e6a8640fc01424c63feef16306
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit e4f0020e8d)
2020-05-29 19:13:34 +00:00
99fa5f7229 ipsec: DES/3DES fixing the iv_len for openssl crypto
Type: fix

Signed-off-by: Rajesh Goel <rajegoel@cisco.com>
Change-Id: I8d128598b4c872f19b64c779c19b5908ba2f2c08
(cherry picked from commit d1d90f5951)
2020-05-26 08:48:28 +00:00
ec9ce338f0 misc: 19.08.2 Release Notes
Change-Id: I78f9edf9c15e9f4a2451be084c04c6318fbb978d
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-04-30 18:54:10 +00:00
0830008b31 ipsec: Add/Del SA not MP safe
Type: fix

some crytto engines store key data indexed by SA index. Creating new SAs
means this store reallocs with packets inflight; bad stuff ensues.

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Ia23c3a59e2d05fb006bdbd9922d01ee192e22853
2020-04-30 17:20:00 +00:00
8e4ed521a6 l2: l2_patch_main should not be static
Without understanding what is going on,
a pattern from l2_fwd.c is applied to l2_patch.c file.

Type: fix
Fixes: d770cfc962
Ticket: VPP-1799

Change-Id: Ia97d448f9d1846549f57ea69044ae15fa39bb942
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
(cherry picked from commit 3be9351e5e)
2020-04-30 11:55:03 +00:00
09c0946e91 vlib: add ASSERT to vlib_time_now(...)
Calling vlib_time_now (&vlib_global_main) from a worker thread is a bad
mistake. ASSERT (vm->thread_index == __os_thread_index) will catch it.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I55af6de84e06143f8f43adc62103b77267a7a441
(cherry picked from commit 77d9838282)
2020-04-29 21:36:51 +00:00
fd0834262c dhcp: fix unicast pkts, clean up state machine
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 c54162981c)
2020-04-13 16:44:42 -04:00
5e62c84bb7 ping: fix buffer allocator error handling
The code sets f->n_vectors = n_to_send, but it can bail out of the
loop if vlib_buffer_copy(...) returns 0.

Need to fix f->n_vectors in the error return path, or we enqueue some
number of 0xfefefefe buffer indices in a debug image or worse in a
production image.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I2d886266006c6c1c2f9ef8e3b95eb46ac6c0b3df
(cherry picked from commit 8324c55f95)
2020-04-13 15:05:12 +00:00
7f094c2212 l2: handle complete clone fail in l2_flood
vlib_buffer_clone(...) may not manage to produce any buffer clones at
all.

vlib_buffer_clone_256 should not smash the original buffer reference
count if no clones are produced.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I14d9d53637a220485c7a0036cfc75a4149b264ea
(cherry picked from commit 95e1925332)
2020-04-13 15:02:30 +00:00
e2568b5d0a misc: check return values from vlib_buffer_copy(...)
vlib_buffer_copy(...) returns NULL if the system is temporarily out of
buffers.

This is NOT correct. Please don't be this person:

   c0 = vlib_buffer_copy (vm, p0);
   ci0 = vlib_get_buffer_index (vm, c0);

Type: fix
Signed-off-by: Dave Barach <dave@barachs.net>
(cherry picked from commit c25ef58965871ea5d2b40904df9506803f69e47e)
Change-Id: I6cd4f289c4fadc3f36c3203b53546e9a788ef99b
2020-04-10 10:19:20 -04:00
d212187f02 docs: pin down sphinx to avoid crash with Sphinx 3.0.0
Using requirements.txt did not work, just specify the version
in the pip install within the makefile.

For the master and stable/2001,
see change Id98c0f94104e455ea819aacec62f605e53db13ce

Change-Id: I1f6ff53d8d52dc8bad42041932421fc12d7ddebf
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-04-07 10:19:51 +00:00
f78294d846 virtio: vhost checksum problem for ipv6
When checksum is enable for IPv6, it erroneously set the flag
VNET_BUFFER_F_OFFLOAD_IP_CKSUM. That flag is meant for ip4 packets only.

Type: fix
Ticket: VPP-1857

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Id03b2937bfa34e2a9b50a36aafe0700bad7fb95e
2020-04-05 16:33:51 -07:00
597d4df6cf api: ipsec: add missing IS_INBOUND flag
External IKE daemons need to be able to flag an SA as inbound (just as
the included ike plugin does). This commit adds this flag to the API.
This change is backward bug-compatible as not setting the flag (old
clients) continues to mean all SAs are created as outbound and fib nodes
are created for them. The addition of this flag inhibits this forwarding
node creation as well as properly flagging the SA as inbound.

Ticket: VPP-1845
Type: fix
Signed-off-by: Christian Hopps <chopps@labn.net>
Change-Id: Ifa6fd664587380aa53e95d0e4eb2e1a4b1df7909
2020-04-01 16:10:31 +00:00
d643e5f301 misc: fix ip6_neighbor_cmd
The option parsing loop had "break" statements included in each
'if (unformat (line_input, "this-option ...") option_values=xxx;'
statement.

Result: the code would silently ignore all but the first
option. Probably broken forever, not easy to spot because the code
looks OK even though it's badly broken.

Manual cherrypick: the function name has changed, the code has
moved to a different file, and the MAINTAINERS file entry doesn't
exist in 19.08.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
(cherry picked from commit 7249b90ab2)
Change-Id: Ie06bb083645302848a19ecc9ad2934927de01f62
2020-04-01 11:41:56 +00:00
88e47b0e47 vppinfra: fix typo in dlmalloc.c
Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Idc567717494b4c40c307f20a40d5e10cd26b0a46
(cherry picked from commit 6e6968f064)
2020-03-30 14:52:59 +00:00
892cc729f8 vppinfra: correct fixed pool header size calculation
Remove duplicate space allocation for the pool header. Not significant
w/ CLIB_CACHE_LINE_BYTES >= 64 since the code rounds the size of the
pool header to an even multiple of the cache line size.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I923f2a60e7565cf2dfbc18d78264bf82ff30c926
(cherry picked from commit 6e495ce428)
2020-03-30 13:56:18 +00:00
118c4461b3 papi: fix socket sendall calls
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 8921dc6754)
2020-03-29 21:59:10 +00:00
b70fd4a545 vppinfra: manual cherrypick timebase fixes
Gerrit Headline
------ --------
25729  fix corner cases in tw_timer_expire
25763  improve timebase resilience
25837  remove time jump workaround

Automatic cherry-picking failed miserably.

Type: fix
Ticket: VPP-1852

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I460effb2b5f4f19ae4548ef01ca3726b7412bd7f
2020-03-27 12:03:19 -04:00
ffe2caf9da virtio: fix link up/down flag
Type: fix

"set int state <interface> down" puts the virtio device link
down. It will not put the link in "UP" state, when
"set int state <interface up>" will be used again to change
the interface admin up. This patch fixes it.

To test:
create tap
set int state tap0 up
set int state tap0 down
sh hardware
sh int
set int state tap0 up
sh int
sh hardware

Change-Id: I3c0e31539f8a2a1e40220e7fb57eedecf408f067
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 529f0e97b6)
2020-03-27 12:23:06 +00:00
edef5b00ed virtio: fix the out of order descriptors in tx
Type: fix

Some vhost-backends give used descriptors back in
out-of-order. This patch fixes the native virtio to
handle out-of-order descriptors.

Change-Id: I74ba03a2111dc601be4396c0fa800c33db5554b4
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 7f6d145acc)
2020-03-27 09:32:09 +00:00
9ef52ab858 rdma: fix bug related to ring buffer
Fix a bug that caused some input packets to be dropped due to errors of
the type 'ip4 length > l2 length'. The change is related to the second
call to the rdma_device_input_bufs() function that happens when the end
of the ring buffer is reached.

Type: fix
Change-Id: I332d69ab22242b3443a0baca6e5dd86349a54765
Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
(cherry picked from commit e5ecf3ea4b)
2020-03-10 08:59:47 +00:00
a9df8e40c7 mpls: adjust mpls-frag size to account for mpls header
Type: fix

Signed-off-by: John Lo <loj@cisco.com>
Change-Id: I0b3042317c58c5a4d64d82b16f62e70f0461e578
2020-03-09 23:09:25 +00:00
488e74adf4 tap: misc fixes
Ticket: VPPSUPP-58

1) Previously, host mtu can't be set if tap interface is in namespace.
2) generate the host mac address, if it is not provided.
3) fix the parameters for tap_create_v2 in vat.
4) fix the pretty print of parameters for tap_create_v2 in custom dump.

Type: fix

Change-Id: I18898af90dbd37d773a40b6535dd9c03c9984679
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-03-04 20:08:24 +00:00
03bcbd3621 dpdk: TSO does not work for Cisco VIC
While TSO is supported for Intel NIC, Cisco VIC does not work.
The problem is due to txmode offloads is not properly set for
the Cisco VIC when enable-tcp-udp-checksum is configured.

Type: fix
Ticket: VPP-1838

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I72c41db9b327ed8d08ef70d74e8cc6206d4a102f
2020-02-29 16:42:14 +00:00
c7a00641f8 avf: Handle chain buffer in TX properly
For chain buffer, need to traverse b->next_buffer to transmit all buffers
in the chain. Only set EOP at the last descriptor in the chain to signal
this is a chain descriptor.

Introduce slow path to handle ring wrap. This is needed because chain
buffer may consist of multiple pieces and it may span from near the end of
the ring to the beginning of the ring.

Type: fix
Ticket: VPP-1843

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Id7c872f3e39e09f3566aa63f3cdba8f40736d508
(cherry picked from commit f7ab7b2d9b)
2020-02-27 16:30:05 +00:00
de1aa39a56 mactime: remove unnecessary function declaration
Type: fix

Change-Id: I80cb666d9eae9d0f780d51fb95454d97ed320454
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit bb688a4dc1)
2020-02-18 13:29:36 +00:00
7e8a3ece6f papi: harden socket handling
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 6df2c79541)
2020-02-18 13:29:06 +00:00
1c45b85dff papi: introduce read_blocking
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 0938547eaa)
2020-02-18 13:28:43 +00:00
72ab26ca8f api: comment, simplify and fix api socket read
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 6a6af6ea1a)
2020-02-18 13:28:25 +00:00
05c2f5b73e classify: fix "show classify filter" debug CLI
Null pointer bug, memory leak. D'oh!

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ic2865757ed9cbb7f48d23c7c30b64299eb5f6674
(cherry picked from commit 104112f2d4)
2020-02-13 13:35:58 +00:00
6255d30069 ikev2: correct byte order in api handlers
Type: fix

Signed-off-by: Aleksander Djuric <aleksander.djuric@gmail.com>
Change-Id: I186286b8959ae138528a5171c22d3e1b00f46baf
Signed-off-by: Aleksander Djuric <aleksander.djuric@gmail.com>
(cherry picked from commit 50c99b4a86)
2020-02-13 12:18:44 +00:00
d3f6dc69be classify: "classify filter ..." debug CLI cleanup
The pcap trace filter initial table index lives in
cm->filter_set_by_sw_if_index [0], which corresponds to the "local0"
interface. Debug cli makes sure that folks don't accidentally specify
the "local0" interface. At least it does now...

Fix the "vlib format.c code coverage" test in test/test_vlib.py.

Type: fix
Change-Id: I35320bc2c8f0c6f1f8c12e3529d1938548185151
Signed-off-by: Dave Barach <dave@barachs.net>
(cherry picked from commit 29c6132108)
2020-02-12 14:10:30 -05:00
7c5a3536ce classify: vpp packet tracer support
Configure n-tuple classifier filters which apply to the vpp packet
tracer.

Update the documentation to reflect the new feature.

Add a test vector.

Type: feature

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Iefa911716c670fc12e4825b937b62044433fec36
(cherry picked from commit 87d24db65f)
2020-02-12 09:42:05 -05:00
d28bac4094 vppinfra: fix typo in tw_timer_template.c
Fix minor memory leak

Type: fix
Ticket: VPP-1833
Fixes: 4af9ba1dab

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Id10fba70471ca78f73f14146054f6b12c5d4431f
2020-02-06 12:30:47 +00:00
520c355b86 vppinfra: preserve total_cpu_time across clock freq adjustment
If clib_time_verify_frequency() adjusts the clock frequency, transform
total_cpu_time to the new time coordinate space. Otherwise, we break
comparisons with previous clib_time_now() value.

Without this correction, time jumps in one direction or the other
depending on the sign of the frequency change. Reasonably harmless in
most cases, but under perfect storm conditions the wheels fall off.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I21802c2630e2c87ff817cd732b7d78bc022cd2d7
(cherry picked from commit e52d8d880a)
2020-02-06 12:30:08 +00:00
5b2eea6e07 pmalloc: always lock pages
Type: feature

Change-Id: I5bbf37969c9c51e40a013d1fc3ab966838eeb80d
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 801c7016ad)
2020-02-06 12:29:37 +00:00
5ec78926b6 lb: lb_add_del_vip and lb_add_del_as doesn't work.
Ticket: FDIO-753
Type: fix

Change-Id: I4a8cf06970b658dfa15768459a3ff76571d6dfff
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
(cherry picked from commit e69f471432)
2020-02-06 12:22:30 +00:00
f540ca8016 vlib: autogenerate <node> before <last-in-arc> constraints
If an arc declaration includes '.last_in_arc = "some-node"', assume
that folks mean it and add explicit ordering constraints.

Fix the "arp" arc declaration which claimed that the arc ends at
arp-disabled, but the arc really ends at error-drop.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ie2de1fb30091671cbc7c62770903a2e05987f141
(cherry picked from commit 5f9f3c8de8)
2020-02-06 12:22:03 +00:00
779cb56719 ikev2: fix memory leak in child SA
traffic selector vector isn't freed when freeing child SA

Type: fix

Change-Id: Icf6c240db5093f45d141451bad6f6627a61821cf
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit 99eefc2cfe)
2020-02-06 12:21:41 +00:00
b38b04edea api: configurable binary api client rx pthread fcn
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 920180e5e0)
2020-02-06 12:21:23 +00:00
4b50a8f025 session: extra checks in session validation
Type: fix

Adding few extra checks while doign session validationwq!

Signed-off-by: Srikanth Akula <srakula@cisco.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4d18b5ad97d1802ce38a07aeb56b5f35939c1187
(cherry picked from commit e140d5d025)
2020-02-06 12:19:50 +00:00
2e05c214a5 virtio: feature arc have higher priority than redirect
Type: fix
Fixes: 8389fb9

Change-Id: Ie159eb444b28b36a7af86049b80fba4e49be93cb
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 06c194d91b)
2020-02-06 12:19:28 +00:00
04b4204d9c tcp: improve lost rxt heuristic
Type: feature

- retransmit first unacked segment if newer retransmitted packets
are acked
- avoid spurious retransmits if recovery ends with sacked bytes

Change-Id: Ic1b56d22e025822edb7609afb136e47440ea6032
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit b3dce89a76)
2020-02-06 12:19:12 +00:00
c58ef62713 session: re-set tx fifo event if out of buffers
Type: fix

Change-Id: I7416e827fbc5c63d082273656441c81dd6246d8a
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit aa43914df6)
2020-02-06 12:18:47 +00:00
8427de5ab1 lacp: add actor steady state check prior to skip processing lacp pdu
In a rare event, we may be skipping processing lacp pdu's when the it is
not in steady state.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I4e4f81dfd4e95433879ee66cdf6edb8d8afbe9b0
2020-02-06 12:18:06 +00:00
dfad269860 fib: refresh adj pointer after fib_walk_sync due to possible realloc
fib_walk_sync may call adj_alloc which may cause adj_pool to expand. When
that happens, any previous frame which still use the old adj pointer needs to
refresh. Failure to do so may access or update to the old adj memory
unintentionally and crash mysteriously.

Type: fix
Ticket: VPPSUPP-54

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ia7c6cb03c1ed9ddbbfb12dd42c8abc7f5b3f210c
2020-01-29 15:21:39 -08:00
0d40954b42 devices: vhost: fix data offset on input
Regardless of whether the virtio_net_hdr is sent as a separate
descriptors or in the same descriptor as the data, we always want to
skip the header length - maybe moving to the next descriptor along the
way.

Type: fix

Change-Id: Iaa70aeb310e589639b20f8c7029aaa8d3ce5d307
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 5ecc1e4d43)
2020-01-29 17:27:21 +00:00
95993c64a3 bfd: reset peer discriminator on timeout
More RFC compliance.

Ticket: VPP-1816 BFD: peer discriminator not reset on timeout
Type: fix

Change-Id: I68063c18097d282b3527e3fb485c1d0d1fd1b0c8
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2020-01-29 12:32:38 +00:00
a06f68556e bonding: Add GSO support
Add GSO support, configurable from the CLI.

Type: feature
Ticket: VPP-1820

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I65885a071b24c74437e6cfe5eff237b01bc1744b
2020-01-28 13:46:40 +00:00
03c0ef95cb bonding: process lacp when bond is admin down
Ticket: VPP-1821
Type: fix
Fixes: 6dfd3785e4

When a bond interface is administratively down but the slaves are
up, process inbound LACP packets received over the slaves. This
was the old behavior with bond interfaces in LACP mode and was
altered unintentionally by another change. Restore the old behavior.

Change-Id: I61b0b700211dea4859b6ee447ab83b33197d9d11
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit 854eb6e3ff)
2020-01-28 13:44:25 +00:00
add407ef37 fib: Reload the adj after possible realloc (VPP-1822)
Type: fix
Fixes: 418b225931

Change-Id: Ia5f4ea24188c4f3de87e06a7fd07b40bcb47cfc1
Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-01-28 13:13:43 +00:00
c385a95e8e api: mark api_trace_command_fn thread-safe
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
2020-01-23 15:35:51 +00:00
418b225931 fib: Adjacency realloc during rewrite update walk (VPP-1822)
Type: fix

Change-Id: I0e826284c50713d322ee7943d87fd3363cfbdfbc
Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-01-22 22:33:17 +00:00
257749c409 fib: FIB crash removing labelled route (VPP-1818)
Type: fix

The crash occured trying to retreive a NULL path list to walk the path
extensions. A walk shoul not be required, because there should be no
extensins, since all paths are removed. The problem is that when the
paths were added, they were not sorted, hence neither were the
extensions and when they were updated, duplicate extensions were added,
and hence a path removal did not remove them all.
Fix is to make sure paths are sorted.

Change-Id: I069d937de8e7bc8aae3d92f588db4daff727d863
Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-01-20 04:39:41 +00:00
a74e802f5c l2: fix MAC learn counter update on adding MAC entry
Type: fix

Signed-off-by: John Lo <loj@cisco.com>
Change-Id: I711432f589ee4a4527cf795526d3b4031999f71d
(cherry picked from commit b2e73b1dcb)
2020-01-08 15:45:16 +00:00
2efa3e76b2 bonding: drop traffic on backup interface for active-backup mode
For active-backup mode, we transmit on one and only one interface. However,
we might still receive traffic on the backup interface. We should drop them
and strictly process incoming traffic on only the active interface.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Idb6b798b30033e84044b151c616be3c157329731
(cherry picked from commit 6dfd3785e4)
2020-01-04 14:51:46 +00:00
a82f590c03 gso: fix the number of buffers required for segmentation
Ticket: VPPSUPP-51
Type: fix

Change-Id: I34d4237eb0644705ce0f523fdd0d6b70308e8bcd
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-01-02 12:49:59 +00:00
775d5b1e22 fib: Adjacency walk fix for IPv6
Type: fix

Change-Id: Id3a1950e49d5eb1883af06a14df97e98f55162a8
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit e7ee300923)
2020-01-01 17:23:28 +00:00
d0bb569621 vxlan: reuse inner packet flow hash for tunnel outer header load balance
Type: fix

Several tunnels encapsulation use udp as outer header and udp src port
is set by inner header flow hash, such as gtpu, geneve, vxlan, vxlan-gbd
Since flow hash of inner header is already been calculated, keeping it
to vnet_buffere[b]->ip.flow_hash should save load-balance node work to
select ECMP uplinks.

Change-Id: I0e4e2b27178f4fcc5785e221d6d1f3e8747d0d59
Signed-off-by: Shawn Ji <xiaji@tethrnet.com>
(cherry picked from commit 623b4f85e6)
2019-12-21 05:36:21 +00:00
2eb13c2954 api: fix dead client scan heap issue
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 5ed3fe3dd4)
2019-12-20 09:15:20 +00:00
814e898eba vxlan: fix vxlan hw offload issue
Type: fix

Since Vxlan hw offload jumps the ethernet-input node, so needs to
adjust the data offset accordingly

In original code, the current_data is 0 when arriving vxlan-flow-input
node(due to no graph node before it, except the dpdk-input), so this
code block cannot find the correct vxlan header:
enum
  { payload_offset = sizeof (ip4_vxlan_header_t) };
vlib_buffer_advance (b0, payload_offset);
see code in src/vnet/vxlan/decap.c, function vxlan4_flow_input_node

This patch fixes this issue

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: Iab4af7a7dc3b69a117a4c9ea1c59662669a6438c
(cherry picked from commit 1ec9fdbf29)
2019-12-05 13:19:54 +00:00
9fcfcb0a9e tcp: fix ip check in lookup validation
Type: fix

Change-Id: Ia18632c8fe22bdcfdf3cb48a4234f8703a7ac1d7
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 07df79150f)
2019-12-03 21:43:25 +00:00
d6d0edbf05 ip: IP address and prefix types (moved from LISP)
Type: refactor

Change-Id: I2c6b59013bfd21136a2955442c779685f951932b
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit ea93e48cf6)
2019-12-02 21:44:10 +00:00
77d760d708 classify: debug cli %v not %s
Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I294f0b773375f6dce020b771db0726ceb5d812cc
(cherry picked from commit 3268a64d3c)
2019-12-02 15:16:12 +00:00
feabb77a48 vcl: if the ldp user send buf with 0 len, it will assert failed.
Type: fix

Change-Id: I8ff60cf8726c463491c687e170ad0b1026a1303a
Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com>
(cherry picked from commit ff31ac6809)
2019-12-01 17:05:25 +00:00
fe5c0a9db7 dpdk: fix non-NULL terminated string
Type: fix

Change-Id: Ic221cd4fcad89aece71239ed96152bf0311f3286
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit ab9b9a5c0e)
2019-12-01 12:54:54 +00:00
ecb1634fa0 virtio: fix use-after-free
Type: fix

Change-Id: Ic67d9da65d937f56ecf994a5504c6351624b32ff
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 8f011830b2)
2019-12-01 12:54:11 +00:00
b34331e8ab vlib: pci: fix non-NULL terminated C-string
Type: fix

Change-Id: I6f25d9295b973ab7133071b6dc325ecd86386898
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 0b91bd6c52)
2019-11-28 10:17:39 +00:00
48f8eb3dc3 tcp: close session on retransmit failure
Type: fix

Since the connection is closed, also mark the session as closed.

Change-Id: Ica3849c3ff12fa7a65ba64e563a60d6c94f5ceca
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 52be67435e)
2019-11-28 10:06:34 +00:00
72ab186f13 tests: Add UT to test incomplete MPLS adjacencies send ARP requests
Type: test

Change-Id: I81e07233aec54c786e4e9beb8c4f06d0a3dca90f
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 1976f36b09)
2019-11-28 10:05:50 +00:00
5371a224a8 interface: send proper link/admin status in event
Type: fix

Change-Id: I7cba9f911abe1ae82d8381a48f65e81b615ede76
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
(cherry picked from commit aa27dcb84c)
2019-11-28 10:02:33 +00:00
bedc513fc2 vcl: Handle newer Glibc (>2.28) where fcntl is actually fcntl64
Glibc 2.28 now provides fcntl64 which is used instead of fcntl
by defining fcntl as fcntl64 in fcntl.h

Type: fix

Change-Id: I87fedfbf3e0d241aafdc920e90f824d71353e0e6
Signed-off-by: Carl Smith <carl.smith@alliedtelesis.co.nz>
(cherry picked from commit e16707b5b2)
2019-11-28 09:56:15 +00:00
c48306407b vcl: fix nonblocking accept with >1 event in the queue
We discard unwanted events until we get an ACCEPTED.
But if we are non-blocking we need to check the queue
length every time and EAGAIN if empty before waiting.

Type: fix

Signed-off-by: Carl Smith <carl.smith@alliedtelesis.co.nz>
Change-Id: Ie0c7e5cb00f0d37d2e1534f8bb384221ff56f2e3
(cherry picked from commit 592a909a30)
2019-11-28 09:51:10 +00:00
49cf46e0d0 crypto: not use vec api with opt_data[VNET_CRYPTO_N_OP_IDS]
opt_data is defined as a array, while in some code, e.g., function
 vnet_crypto_get_op_type, it's used as vec.
vec api is not applicable to static arraies.

src/vnet/crypto/crypto.h:234:70: error: address of array 'cm->opt_data' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
  vnet_crypto_op_data_t *od = ({ do { if ((0 > 0) && ! ((id) < ((cm->opt_data) ? (((vec_header_t *) (cm->opt_data) - 1)->len) : 0)))

Type: fix

Change-Id: I0b6754406e4216ca975bc1da4b5d4ce293a9bb45
Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
(cherry picked from commit b15d796dbf)
2019-11-28 09:46:03 +00:00
d2bff07864 svm: improve fifo segment verbose cli
Type: feature

Also make sure that size for dlmalloc allocated private segments is
accurate.

Change-Id: I6ec81ff99a13dd29b9664d768835a68019f0c96c
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit f8461bfb48)
2019-11-28 09:40:58 +00:00
63eee2eb55 vcl: fix epoll connected events sid
Type: fix

Use sid returned by vcl_session_connected_handler instead of trying to
infer it from vpp session handle.

Change-Id: Ic0fbb90ec2bd851b435fc3f2a34265ac9a8ab29f
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit f1653e62fe)
2019-11-28 09:39:19 +00:00
6c1ce53b44 tcp: validate the IP address while checking TCP connection
Type: feature

Along with the port information, we need to validate the IP address details as well.
This is very useful in the case port re-use scenario

Signed-off-by: Srikanth Akula <srakula@cisco.com>
Change-Id: I11e1ebcd3e56aae47ac235a89606a83c928aa6bb
(cherry picked from commit cf4c2102d9)
2019-11-28 09:37:41 +00:00
67bb7ca004 session tcp: refactor pacer time
Type: refactor

Change-Id: Ic1c3e1f7987702cd88972acc34849dc1f585d5fe
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit a8e71c8981)
2019-11-28 09:30:38 +00:00
87e1bcdd75 tests: test tls case
Type: feature

Signed-off-by: haiyanx1.zhang <haiyanx1.zhang@intel.com>
Change-Id: I071f5face0d489dc967cce1edcffbc1f8fac5c7e
Signed-off-by: haiyanx1.zhang <haiyanx1.zhang@intel.com>
(cherry picked from commit 419d31f817)
2019-11-28 09:24:10 +00:00
64d744350e tests: add cli_return_response to vpp_papi_provider
To improve gcov/lcov code coverage stats, it's necessary to send
incorrect debug CLI commands; to force vpp into debug CLI error paths.

cli_return_response() sends commands and returns the response object,
so test vectors can handle failures.

Type: feature

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I4fab591c9d2e30c996f016e18e4fd69b9c5bed06
(cherry picked from commit 5932ce17e1)
2019-11-28 09:19:08 +00:00
c2b4b3b610 ipsec: fix trailing data overflow
IPsec writes trailing data at the end of the buffer without checking
if there is enough space. If the packet length equals buffer size this
leads to rewiting of the next buffer header in the pool.

Type: fix

Change-Id: Iceb27bb724c7243863a4b532aad0808051b7d74c
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2019-11-19 12:24:34 +00:00
b1b4b5cf58 crypto: do not crash if no crypto engine loaded
Do not overflow ops_handlers vector.

Type: fix

Change-Id: I8d5e7fb8125a7bd87ecfe6f4f1390fb9f43dad8f
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 6545df7913)
2019-11-19 12:17:48 +00:00
7dfe1ac660 session: unify buffer tx dispatching
Type: refactor

Use pending tx buffer vector to postpone dispatching of all buffers,
i.e., either generated as a result of tx events or custom tx event.

Change-Id: Ic5894c4653c338cfb04555d20857f954b245ee83
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 8a754f1a55)
2019-11-18 13:49:06 +00:00
aa35702743 fib: Copy the prefix before use in case the underlying entry reallocs.
Type: fix

all other uses of the fib_entry_get_preifx in the code base don't pass
the prefix into recursive functions.

Change-Id: Ic1c56acd406a733b215ee2fd98b6bed58b490a4f
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 320dfcf2aa)
2019-11-18 13:45:06 +00:00
9a28d175d4 gtpu: check packet has enough data for gtpu header
Type: fix

Change-Id: I604e4dd2b29962bfcd8e950a0074637dab53c79e
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 318fbfe89d)
2019-11-18 13:43:02 +00:00
7fcc906203 bonding: fix non-null terminated vector
Type: fix

Change-Id: Iea7d73a304236b525b95bdad3bfdb41e711f8cdb
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit a03c7d5b92)
2019-11-18 13:38:33 +00:00
4fc160d7dd vlib: fix handoff queue sequencing bug
Set vm->check_frame_queues after actually enqueuing a frame. Under
obscure circumstances, the code managed to set check_frame_queues so
far in advance that 100 dispatch cycles could elapse before the frame
enqueue succeeded. That resulted in permanent lack of queue service.

Type: fix
Ticket: VPP-1734
Fixes: 18191

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: If2d398202b4ba2b96581d25e8142daef3f74c9e5
(cherry picked from commit 320998a812)
2019-11-18 13:37:23 +00:00
636a840758 tcp: avoid retransmits post reset
Type: fix

Change-Id: Ib6a8f5ca597389700e5746f089a5cec7eee65ab5
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit fd4c3fe364)
2019-11-18 13:34:53 +00:00
061e8671a7 rdma: fix name auto-generation on create
When creating rdma interface without specifying a name, we need to
generate one instead of NULL.

Type: fix

Change-Id: If41870691dec47e8e673d48ac4b4ddffd2385a03
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit a50892e150)
2019-11-18 13:32:59 +00:00
4cf238b9d7 tap: fix cli parser
Type: fix

Change-Id: I38ee9efd23774cce7790565825527cca9ba6f200
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 0ba86cb1bd)
2019-11-18 13:32:08 +00:00
8f6b9a39e6 dpdk: ipsec gcm fixes
- Fix AAD initialization. With use-esn the aad data consists of the SPI
and the 64-bit sequence number in big-endian order. Fix the u32 swapped
code.

- Remove salt-reinitialization. The GCM code seems inspired by the GCM
RFCs recommendations on IKE keydata and how to produce a salt
value (create an extra 4 octets of keying material). This is not IKE
code though and the SA already holds the configured salt value which
this code is blowing away. Use the configured value instead.

Type: fix

Change-Id: I5e75518aa7c1d91037bb24b2a40fe4fc90bdfdb0
Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit d58419f19b)
2019-11-18 13:30:59 +00:00
cde7068bbe crypto: fix crypto perf unittest crash
Type: fix

crypto perf test crashes for key size different than 16 bytes.
This patch fixes the issue

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Change-Id: Ic8a8ca83ca189c879815dc5d065b8c6f7826cd41
(cherry picked from commit bc2e640db7)
2019-11-18 13:30:35 +00:00
e97a054fd3 svm: fix byte accounting when allocating fifo header
Type: fix

Change-Id: Ie50625271d257da814445ce13c2e6cd98986d523
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit c9dff181c8)
2019-11-18 13:29:09 +00:00
93feaa2fff tests: make threads in punt tests join when finished
The 42693521f6 added the timeout
to the child process join + print the name of the offending
child process.

Upon testing the issue furher, appeared the offenders were
always the same - punt tests. The processes running them
were stuck trying to acquire lock, even if all
the user-accessible execution has finished. Some searching
revealed that one needs to tread carefully when dealing
with Thread and Multiprocessing at the same time.

punt tests used threads but did not call thread.join. Somehow
it worked in some cases but not the others. This fix makes
the threads exit cleanly - which also makes the timeouts
waiting for the process to join disappear.

Type: test
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I05d99bb48a9987544bbfe45118755c09d7867aa0
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit 3f8c87132d)
2019-11-18 13:28:35 +00:00
59aed0eed4 nat: NAT udp counter & unit test fixes
Ticket: VPP-1798
Type: fix

Change-Id: I42f02d5824575720e95b9fc99cfa864252221a82
Signed-off-by: Filip Varga <fivarga@cisco.com>
(cherry picked from commit 5854b43de4)
2019-11-18 13:19:19 +00:00
d451cbd0bd tcp: correct validity check return value
Type: fix

Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com>
Change-Id: Ib59bf664d8da20516d8f16d716c5e8698675da4b
(cherry picked from commit 3ea17d54a9)
2019-11-18 13:18:20 +00:00
fc000f0e1d tests: support setting random seed
Log the random seed used when running tests and provide means to re-use
it in a later run.

Type: feature

Change-Id: I18d2a36ee802b901d4cca5577df41cec07f09cc0
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit 45a95dd782)
2019-11-18 13:17:57 +00:00
329c884aa2 libmemif: reset number of queues on disconnect
Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: If4df47b1109ac90d4d5834b3aa7d326f6b3761d2
(cherry picked from commit 718a19b8f9)
2019-11-18 13:17:43 +00:00
7f9603d90a tests: avoid test runner hanging on child test process join
In parallel test, the single process is spawning
a bunch of child processes running the tests,
and communicates to them. When the child process
signals that it has finished, the parent calls
child.join(). Sometimes this join never returns.
The result is a lot of defunct python processes,
and the test run just hangs.

I have seen this failure intermittently a fair bit
in a busy containerized environment, and by chance,
consistently reproduced it on a Thinkpad X280
with 8G of RAM and Ubuntu 19.04, which allowed
to diagnose it.

Type: test
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: If0a3110fc2d23e73d77c310d61c3ea90a2b53610
(cherry picked from commit 42693521f6)
2019-11-18 13:17:27 +00:00
22dec96951 ipsec: ipsec-input: check for too-short packets
Make sure packet is big enough before processing it.
Policy matching is done speculatively but is discarded if packet is too
short.

Type: fix

Change-Id: I647db2c4e568b0d9bf2cfd5056e1b1c2e25132fe
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit f7f49640bb)
2019-11-18 13:17:12 +00:00
d74cb99a98 vlib: fix for vlib_node_add_next_with_slot
- vlib_node_add_next_with_slot was not cleaning the old next node
references to the given slot when replacing it with new next node. This mostly
worked until one tried to set the slot to a previously (but not currently) used
next node for that slot.

Type: fix

Signed-off-by: Christian Hopps <chopps@labn.net>
Change-Id: I7ee607625da874e320158b80f12ddc16e377f8e9
(cherry picked from commit 2e8b0618b1)
2019-11-18 13:16:39 +00:00
511cef1b9e mpls: number of mpls tunnel paths returns zero
The number of paths on the mpls tunnel returned through the bapi is
always zero. Doing a ntohl on a uint32 and poking it into a uint8 causes the problem.

Type: fix
Signed-off-by: IJsbrand Wijnands <ice@cisco.com>
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I4135ad43a891e7818ca673c8067ef1f11cb34530
(cherry picked from commit bf103d99e6)
2019-11-18 13:16:21 +00:00
89ab1762d7 session: reschedule asap when snd space constrained
Type: feature

Improves fairness for sessions that are snd space or pacer constrained.

Change-Id: Ida5f523090f1dcbfb17bf5116bc7917747ac8593
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit dd97a48d9f)
2019-11-18 13:15:56 +00:00
ccdd73e636 vlib: Handle race in thread barrier processing
When CLIB_DEBUG is enabled, vlib_foreach_main macro asserts that
vlib_main it currently looks at is safely parked in barrier, by
checkling that vlib_main->parked_at_barrier is not 0.
Unfortunately, the check is racy - workers first increment the
atomic counter to indicate that they have reached the barrier
and _then_ set this_main->parked_at_barrier to 1. For the last
worker to suspend this opens the race - main thread is free
to execute and assert immediately after atomic counter has been
incremented, before worker gets to write to own parked_at_barrier.

Fix this by simply swapping the order of two operations.

Type: fix

Signed-off-by: Alexnader Kabaev <kan@FreeBSD.org>
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Iae47abd6ca0be1c5413f5ecaefabc64cd7eac2ed
(cherry picked from commit feda545105)
2019-11-18 13:15:39 +00:00
f821dd7990 tls: fifo size is u32
- unformat_memory_size() writes to a uword *
- Limit cli input to u32

Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I453a5633e04f9ee6f2f1a843634f99063a81579b
(cherry picked from commit b1a81aa679)
2019-11-18 13:14:44 +00:00
af62709c74 tests: decode worker stdout/stderr output
Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I309254e9e99920fbeaa50eea503c1c2a9470abfe
(cherry picked from commit 97ea2f4ec0)
2019-11-18 13:14:06 +00:00
b3f54ec401 vcl: handle segment map errors
Type: fix

Change-Id: Ibd122a4565c067627c4bbc8cac7df2d5b6497392
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit dbc9c599b9)
2019-11-18 13:12:13 +00:00
57997c8748 session tcp: infra for transports to send buffers
Type: feature

Add infra that allows transpors to enqueue pending buffers without the
need to build and manage their own pending frames. An important benefit
is the fact that buffer wire/tx ordering is ensured by session layer.

Change-Id: I764fd1693d610b321a1d0c84b648a314f14583db
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 2a7ea2ee92)
2019-11-18 12:31:58 +00:00
fd2f6f89e6 ip: Punt rather than drop unkown IPv6 ICMP packets
Type: feature

Change-Id: Ib137c453ff2dd5b9d028c653afa80e6b2b81b9e0
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 1afe952726)
2019-11-15 07:42:36 +00:00
69f0861872 http_static: fifo-size is u32
- Limit cli input to u32

Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: Ib1f8ee9764da91a7804cc08901112c3f074130bc
(cherry picked from commit b101058890)
2019-11-15 07:42:11 +00:00
103669de7d rdma: fix next node rx redirect
Type: fix

Change-Id: I694db40c3a0361852d01b84c7a45e32e39e9f4af
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 972d71da86)
2019-11-15 07:36:27 +00:00
dea724f796 ikev2: fix traffic selector match
Type: fix

Change-Id: I81ab3dcd03f397b3d275da6cfa094e048ad92f95
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit cb3cfe876b)
2019-11-15 07:25:14 +00:00
066ebabc5a session: fix show cli with closed session
Type: fix

Change-Id: Ifb6ead644c0273b84a5647f7923053f1db7c5a76
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 2d0b2bbb97)
2019-11-15 07:22:59 +00:00
b5a0108acf vlib: enhance the "show cli" debug CLI command
Dump the entire CLI, mp-safe commands, non-mp-safe commands, commands
which have been executed. Optionally, clear the hit counters.

Type: feature

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ie38fc664b7deaabc35ca35be68db7e159272f551
(cherry picked from commit a1f5a956e5)
2019-11-15 07:22:16 +00:00
0b8f7cf89f session: avoid double dispatch of new events
Type: fix

Avoid re-dispatching new events if they've just been added to the old
events linked list.

Change-Id: Ie5d0b799eae6cebb118d97204e5111eb194c0b8e
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 45b7973ddd)
2019-11-15 07:20:32 +00:00
513a8ffd88 vlib: Trivial - fix typo in short help
Type: fix

Change-Id: Ifada594088984291ce2e79da0bbbbd1f500640c9
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
(cherry picked from commit 43d8cf6fad)
2019-11-15 07:18:59 +00:00
8ef3741a27 dpdk: use local logger
Type: fix

Change-Id: I44922f70aef6a3c53f0f56c6d0656502c8fd69b2
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
(cherry picked from commit 59c110736b)
2019-11-15 07:18:38 +00:00
52d6686e60 session: app-closed to transport-deleted on delete notify
Type: refactor

As a result, transport-deleted is the only session state that has no
transport data structure.

Change-Id: I2da2bc4bbb141d8a7b52faae66a4733de8f8513b
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 3b5e222f8a)
2019-11-15 07:15:44 +00:00
82ae1a485e ip: reassembly: fix use-after-free
When processing the last buffer of a reassembled packet, the current
buffer will be freed and must be reloaded using the updated index.

Type: fix

Change-Id: Ib39e29e60eb527b4cd4828a3aa37d82c8dddd709
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit cf7803d2e8)
2019-11-15 07:15:07 +00:00
442870c03a tests: DEBUG=gdb[server]-all to debug worker(s)
Type: test

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I0264451632c1ce780b38a2c15a7e34350fc6d521
(cherry picked from commit 2456433df4)
2019-11-15 07:12:43 +00:00
2c55610e20 vcl: add api to set lcl ip
Type: feature

Change-Id: I40169fbbe8a20670dd612c341b6c78b5c925bf74
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit ef7cbf6adf)
2019-11-15 07:11:33 +00:00
1c2fd1609c vlib: linux: fix wrong iommu_group value issue when using dpdk-plugin
When VPP work with dpdk-plugin, linux_vfio_main_t->container_fd is always -1
since it never have chance to run open("/dev/vfio/vfio") to get the fd.

But this lead to a potential issue of VPP, that is, when start VPP without
uio-driver field setup in /etc/vpp/startup.conf, VPP will run to automatical
select uio driver in vlib_pci_bind_to_uio() and the function depend on
iommu_group value to decide to work on vfio or vfio-noiommu mode.

Since in vlib_pci_get_device_info() have the condition container_fd != -1,
so the iommu_group value will be always -1 at this scenario, this caused
that VPP mistake to run with vfio-noiommu driver on intel_iommu=on state.

Actually in order to get iommu_group and iommu_group/name value, no need to
depend on linux_vfio_main_t->container_fd value, so the fix remove the
condition lvm->container_fd != -1, then it can get the correct iommu_group
value.

Type: fix

Change-Id: I3f162fc4971b9a2b8717205f8f3b52e30c5e5b69
Signed-off-by: Yulong Pei <yulong.pei@intel.com>
(cherry picked from commit 45495480c8)
2019-11-15 07:11:04 +00:00
ab46b6a03b tcp: fix retransmit with no sacks
Type: fix

Change-Id: I6f7df0d358f57f7feadb9b7a3fcffb99558b2af8
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit bf1f8b7f28)
2019-11-12 22:13:12 +00:00
a6a98b5460 nat: reapply respect udp checksum
Type: fix

Signed-off-by: Filip Varga <fivarga@cisco.com>
(cherry picked from commit 16572355c9)
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I119ee45f7007e0a689d46c9f75eb6314f15990e2
2019-11-07 22:17:13 +01:00
3bacbc975f nat: revert respect udp checksum
This reverts commit 00be6b1886.
Type: fix

Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Ibef710319222e311bbdfd3221acc4df82139d12d
2019-11-07 22:16:39 +01:00
00be6b1886 nat: respect udp checksum
Type: fix

Change-Id: I732be02d2e2b854eb589c3fa10f980ef2dbe8dfc
Signed-off-by: Filip Varga <fivarga@cisco.com>
(cherry picked from commit 16572355c9)
2019-11-07 20:09:00 +00:00
f073acdcae nat: Revert "nat: respect udp checksum"
This reverts commit 80276a7101.

The commit in master was found to be wrong, was reverted, and replaced by 16572355c9

This reverts the corresponding commit in stable/1908, to replace with the correct fix.

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Idc27c0d81edf2263e523088f7ee7b66655db20f1
2019-11-07 20:08:36 +00:00
1c3c9f0393 api: Add API support for PP2 plugin to stable/1908
Support create/delete interface with marvell PP2 API

Type: feature

Signed-off-by: Jianlin Lv <Jianlin.Lv@arm.com>
Change-Id: I2a81024e0fcf2f389d39a5498167a752f8f807e5
2019-11-07 13:32:36 +00:00
387123e675 dpdk: fix tso not properly check the 'enable-tcp-udp-checksum' option issue
Type: fix

Fix tso did not properly check the 'enable-tcp-udp-checksum' option issue
Add description of 'tso' and 'enable-tcp-udp-checksum' in startup.conf

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: Id659067a9fa9e1db6c3f8dc533a2e90351b86831
(cherry picked from commit 5bec5f7860)
2019-11-05 10:47:31 +00:00
c9ddd2eec1 vlib: only dump 1st buffer in chain by default
Several nodes include buffers in their traces, but only the 1st. When
formatting the trace we must not try to iterate through all chained
buffers.
Default to display only the 1st buffer.

Type: fix

Change-Id: Ib3c668bbf4ab70ae68eba2ac402c7b7329825b70
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 4354317bf3)
2019-11-05 10:46:54 +00:00
e7ac6d0250 ipsec: fix esp trace seq number overflow
Do not copy invalid seq number if packet is too small.

Type: fix

Change-Id: I1e78f5920e9645521f57efccaf35bbf9ce0676a8
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit c520fe7ab9)
2019-11-05 10:44:44 +00:00
e04a58d27b session: fix dispatch event logging
Type: fix

Change-Id: Icf3c73cd7eb7565ed6e1b0371da172b5408a9d36
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit ba13c3b369)
2019-11-05 10:42:46 +00:00
6de46b40d2 tcp: track lost rxt segments in byte tracker
Type: feature

Change-Id: I18dfac9c3d2f539edf20dba64cd2b7b541154144
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 46ec6e018e)
2019-11-05 10:41:16 +00:00
7def5ba815 vlib: fix subclass name being truncated in output
Type: fix

Change-Id: I50816cca4eb88f58209138a348fc5954ab835f5b
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
(cherry picked from commit c9832e3df8)
2019-11-05 10:40:29 +00:00
ac68457e55 dns: fix typo in counter
Type: fix

Change-Id: Id8a0ce8278816d2839d229799daa3735a097bc7b
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
(cherry picked from commit e74718fa98)
2019-11-05 10:40:01 +00:00
bfb7c2a459 l2: fix typo in doxygen
Type: style

Change-Id: I286280fffa6ab5d3e15986911a4ccc35efbf41c3
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
(cherry picked from commit ddbd90aae3)
2019-11-05 10:39:41 +00:00
0700f3c50e ip: cleanup typos in documentation
Type: style

Change-Id: I7d44b7fab1b8b196e4934cb4832ee51084c5bf98
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
(cherry picked from commit 5b755e2f9f)
2019-11-05 10:39:15 +00:00
eaec04895e tcp: rx fifo size is u32
- Limit cli input for rx fifo size to u32

Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: If5a8e0668acf5b0f369acf4f120e47a012bd1899
(cherry picked from commit db39656d7a)
2019-11-05 10:37:25 +00:00
00413d3fed tls: fix on tcp connection reset
VPP would fail in tcp_connection_reset() if the tls
or app session was just created.

Type: fix

Change-Id: I45d107f57e4f3fc468c15ca3392d5e1c413bd690
Signed-off-by: Zeyu Zhang <zeyu.zhang@intel.com>
(cherry picked from commit cbbc4a2558)
2019-11-05 10:35:25 +00:00
bf2aa86fe9 lisp: fix lisp-gpe db hash
lgt->key is already a pointer to the key, hash the pointed data instead
of the pointer value.

Type: fix

Change-Id: I4d29d8c6519afc3843cb2e5ef88795d60f715e23
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 0c4def0e84)
2019-11-05 10:35:00 +00:00
2172c35eb4 vcl: handle rx notifications on reused sessions
Type: fix

Ignore events on sessions that have been reused but not fully
initialized.

Change-Id: Ided020eb5245d665d0a2e4a9e1f8a6dddebae009
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit bd52e46fe8)
2019-11-05 10:34:11 +00:00
f0c4096e1b session: allow transport cleanup only if not deleted
Type: fix

Change-Id: I51282182952a66be698226bace39626df4d67b9f
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 5afea129ed)
2019-11-05 10:33:39 +00:00
92a5fdd684 tests: make RA tests run on VPP time
the IPv6 RA tests take timing into the account,
but the time inside VPP may go slightly differently compared
to the time inside the driving python thread,
if the machine running the tests is heavily loaded.
Make a sleep function which sleeps "on VPP time" and use it.

Change-Id: I3b34b0164f6e0ec7a619b92ee308089a4a8935e3
Type: test
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit 63cb8827e5)
2019-11-05 10:31:18 +00:00
5cd73e6d92 vlib: unix trivial- clean up typos in docs
seen while reading through the code.

Type: style

Change-Id: I7a2f021b9f06d0eebb2ea3d0cafb6955ccb14781
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
(cherry picked from commit d29422cbee)
2019-11-05 10:31:00 +00:00
9e20470cb3 ip: trivial typos in docs
Type: style

Change-Id: I620f15b96ee5401e0145a139f06d343d7c4fadb4
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
(cherry picked from commit f158944cc4)
2019-11-05 10:25:43 +00:00
3d30598b7b tcp: avoid sending acks when data available
Type: fix

Change-Id: I02e2cb2d349f9ddb2bfed040a08ca448f379d565
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit cb711a4ec9)
2019-11-05 10:23:52 +00:00
efb8db4c8a session: avoid old io dispatch if no slots left to send
Type: fix

Signed-off-by: Ryujiro Shibuya <Ryujiro.Shibuya@owmobility.com>
Change-Id: I8e1f6cbd905ad5c21aed1b2e358540d0fbd7fc47
(cherry picked from commit 2a1118411d)
2019-11-05 10:22:25 +00:00
eeaf6e7614 gso: fix buffers trace
When segmenting, new buffers must inherit the original buffer trace
handle.

Type: fix

Change-Id: Ibd1859a501b2862906dfc563b98652cfee5681da
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-11-03 19:51:06 +00:00
5b055af741 ipsec: fix tunnel protection removal
Type: fix

Change-Id: I4d5546d1f9b3a162291997f6f0c094c5c3d6cf31
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit 89b2495000)
2019-11-03 19:49:07 +00:00
c07b9b6891 rdma: build: fix ibverb compilation test
Type: fix

Change-Id: Ib6389ecbcf4a1b7bae25b2bd9e7fbdec49545aaa
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 386ebb6e2b)
2019-10-31 22:52:40 +00:00
65ef66543a tcp: correct tcp connection lookup condition
Type: fix

Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com>
Change-Id: Ibdbac568d5f765e6b5c959cab5e32dc33335064d
(cherry picked from commit c8be851161)
2019-10-31 12:17:59 +00:00
80276a7101 nat: respect udp checksum
Type: fix

Change-Id: I73895fa0101bd50483160c8dc6faac2c67513077
Signed-off-by: Filip Varga <fivarga@cisco.com>
(cherry picked from commit 0d75f78364)
2019-10-31 12:17:38 +00:00
709375e755 memif: memif buffer leaks during disconnecting zero copy interface.
code added to free the zero copy interface rx/tx queue buffers during disconnecting.
As ddc9eb4 find the last official solution introduced core in ut. This does not.

Type: fix

Signed-off-by: Changqian Wang <changqwa@cisco.com>
Change-Id: I971ee164e6d4331a85feb9e65d6702d771c86985
(cherry picked from commit 00b2d74d1f)
2019-10-31 12:17:09 +00:00
f3ecd4c029 gtpu: msg id fix in send_gtpu_tunnel_details api
Type: fix

_vl_msg_id must start at msg_id_base.

Signed-off-by: Miklos Tirpak <miklos.tirpak@gmail.com>
Change-Id: Id3f05683c873fcac47667a9736e45e85849b740c
(cherry picked from commit bd0a00a456)
2019-10-31 12:16:45 +00:00
cd0c5d8373 tcp: improve rate samples for retansmitted segments
Type: fix

- Initialize max_seq on both transmitted and retransmitted segments
- Keep track of segments that have been sacked.
- Track new data segments sent during recovery

Change-Id: Ice55231a3da200ae6171702e54b2ce155f831143
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit d6ae4bf13a)
2019-10-31 12:16:19 +00:00
dcc5de6fc3 tcp: fix sack retransmit beyond snd_nxt
Type: fix

Ensure that sack retransmit logic does not try to inadvertently send new
data.

Change-Id: Idfda19643577d9c1b58e2af8d8283cabfbaf98e6
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 81cb8e4092)
2019-10-31 12:16:05 +00:00
abe07c8a25 vppinfra: make coverity happy with vec_set_len
Coverity gets confused by ASSERT((l) <= vec_max_len(v)) when l is 0.

Type: fix

Change-Id: I247d7015b148233d8f195bcf41e9a047b7a21309
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 70d5d4fa09)
2019-10-31 12:15:48 +00:00
952d4e7fb9 vppinfra: add clib_mem_free_s
IPsec zero-es all allocated key memory including memory sur-allocated by
the allocator.
Move it to its own function in clib mem infra to make it easier to
instrument.

Type: refactor

Change-Id: Icd1c44d18b741e723864abce75ac93e2eff74b61
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 78af0a8c5f)
2019-10-31 12:15:33 +00:00
54ff70cb3c tcp: Init cwnd from ssthresh.
Set high ssthresh out of the box and make configurable

Type: fix

Signed-off-by: Sergey Ivanushkin <sergey.ivanushkin@enea.com>
Change-Id: Iba1549b4ee55e51468ad0b28ef3d26a85fa9cae0
(cherry picked from commit c30318da22)
2019-10-31 12:14:15 +00:00
b345e41ed0 session: increase max ctrl msg size
Type: fix

Connect ctrl message recently outgrew the maximum ctrl msg size, so
increase the limit. Also add static asserts for messages that could
potentially exceed the limit.

Change-Id: I0d3e32e0d4d67d7e222cff14ddba59a0c3fb8b00
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit e24a4bc023)
2019-10-31 12:13:57 +00:00
7364ac14b6 tcp: avoid head retransmit if scoreboard has no holes
Type: fix

Change-Id: I6164ad0d97cd91b60c85302eff691836d12a0a70
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 8a8b05c526)
2019-10-31 12:13:32 +00:00
ae36a85c86 gbp: missing contract hash-mode setting
Type: fix

Change-Id: Ia0f1e88b43e861d3f6965076c73cc48fb9574da3
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit bb098f1764)
2019-10-29 20:24:52 +00:00
9a4e5878b0 l2: l2bd nd termination test instability
The test for ND event suppression reused the previous test run
ipv6 address, and would sometimes consider that a duplicate,
and therefore suppressing that one too.

Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I1b115aa4eba9d57770fa03fcf38b7a1c251cfe88
(cherry picked from commit df0191ead2)
2019-10-29 10:03:16 +00:00
abad677803 devices: vhoost cpu->copy array overflow on tcp jumbo frame (65535 bytes)
We reserve 40 slots in cpu->copy array prior to copy out to avoid overflowing
the array. However, 40 is not enough for the jumbo frame because desceiptor
buffer len is likely at 1536. Change the reserve to 200 and add ASSERT to avoid
encountering the same problem in the future.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ibf0c03c4b4f33e781d5be8679ccd6c3a4b4a646d
(cherry picked from commit 7331005c16)
2019-10-29 10:01:02 +00:00
b4c5f16889 build: add missing ldflags to exe and shared
Type: fix

Change-Id: I859bc6ebc574ab09fd70b45f8c911769d00e7acf
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 534de8b2a7)
2019-10-29 09:53:39 +00:00
16a17507f4 vppinfra: add vec_set_len()
l2-flood and bier nodes reset vector length without updating it to its
effective size. Introduce a helper to do it (this allows ASAN to keep
track of the new vector size).

Type: refactor

Change-Id: I2d652550c440f0553a2b49c3ee3d37b49ebc16c3
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 8a4bfdae87)
2019-10-29 09:53:17 +00:00
f7b53e155a tests: add PID of VPP under test to API dump filename for the test
Some testclasses (e.g. IPSec) have methods with the same names,
this causes a race when running in parallel to save the API and
move it into the test's directory - the name of the file has
only the test method name as a discriminator.

Saving two traces from two VPP instances "succeeds", in that
it silently overwrites the file. But only one mv operation
works - the other gives an error "file not found" and fails the test.

Solution: add the PID of VPP under test to the API dump filename,
this way the filenames become guaranteed unique and the race is avoided.

Change-Id: I1bb47ed73369fea0f1bfbf907588a51e2cabfb7f
Type: test
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit 586d3edf49)
2019-10-29 09:52:42 +00:00
aad7fa7d6f vlib: enable worker-thread dispatch pcap trace
Needed a bit of foreach_vlib_main(...) action to turn on/off all
instances of vm->dispatch_pcap_enable, and to pick up the pcap_main_t
pointer from vlib_global_main.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I49b69b87934c7dc7a9835cd07aa2c5c4d3c79f18
(cherry picked from commit 349cd1af77)
2019-10-29 09:51:42 +00:00
270594b5d3 misc: Update gitignore for /test/ext/.d
.. otherwise i'm going to commit it accidentally

Type: feature

Change-Id: I0378b9a29a28ea7317bc7d234f8cbacdafd6b762
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 8161d73d7e)
2019-10-29 09:50:55 +00:00
f6e4a3c2a0 tcp: fix mss flag in option parsing
Type: fix

Change-Id: Ib03151a097caf15e4e8285afea83d1b930a874b0
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit a9e1f7b99b)
2019-10-29 09:50:33 +00:00
87aadb1e75 svm: immediate fifo growth even when wrapped
Type: fix

- when the fifo is wrapped, and if applicable, insert a new chunk after
  the tail-chunk and rebuild the rb_tree.
- make sure that this new algorithm can be applied only when the fifo is
  used by a single thread (master-thread of the fifo).

Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com>
Change-Id: I3fc187bc496ea537ca24381e4abc08d2906c9e03
(cherry picked from commit 8e20fe7ab4)
2019-10-29 09:49:06 +00:00
e68fe9c516 tls: allow disconnects from main thread
Type: fix

Use api with explicit thread index to retrieve tls contex on close.

Change-Id: Ibdc4338747300b7fc8f91ef3e10bcd48ce7ae366
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 6faac1622e)
2019-10-29 09:48:30 +00:00
cdb11ea329 tcp: refactor flags into cfg and conn flags
Type: refactor

Change-Id: Ib5e2ecf55732599e1322736e3662178c9da49c7d
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit bbcfaac957)
2019-10-29 09:48:03 +00:00
abdc7dfb5f tcp: improve pacing after idle send periods
Rest pacer on ack reception if we haven't recently sent anything.

Type: feature

Change-Id: I820bacd81b65130052dfafbfcbe6ca4553069fbc
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit c31dc31f84)
2019-10-29 09:47:37 +00:00
9a114bcb28 ebuild: Unite default build platform to vpp
Top level makefile is using vpp as the default platform. The other place
where platform is specified has native as the default. Unite them to the
only currently supported platform - vpp.

Type: make

Change-Id: Idb12ccc3056dd6be640a2d6763dc30e4f789d2ac
Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
(cherry picked from commit 664ec91fde)
2019-10-29 09:45:11 +00:00
7b3695d34d misc: 19.04.3 Release Notes
Type: docs

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I43a236be5289c50dafbede08beabe4c09ff3c892
2019-10-29 02:53:32 +00:00
1517d5e727 bonding: fix interface deletion
Copy sw_if_index value instead of using pointers to original
bif->slaves content which could be overriden by eg. vec_del1().

Type: feature

Change-Id: I37e458effd6b2367479574f7bd3facd4e93bada4
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit cc3aac0569)
2019-10-27 10:14:26 +00:00
f5f41e5f13 misc: (cdp) fix non-null terminated vector use
Type: fix

Change-Id: I31e5d9d9e93339eb789aed20996f326b085c22a9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 94e4dea15a)
2019-10-27 10:12:27 +00:00
de6453aa63 svm: reset vector data instead of length
Reseting vector length confuses ASAN and does not reset data either.
Only reset data instead.

Type: fix

Change-Id: Id60b8333df28a5b636a9d302b987bbad95c85c38
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit a9f1e7d4fd)
2019-10-27 10:10:47 +00:00
755f836d4d session: fix use-after-free
Type: fix

Change-Id: Ie63b80db56febc8a16bafcdd5399b2f92b6aa437
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 94d2da0b29)
2019-10-27 10:10:14 +00:00
461100061f ipip: fix typos in short_help
Type: fix
Signed-off-by: Ignas Bacius <ignas@noia.network>
Change-Id: Ica069e8c9dd4efd1f00639754da471bf11418b57
(cherry picked from commit 3d93ad9f33)
2019-10-27 10:07:34 +00:00
30f7e41987 gbp: Add extended SFC unit tests
Type: feature

Change-Id: I1218257af0053ae27c4394d7666fde87a732e08c
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit a3c8ca10e9)
2019-10-27 10:06:54 +00:00
f872cb0dad ping: Move to plugin
Type: refactor

Change-Id: I51d5bf54dfd408aa0c406cbdf0f4be10ef19d10d
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 26c7a4b0b6)
2019-10-27 10:06:30 +00:00
13d35675f0 tests: make pg_start() wait until pg completes
A sizable number of tests call pg_start() to get the packets flowing and then
immediately expect to have the entirety of the packets gone through.
This works on powerful and unstressed hardware, but fails in beautifully random
ways under load.

This also necessitates the complicated logic of remembering the "zombie captures",
then sleeping for some time before cleaning them up....

The solution is simple: in pg_start(), start the generators, wait till they
all finish, clean up, done.

Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I930e51b7aae39c9841d22dd905a4d13a465a672b
Type: test
(cherry picked from commit 8d829f6c48)
2019-10-27 10:05:12 +00:00
e46f029003 tests: log error which happens during connect and wait longer for stats socket
Intermittently, a test would start VPP, but no testcases would execute.
This would be more probable apparent during the high load or if there
is another testcase dumping the core at that moment.
Adding the logging to the connection revealed it was the stats socket
connection erroring with error -2. Increasing the deadline
from 3 seconds to 5 minutes has eliminated this error.

Change-Id: I40bd7e642abb9e2aef0238c612e4c34781de5db2
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Type: test
(cherry picked from commit 4f05a8e408)
2019-10-27 10:04:47 +00:00
5bf125be8f tests: explicitly wait for the PG to finish before looking for capture file
Rather than only using time-based method of periodically checking
whether the pcap file appeared, first check that the packet generator
has stopped. To make this change fail-safe, have a 5-minute timeout
on this activity, just in case the things go terribly wrong.

Type: test
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Id16b2802b2de8a4cafb5d9f0a8c9ba62ec89dc32
(cherry picked from commit 3d36f19a0f)
2019-10-27 10:03:28 +00:00
7b135c639e tcp: retry lost retransmits
Add heuristic that detects lost retransmitted segments and retries
sending them.

Type: feature

Change-Id: I34d1bb16799e1993779222eb2bfad4b40704159e
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit be237bf023)
2019-10-27 10:02:16 +00:00
31c31c25e9 sr: fix deleting an SR l2 steering policy
Type: fix
Signed-off-by: Ahmed Abdelsalam <ahabdels@cisco.com>
Change-Id: I9e98b1622785e58484bf316ef491e44cfb06bcb7
(cherry picked from commit a6b93eac59)
2019-10-27 10:01:34 +00:00
86a247310c ikev2: fix dangling pointer
Type: fix

Change-Id: I8aa9029e0a5cf21aa24a90b39eb2787653f65abb
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit 1890e9ce57)
2019-10-27 10:01:11 +00:00
0d2f654a03 build: clean up make help output
This change is designed to help the uninformed find the right way
to run extended tests by using the test-all[-debug] targets.
'make test EXTENDED_TESTS=y' fails to build as it has a dependency
on 'vom-install' which is conveniently included in test-all[-debug].

- clarify test-all[-debug] description and
  make test-help description
- Also align indentation of make help output

Type: style

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: Ief54cc8a5af68c052aacb0d660237c5eb63451b5
(cherry picked from commit 2777ec7615)
2019-10-27 10:00:29 +00:00
fe9613631c vlib: fix cli process stack overflow
Type: fix

Some cli processes, including configuring an test flow
on an i40e interface consume more than the currently
available stack space.

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: I3df53d251cd43286f94647384d6e50a463bad15c
(cherry picked from commit 2fd44a00aa)
2019-10-27 09:58:59 +00:00
fded97083b quic: fix wrong condition in update_fifo_size
Type: fix

Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com>
Change-Id: If371cde9412be29634164830c58634da248ad0ae
(cherry picked from commit cc702410c1)
2019-10-27 09:58:07 +00:00
925b94aa3c vppinfra: fix page boundary crossing bug in hash_memory64
Fix a day-1 bug, possibly dating back as far as 2002. The zap64() game
involves fetching 8 byte chunks, and clearing octets not to be
included in the key.

That's fine *unless* the 8-byte fetch happens to cross a page boundary
into unmapped or no-access space.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I4607e9840032257c96ba7387f86c931c0921749d
(cherry picked from commit 7e2cea3d26)
2019-10-23 21:42:36 +00:00
0e520fdfd4 gbp: use correct dst mac for RD-UU forward
Type: fix

Change-Id: Ifdd193fab24796346b11a5df81740880f9a50ee8
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit db056acca0)
2019-10-22 11:23:46 +00:00
eb0cea6919 bonding: feature arc may not be enabled for the slave interface
vnet_feature_enable_disable takes sw_if_index, not hw_if_index. If there
is a subinterface created prior to the slave interface is created,
sw_if_index and hw_if_index start to diverge and the problem will happen.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I11e1f099378832f83b748526c6cbeb56960fad3c
(cherry picked from commit 1a41a35b27)
2019-10-22 11:21:05 +00:00
e36e5cbac4 ip: fix clang debug compilation
The non-extern declaration confuses clang linker in debug mode.
The function is defined as inline above anyway.

Type: fix
Fixes: c6215d902f

Change-Id: Ic7e4477631cf0bcfb31ab3f81effe3642dd4223e
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 5b1379be3e)
2019-10-22 11:18:38 +00:00
4ac265adc6 tcp: fix tso not work in single buffer issue
Type: fix

Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
Change-Id: Iddb6fd41812e8c97af58859ef43279cfc0f9d1df
Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
(cherry picked from commit 8a047ed741)
2019-10-22 11:18:01 +00:00
be2d536f87 mpls: support fragmentation of mpls output packet
Type: fix

Signed-off-by: Rajesh Goel <rajegoel@cisco.com>
Change-Id: Ie4372c5cf58ab215cdec5ce56f8a994daaba2844
(cherry picked from commit d6f1c9c514)
2019-10-22 11:15:17 +00:00
d3b170254b ip: only install IPv6 prefixes in FIB when the interface is up
otherwise they get installed twice and the reference counting means they are not removed.
This is the same behaviour as IPv4.

Type: fix

Change-Id: I9266e04ccff6ff06a577e85973a2ddbeb9dfc52b
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 1ff3c15b3c)
2019-10-22 11:14:47 +00:00
15800e9442 fib: P2P interfaces do not need specific multicast adjacencies
they can use the 'auto' adj for all traffic

Type: fix

Change-Id: Id2b9557683252a94badc8f9dfab5f7b2ae26f1ee
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit da0e7497ca)
2019-10-22 11:13:06 +00:00
3bc9d5551a tests: handle unicode charactes in cli output
Type: fix

Change-Id: Ic4fb53e6d10a1de155a3088be81d53d9efeb0c0f
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit 6be5564833)
2019-10-22 11:11:45 +00:00
116e05f57f build: add env variable to pass extra cmake args
If VPP_EXTRA_CMAKE_ARGS is set, its content will be
appended to the vpp cmake command cli

Type: feature

Change-Id: I825d4239e62b0a2fb70a652f0671f6c559630aad
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
(cherry picked from commit 2973654033)
2019-10-22 11:02:29 +00:00
fea0713f66 tcp: rate sample for persist segments
Type: fix

Change-Id: I7c38d2ad6364f098529f51c15b533eb234b82716
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit dd60b1b128)
2019-10-18 14:44:01 +00:00
c518bd63c3 vlib: move thread barrier around mod of global node next data
The old code modified the node next array prior to obtaining the thread
barrier. Then it updated the runtime node data, and upon barrier release
caused reforking of each worker thread. The reforking clones the main
thread nodes and reconstructs the runtime node structure. This cloning
is not 100% "deep" in the sense that the node next array is
shared (i.e., only the pointer is copied). So prior to the barrier being
obtained the node's next array is being changed while workers are
actively using it (bad). Treating the node next array as read-only in
the workers and sharing it is a decent optimization so instead of trying
to fix that just move the barrier a little earlier in the process to
protect the node next array as well.

This was tripping an assert in next frame ownership change by way of the
ip4-arp node. The assert verifies that the node's next array length is
equal to the runtime next node count. The race above was lost and the
node next array data was updated in the main thread while the arp code
was still executing in a worker.

This was being hit when many arp requests were being sent from both ends
of a tunnel during which the add next node function was called, which
often led to an assert b/c the next node array was out of sync with the
runtime next node count.

- PS#2 update - move barrier sync to just above code that modifies state.

Ticket: VPP-1783
Type: fix

Signed-off-by: Christian E. Hopps <chopps@chopps.org>
Change-Id: I868784e28f994ee0922aaaae11c4894a3f4f1fe7
Signed-off-by: Christian E. Hopps <chopps@chopps.org>
(cherry picked from commit d3122ef4ec)
2019-10-18 14:39:40 +00:00
b8f61f4863 dhcp: API return code fix
Type: fix

Change-Id: Ifcbfeecd6ca1215ec473eec4cce736ab4eacde80
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit d751746af9)
2019-10-18 14:39:18 +00:00
a61ba6d1f9 ip: Fix IP unnumbered dump of one interface
Type: fix

Change-Id: I35fb6fdfba50c4a59cf1ffb94cb51487bcf5afc9
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit ac3e72cb97)
2019-10-18 14:38:34 +00:00
95c5e32b16 misc: add "show run summary"
Prints the interior node vector rate, rx / tx / drop rates

Type: feature

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I57130db0f99e852a8498aa90d01e52f7ac33dcc9
(cherry picked from commit ac78f8a902)
2019-10-18 14:37:53 +00:00
47c6f36be7 hsa: make APP_OPTIONS_PREALLOC_FIFO_PAIRS configurable
-add prealloc_fifo_pairs  member in echo_main_t
-new cli parameter in vpp_echo

Type: feature

Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com>
Change-Id: I6bb1214ee93e06421cd0a3721420278c51cd59c4
(cherry picked from commit 7028a0157e)
2019-10-18 14:37:29 +00:00
7fc3d97b82 quic: make quic fifo size configurable via cli
Type: feature

Depends-On: I8d71078a9ed42326e19453ea10008c6bb6992c52
Change-Id: I6d6ac649094ef4bee2aed311915dd58f11972e79
Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com>
(cherry picked from commit 00078b9913)
2019-10-18 14:36:57 +00:00
f864498309 fib: fix use-after-free for interface adj removal
Type: fix

Change-Id: I82308e368d14d84f5970dad229bdcf2de7d1839d
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 7391156ce6)
2019-10-17 20:25:54 +00:00
8b7faa7270 bonding: graph node running after bond-input in feature arc may crash
In bond RX quad loop, when all packets within the frame have the same incoming
interface, we cannot skip calling bond_update_next because that function calls
vnet_feature_next() to update the b->current_config_index. The next node needs
the correct b->current_config_index to work with.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I3d8b3d4e0f95490f406fae7638f0c43c301ce664
(cherry picked from commit 71e5b47102)
2019-10-17 12:55:31 +00:00
2279e44bf0 ip: RD-CP API incorrect reply code
Type: fix

Change-Id: Ie436d51999dc1384a0db492f28a7e66620e14551
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit be01e635bc)
2019-10-17 12:25:52 +00:00
cbdff7518b fib: recursive calculation leads to delegate pool realloc
Type: fix

Change-Id: Ib7ac53d1b59b641ccd3b1d733107d7f1ba174314
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit a66020becd)
2019-10-17 12:25:39 +00:00
cb19100c18 vppinfra: create unformat function for data size parsing
Type: feature

Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com>
Change-Id: I8d71078a9ed42326e19453ea10008c6bb6992c52
(cherry picked from commit 579b165069)
2019-10-16 12:40:33 +00:00
fb76b4549f misc: add "maxframe" and "rate" to packet-generator cli.
Allow for setting the maximum number of generated packets to be included
in the frame passed to next nodes. This is very important for testing
code which may be susceptible to multi-frame vs single-frame bugs (e.g.,
code that is doing re-ordering where packets may be buffered between
frames).

Update:
- remove redundant packet "rate" option.
- reduce n_max_frame to u32 as that's what pulled from the CLI.

Type: feature
Signed-off-by: Christian E. Hopps <chopps@chopps.org>
Change-Id: Ie362bbb110b2cf01d9f65c559bbe9101e17b7fdc
Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 87d7bac5cf)
2019-10-16 12:40:14 +00:00
8a7109cc6e rdma: fix crash when failing to read pci addr on create
Type: fix

Change-Id: I543e2e5976cb384b81278a7ec98a0a6ab1612438
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 0dd97d473b)
2019-10-15 10:46:04 +00:00
8413f48d6e rdma: fix crash when failing to detect numa node on create
Type: fix

Change-Id: Ibb8e7c1c13869c1dce2385f58bd7260fcf776c5a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 90ea5dc1bd)
2019-10-15 10:45:50 +00:00
a086e304e4 vlib: pci: set pci driver name to none when no driver is loaded
If no Linux PCI driver module is loaded, then the driver_name in the PCI
info struct is NULL. This can triggers crash when checking driver name
eg. in vlib_pci_device_open().
Default to "<NONE>" as driver name, which should never match.

Type: fix

Change-Id: I9e69889a7566467bd8220b92bbbaa72ada957257
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 0eae2bb1f1)
2019-10-15 10:45:30 +00:00
b022d3195a ip: fix use-after-free in IPv6 SLAAC expiration
Type: fix

Change-Id: I46b166b3a10c4543eafa4422531dd3c725db45f1
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 79c9d36503)
2019-10-15 10:45:12 +00:00
7efa9c5342 nat: fix use-after-free
Type: fix

Change-Id: Iac91c086c4e975f0bada058f40b7b7d4475377f8
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 7233846ce9)
2019-10-15 10:44:53 +00:00
d294b98c1d devices: vhost not reading packets from vring
In a rare event, after the vhost protocol message exchange has finished and
the interface had been brought up successfully, the driver MAY still change
its mind about the memory regions by sending new memory maps via
SET_MEM_TABLE. Upon processing SET_MEM_TABLE, VPP invalidates the old memory
regions and the descriptor tables. But it does not re-compute the new
descriptor tables based on the new memory maps. Since VPP does not have the
descriptor tables, it does not read the packets from the vring.

In the normal working case, after SET_MEM_TABLE, the driver follows up with
SET_VRING_ADDRESS which VPP computes the descriptor tables.

The fix is to stash away the descriptor table addresses from
SET_VRING_ADDRESS. Re-compute the new descriptor tables when processing
SET_MEM_TABLE if descriptor table addresses are known.

Type: fix
Ticket: VPP-1784

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I3361f14c3a0372b8d07943eb6aa4b3a3f10708f9
(cherry picked from commit 61b8ba69f7)
2019-10-14 11:12:37 +00:00
d557b187f7 ip: MFIB CLI fix for parsing path flags
Type: fix

Change-Id: I7ed9726d8c5ca26715a84b004a18fd7f93142486
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 46023762d1)
2019-10-14 07:51:42 +00:00
47a2a705d0 lisp: fix dangling references to bihash tables
gid_ip4_table_t's and gid_ip6_table_t's are allocated from pools. They
MUST NOT be listed on the clib_all_bihash list to avoid dangling
references.

Switch to the clib_bihash_init2 API, which has the required knob.

Type: fix
Ticket: VPP-1788

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I49a17e937922c3af2e1c46b24e20883af51584a8
2019-10-11 15:45:39 +00:00
23afd57095 tcp: unittest: do not access non-existent samples
There is no bt->samples for this test, do not use it.

Type: fix

Change-Id: I2090290887bc5c0b5cdb0561cf2bf72a87781089
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit b0a7c484ee)
2019-10-11 14:41:20 +00:00
d5b7840245 acl: fix intermittent test failure
ACL tests use random port number in the tests.
A port number 6081 causes the decode in scapy
to consume some of the Raw payload into GENEVE
encoding, which breaks the test.

Solution: bring up the lower range of random
port to 16384, so that it does not touch any
of the well known ports.

Type: test
Change-Id: I022660d8ec147857924b436f1871b0b5ddcf4c47
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit ec574ff912)
2019-10-11 14:41:02 +00:00
2f9ec50016 quic: Create custom event logger
Type: feature

Change-Id: I20acfe6a53cf9f15e3e4b8847b6f76757962f1c7
Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com>
(cherry picked from commit dd4d8ac292)
2019-10-11 14:40:48 +00:00
291cd93ee0 api: fix non-null-terminated C-string
Type: fix

Change-Id: I132112bf77e1fad7fc0227a96e6b0cee590295e8
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit fb0bb3a732)
2019-10-11 11:51:09 +00:00
c1ee34f8d1 ipsec: initialize msgid and allow no dh in child sa
- set msgid to 0 not random.
- allow for no DH in ESP child SA

Ticket: VPP-1781
Type: fix
Signed-off-by: Christian E. Hopps <chopps@chopps.org>
Change-Id: Ibe26009d38f444eeaec5b042097f145d161c7672
(cherry picked from commit 0e182c5b1d)
2019-10-11 11:50:52 +00:00
3a61a40dd4 quic: Add Tx, Rx and packet drop counters
Type: feature

Change-Id: I25aeeed49fc569315296a73c5595c2e2e302434f
Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com>
(cherry picked from commit ff1f6faaa9)
2019-10-11 11:47:27 +00:00
4adcdcd197 session: fix use-after-free
Make sure to reinitialize data before free-ing it.

Type: fix

Change-Id: I45727c456d0345204d4825ecdd9690c5ebeb5e94
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit d4aeb84c3f)
2019-10-11 11:46:42 +00:00
88af6c3f4a quic: add cli command for stats
add command to display stats from quicly (rtt, packet loss)

Type: feature

Change-Id: Iaa18bc78fbf80a9367ef150a8cf4997a456c6b39
Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com>
(cherry picked from commit 922f0b211c)
2019-10-11 11:46:14 +00:00
63f2b46a8c build: build-root/Makefile rm of install tree
Type: fix

The scenario is touch of a dpdk source file in places like
<TOP>/build-root/build-vpp-native/external/dpdk-19.08/.  The subsequent
build will trigger an rm -rf $(PACKAGE_INSTALL_DIR) by
build-root/Makefile at around line 709.  Because the package in
question, "external", consists of various "sub" packages, all of which
are controlled with files like .quicly.install.ok located in
build-root/build-vpp[_debug]-native/external, we end up not handling the
.*.install.ok files to reflect the removal of that PACKAGE_INSTALL_DIR.
This fix will correct that, at least for the case of touching/changing
dpdk files. A better long term solution would be to change the "sub"
packages to be full fledged build system packages, as Dave Barach points
out.

Signed-off-by: Burt Silverman <burtms@gmail.com>
Change-Id: Ia94ccaa2795cbf354b5921c3001a7141313b66be
(cherry picked from commit 839a7bce38)
2019-10-11 11:45:49 +00:00
340a3b1e49 hsa: fix vpp_echo mq locking
Type: fix

Change-Id: I18d2cde0baaed4134e8378c09aaa88693fb997f8
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
(cherry picked from commit 46b91ebb5c)
2019-10-11 11:45:25 +00:00
a3c45242b1 vppinfra: implement CLIB_PAUSE () for aarch64 platforms
Define CLIB_PAUSE () to generate the "yield" instruction. No significant
performance changes were observed for clib_spinlock_t and clib_rwlock_t.

Type: feature

Change-Id: I59eb996e61c7a16007517e57e6996567302c1657
Signed-off-by: Jason Zhang <jason.zhang2@arm.com>
Reviewed-by: Lijian Zhang <Lijian.Zhang@arm.com>
(cherry picked from commit 18512b002d)
2019-10-11 11:44:48 +00:00
3642782a27 tcp: custom checksum calculations for Ipv4/Ipv6
Type: feature

Based on the configuration, we can disable checksum offload capability
and calculate checksum while pushing the TCP & IP header.
This saves some cycles when VPP stack is used in legacy hardware devices.

Signed-off-by: Srikanth A <srakula@cisco.com>
Change-Id: Ic1b3fcf3040917e47ee65263694ebf7437ac5668
2019-10-10 15:46:18 +00:00
43b36af1fc rdma: prevent loopback of broadcast packets
TX queues must be created before RX queues on Mellanox cards in order to
not receive our own broadcast packets.

Type: fix

Change-Id: I32ae25a47d819f715feda621a5ecddcf4efd71ba
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit df213385d3)
2019-10-09 12:38:39 +00:00
4787d18b19 rdma: make sure pci subsystem is initialized
The rdma driver use the pci subsystem, make sure the dependency is
recorded.

Type: fix

Change-Id: Ibd613f623d355612881acc31b9423f2de13793a3
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 4a98388dae)
2019-10-09 11:11:46 +00:00
9f1cea03c8 dns: fix non-NULL terminated C-string
Type: fix

Change-Id: Ib030e6ac3386528901e0805d1ffe2eec033d819f
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 328c08d603)
2019-10-08 06:39:56 +00:00
11eb8e03ae vlib: fix old nodes vector overflow in refork
Type: fix

Change-Id: I81c4cf0ce87288bb2d3c7b9f31e9419290d588b4
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 5517bd3453)
2019-10-08 06:39:27 +00:00
07228c09a6 ipsec: fix use-after-free
When deleting interface from the API, 'hi' gets removed before
'h->sw_if_index' is copied.

Type: fix

Change-Id: I8e10108e9bdf95ab2fe002790d98262d583ca58c
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 8133c780a2)
2019-10-07 13:14:02 +00:00
c385270341 bonding: fix non-null-terminated C-string
Type: fix

Change-Id: Ibb7ba878b049b8b18e890c43fdd6324cb88d63b8
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 5c828bc1f2)
2019-10-07 13:13:41 +00:00
c8f447e71e api: fix use-after-free
Type: fix

Change-Id: I2a599c22d5770587fdd419e5d212c8527054d2e9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit f26b2511cf)
2019-10-07 13:10:10 +00:00
8f4fccab9f bonding: traffic traversing the wrong interface
Missing an increment in the while loop. Hashes not stored in the array.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I603027f5a7305478f48a102ac8035ffde9102c53
(cherry picked from commit 0471cdbd3f)
2019-10-05 16:45:03 +00:00
ba55df18b5 hsa: fix non-NULL terminated C-string use in echo
Use '%v' format for non-NULL terminated vectors instead of '%s'.

Type: fix

Change-Id: Id83de52486ad8dad3cdf3f32dad63a223fc1fdf7
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit bb5ff4e4bb)
2019-10-04 14:23:29 +00:00
f42f1d5db7 session: Fix missing elt regrab
Type: fix

Change-Id: Ie756c5477d989702e633aa0d42ca154ff32b4c9a
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
(cherry picked from commit 19e52c96dc)
2019-10-04 14:23:07 +00:00
2e6d739344 ipsec: support 4o6 and 6o4 for tunnel protect
Type: feature

Change-Id: Ib2352ca4c7abf4645f21fa16aaaf27408890a2bf
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit b325983a44)
2019-10-04 14:22:12 +00:00
24f486cb56 misc: add vnet classify filter set support
Type: feature

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I79b216d2499df143f53977e5b70382f6f887e0bc
(cherry picked from commit f5667c3055)
2019-10-04 14:21:39 +00:00
cefa74829a vlib: improve summary vector-rate statistics
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 a8df85ce1f)
2019-10-04 12:49:16 +00:00
b7c4a5c76f stats: fix per-worker stat vector length
Type: fix

Change-Id: I198a2312f5fc6e922c8a6c51ba7248ce6e236f81
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit dba00cad1a)
2019-10-04 12:01:05 +00:00
6af2886a08 session: allow transport cleanup in any state
Type: fix

Third time's a charm

Change-Id: I31555a35d2b51f49a93a2a213c28896b0cad4c09
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit b5a2f70569)
2019-10-03 16:21:12 +00:00
f13634f1ab rdma: fix non-NULL terminated C-string overflow
Type: fix

Change-Id: I584777825636347c116bd084e348858bcb1b7d75
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 7ff07354c3)
2019-10-03 16:20:03 +00:00
513a74b855 session: fix io_evt mq locking
Type: fix

Change-Id: Iaa8045bba19cc305c84074668a20e1468d431b10
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
(cherry picked from commit 35174b428b)
2019-10-03 16:16:17 +00:00
c00898c485 tests: add quic plugin qclose/sclose tests
Type: test

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I3122b038f7d77c7e5e8ee7c24046da6c94ca2d2c
(cherry picked from commit 83c1e9a35b)
2019-10-03 16:15:45 +00:00
f2c754caa9 ip: fix use-after-free in reassembly
- ip{4,6}_reass_finalize() frees the reassembly context: do not access
it after the call.
 - traces access reassembly context: free it after and not before
tracing.

Type: fix

Change-Id: Ia3aaea9c7b74932e249e013be04b9bd7298fd187
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 2d0ebd7ebc)
2019-10-03 16:14:36 +00:00
bebbd7f62d classify: use vector code even when data is not aligned
Type: feature

Change-Id: I8f5f4841965beb13ebc8c2a37ce0dc331c920109
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 8304933922)
2019-10-03 16:12:23 +00:00
35a265ceae ip: respect buffer boundary when searching for ipv6 headers
Type: fix

Change-Id: I5a5461652f8115fa1270e20f748178fb5f5450f2
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit 769145cdbc)
2019-10-03 16:11:41 +00:00
09c91fe627 session: fix unbind coverity warning
Type:fix

Change-Id: If4fce6bd9b06ed545d72df847afd6a74cdefe042
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit eef61bb81a)
2019-10-03 15:11:24 +00:00
591aa64e81 ipsec: add insecure option for format of SA
If specified, shows keys, otherwise redacts. This change sets this flag
in the existing CLI code (thus maintaining the old behavior). The use
case for not specifying the insecure flag (and thus redacting the keys
from the show output) is for log messages.

Type: feature
Signed-off-by: Christian E. Hopps <chopps@chopps.org>
Change-Id: I8c0ab6a9a8aba7c687a2559fa1a23fac9d0aa111
(cherry picked from commit 01d61e7881)
2019-10-03 10:09:14 +00:00
2d986799b5 vcl: initialize ctrl_mq in workers
Type: fix

Change-Id: I1b9c8b0f9292f039b941e18d8aca5d734d5f1e77
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 22ba3303d8)
2019-10-03 10:08:53 +00:00
432fe38b61 ipsec: allow null cipher with dpdk esp
The NULL cipher is a (valid) non-AEAD choice for ESP encrypt path.
Allow it.

Type: fix
Signed-off-by: Christian E. Hopps <chopps@chopps.org>
Change-Id: I6d8b66223a0ffb0952c2dd6fa898a8a2289fef7a
(cherry picked from commit 5a2426386d)
2019-10-03 10:07:17 +00:00
41e96bbc64 ipsec: fix memleaks in ikev2 openssl code
- Need to always free created contexts
- Always pair init with cleanup for older openssl API.

Type: fix
Signed-off-by: Christian E. Hopps <chopps@chopps.org>
Change-Id: Ie8840403bcac500c20085d57240401ad39d119f8
(cherry picked from commit 9a5aab34f5)
2019-10-03 10:06:58 +00:00
cb671c3e13 udp: do not send received packets to error-drop
This tends to pollute the error counter.

Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
Change-Id: Idb628e767b074a5ee7e00d001bc88c378d7b8d0b
(cherry picked from commit 8fadb658a1)
2019-10-03 08:44:50 +00:00
1e937f8a88 session: fix cleanup in closing states
Type: fix

Change-Id: Iccc283bb98d3bb459a711ec2b74d6a32ad12903b
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 54c93cfc25)
2019-10-03 08:44:24 +00:00
e8bcb944c5 fib: fix some typos in fib/mtrie
Type: fix

Change-Id: I1af0e4a9bc23a3b6b6d3a74df093801ab6cae1f8
Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
(cherry picked from commit 33af8c1ed8)
2019-10-03 08:43:47 +00:00
d46055e868 ip: refactor reassembly
this is a preparation step for introducing other reassembly types

Type: refactor

Change-Id: I197e299dbd729b00eead31667913b8ceff915d63
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit 896c896a3c)
2019-10-03 08:43:03 +00:00
3f6e370ebd papi: truncate long logger messages
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 5e2f84d2cf)
2019-10-03 08:42:41 +00:00
29dc11bde2 vlib: add flag to explicitelly mark nodes which can init per-node packet trace
Type: feature

Change-Id: I913f08383ee1c24d610c3d2aac07cef402570e2c
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 7ca5aaac10)
2019-10-03 08:42:13 +00:00
c0552134ed build: pass 'no-pci' to autgenerated config
Avoid aggresive hiijack of pci interfaces when 'make run' and
'make run-release' are used and there is no startup.conf present.

Type: feature

Change-Id: Id653b5f9ac3d2935a40299885e616960e75d4a95
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit be7ef3b5c2)
2019-10-03 08:41:52 +00:00
5308ce13f6 gbp: fix contract rule handling
Fix a memory leak when removing old GBP contract rules and make sure a
GBP contract rule exists when matching the corresponding ACL rule.

Type: fix
Fixes: 13a08cc098

Change-Id: Iba67d573e69280ad998488a7a3d3462341c68ea4
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 44ca60ecdb)
2019-10-03 08:41:20 +00:00
68ac86e923 hsa: fix typo in vpp_echo for tx-buf
fix typo and allow use of Gb, Mb or Kb for tx/rx-buf sizes

Type: fix

Change-Id: I2cfd4c09d6b14dd5c744d942eea09ca9ddcc0f46
Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com>
(cherry picked from commit bb73ae7b14)
2019-10-03 08:40:55 +00:00
cec9496dd5 nat: fix update of outside fibs (output-feature)
NAT hasn't worked when NAT interfaces wasn't in
default VRF (fib_index = 0). This issue has been occurred with
interfaces with output-feature in endpoint-dependent mode.

Update VAT commands:
  - update nat44_add_del_address_range
  - add nat44_interface_add_del_output_feature

Ticket: VPP-1732
Type: fix

Change-Id: Iddea15dde4b948f159a0056d48c55bd917037fd1
Signed-off-by: Dmitry Vakhrushev <dmitry@netgate.com>
(cherry picked from commit 6c57a4a985)
2019-10-03 08:40:25 +00:00
ad32207681 ebuild: Add MAKE_PARALLEL_FLAGS to VPP build
Align with other packages.

Type: make

Change-Id: I3c8f5c6a349ce9d4e05f546945ae2d8dcf3b1b61
Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
(cherry picked from commit 1c887d9362)
2019-10-03 08:39:31 +00:00
d3d71352cb classify: remove includes from classifier header file
Type: refactor

Change-Id: I6f0af1c3078edce1c1b29a8b99c4a232d7084d33
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 864d857c6c)
2019-10-03 08:39:00 +00:00
4ce47210e9 hsa: refactor vpp_echo failure handling
- Return unique value for each failure condition
- Last failure value returned
- All failures included in description
- Output failure value and description

Type: test

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I72d5e7f660ad4765c468874421622607af6ae3d1
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
(cherry picked from commit 0e402a98b2)
2019-10-03 08:38:29 +00:00
4767cf24f4 vcl: allow non-blocking connects
Type: feature

Change-Id: I55349f482ce6781337f747b2f0d2c0a027c3a675
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 57c88938f8)
2019-10-03 08:36:14 +00:00
98780be1cd ip: mfib CLI 'via local' fix
Type: fix

Change-Id: I6fd7bb27b95a50d37424f65dc51e8b341f8b1b28
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit eacc8c5943)
2019-10-02 13:16:58 +00:00
da3cc716c0 session: validate connection in session lookup del
Type: fix

Change-Id: I4e2617f99064c5a96e4debae8b68716ca129ee73
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit e1e7fb88e4)
2019-10-02 01:50:20 +00:00
d4aa3d9f88 tcp: use sacks for timer based recovery
Type: feature

If available, reuse sack scoreboard in timer triggered retransmit to
minimize spurious retransmits.

Additional changes/refactoring:
- limited transmit updates
- add sacked rxt count to scoreboard
- prr pacing of fast retransmits
- startup pacing updates
- changed loss window to flight + mss

Change-Id: I057de6a9d6401698bd1031d5cf5cfbb62f2bdf61
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 36ebcfffbc)
2019-10-02 01:49:36 +00:00
45aab261a1 ip: fix memory leak in ip_dump handler
Type: fix

A vector allocated by vl_api_ip_dump_t_handler() was not being
freed.

Change-Id: I13425b8087e60df60c6aaa1230aa7e6d60b101a8
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit 6d5f659255)
2019-10-02 01:45:09 +00:00
4afd0a1298 session: avoid transport cleanup if previously deleted
Type: fix

Change-Id: I485d38c7d9473e2ad1cbd8e17a788ec8d29ab001
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit cac31a4a23)
2019-10-01 22:06:54 +00:00
bd05baee48 hsa: fix vpp_echo stats output
- Output stats when there are missing timing events
- Add missing timing event status to the stats output

Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I10a8db6db9568b98379df544d0098f9722a44867
(cherry picked from commit 789ac9de06)
2019-10-01 18:36:01 +00:00
90ac1abeec session: move ctrl messages from bapi to mq
Type:refactor

Moves connect, disconnect, bind, unbind and app detach to message
queue from binary api. Simplifies app/vcl interaction with the session
layer since all session control messages are now handled over the mq.

Add/del segment messages require internal C api changes which affect all
builtin applications. They'll be moved in a different patch and might
not be back portable to 19.08.

Change-Id: I93f6d18e551b024effa75d47f5ff25f23ba8aff5
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 458089bbad)
2019-09-30 16:46:38 +00:00
ff596d93f3 tcp: fix unformat cwnd multiplier
Type: fix

Change-Id: Ife4e650cb8b16f84ca6f77ba7b1d17a0f452fc3f
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 1df833e6de)
2019-09-30 16:45:48 +00:00
59ffe5ea1c fib: do not dump no-longer valid adjacencies
In some cases, we can refer to no-longer adjacencies (eg. in traces). Do
not dump them in this case as they are probably incorrect (memory can be
reused).

Type: fix

Change-Id: Ib653ba066bb6595ec6ec37d313a3124bce0eeed3
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 138c37af52)
2019-09-30 15:34:52 +00:00
804a95cf81 gbp: remove loopback interfaces between tests
Type: fix

Change-Id: I440f25b95b23b717518d101a1327ecf16d6ba39a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit d51880c5de)
2019-09-30 15:34:34 +00:00
a30d969297 session: fix msg freeing on error
Type: fix

Change-Id: I0807f84737d5e98e69e9ed27a1de6813b2ddd138
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
(cherry picked from commit 1afa7afffa)
2019-09-30 15:32:48 +00:00
296513b590 tcp: refactor congestion event handling
Type: refactor

Minor cleanup to congestion event handling.

Change-Id: I7179ff9e21c1853382ba814652c9024f3e5b8a37
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit afef8bf223)
2019-09-30 15:32:24 +00:00
8e4afc86d2 session: builtin app rx notifications regardless of state
Type: feature

Provide rx notifications to builtin apps even after disconnect.
Consequently tcp connections that are past FIN_WAIT_1 can still receive
rx notifications.

This is not currently supported for external applications.

Change-Id: I529da7f7120b0e7c62c5026ac71f86d6b5196cf4
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 5c29029ef0)
2019-09-30 15:30:00 +00:00
2fa9f679c8 ikev2: add support for GCM cipher
Type: feature
Change-Id: Ic703015b55f0ae947e5e44b10b74b3c79efe7da6
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit de2dd6c356)
2019-09-30 15:29:23 +00:00
bc49679802 tests: split up the long running IPSec tests into separate classes
Type: test
Change-Id: Ieeae7f1653f5f2e8e49f258871b389ef8954c90b
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit fbc388986e)
2019-09-30 15:29:08 +00:00
0aff6ecda7 quic : refactor function naming
- functions renaming to be consistent with the other plugin functions name
- removing useless logs

Type: style

Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com>
Change-Id: Iea212a799448975e01a92f16cc329de13907ff07
Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com>
(cherry picked from commit b28349e891)
2019-09-30 15:27:39 +00:00
69460ae11c tcp: compute snd time for rate sample
Type: feature

Change-Id: I6bd675dc28dbc34293e895911efe986844c0564f
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 7436b43673)
2019-09-30 15:27:12 +00:00
079895d95f session: limit pacer bucket size
Type: feature

Change-Id: I3ca27b09670716eba463d7b16771f765a1bd6dcd
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 7c8f828ba3)
2019-09-30 15:26:18 +00:00
3d7e472309 vlib: fix cli process stack overflow
Some cli processes, including bringing up an i40e interface with dpdk,
consume more than the currently available stack space.

Type: fix
Fixes: VPP-1774
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
Change-Id: I86ceb9e6e07523d5e0f760b5922467f09a8d4006
(cherry picked from commit 735d2e202b)
2019-09-30 15:25:52 +00:00
faf5195e3a http_static: add dynamic GET / POST method hooks
Add .json output to format_vnet_sw_interface_cntrs(...)

Type: feature

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ied036ebfaaafbf1dfc2a4e396c00f09f40659400
(cherry picked from commit 5554c56a65)
2019-09-30 15:25:25 +00:00
e4de750843 vlib: cli support ctrl-w to erase left word
Type: fix
Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
Change-Id: I3ae7dc3858d0353764d629d6a9eff2bdab5f8768
(cherry picked from commit 67e4df144b)
2019-09-30 15:25:02 +00:00
b1ef5567b6 session: add session enable option in config file
Type: feature

Change-Id: I8f02873e75c6e890f6749806d4f02547f951c8ca
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
(cherry picked from commit 1292d19c79)
2019-09-30 15:24:38 +00:00
62042e618a hsa: Fix QUIC sessions count calculation
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
Change-Id: Ia53a41a30920f8af7cd00c6f809b32e7cc277b7a
(cherry picked from commit a786687ab4)
2019-09-30 15:24:19 +00:00
b7a6c5633c map: fix non-null-terminated C-string
Type: fix

Change-Id: Ia3a4693acd5eab234f60b37436c5b642b00bda46
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 3c7c613cf1)
2019-09-30 15:23:59 +00:00
8e35619169 dpdk: fix null-termination of strings
Fix problem with some strings not being null-terminated,
by using the vec_terminate_c_string macro in two places.
The problem was found using AddressSanitizer.
(Also make sure indentation is OK for those changes.)

Ticket: VPP-1772
Type: fix

Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Change-Id: Ib7826e3c322e58b649e2d7f6053786da618a5e9e
(cherry picked from commit 7fd402163c)
2019-09-30 15:23:24 +00:00
003dd32489 hsa: fix memory management bugs
Fix use-after-free and non-null terminated string.

Type: fix

Change-Id: Ibba2a6cae68c612a34477aa813b3bf27a0c8fc1f
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 58519563ac)
2019-09-30 15:23:02 +00:00
fcb879c96c quic: fix use-after-free
Type: fix

Change-Id: I5e5e37684e336ca992dae8ea1d39b1fb103802b1
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 6d6456ab42)
2019-09-30 15:22:43 +00:00
c811c43606 quic: fix non-null terminated hostname string
Type: fix

Change-Id: I089d359d5726050f32f69366547086216fdb3098
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit b840c773dc)
2019-09-30 15:22:20 +00:00
bda5886239 session: fix session filter range
Type:fix

Change-Id: I173f45bf3d90e6979675b2ac812a969539f02147
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 61a89f2b61)
2019-09-30 15:20:13 +00:00
2af93b2643 misc: fix shebang with missing env
This is needed for macos where /usr/bin/python[23] does not exist
and /usr/bin is write protected

Type: fix

Change-Id: Ia1b3c732248c78482993de532fa2ea96e376d90a
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
(cherry picked from commit 5c2f96436a)
2019-09-30 15:19:53 +00:00
e6b29a9df5 papi: let async calls return context
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 2f6e0c6002)
2019-09-30 15:19:29 +00:00
45a02523b1 ikev2: fix crash during IKE SA Init exchange
Type: fix

Change-Id: If827fe348fe35d1221d29f91b7e6ea1624d13999
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit b736e75d5b)
2019-09-30 15:19:09 +00:00
587eeecf0d quic: fix server opening stream immediately
Previously, if the first thing a server did was to open a stream and
send data, this could trigger a crash on the clilent side VPP as the
quic session wouldn't be allocated.

Change-Id: I43990ce2a71217d6719ecae4da60111d05fbcfc0
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
(cherry picked from commit ffbfe3a2d6)
2019-09-30 15:18:51 +00:00
9636f97482 build: fix unsupported CMake comparison operation
VERSION_GREATER_EQUAL is not supported before CMake version 3.7.

Type: fix

Signed-off-by: Jianlin Lv <Jianlin.Lv@arm.com>
Change-Id: Id690b7b7c26121f9d289ebd0aaea0860be63795f
(cherry picked from commit ea397f5a67)
2019-09-30 15:18:30 +00:00
d5e8ed7be1 stats: add /if/<n>/<n>/state for lacp interface state
Add /if/lacp/<bond-sw_if_index>/<slave-sw_if_index>/state

<bond-sw_if_index> is a vector of the bond sw_if_index
<slave-sw_if_index> is a vector of the slave sw_if_index
Content is the integer value of the lacp actor state. The state is actually
a bitfield as described in the lacp protocol spec.

Type: feature

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ic6eca8ce2a1acd2d858e4e50b7eac1d000ea08e5
Signed-off-by: Ole Troan <ot@cisco.com>
(cherry picked from commit 0f09a828ad)
2019-09-30 15:18:09 +00:00
b0888636de tests: run vapi tests by default
Type: fix

Change-Id: I7b190507446fca745fc4bc6abbdeed48f55abdb9
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-09-30 12:13:04 +00:00
c90f4363aa stats: fix per_worker vector rate heap
The per_worker counters were outside of the stats heap.
Also fixes the length of the per_vector counter.
A simple vector is two dimensional including a thread dimension.

Fixes: f89a6de8f0
Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I370bf9cb033d264f42df2723e01b768dc270792b
(cherry picked from commit a41b0b78a4)
2019-09-30 09:33:03 +00:00
2f77ee8919 lb: vpp hang when executing "lb flush" commands with more parameters.
- get all vip list.
- get all as list per vip.

Ticket: VPP-1778
Type: fix

Change-Id: I0d82f38960ef1264d04ac07589a555d01f6e8110
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
2019-09-30 09:32:47 +00:00
54e099f101 build: fix running error with vmxnet3_test_plugin.so
vpp_api_test load vmxnet3_test_plugin.so error:
"load_one_plugin:42:/vpp/lib/vpp_api_test_plugins/vmxnet3_test_plugin.so:
  undefined symbol: unformat_vlib_pci_addr"

Type: fix

Signed-off-by: Jianlin Lv <Jianlin.Lv@arm.com>
Change-Id: I444aa05d0bc3c4f4f25082388243f1adb305dd0a
(cherry picked from commit 082ebeba16)
2019-09-30 00:13:27 +00:00
4aee015225 libmemif: prevent crash in case of invalid connection handle
Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: I803c86a48e0148ef143026a5cd93e4510c4f0611
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
(cherry picked from commit bdf3ebe358)
2019-09-30 00:10:30 +00:00
2ff21af396 session: improve cli
Type: feature

Allow session cli filtering based on thread index, transport protocol,
session state and range of session pool indices. For instance

show session thread 1 proto tcp state ready range 0 20 verbose

Shows the session ids for the first 20 tcp sessions in thread 1 that are
in ready state.

To avoid excessive output that could reasult in the worker barrier being
held by the main thread for long periods of time, the session cli will
only output:
- session ids (verbose == 1) for a maximum of 50 sessions / worker
- verbose > 1 details for a maximum of 10 sessions

Change-Id: I2cfb351b548e2e0a1d5b4345810be613e2917d17
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 5bb23ecd09)
2019-09-30 00:08:22 +00:00
6702641f53 tcp: use rate sample rtt in recovery if possible
If in recovery and rate samples are taken for burts that have not been
retransmitted, use the rtt estimate.

Type: feature

Change-Id: I95028f492008457c959157aa4ee4c3435fa9c3f0
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 1dbda64b46)
2019-09-29 16:45:32 +00:00
dedb3c8d95 tcp: cleanup scoreboard after recovery
Type: fix

When recovering from congestion, remove last hole in scoreboard if it
covers all bytes sent above snd_congestion.

Change-Id: I752accd4590cd9bf553c35a1bb40a38c308c04f5
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 321cfa5fcb)
2019-09-29 16:41:21 +00:00
9dba3dbf03 tcp: handle sack reneging
Type: feature

Change-Id: I201155b1b92cf7e57310af726879dab039090582
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 558e3e0957)
2019-09-29 16:34:19 +00:00
6f3621d772 tcp: enable gso in tcp hoststack
Type: feature

Change-Id: If68d07fbe8c6f7fffd2f93c7e854367082927e4f
Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
(cherry picked from commit 1146ff4bcd)
2019-09-29 16:32:26 +00:00
56f1938ee2 tcp: cc algos handle cwnd on congestion signal
Type: refactor

Change-Id: I15b10a22d0d0b83075a0eef5ef8c09cf76989866
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 8b4114e52f)
2019-09-29 16:23:09 +00:00
0ad8477baf tcp: send rwnd update only if wnd is large enough
Type: feature

Change-Id: I3e97e05a31806afb6b2e84ecf05fb96d285db92e
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 017dc45243)
2019-09-29 16:22:19 +00:00
fbe948c813 tcp: force zero window on full rx fifo
Type: feature

Change-Id: I7c5684a9f88e56fd62d83a59c14c4e4a6f096b89
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 182d219833)
2019-09-29 16:21:06 +00:00
ea584d137d tcp: validate connections in output
Type: feature

This shouldn't happen unless connections are removed after buffers were
enqueued to tcp-output and before tcp-output runs. For instance, packet
is enqueued to tcp output and cleanup is called for connection.

Change-Id: Ib7dd82ffa6cfb21ff5068aba010e0a3497eeea13
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 78dae00881)
2019-09-29 13:15:45 +00:00
fe005b4045 ethernet: move dmac filtering to inline function
In eth_input_process_frame(), destination MAC addresses are
compared to the interface hardware address in a loop. Move
this to a separate inline function to facilitate making changes
to the filtering logic more cleanly.

Type: refactor

Change-Id: I0978f01667e78af5214dbbc9ba223f5b84ce6b7e
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit fa20d4c537)
2019-09-29 13:08:40 +00:00
bc5f2bcc2c session: avoid bihash list for session tables
Type: fix

Change-Id: I1dbc822061f43fcc25dfa5d1728f5c7575139f45
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 27eeb87f43)
2019-09-29 13:08:00 +00:00
d89329a90f gbp: fix set_mac() in unit tests
Do not use low-level sw_interface_set_mac_address() directly and use
higher-level set_mac() instead, otherwise interface local_mac and
configured mac are out-of-sync

Type: fix
Fixes: 25b049484f

Change-Id: I9366e7afb95ef00e25a94ca3b0e6309871169878
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit a03d25d327)
2019-09-29 13:07:26 +00:00
8d5959f45e tcp: fix rx min/max fifo size parsing
Type: fix

Change-Id: Iff4a13da654dbdf7f08bb6d0743b466a1e6be01b
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 4e1fcf4905)
2019-09-29 10:19:18 +00:00
e7e56def2e tcp: improve mss computation
Type: fix

Use different mss for v4 and v6 packets.

Change-Id: Ifcd322c1fd74f749a42bae671dd6cfed8c32b150
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit cedcf608fe)
2019-09-29 10:17:57 +00:00
1b13beb845 session : make sure session layer is enabled when cli operate the sessions.
Type: fix

show session rules tcp
vpp/src/vnet/session/application_namespace.c:34 (app_namespace_get)
 assertion `! pool_is_free (app_namespace_pool, _e)' fails
Thread 1 "vpp_main" received signal SIGABRT, Aborted.

Signed-off-by: Guanghua Zhang <ghzhang@fiberhome.com>
Change-Id: I3430339a598a92d0a38826471adeb4547b0b7df4
(cherry picked from commit fcd5e12b1c)
2019-09-29 10:17:24 +00:00
c2cfe5d8e5 quic: disable quic plugin by default
Change-Id: I8eb243e80ff043a23cb3efae186164dad6c11ca8
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
(cherry picked from commit baf1c7ccc1)
2019-09-28 20:24:34 +00:00
b73d1e91c5 ipsec ip tcp l2: multiarch nodes cannot be declared as static
Credits to ray.kinsella@intel.com who spotted the issue and identified
root cause.

Type: fix

Change-Id: I4afe74c47769484309f6aebca2de56ad32c8041f
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit d770cfc962)
2019-09-28 20:24:13 +00:00
e1204e5049 tests: fix centos detection
Type: fix
Fixes: defde0f870

Change-Id: Ib81e3610bd0fc22901a902dc76692f1951ead2b8
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit 3a350702ec)
2019-09-28 20:23:04 +00:00
b462d94038 session: move svm_fifo_clear_deq_ntf to before calling the app callback
Type: fix

in case the app requests another dequeue notification, it should not be cleared

Change-Id: I7e94e8e30ef098f87f5e7f4880af276970ee5b37
Signed-off-by: Vladimir Kropylev <vladimir.kropylev@enea.com>
(cherry picked from commit 5c89fbf286)
2019-09-28 20:21:22 +00:00
61b1d46db0 devices: fix issue of per_interface_next_index
Per interface, next hop graph node can be customized
with vnet_hw_interface_rx_redirect_to_node function,
but it doesn't work well for af-packet type interface.

In current implementation, with function
af_packet_set_interface_next_node invoked next hop graph
node index can be set to apif->per_interface_next_index,
but it's not set to next0 properly for packet processing
in af_packet_device_input_fn.

Type: fix

Signed-off-by: Michael Yu <michael.a.yu@nokia-sbell.com>
Change-Id: I8e132ddd1c3c01b6f476de78546d4a9389b3ff87
Signed-off-by: Michael Yu <michael.a.yu@nokia-sbell.com>
(cherry picked from commit 90b34ed67a)
2019-09-28 20:20:42 +00:00
a2c0637129 tcp: track zero rwnd errors
Type: feature

Distinguish between rcv window errors and errors after we advertised a
zero rcv window, i.e., potential window probes.

Change-Id: I6cb453c7aaae456c0a05a8328cfaa55eaca10bf7
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit a495a3ea14)
2019-09-28 20:15:44 +00:00
6cf2fde9bb ip: remove unused function parameter
Type: refactor

Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
Change-Id: I8674ff5f6f6336b256b7df8187afbb36ddef71fb
(cherry picked from commit e7eba48937)
2019-09-27 16:54:02 +00:00
7f85aecb5c lacp: continuing input packet trace from device driver
lacp gets the packet from the device driver. Let's continue the input
packet trace's trajectory instead of restarting it in lacp-input.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I4d4537e050742a23f74287086d38d39673ebd60f
(cherry picked from commit 977c1dec69)
2019-09-27 09:38:51 +00:00
154e4a6cb7 svm: fix fifo hdr freelist allocation
Type: fix

Change-Id: Ia362ad821db1fd506e973e1844cc3ec74703cc17
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 73cad33b56)
2019-09-27 09:36:42 +00:00
997f95e11a hsa: clean up vpp_echo json output
Type: style

Change-Id: I8dbf2197b78690b94a346d6ff564648ab42f8235
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
(cherry picked from commit 374f706bff)
2019-09-27 09:36:17 +00:00
244bc6764e quic: enable stable quic tests
Type: test

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I041c011ee955acba656b774049b530efe1d50f22
(cherry picked from commit f3a8c08033)
2019-09-27 09:35:54 +00:00
b4a243723d dns: update the MAINTAINERS file
This complements the cherrypick done within
commit 46441cb9cd to sync up the file state
with the corresponding commits in master branch.

Type: fix
Ticket: VPP-1752

Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Idc82b1ad59adb0f7c185d27ced57e9a4c25ce62f
(cherry picked from commit 84a563ae40)
2019-09-27 09:32:03 +00:00
db418e8e7b avf: reduce default ITR interval
Type: fix
Fixes: b4ff07a

Change-Id: I361ec71944048734b73eec700e32531fb070194e
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 87f0dc7377)
2019-09-27 07:15:58 +00:00
c29681395a tap: fix tap interface not working on Arm issue
The VPP code tries to set all userspace memory in the table via IOCTL
to VHOST_SET_MEM_TABLE. But on aarch64, the userspace address range is
larger (48 bits) than that on x86 (47 bits). Below is an segment from
/proc/[vpp]/maps.

fffb41200000-fffb43a00000 rw-s 00000000 00:0e 532232
/anon_hugepage (deleted)

Instead of setting all userspace memory space to vhost-net, will only set
the address space reserved by pmalloc module during initialization.

Type: fix

Change-Id: I91cb35e990869b42094cf2cd0512593733d33677
Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
Reviewed-by: Steve Capper <Steve.Capper@arm.com>
(cherry picked from commit ba0da570f2)
2019-09-27 07:15:38 +00:00
2160efbaf1 stats: memory leak with per-node-counters on
vlib_node_get_nodes() creates a duplicate node structure which was never freed.

Type: fix
Fixes: 1ddbc0138b
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Ib1200854937faaa694b398607d2f0ba65aa81c01
(cherry picked from commit b6fde4a8ba)
2019-09-26 13:17:19 +00:00
c395ff1432 vppapitrace: add text output
Add new argument --todump, to mimic the VPP
api trace dump output.

Type: feature
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Ia8c845b321ef9d55dd6e2f388165ca5498406ab6
(cherry picked from commit a2ac36c917)
2019-09-26 09:14:46 +00:00
a2aa83ca93 misc: improve pcap drop trace output
Append <nodename>: <error-string> to pcap drop traces.

The data displays perfectly fine in [vanilla] wireshark, and makes it
100% obvious which node dropped the packet, and why.

Type: feature
Ticket: VPP-1776

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I9b964b99da4011b93723354db6ef0b128fca20cb
(cherry picked from commit 9382ad9b39)
2019-09-25 22:19:59 +00:00
731312df93 misc: unify pcap rx / tx / drop trace
Use a single vnet_pcap_t in vlib_global_main, specifically to support
unified tracing

Update sphinx docs, doxygen tags

Type: refactor
Ticket: VPP-1776

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Id15d41a596712968c0714cef1bd2cd5bc9cbdd55
(cherry picked from commit 33909777c6)
2019-09-25 22:19:59 +00:00
2cf5b1a1ec interface: fix pcap drop trace in case of vlan
Type: fix

Change-Id: If3c4e5c376b51a26143d8922dcacfbda534163bd
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 4e323cbdbd)
2019-09-25 22:19:59 +00:00
1b696ac9b3 misc: classifier-based packet trace filter
See .../src/vnet/classify/trace_classify.h for the business end
of the scheme.

It would be best to hash pkts, prefetch buckets, and do the primary
table lookups two at a time. The inline as given works, but perf
tuning will be required. "At least it works..."

Add "classify filter" debug cli, for example:
classify filter mask l3 ip4 src dst \
  match l3 ip4 dst 192.168.2.10 src 192.168.1.10

Add "pcap rx | tx trace ... filter" to use the current classify filter chain

Patch includes sphinx documentation and doxygen tags.

Next step: device-driver integration

Type: feature

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I05b1358a769f61e6d32470e0c87058f640486b26
(cherry picked from commit 9137e54006)
2019-09-25 22:19:59 +00:00
2abe699d10 interface: use the correct condition for checking if the pcap fd is open
The 9af7e2e87e used a comparison that fd is >= 0 to check that
the pcap needs closing. While the pcap_close() function does
reset the file descriptor to -1, the freshly initialized structure
has it equal to 0.

This causes the VPP to close stdin if the packets are being seen
on pg interface without the capture file being opened.
This triggers the vpp attempting to read from STDIN
(another bug), which results in running out of memory.

Change-Id: I11d61422701500a9b3e0dd52d59383f297d57f54
Type: fix
Fixes: 9af7e2e87e
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit 4da1506d39)
2019-09-25 22:19:59 +00:00
cbc5e50caf interface: fix pcap_write function
when use pcap cli to capture pcakets into two files rx01.pcap && rx02.pcap,
the first time:
1)pcap rx trace on max 100 intfc any file rx01.pcap
2)......the process of capture data to buffer......
3)pcap rx trace off

the second time:
4)pcap rx trace on max 100 intfc any file rx02.pcap
5)......the process of capture data to buffer......
6)pcap rx trace off

the pcap_write function bug in this two lines
pm->n_packets_captured = 0;
if (pm->n_packets_captured >= pm->n_packets_to_capture) referring to calling pcap_close()
will result in that the twice pcap cli both writes the packets
into rx01.pcap, but nothing into rx02.pcap. Beside, the rx02.pcap
file will not be created.

solution: separate the pcap_close() out of pcap_write()

The automatic cherrypick did not work, so
the manual cherrypick of commit 9af7e2e87e6a11fb69309fc9ce4432acbc4e3
was performed as follows:

0) git checkout stable/1908
1) git checkout -b stable-1908-history-rewrite
2) git rebase -i d1e17d00bb81659bf9e45caa62482bf7029d98f7~1
3) in the editor, mark the second commit as "edit", search for the following commits
   and edit as in the snippet below:

  edit 30d28bdfd api: enforce vla is last and fixed string type
  drop 4c19bfd93 vlib: clean up the "pcap dispatch trace" debug CLI
  pick 4aef0dd82 dpdk: fix extended stats
  edit 1dafb7fd8 dpdk: initialize rte_mbuf during mempool dequeue
  drop 4b943d632 misc: clean up "pcap [rx|tx] trace" debug CLI

4) close the editor
5) git cherry-pick 9af7e2e87e
   (it applies cleanly)
6) git rebase --continue
   (rebase of a 1000+ patches)
7) at prompt - git cherry-pick -x e5948fb49a
8) git rebase --continue
9) at prompt - git cherry-pick -x b97641c79f
10) git rebase --continue
11) the rebase finished.
12) git checkout stable/1908
13) git diff stable/1908..stable-1908-history-rewrite | patch -p1
14) discard the whitespace-only hunk
15) git commit -a -s; edit this commit message

Type: fix
Change-Id: Iedeb46f9cf0a4cb12449fd75a4014f95f3bb3fa8
Signed-off-by: Jack Xu <jack.c.xu@ericsson.com>
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-09-25 22:19:59 +00:00
662aa2f853 hsa: fix http response
http_ok is a const null-terminated string, not a vector.

Type: fix
Fixes: 844a36d1a6

Change-Id: Ide1a23506d9f43cd33c3a4b8ba11658c67fbecc8
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit b6834750c0)
2019-09-25 22:09:31 +00:00
2736fc7fcf libmemif: introduce 'memif_per_thread_' namespace
APIs in 'memif_per_thread_' namespace are used to split the global
database into separate databases, to improve multi-thread use cases.

Using 'memif_per_thread_init' client can create separate libmemif
databases (libmemif_main_t). Client will reference these databases
using memif_per_thread_handle_t. Each database requires unique socket.
Created interface will be stored in the same database as the socket
passed in connection arguments.

Example code: extras/libmemif/examples/icmp_responder_3-1/main.c

Type: feature

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: I261563ecc34761a76e94f20c20015394398ddfd7
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
(cherry picked from commit 17f2a7bbf2)
2019-09-25 22:09:12 +00:00
17b7a067a2 ipsec: Fix NULL encryption algorithm
Type: fix
Ticket: VPP-1756

the block-size was set to 0 resulting in incorrect placement of the ESP
footer.

add tests for NULL encrypt + integ.

Change-Id: I8ab3afda8e68f9ff649540cba3f2cac68f12bbba
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 2cdcd0cf40)
2019-09-25 22:09:00 +00:00
53616f5caf rdma: fix pending packets check on tx
Fix coverity CID 203636: Control flow issues  (NO_EFFECT).
This greater-than-or-equal-to-zero comparison of an unsigned value is
always true. "n_left_from >= 0U".

Type: fix
Fixes: e7e8bf37f1

Change-Id: Ibbf8c82defb12d6d532345eea657d5f300e6a514
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-09-25 22:08:43 +00:00
4fffc536f4 rdma: use rings for buffers management
Refactor rdma driver for improved performance and prepare for raw
datapath access.

Type: refactor

Change-Id: Iae31872055a6947708ea9f430bd1dc083ea63b5a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-09-25 22:08:43 +00:00
264dce73a5 quic: Fix listener vpp_session_handle
Type: fix

Change-Id: I19f70403e15cd180e9d337fbdad47191de333b34
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
(cherry picked from commit 50059cca89)
2019-09-25 22:08:17 +00:00
9e028d0477 avf: print queue id in packet trace
Type: feature

Change-Id: If3deb26b9ee3b9e677c9dc50789bf81fe6c11dee
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit c33eddebe8)
2019-09-25 22:07:48 +00:00
d8aa2ae327 lacp: mark is_mp_safe for show and dump binary API
show and dump binary APIs for lacp neighbors are running in the same thread
as the create and delete interface. There is no need for barrier lock.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Id584bd7408210fcc23b464ef2084f11f88bca58b
(cherry picked from commit cda35b38d7)
2019-09-25 22:07:01 +00:00
34f17c4472 interface: Remove residual dpdk bonding code
dpdk bonding code was removed in 19.08. However, there are still references
to VNET_SW_INTERFACE_FLAG_BOND_SLAVE which was set by the already removed
code.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I949a7281e6273f2733dd7532cc4a3bb4f3ce30de
(cherry picked from commit 5ad541eeaa)
2019-09-25 22:06:43 +00:00
d4895f2fcf tcp: fix byte tracker samples flush
Type: fix

Change-Id: I3b4cb8fc17387693d6ad6cdef004ca99cd56bc23
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 92f190a802)
2019-09-25 22:06:20 +00:00
56417fa946 ipsec: Add 'detail' option to 'sh ipsec sa'
Type: feature

with detail option prints all details for all SAs

Change-Id: Ic3c423c085dfc849cf9c3e18a6f624b82150d961
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 670027a506)
2019-09-25 22:06:05 +00:00
41fd164872 ip: reassembly: remove unnecessary code
Type: refactor

Change-Id: I30cb324006c3c6ab88d01c044cf80fab3a34f13a
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit 8e9e0eccb2)
2019-09-25 22:05:36 +00:00
6f8097ba6e ip: fix merge issue
Signed-off-by: Klement Sekera <ksekera@cisco.com>

Change-Id: Idd64b0b3eedb7179f6d316b66cea8160ad577990
Type: fix
Fixes: 630ab5846b
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit 95e091b268)
2019-09-25 22:05:36 +00:00
69bf8326f1 ip: reassembly: send packet out on correct worker
Note which worker received fragment with offset zero and use this worker
to send out the reassembled packet.

Type: fix
Change-Id: I1d3cee16788db3b230682525239c0100d51dc380
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit 630ab5846b)
2019-09-25 22:05:36 +00:00
51699e62c4 tests: support worker threads
Add support for specifying the worker thread when adding packet stream.

Type: feature

Change-Id: I8a98b91c211e60cd53e1166f9f51365394ecacfd
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit 4ecbf105a4)
2019-09-25 22:05:36 +00:00
00127d6999 vlib: fix null pointer crash on strncmp
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff4b71de0 in __strncmp_sse42 () from /lib64/libc.so.6
(gdb) up
up
    vm=0x7ffff6664d40 <vlib_global_main>, addr=0x7fffb4bec6d0,
    ids=0x7fffb31675f0 <avf_pci_device_ids>, handle=0x7fffb4bec594)
    at /usr/src/debug/vpp-20.01/src/vlib/linux/pci.c:1250
1250	  if (strncmp ("vfio-pci", (char *) di->driver_name, 8) == 0)
(gdb) p di
p di
$1 = (vlib_pci_device_info_t *) 0x7fffb6446164
(gdb) p di->driver_name
p di->driver_name
$2 = (u8 *) 0x0
(gdb)

driver_name may be null. strncmp is not forgiving. Change to use C11 safeC
version.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I1777a5966ceee7409d7bde86c30b14dc75534a5a
(cherry picked from commit ab4899257a)
2019-09-25 22:03:11 +00:00
7cd964ee45 lb: fix memcpy error issue
vl_api_prefix_t size is 21 byte, ip46_address_t size is 16 byte, only copy
16 byte of vl_api_prefix_t to ip46_address_t is not correct.

Type:fix

Change-Id: I35ede7836a0c878d39388b29b15d91bb08f87a07
Signed-off-by: Yulong Pei <yulong.pei@intel.com>
(cherry picked from commit 71f36067ca)
2019-09-25 06:48:00 +00:00
54ff3fc834 sr: fix sr_set_encap_source reply
Can we get a reply macro that would avoid such copypaste errors?

Type: fix

Change-Id: I753efb1d82fced668c27f2e44b0318bfd31c0a23
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
(cherry picked from commit 1096b46d9b)
2019-09-24 21:00:00 +00:00
074b711f7b hsa: move udp_echo to vpp_echo
Type: refactor

Change-Id: I9b8bc4e54bfae9fa3ed367d4a9676fb09c27fb2a
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
(cherry picked from commit dee4c2e403)
2019-09-24 20:56:08 +00:00
9db3dee1a0 misc: missing ntohl for bond_slave's custom dump
sw_if_index argument is u32 and it needs to be converted to host order
for format in custom dump, a very highly sophisticated stuff.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ie6d49a17e4411df5d567dbb2a7c95993dceda31b
(cherry picked from commit 58caa37dca)
2019-09-24 20:55:52 +00:00
6aba16230c avf: fix init when num_rx_queues > num_tx_queues
Type: fix
Fixes: ae91180

Change-Id: Id93b0f4d23ad7022e341e305bbd93ef2fff5787d
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 017002ae35)
2019-09-24 20:55:40 +00:00
e73bd85033 tcp: add option for always on event logging
Type: feature

Add option to always compile in debugging infra. Debug verbosity can be
controlled via configuration updatable via cli. Compile time inclusion
and configuration of event logging verbosity is still available in order
to minimize event logging impact.

Change-Id: I9d946efe9fa4204fdace1adb1d6588c97b5ae758
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit a436a42221)
2019-09-24 20:55:30 +00:00
99691949a5 vcl: fix ldp_set_app_name overflow
In case of overflow, we null-terminate the parameter ('app_name')
instead of ldp global name ('ldp->app_name').
Moreover, snprintf() always safely null-terminate the destination string
even in case of overflow.

Type: fix
Fixes: 048b1d6ab7

Change-Id: I4d8b0e020a228e982b6699d652b341c5afe92993
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 747b3d8b0e)
2019-09-24 19:09:08 +00:00
2e0f929b60 quic: fix rx_callback refactoring
* check_quic_client_connected might allocate ctx
and invalidate our pointer

Type: fix

Change-Id: I885ca5a1a6db9a7765c9047a7df9cdf66c94f1cb
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
(cherry picked from commit 1682b51c41)
2019-09-23 12:41:15 +00:00
a583e2d75b hsa: move tcp_echo to vpp_echo
Type: refactor

Change-Id: Ic23859a1686eff2ae4d08a86b69ff4813498459e
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
(cherry picked from commit a8462fbca3)
2019-09-23 12:41:05 +00:00
fd3b9207a6 tests: Revert "Tests: Example duplicate code refactoring."
This reverts commit 6955595a57. The result
is that test filtering for reassembly tests works again.

Type: fix

Change-Id: I4acb094b5b4aa264745986afa0bb0528789807b3
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit 947a85c779)
2019-09-23 12:40:51 +00:00
4db04c021d vppapigen: remove python2 support
vppapigen has been running under python3 for months.
Remove the python2 conditional code.

In case of an error, explicitly log and return non-0.

Type: refactor
Change-Id: I20a73e0f2cb875aab6441959a85a35e88c9f8250
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
(cherry picked from commit 2cd3cc8a60)
2019-09-23 12:40:39 +00:00
1be8581c6f tcp: forward conn resets through tcp-output
Type: refactor

Change-Id: I5718853d89ebeae9d66be975a803a3674bec5986
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit df36f4963f)
2019-09-21 15:21:03 +00:00
4c737a7e54 tests: fix test-checkstyle to check plugin tests
Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I93eb0ae4338247fa2479f8e419483d1593436dc7
2019-09-21 13:47:32 +00:00
0dda2a37ba vppinfra: Update "show cpu" output for AArch64 chips
- Allow "Microarch model(family)" row to show PASS
revison as either string (like A0, B0) or number (like
1.0, 2.0).
- Fix part number for Marvell CN96XX

Type: refactor

Change-Id: Ie01a3960c4e5e481be354dc8bb60f744e5c65737
Signed-off-by: Nitin Saxena <nsaxena@marvell.com>
(cherry picked from commit c9122f9739)
2019-09-21 09:49:18 +00:00
c51d2afbb1 dpdk: fix ipsec coverity warning
Type: fix
Fixes: 5025d40a11

Update the expression for a conditional block which should be executed
when an encrypted packet will be sent via IPv6. Coverity was
complaining that a NULL pointer could be dereferenced. It is unclear
whether that ever would have actually happened, but the updated
expression should quell the warning and should more accurately detect
whether the block for IPv6 should be executed.

Change-Id: I731cad1f982e8f55bd44e6e05e98eff96f1957bb
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit c458f5c09a)
2019-09-21 08:29:14 +00:00
1348197c86 vlib: fix vlib_buffer_main_init_numa_node memory leak.
Type: fix

Signed-off-by: Guanghua Zhang <ghzhang@fiberhome.com>
Change-Id: I8252ed2555f5af6db2f12dc7c30e41cc1ec7dde0
(cherry picked from commit 785daf4f84)
2019-09-21 08:28:44 +00:00
62988dc632 build: fix vpp compilation failure on ThunderX2 and Amp
fix compile issue that caused by enabling "-mtune=thunderx2t99"
flag during compilation, such as
"/opt/vpp-agent/dev/vpp/src/vnet/interface_stats.c:164:1:
internal compiler error: Segmentation fault"

Type: fix

Change-Id: Iaf9f80a6c203a7e5b6a40523f14a62bb37091c92
Signed-off-by: Jianlin Lv <Jianlin.Lv@arm.com>
(cherry picked from commit 416e32cf92)
2019-09-21 08:28:17 +00:00
61d9c6bfdf ip: leverage existing vlib_buffer_advance
The function ip4_rewrite_inline_with_gso can leverage
the existing vlib_buffer_advance to simplify code.

Type: fix

Change-Id: I25d943dc78aba2f67654385cf3f693eb01e0210e
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
(cherry picked from commit a6659214aa)
2019-09-21 08:27:10 +00:00
fb53022e58 nsh: rewrite nsh_output_inline
Type: style

Change-Id: I0c870eddb427efa26cd5b52daf12b13c3927976a
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
(cherry picked from commit e16f6a77eb)
2019-09-21 08:26:36 +00:00
ffdfe308b9 rdma: add support for MAC changes
Type: feature

Change-Id: I5803b52d12e56f2ccc1316e89ece6f1c5898810a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 0dcafcc505)
2019-09-21 08:25:56 +00:00
5564db8532 dpdk: add TSO support in dpdk plugin.
Type: feature

You can enable tso in starup.conf like this:
dev 0000:86:00.0{
	tso on
}

TSO is disabled by default.

Change-Id: Ifdbaf5322f768c384aa54e532d7bf45e810ca01c
Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
(cherry picked from commit de5ed58fdb)
2019-09-21 08:25:35 +00:00
f5d6c80acc dpdk: QAT devices update, add c4xxx and xeon d15xx
Type: feature

Change-Id: I21f8f4563f5545a684b2666f7410847e0f7bc403
Signed-off-by: Jim Thompson <jim@netgate.com>
(cherry picked from commit 4d843b9940)
2019-09-21 08:25:13 +00:00
cbae1e1c5c rdma: add support for input feature arcs
Input feature arcs enable functions such as l2patch or bonding.

Type: feature

Change-Id: Ie333c9b8f7ea20f8a3a409a9a06367807e215a57
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 74eba446b1)
2019-09-21 08:24:45 +00:00
a267cba29c session: add explicit reset api
Type: feature

This can be used to forcefully close a session. It's only available to
builtin applications for now. Transports must support the reset api
otherwise normal close is used.

Change-Id: I5e6d681cbc4c8045385e293e0e9d86fa2bf45849
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit dfb3b87712)
2019-09-20 21:36:26 +00:00
7fe501a4b5 tcp: set cc_algo on connection alloc
Type: feature

Change-Id: Ie00329b11e26cab5db64b9c006171d283854c8ef
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 12f6936cd8)
2019-09-20 21:36:07 +00:00
82df1eb900 tcp: allow cc algos to set pacing rate
Type: feature

Change-Id: Ie7f0f5d2a476d401ede567e422abb953b2bb4a78
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit d206724e78)
2019-09-20 21:35:19 +00:00
bda2844c47 vppapigen: fix missing vla check for union class
Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Ie775cf3469d761847ac39cf0d80a3ec6463b7928
(cherry picked from commit d5a78a5310)
Signed-off-by: Ole Troan <ot@cisco.com>
2019-09-20 12:12:16 +02:00
c5dd20250b bonding lacp: deleting virtual interface which was enslaved may cause crash
Virtual interfaces may be part of the bonding like physical interfaces. The
difference is virtual interfaces may disappear dynamically. As an example,
the following CLI sequence may crash the debug image

create vhost-user socket /tmp/sock1
create bond mode lacp
bond add BondEthernet0 VirtualEthernet0/0/0
delete vhost-user VirtualEhernet0/0/0

Notice the virtual interface is deleted without first doing bond delete.
The proper order is to first remove the slave interface from the bond prior
to deleting the virtual interface as shown below. But we should handle it
anyway.

create vhost-user socket /tmp/sock1
create bond mode lacp
bond add BondEthernet0 VirtualEthernet0/0/0
bond del VirtualEthernet0/0/0   <-----
delete vhost-user VirtualEhernet0/0/0

The fix is to register for VNET_SW_INTERFACE_ADD_DEL_FUNCTION and remove
the slave interface from the bond if the to-be-deleted interface is part of
the bond. We check the interface that it is actually up before we send
the lacp pdu. Up means both hw and sw admin up.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: If4d2da074338b16aab0df54e00d719e55c45221a
(cherry picked from commit bac326cb7c)
2019-09-20 05:48:27 +00:00
69dd1f5bce devices: vhost-user crashes displaying show trace for deleted interface
After the trace is collected and if the interface is then deleted, show
trace may crash for the debug image. This is due to the additional check
in pool_elt_at_index() to make sure that the block is not free.

The fix is to do the check in vhost format trace and return "interface deleted"

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I0744f913ba6146609663443f408d784067880f93
(cherry picked from commit 5cd987dda6)
2019-09-20 05:47:48 +00:00
1d74eceb1f hsa: Refactor quic_echo to allow other protocols
Type: refactor

Change-Id: Iaef9091e1d057110530255e644fad1c298418966
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-09-20 05:47:01 +00:00
5ab1946466 quic: quic_app_rx_callback refactor.
Add quic_process_one_rx_packet() function

Type: refactor

Change-Id: Iecaec3f7fed9f95a25ea55d0251626beb79181fd
Signed-off-by: Mathias Raoul <mathias.raoul@gmail.com>
(cherry picked from commit f85770c4a1)
2019-09-20 05:46:23 +00:00
98f1527a54 misc: fix pcap rx/tx status command
Type: fix
Ticket: VPP-1775

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I48a1c385ccfabca84dfb61aac526c7f67d9822d3
2019-09-19 19:42:25 +00:00
b197fd7b67 ipsec: fix missed IPSEC_INTEG_ALG_MD5_96
This algorithm was missed in last improvements.

Type:fix

Signed-off-by: Dmitry Vakhrushev <dmitry@netgate.com>
Change-Id: Ib818cbdcdd1a6f298e8b0086dac4189cc201baa3
(cherry picked from commit 77cc14a2b2)
2019-09-19 18:18:28 +00:00
2dde5a4782 dpdk: ipsec tunnel support for ip6-in-ip4
Type: feature

If an attempt was made to send an IPv6 packet over an IPv4 tunnel,
the DPDK esp_encrypt did not complete setting up
the crypto operation for a buffer, but still queued the crypto
operations that were allocated. This results in a SEGV when
attempting to dequeue them in dpdk-crypto-input.

Allow IPv6 packets to be sent over a v4 tunnel when using the DPDK
plugin esp crypto nodes.

Change-Id: Ic9a4cd69b7fc06a17ab2f64ae806ec2ceacfef27
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit 5025d40a11)
2019-09-19 18:16:47 +00:00
1ffabcb3df stats: refactor header files
Performant stat segment scraping involves caching the results of
stat_segment_ls (...) and directly fishing counter data from the
shared-memory segment.

To do that, we need to publish several things previously hidden,
declared in stat_client.c:

o stat_client_main_t typedef
o stat_segment_access_t typedef
o stat_segment_access_start inline function
o stat_segment_access_end inline function

Type: refactor

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I3175e3d1f1fd8ea816336a584565179d1972115c
(cherry picked from commit 531969ef61)
2019-09-19 18:16:21 +00:00
6b9847e801 gbp: add local l3out redirect to local SEP unit test
Type: test

Change-Id: Ia6dad86d02f6f665a3e6960812b2527eaabb65f1
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-09-19 18:15:43 +00:00
da900b25c8 ip: allow addrs from the same prefix on intf
Type: feature

Adding a prefix to an interface was not permitted if it overlapped
with another prefix on an interface which used the same FIB.

Loosen the restriction. Allow 2 or more addresses from the same
prefix on a single interface. Reference count the prefix to figure
out when a glean/connected route for the prefix needs to be added
or removed.

Added unit tests to check that the route is only removed when all
addresses in the prefix are removed from the interface.

Change-Id: I1a962ecb5e1ee65fc6d41f98a4cc097a51a55321
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit 6c92f5babd)
2019-09-18 21:53:10 +00:00
f4dcae4164 misc: 19.08.1 Release Notes
NB: due to a API-breaking fix
(https://gerrit.fd.io/r/#/c/vpp/+/21762/)
for a critical issue that was necessary, we are deferring
the artifacts for 19.08

Change-Id: If4f73dd7bc2964cb0a765ee6006b944f075a423b
Type: docs
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-09-18 16:36:13 +00:00
7c33c343e8 memif: always enable zero-copy when creating memif using API
Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: I823b6297e1d2bdd438633ec7b877960e6d8423fa
(cherry picked from commit 6388235754)
2019-09-18 13:44:07 +00:00
50f8831068 build: fix rpm python 3 depends
Type: fix

Change-Id: Ie6eaccb27779bb14c0a23764a16cd22f0a72e379
Signed-off-by: Ed Kern <ejk@cisco.com>
(cherry picked from commit c63c0166ee)
2019-09-18 13:30:36 +00:00
e6a5712624 api: split vl_api_prefix into two
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>
2019-09-12 13:17:40 +02:00
4b943d6328 misc: clean up "pcap [rx|tx] trace" debug CLI
Separate debug CLI arg parsing from the underlying action
function. Fixes a number of subtle ordering dependencies, and will
allow us to add a binary API to control the feature at some point in
the future.

Type: refactor
Ticket: VPP-1770

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Id0dbeda06dad20e756c941c691e2088ce3c50ec7
(cherry picked from commit b97641c79f)
2019-09-10 15:20:08 -04:00
1dafb7fd83 dpdk: initialize rte_mbuf during mempool dequeue
In some cases it may happen that buffer is allocated by DPDK, and freed
by VPP native code. In such cases dpdk metadata is not reset, so we need
to do that during mempool dequeue. Template approach is taken to reduce
cost of that operation.

Type: fix
Fixes: 910d369

Change-Id: Ic239007cfc8fbceb965021c56963cda9d53f63be
Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-09-09 16:22:27 +00:00
4aef0dd828 dpdk: fix extended stats
Extended stats are not displayed due to incorrect condition.

Type: fix
Change-Id: Ie04664e6274137462dce832bf7ee06204cd77be5
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2019-09-09 16:19:23 +00:00
4c19bfd93f vlib: clean up the "pcap dispatch trace" debug CLI
Separate debug CLI arg parsing from the underlying action
function. Fixes a number of subtle ordering dependencies, and will
allow us to add a binary API to control the feature at some point in
the future.

Type: refactor
Ticket: VPP-1762

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I1240fe3f61a0acf5ee9faed60d6ad3386e72e569
(cherry picked from commit e5948fb49a)
2019-09-09 15:16:03 +00:00
30d28bdfd8 api: enforce vla is last and fixed string type
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 e5ff5a36dd)
Signed-off-by: Ole Troan <ot@cisco.com>
2019-09-09 09:59:48 +00:00
157f1cd349 ip: fix udp/tcp checksum corner cases
When checksumming chained buffers with odd lengths: insert a
NULL byte, or the calculation fails.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Signed-off-by: John Lo <loj@cisco.com>
Change-Id: I380f7c42897bdb28c8c29aa1c4cdaaa849cc9ecc
(cherry picked from commit c4abafd83d)
2019-09-07 03:49:39 +00:00
623a1b7053 tap: revert clean-up when linux will delete the tap interface
Type: fix
Ticket: VPP-1766

revert e4ac48e792

Change-Id: I03feea4008a47859d570ad8d1d08ff3f30d139ef
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-09-05 21:58:15 +00:00
5f652e762e crypto: add '-maes' compile switch
AES intrinsics use builtins available only with the -maes and GCC 9 just
started to enforce it.

Type: fix

Change-Id: Ia6825ea3eae7191a4bfee47f9fa93fad16ccf76c
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 561be280fe)
2019-09-05 15:34:38 +00:00
e21bb1e0c2 gbp: add unknown remote EP redirect unit test
Type: test

Change-Id: I1dfbeef08a4f112551450682fc4040820251485b
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-09-05 11:30:26 +00:00
bd939abcaf gbp: add remote EP redirect to remote SEP unit test
Type: test

Change-Id: I4dd685f9acd4d467e0967e6fdd428558ffc8b209
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-09-05 11:05:31 +02:00
d1d4043df2 quic: handle session migration notifications
Rely on the migrate callback to move quic connections to follow the
underlying udp connection placement.

Change-Id: Ia1cf3a16187bbe48f5afb3d1f444427f288ff79c
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
(cherry picked from commit 243e1933bb)
2019-09-04 17:42:37 +00:00
3ce1239b8e ethernet: fix dmac check avx2 loop condition
In eth_input_process_frame(), a loop which checks the destination
MAC address of received packets had a different condition for avx2
than it did for the non-avx2 version of the loop. It could result
in one unnecessary execution of the loop body after all packets
had been processed.

Type: fix
Fixes: 8d6f34e2b1

Change-Id: Ib673f45917a0dea461987fdc8f0ca318b749fb1a
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit a6d4e3135b)
2019-09-04 09:56:52 +00:00
5bdc1f5245 vppinfra: add bihash_init2
Add controls to list / not list a specific bihash in clib_all_bihashes,
to immediately initialize a bihash.

clib_bihash_init2 is now the primary API. It takes a typical args_t
structure. clib_bihash_init becomes a compatibility widget. It
fabricates an args_t and calls init2...

Type: refactor
Ticket: VPP-1758

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ib3e1304884997cf7025af20bdc67a7dda290f15b
(cherry picked from commit bdf9b97774)
2019-09-03 19:43:34 +00:00
08940a2cb8 tap: interface rx counter not increment correct
vlib_increment_combined_counter takes sw_if_index, not hw_if_index. Using
hw_if_index may work as long as there is no subinterface created to cause
hw_if_index and sw_if_index to differ.

Type: fix
Ticket: VPP-1759

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I6db042186eeeacf32250f7ef261af8cd6f5ce56e
(cherry picked from commit efa119db39)
2019-09-03 19:40:53 +00:00
fec95f8df7 vmxnet3: interface rx counter not increment correctly
vlib_increment_combined_counter takes sw_if_index, not hw_if_index. Using
hw_if_index may work as long as there is no subinterface created to cause
hw_if_index and sw_if_index to differ.

Type: fix
Ticket: VPP-1760

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: If50412dc1e84c4f1f5b977b58d0e1aeb5ab8ebe6
(cherry picked from commit ddf625d603)
2019-09-03 18:23:06 +00:00
f98993aaa1 nat: handoff traffic matching for dynamic NAT
Type: feature

Change-Id: I5c5af6f9acb340cc674323305104b8ce23e6d21d
Signed-off-by: Filip Varga <fivarga@cisco.com>
(cherry picked from commit 22bb417e91)
2019-09-03 10:15:07 +00:00
e48f5574f7 acl: perform a sanity check of ACL rules before creating ACL
Adding acl with incorrect arguments like 1.1.1.1/24 (instead of 1.1.1.0/24)
don't cause a disaster, but doesn't match either, as some might expect.

Add an explicit sanity check which returns an error.

Type: fix

Change-Id: Id1601f4b9c9887d3e7e70aac419d1f1de0c0e012
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-09-02 18:49:49 +00:00
de6faf9319 ip: ip6_preflen_to_mask incorrect result for prefix len > 64
The as_u64[0] in the result was not correctly filled in for
longer prefix lengths.

Type: fix
Fixes: 1c7104514c

Change-Id: I871772c618475396d1c1c4c699ff77e35097f07e
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit 59ac9c23c4)
2019-09-02 18:30:34 +00:00
404e24de56 gso: fix segmentation when gso_size greater than vlib buffer size
Type: fix
Ticket: VPP-1751

Change-Id: I5ffb078492adc97374290de404f2ec0102b75184
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 3f1964d2d2)
2019-09-02 11:55:53 +00:00
43a5b7cc44 dpdk: enable checksum offload for Intel SRIOV NIC drivers
Type: fix

Signed-off-by: John Lo <loj@cisco.com>
Change-Id: I3ee59106ba45164a4ee3788bf4dcf5bf4c2dc1c2
(cherry picked from commit 03598c4bcc)
2019-08-30 13:24:51 +00:00
dc4161eb85 avf: properly set irq queue masks
Type: fix
Fixes: ae91180

Change-Id: I9c55c3fdf41089d337b998e2e28abb23d81525ef
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 2ca9a84bd0)
2019-08-26 16:21:02 +00:00
9e25c7723d tests: move plugin tests to src/plugins/*/test
- Relocate plugin tests for 'make test' into
  src/plugins/*/test so that plugin test cases
  are co-located with the plugin source code.

Type: refactor
Ticket: VPP-1754

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I503e6a43528e14981799b735fa65674155713f67
(cherry picked from commit a43c93f855)
2019-08-23 17:31:08 -04:00
46441cb9cd dns: cherry-pick 21444, 21468 from master
Type: refactor
Ticket: VPP-1752

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ieaec721056531ba0c70538c9bf97769a0e80aefd
2019-08-23 10:54:24 -04:00
1c586de48c misc: 19.08 new features
The full RELEASE.md diff is b610f2022c

Change-Id: Ide6d85d41bdc836a03390a50ab94f6ebbaae0b28
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-08-21 17:46:52 +00:00
01685beada devices: skip checksum calculation if guest supports checksum offload
Set VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD for the interface
to skip checksum calculation if guest supports checksum offload.

Type: fix
Ticket: VPP-1750

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ie933c3462394f07580ef7f2bec1d2eb3b075bd0c
(cherry picked from commit a75ad87640)
2019-08-20 23:02:48 +00:00
2ecbf6dc54 tcp: default to debug disabled
Type:fix
Ticket:VPP-1737

Change-Id: Ib5c33f0bdb3a8b1c2585135fcc8c07b151e47df3
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-20 18:14:26 +00:00
14c7756ad8 dns: handle multiple replies for single requests
The world is a mess. A single DNS request may yield multiple, subtly
different responses; all with the same DNS protocol-level ID.

Last response wins in terms of what ends up in the cache.

First response wins in terms of the response sent to the client. Hard
to do otherwise since we have no clue that more than one answer will
be forthcoming.

Type: fix
Ticket: VPP-1749
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I3175a40eb1fea237048d16b852a430f5ab51eaef
(cherry picked from commit e8d2dcb6a6)
2019-08-20 12:48:52 +00:00
b610f2022c misc: VPP 19.08 Release Notes
Change-Id: I81c7ad50c66b4b8d690e87aad1f3c16af065fc85
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-08-20 11:50:19 +00:00
28c6e5cfdb dhcp: resolver process node index in main_t
Remove the (unused) node_registration_t, don't try to use it to signal
resolution events.

Type: fix
Ticket: VPP-1746

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ice975e32152892ac4100b9e758412d48a43f09f1
(cherry picked from commit 018c14b7db)
2019-08-19 09:23:20 +00:00
6bde1f4cd1 gso: fix l3 and l4 header offset in case of tagged interface
previously, PG and virtio interfaces calculate wrong l3 and l4
header offset. This patch fixes this issue.

Type: fix
Ticket: VPP-1739

Change-Id: I5ba978e464babeb65e0711e1027320d46b3b9932
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 14bea1bb65)
2019-08-19 08:39:57 +00:00
859c6a5d01 gso: fix the segmentation to use current_data offset
Type: fix
Ticket: VPP-1740

Change-Id: If3e34b5b8260e4c50af338895066c2c96f4603af
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 0a5734372d)
2019-08-18 22:02:42 +00:00
62e4d84220 gso: remove the ip checksum flag in case of ipv6
Type: fix
Ticket: VPP-1727

Change-Id: Icfee35c5ab5e1c65079d1ca7bb514162319113e5
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 7dfcf7f1f5)
2019-08-17 00:36:40 +00:00
4222fb1835 tcp: fix cc algo name parsing
Type: fix

The initial config parser passed a pointer to the field algo id field in
tcp main. Because the field is a u8 and it was interpreted as a uword,
it ended up overwrting other tcp configuration fields.

Change-Id: Ie9020051c8fca40e14cf42a9888daa87360e5038
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit d25d364d2b)
2019-08-16 14:30:25 +00:00
a5766fe139 vlib: copy trace_handle in vlib_buffer_copy/clone() functions
Since vlib_buffer_copy() and vlib_buffer_clone() both preserve
VLIB_BUFFER_IS_TRACED bit in flags field, it should also copy
trace_handle which would add minimal overhead. Thus, callers of
these functions do not have to call vlib_buffer_copy_trace_flags()
to copy trace_handle.

Type: refactor
Ticket: VPP-1745

Signed-off-by: John Lo <loj@cisco.com>
Change-Id: Iff6a3f81660dd62b36a2966033eb380305340310
(cherry picked from commit 6631780422)
Signed-off-by: John Lo <loj@cisco.com>
2019-08-15 15:26:46 -04:00
4c945dacb9 acl: fix stats-segment counters validation on acl update
The stats-segment validation/clear logic for acl counters was wrong,
fix it. Also add the code to the unittests to cover that case,
add a vat command to enable/disable counters, clean up
the unnecessary endian conversion and remove the stray clib_warning()

Change-Id: I421297a92e4aeb885c468c72a97cec25981df615
Type: fix
Ticket: VPP-1744
Fixes: f995c7122b
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-08-15 15:22:11 +00:00
2f51729bb3 tcp: extend protocol configuration
Type: feature
Ticket: VPP-1736

Expose more configuration parameters and refactor some of the existing
ones.

Change-Id: If44c31ff77ce3d7e8da67d39a4ff61346bdf5ccc
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 9094b5c319)
2019-08-14 16:27:49 +00:00
bb83b16a3c svm: fix svmtool and svmdbtool segment fault.
Type: fix
Ticket: VPP-1741

Signed-off-by: Guanghua Zhang <ghzhang@fiberhome.com>
Change-Id: Ifd3abaa5ec912378dbc7b73c4863aad26777dd7e
(cherry picked from commit 60f16c22b4)
2019-08-14 15:10:31 +00:00
8ef151c900 gbp: do not scan gbp bihash if not instantiated
Type: fix
Fixes: 32dcd3b2f2

Change-Id: I42550fcc5b3fa486a05770d3e220d7a86315628e
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-08-14 09:46:37 +02:00
3a7457201c session: fix enqueue notification on 32bit systems
Type: fix
Ticket: VPP-1736

Change-Id: I7b5566525fc30fe0d3cc8cd991960f6ed2f1fc27
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 5d8a806144)
2019-08-13 17:34:16 +00:00
0325c021f4 papi: Revert vpp-api-python to py2, add py3 pkg
A previous commit, ca3d38ae18, converts
the vpp-api-python package from a python2 library to a python3 one.
This changes the behaviour of the package and breaks anything that
uses it as a dependency.

This change reverts the package behaviour to a python2 package, and
additionally adds a *separate* python3 package for correct python3
behaviour.

Type: fix
Fixes: VPP-1738
Signed-Off-By: Ian Wells <iawells@cisco.com>
Change-Id: I54eb45156eb6e00fc4cd5b48e7a0aa17fd2f43f7
Signed-off-by: Dave Barach <dave@barachs.net>
(cherry picked from commit 13cef0cc2c)
2019-08-13 08:04:41 +00:00
63cafb331d fib: add adj_midchain.h to the list of files to install in the include path
Type: fix
Ticket: VPP-1735

Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
Change-Id: I7063516a60bb211ad91ef04041b2751ca3f6598e
2019-08-13 08:00:23 +00:00
d34e0cb0c8 http_static: manual cherry-pick 21231,21246
Type: fix
Ticket: VPP-1736

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ie34d1b7d7030c160972f3173a4401ef632e38633
2019-08-12 22:33:03 +00:00
eda581e443 tcp: handle fin+rst+syn in closing state
Type: fix
Ticket: VPP-1736

Change-Id: I32d4d4a5de04e89087f4ab4a5c425eda572932a8
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-12 18:35:16 +00:00
78cc42d608 http_static: tls support
Type: refactor
Ticket: VPP-1736

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I45745e568cd943293d0015a61f67ec799b6804d8
(cherry picked from commit 6b53fd5163)
2019-08-12 17:34:15 +00:00
af8075529f api: vppapitrace JSON/API trace converter
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 edfe2c0079)
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-08-12 12:37:37 +00:00
3d674e86b7 vlib: fix vlib_buffer_copy to preserve buffer flags bit
Make vlib_buffer_copy() preserve buffer flags bit the same way as
that of vlib_buffer_clone() so both are consistent.

Type: fix

Signed-off-by: John Lo <loj@cisco.com>
Change-Id: I6c32aa1e88724b482ce2439d82019e690311b664
(cherry picked from commit 8ed2d524aa)
2019-08-10 13:58:23 +00:00
28d86217bf tls: mark as no lookup transport
Type:fix

Also fix transport close while handshake is ongoing.

Change-Id: I004c56d2297d0847c2cb77202f8fba3edaacad29
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit d09236d17d)
2019-08-09 19:19:31 +00:00
a932a34a22 udp: fix rx event generation
When session is owned by another thread, avoid postponing the generation
of the rx event.

Type:fix

Change-Id: Ie6afc8116ce40e83d8aae0432b48e19b31287d8b
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 9cbf6818b3)
2019-08-09 16:58:17 +00:00
ec25b91ad3 session: allow closed transports to send
Type:fix

Transports like tcp may notify session layer of a close but they may
defer the connection's deletion (e.g., tcp time-wait). During that time,
transports may still want to send packets. So, unless the session has no
transport (transport-deleted state), allow the transport to send.

Change-Id: I3ae335c7b951ff64be8529a5e3f3ad790feddc84
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit a678974cc5)
2019-08-09 16:25:14 +00:00
1403fe6047 tls: handle transport reset
Type:fix

Change-Id: I5994fb53dc4b9fd58920b3d67472c38b41db27c2
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit f03c49413f)
2019-08-09 15:10:18 +00:00
58e95bc2cd svm: fix fifo max writeable chunk computation
Type:fix

Change-Id: I60fdd7651a3d3fac505e7aec7a41f9d096022895
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit fcd26a0394)
2019-08-09 13:53:03 +00:00
0f0ff02a93 tls: fix close with data
Type:fix

Also changes the way the ctx is freed. TLS now waits for tcp delete
notification before freeing the ctx.

Change-Id: I2f606a9ce7b3755ae9d11d6fe714fe11b65dcb98
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit ef2b3357b4)
2019-08-09 13:52:29 +00:00
c9a9f5d347 tcp: fix zero rwnd sent check
Type:fix

Change-Id: I1e6f2cb28c1bf544cc3d060b11c8935f9edb0eed
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit d1ba3d2577)
2019-08-09 13:52:02 +00:00
c7f0fe030f tcp: cleanup timers
Type:refactor

Change-Id: I37dbc8b55827d66c2578d6ab8b86ed7e18198aa6
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-09 13:51:40 +00:00
7119c22f82 udp: fix connections move
Without this the use of uc0 is racy between the current thread and the
thread that owns it and will delete it.

This also ensures we don't trigger a read event on the session before
moving it to the right thread and notifying the application.

Type: fix
Change-Id: Icb1ca3ee5805ea3c0d2d424d4b23511465deb3b6
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
(cherry picked from commit b339233494)
2019-08-08 02:25:24 +00:00
23526f78a8 docs: Initial changes for stable/1908 branch
This patch adds an entry for the defaultbranch
in .gitreview

Change-Id: Icb772912db57db055aec94d3a6a3cba21ba00876
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-08-07 17:30:04 +00:00
725 changed files with 33222 additions and 16821 deletions

1
.gitignore vendored
View File

@ -99,6 +99,7 @@ GTAGS
# Build files in the test directory
/test/*.ok
/test/ext/.d
# vppctl command list
/src/scripts/vppctl-cmd-list

View File

@ -2,3 +2,4 @@
host=gerrit.fd.io
port=29418
project=vpp
defaultbranch=stable/1908

View File

@ -34,65 +34,70 @@ repositories:
- 'vpp'
committers:
- <<: *vpp_ptl
- name: 'Keith Burns'
company: 'gmail'
email: 'alagalah@gmail.com'
id: 'alagalah'
timezone: ''
- name: 'Chris Luke'
company: 'comcast'
email: 'chris_luke@comcast.com'
id: 'chrisluke'
timezone: ''
- name: 'Dave Barach'
company: 'barachs'
company: 'cisco'
email: 'openvpp@barachs.net'
id: 'dbarach'
timezone: ''
- name: 'Damjan Marion'
company: 'cisco'
email: 'damarion@cisco.com'
id: 'dmarion'
timezone: ''
- name: 'Dave Wallace'
company: 'gmail'
email: 'dwallacelf@gmail.com'
id: 'dwallacelf'
timezone: ''
- name: 'Florin Coras'
company: 'gmail'
company: 'cisco'
email: 'florin.coras@gmail.com'
id: 'florin.coras'
timezone: ''
- name: 'Ed Warnicke'
company: 'gmail'
email: 'hagbard@gmail.com'
id: 'hagbard'
- name: 'Benoit Ganne'
company: 'cisco'
email: 'bganne@cisco.com'
id: 'bganne'
timezone: ''
- name: 'John Lo'
company: 'cisco'
email: 'loj@cisco.com'
id: 'lojohn'
timezone: ''
- name: 'Marco Varlese'
company: 'suse'
email: 'marco.varlese@suse.de'
id: 'marco.varlese'
- name: 'Chris Luke'
company: 'comcast'
email: 'chris_luke@comcast.com'
id: 'chrisluke'
timezone: ''
- name: 'Damjan Marion'
company: 'cisco'
email: 'damarion@cisco.com'
id: 'dmarion'
timezone: ''
- name: 'Neale Ranns'
company: 'cisco'
email: 'nranns@cisco.com'
id: 'nranns'
timezone: ''
- name: 'Matthew Smith'
company: 'netgate'
email: 'mgsmith@netgate.com'
id: 'mgsmith'
timezone: ''
- name: 'Ole Trøan'
company: 'employees'
email: 'otroan@employees.org'
id: 'otroan'
timezone: ''
- name: 'Sergio Gonzalez Monroy'
company: 'outlook'
email: 'sergio.gonzalez.monroy@outlook.com'
id: 'smonroy'
- name: 'Paul Vinciguerra'
company: 'vinciconsulting'
email: 'pvinci@vinciconsulting.com'
id: 'pvinci'
timezone: ''
- name: 'Dave Wallace'
company: 'gmail'
email: 'dwallacelf@gmail.com'
id: 'dwallacelf'
timezone: ''
- name: 'Ed Warnicke'
company: 'gmail'
email: 'hagbard@gmail.com'
id: 'hagbard'
timezone: ''
- name: 'Andrew Yourtchenko'
company: 'cisco'
email: 'ayourtch@cisco.com'
id: 'ayourtch'
timezone: ''
tsc:
# yamllint disable rule:line-length

View File

@ -49,6 +49,11 @@ I: vppinfra
M: Dave Barach <dave@barachs.net>
F: src/vppinfra/
Physical Memory Allocator
I: pmalloc
M: Damjan Marion <damarion@cisco.com>
F: src/vppinfra/pmalloc.[ch]
Vector Library
I: vlib
M: Dave Barach <dave@barachs.net>
@ -62,6 +67,13 @@ M: Damjan Marion <damarion@cisco.com>
M: Dave Barach <dave@barachs.net>
F: src/vlib/buffer*.[ch]
Vector Library - PCI
I: pci
M: Damjan Marion <damarion@cisco.com>
F: src/vlib/pci/
F: src/vlib/linux/pci.[ch]
F: src/vlib/linux/vfio.[ch]
Binary API Libraries
I: api
M: Dave Barach <dave@barachs.net>
@ -73,6 +85,11 @@ I: bfd
M: Klement Sekera <ksekera@cisco.com>
F: src/vnet/bfd/
VNET Classifier
I: classify
M: Dave Barach <dave@barachs.net>
F: src/vnet/classify
VNET Device Drivers
I: devices
M: Damjan Marion <damarion@cisco.com>
@ -86,9 +103,10 @@ M: Mohsin Kazmi <sykazmi@cisco.com>
F: src/vnet/devices/tap/
VNET Native Virtio Drivers
I: virtio
M: Mohsin Kazmi <sykazmi@cisco.com>
F: src/vnet/devices/virtio/
I: virtio
M: Mohsin Kazmi <sykazmi@cisco.com>
M: Damjan Marion <damarion@cisco.com>
F: src/vnet/devices/virtio/
VNET Etherent
I: ethernet
@ -111,11 +129,17 @@ F: src/vnet/mfib/
F: src/vnet/dpo
F: src/vnet/adj
VNET IPv4 and IPv6 LPM
VNET IPv4 LPM
I: ip
M: Dave Barach <dave@barachs.net>
F: src/vnet/ip/
VNET IPv6 LPM
I: ip6
M: Neale Ranns <nranns@cisco.com>
M: Jon Loeliger <jdl@netgate.com>
F: src/vnet/ip/
VNET QoS
I: qos
M: Neale Ranns <nranns@cisco.com>
@ -258,11 +282,26 @@ I: syslog
M: Matus Fabian <matfabia@cisco.com>
F: src/vnet/syslog
VNET GENEVE
I: geneve
M: N/A
F: src/vnet/geneve/
VNET FLOW
I: flow
M: Damjan Marion <damarion@cisco.com>
F: src/vnet/flow/
Plugin - Access Control List (ACL) Based Forwarding
I: abf
M: Neale Ranns <nranns@cisco.com>
F: src/plugins/abf/
Plugin - Simple DNS name resolver
I: dns
M: Dave Barach <dave@barachs.net>
F: src/plugins/dns/
Plugin - Group Based Policy (GBP)
I: gbp
M: Neale Ranns <nranns@cisco.com>
@ -300,6 +339,11 @@ Y: src/plugins/flowprobe/FEATURE.yaml
M: Ole Troan <otroan@employees.org>
F: src/plugins/flowprobe/
Plugin - http_static
I: http_static
M: Dave Barach <dbarach@cisco.com>
F: src/plugins/http_static/
Plugin - Group Based Policy (GBP)
I: gbp
M: Neale Ranns <nranns@cisco.com>
@ -346,6 +390,11 @@ I: pppoe
M: Hongjun Ni <hongjun.ni@intel.com>
F: src/plugins/pppoe/
Plugin - Ping
I: ping
M: Andrew Yourtchenko <ayourtch@gmail.com>
F: src/plugins/ping
Plugin - IPv6 Segment Routing Dynamic Proxy
I: srv6-ad
M: Francois Clad <fclad@cisco.com>
@ -389,6 +438,17 @@ I: nsim
M: Dave Barach <dave@barachs.net>
F: src/plugins/nsim/
Plugin - Simple DNS name resolver
I: dns
M: Dave Barach <dave@barachs.net>
F: src/plugins/dns/
Plugin - Unit Tests
I: unittest
M: Dave Barach <dave@barachs.net>
M: Florin Coras <fcoras@cisco.com
F: src/plugins/unittest/
Test Infrastructure
I: tests
M: Klement Sekera <ksekera@cisco.com>
@ -435,6 +495,11 @@ I: vppapigen
M: Ole Troan <otroan@employees.org>
F: src/tools/vppapigen/
API trace tool
I: vppapitrace
M: Ole Troan <otroan@employees.org>
F: src/tools/vppapitrace/
Binary API Compiler for C and C++
I: vapi
M: Ole Troan <ot@cisco.com>
@ -487,13 +552,21 @@ F: src/plugins/hs_apps/
Python binding for the VPP API
I: papi
M: Ole Troan <ot@cisco.com>
M: Paul Vinciguerra <pvinci@vinciconsulting.com>
F: src/vpp-api/python
IPv6 Connection Tracker
I: ct6
M: Dave Barach <dave@barachs.net>
F: src/plugins/ct6
Plugin - SCTP
I: sctp
F: src/plugins/sctp/
IOAM
I: ioam
F: src/plugins/ioam
THE REST
I: misc
C: Contact vpp-dev Mailing List <vpp-dev@fd.io>

108
Makefile
View File

@ -20,6 +20,7 @@ SAMPLE_PLUGIN?=no
STARTUP_DIR?=$(PWD)
MACHINE=$(shell uname -m)
SUDO?=sudo
DPDK_CONFIG?=no-pci
,:=,
define disable_plugins
@ -101,7 +102,7 @@ else
RPM_DEPENDS += yum-utils
RPM_DEPENDS += openssl-devel
RPM_DEPENDS += python-devel python36-ply
RPM_DEPENDS += python36-devel python36-pip
RPM_DEPENDS += python3-devel python3-pip
RPM_DEPENDS += python-virtualenv python36-jsonschema
RPM_DEPENDS += devtoolset-7
RPM_DEPENDS += cmake3
@ -111,6 +112,11 @@ endif
# +ganglia-devel if building the ganglia plugin
RPM_DEPENDS += chrpath libffi-devel rpm-build
RPM_DEPENDS_DEBUG = glibc-debuginfo e2fsprogs-debuginfo
RPM_DEPENDS_DEBUG += krb5-debuginfo openssl-debuginfo
RPM_DEPENDS_DEBUG += zlib-debuginfo nss-softokn-debuginfo
RPM_DEPENDS_DEBUG += yum-plugin-auto-update-debug-info
# lowercase- replace spaces with dashes.
SUSE_NAME= $(shell grep '^NAME=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g' | sed -e 's/ /-/' | awk '{print tolower($$0)}')
SUSE_ID= $(shell grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g' | cut -d' ' -f2)
@ -178,57 +184,57 @@ endef
help:
@echo "Make Targets:"
@echo " install-dep - install software dependencies"
@echo " wipe - wipe all products of debug build "
@echo " wipe-release - wipe all products of release build "
@echo " build - build debug binaries"
@echo " build-release - build release binaries"
@echo " build-coverity - build coverity artifacts"
@echo " rebuild - wipe and build debug binares"
@echo " rebuild-release - wipe and build release binares"
@echo " run - run debug binary"
@echo " run-release - run release binary"
@echo " debug - run debug binary with debugger"
@echo " debug-release - run release binary with debugger"
@echo " test - build and run (basic) functional tests"
@echo " test-debug - build and run (basic) functional tests (debug build)"
@echo " test-all - build and run (all) functional tests"
@echo " test-all-debug - build and run (all) functional tests (debug build)"
@echo " test-gcov - build and run functional tests (gcov build)"
@echo " test-shell - enter shell with test environment"
@echo " test-shell-debug - enter shell with test environment (debug build)"
@echo " test-wipe - wipe files generated by unit tests"
@echo " retest - run functional tests"
@echo " retest-debug - run functional tests (debug build)"
@echo " test-help - show help on test framework"
@echo " run-vat - run vpp-api-test tool"
@echo " pkg-deb - build DEB packages"
@echo " pkg-deb-debug - build DEB debug packages"
@echo " vom-pkg-deb - build vom DEB packages"
@echo " vom-pkg-deb-debug - build vom DEB debug packages"
@echo " pkg-rpm - build RPM packages"
@echo " install-ext-deps - install external development dependencies"
@echo " ctags - (re)generate ctags database"
@echo " gtags - (re)generate gtags database"
@echo " cscope - (re)generate cscope database"
@echo " checkstyle - check coding style"
@echo " fixstyle - fix coding style"
@echo " doxygen - (re)generate documentation"
@echo " bootstrap-doxygen - setup Doxygen dependencies"
@echo " wipe-doxygen - wipe all generated documentation"
@echo " checkfeaturelist - check FEATURE.yaml according to schema"
@echo " featurelist - dump feature list in markdown"
@echo " json-api-files - (re)-generate json api files"
@echo " install-dep - install software dependencies"
@echo " wipe - wipe all products of debug build "
@echo " wipe-release - wipe all products of release build "
@echo " build - build debug binaries"
@echo " build-release - build release binaries"
@echo " build-coverity - build coverity artifacts"
@echo " rebuild - wipe and build debug binares"
@echo " rebuild-release - wipe and build release binares"
@echo " run - run debug binary"
@echo " run-release - run release binary"
@echo " debug - run debug binary with debugger"
@echo " debug-release - run release binary with debugger"
@echo " test - build and run (basic) functional tests"
@echo " test-debug - build and run (basic) functional tests (debug build)"
@echo " test-all - build and run functional and extended tests"
@echo " test-all-debug - build and run functional and extended tests (debug build)"
@echo " test-gcov - build and run functional tests (gcov build)"
@echo " test-shell - enter shell with test environment"
@echo " test-shell-debug - enter shell with test environment (debug build)"
@echo " test-wipe - wipe files generated by unit tests"
@echo " retest - run functional tests"
@echo " retest-debug - run functional tests (debug build)"
@echo " test-help - show help on test framework"
@echo " run-vat - run vpp-api-test tool"
@echo " pkg-deb - build DEB packages"
@echo " pkg-deb-debug - build DEB debug packages"
@echo " vom-pkg-deb - build vom DEB packages"
@echo " vom-pkg-deb-debug - build vom DEB debug packages"
@echo " pkg-rpm - build RPM packages"
@echo " install-ext-deps - install external development dependencies"
@echo " ctags - (re)generate ctags database"
@echo " gtags - (re)generate gtags database"
@echo " cscope - (re)generate cscope database"
@echo " checkstyle - check coding style"
@echo " fixstyle - fix coding style"
@echo " doxygen - (re)generate documentation"
@echo " bootstrap-doxygen - setup Doxygen dependencies"
@echo " wipe-doxygen - wipe all generated documentation"
@echo " checkfeaturelist - check FEATURE.yaml according to schema"
@echo " featurelist - dump feature list in markdown"
@echo " json-api-files - (re)-generate json api files"
@echo " json-api-files-debug - (re)-generate json api files for debug target"
@echo " docs - Build the Sphinx documentation"
@echo " docs-venv - Build the virtual environment for the Sphinx docs"
@echo " docs-clean - Remove the generated files from the Sphinx docs"
@echo " test-doc - generate documentation for test framework"
@echo " test-wipe-doc - wipe documentation for test framework"
@echo " test-cov - generate code coverage report for test framework"
@echo " test-wipe-cov - wipe code coverage report for test framework"
@echo " test-checkstyle - check PEP8 compliance for test framework"
@echo " test-refresh-deps - refresh the Python dependencies for the tests"
@echo " docs-venv - Build the virtual environment for the Sphinx docs"
@echo " docs-clean - Remove the generated files from the Sphinx docs"
@echo " test-doc - generate documentation for test framework"
@echo " test-wipe-doc - wipe documentation for test framework"
@echo " test-cov - generate code coverage report for test framework"
@echo " test-wipe-cov - wipe code coverage report for test framework"
@echo " test-checkstyle - check PEP8 compliance for test framework"
@echo " test-refresh-deps - refresh the Python dependencies for the tests"
@echo ""
@echo "Make Arguments:"
@echo " V=[0|1] - set build verbosity level"
@ -308,7 +314,7 @@ else ifeq ($(OS_ID),centos)
@sudo -E yum install $(CONFIRM) centos-release-scl-rh epel-release
@sudo -E yum groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
@sudo -E yum install $(CONFIRM) $(RPM_DEPENDS)
@sudo -E debuginfo-install $(CONFIRM) glibc openssl-libs mbedtls-devel zlib
@sudo -E yum install $(CONFIRM) --enablerepo=base-debuginfo $(RPM_DEPENDS_DEBUG)
else ifeq ($(OS_ID),fedora)
@sudo -E dnf groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
@sudo -E dnf install $(CONFIRM) $(RPM_DEPENDS)

File diff suppressed because it is too large Load Diff

View File

@ -25,8 +25,7 @@ vpp_cmake_prefix_path := $(subst $() $(),;,$(vpp_cmake_prefix_path))
vpp_cmake_args ?=
vpp_cmake_args += -DCMAKE_INSTALL_PREFIX:PATH=$(PACKAGE_INSTALL_DIR)
vpp_cmake_args += -DCMAKE_C_FLAGS="$($(TAG)_TAG_CFLAGS)"
vpp_cmake_args += -DCMAKE_LINKER_FLAGS="$($(TAG)_TAG_LDFLAGS)"
vpp_cmake_args += -DCMAKE_BUILD_TYPE="$($(TAG)_TAG_BUILD_TYPE)"
vpp_cmake_args += -DCMAKE_PREFIX_PATH:PATH="$(vpp_cmake_prefix_path)"
ifeq ("$(V)","1")
vpp_cmake_args += -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
@ -42,12 +41,16 @@ ifneq ($(wildcard /opt/rh/devtoolset-7/enable),)
vpp_cmake_args += -DCMAKE_PROGRAM_PATH:PATH="/opt/rh/devtoolset-7/root/bin"
endif
ifneq ($(VPP_EXTRA_CMAKE_ARGS),)
vpp_cmake_args += $(VPP_EXTRA_CMAKE_ARGS)
endif
vpp_configure_depend += external-install
vpp_configure = \
cd $(PACKAGE_BUILD_DIR) && \
$(CMAKE) -G Ninja $(vpp_cmake_args) $(call find_source_fn,$(PACKAGE_SOURCE))
#vpp_make_args = --no-print-directory
vpp_build = $(CMAKE) --build $(PACKAGE_BUILD_DIR)
vpp_build = $(CMAKE) --build $(PACKAGE_BUILD_DIR) -- $(MAKE_PARALLEL_FLAGS)
vpp_install = $(CMAKE) --build $(PACKAGE_BUILD_DIR) -- install | grep -v 'Set runtime path'
vpp-package-deb: vpp-install

View File

@ -22,29 +22,8 @@ endif
vpp_root_packages = vpp vom
vpp_common_cflags = \
-g \
-DFORTIFY_SOURCE=2 \
-fstack-protector \
-fPIC \
-Wall \
-Werror \
-fno-common
vpp_debug_TAG_CFLAGS = -O0 -DCLIB_DEBUG $(vpp_common_cflags)
vpp_debug_TAG_CXXFLAGS = -O0 -DCLIB_DEBUG $(vpp_common_cflags)
vpp_debug_TAG_LDFLAGS = -O0 -DCLIB_DEBUG $(vpp_common_cflags)
vpp_TAG_CFLAGS = -O2 $(vpp_common_cflags)
vpp_TAG_CXXFLAGS = -O2 $(vpp_common_cflags)
vpp_TAG_LDFLAGS = -O2 $(vpp_common_cflags) -pie
vpp_clang_TAG_CFLAGS = -O2 $(vpp_common_cflags)
vpp_clang_TAG_CXXFLAGS = -O2 $(vpp_common_cflags)
vpp_clang_TAG_LDFLAGS = -O2 $(vpp_common_cflags)
vpp_gcov_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG -DCLIB_GCOV -fPIC -Werror -fprofile-arcs -ftest-coverage
vpp_gcov_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG -DCLIB_GCOV -fPIC -Werror -coverage
vpp_coverity_TAG_CFLAGS = -g -O2 -fPIC -Werror -D__COVERITY__
vpp_coverity_TAG_LDFLAGS = -g -O2 -fPIC -Werror -D__COVERITY__
vpp_debug_TAG_BUILD_TYPE = debug
vpp_TAG_BUILD_TYPE = release
vpp_clang_TAG_BUILD_TYPE = release
vpp_gcov_TAG_BUILD_TYPE = gcov
vpp_coverity_TAG_BUILD_TYPE = coverity

View File

@ -190,7 +190,7 @@ ARCH_TARGET_tmp = $(call ifdef_fn,$(ARCH)_target,$(ARCH)-$(OS))
TARGET = $(call ifdef_fn,$(PLATFORM)_target,$(ARCH_TARGET_tmp))
TARGET_PREFIX = $(if $(not_native),$(TARGET)-,)
# CPU microarchitecture detection.
# CPU microarchitecture detection.
# Either set <platform>_march in build-data/platforms/<platform>.mk,
# or detect and use the build-host instruction set
@ -236,7 +236,7 @@ PACKAGE = $*
# Build/install tags. This lets you have different CFLAGS/CPPFLAGS/LDFLAGS
# for e.g. debug versus optimized compiles. Each tag has its own set of build/install
# areas.
TAG =
TAG =
TAG_PREFIX = $(if $(TAG),$(TAG)-)
# yes you need the space
@ -309,8 +309,8 @@ endif
# Always prefer our own tools to those installed on system.
# Note: ccache-bin must be before tool bin.
#
# Removed LD_LIBRARY_PATH from BUILD_ENV (drb, 10/31/17):
#
# Removed LD_LIBRARY_PATH from BUILD_ENV (drb, 10/31/17):
# export LD_LIBRARY_PATH=$(TOOL_INSTALL_DIR)/lib64:$(TOOL_INSTALL_DIR)/lib
# Reported to cause trouble. Only of historical interest, since we no longer
# build a full tool chain from source.
@ -617,7 +617,7 @@ check_platform = \
try make PLATFORM=$(PLATFORM) install-tools) ; \
exit 1 ; \
fi
configure_check_timestamp = \
@$(BUILD_ENV) ; \
$(check_platform) ; \
@ -653,12 +653,10 @@ configure_check_timestamp = \
# NB: GNU Make 4.2 will let us use '$(file </proc/cpuinfo)' to both test
# for file presence and content; for now this will have to do.
ifndef MAKE_PARALLEL_JOBS
MAKE_PARALLEL_JOBS = -j $(if $(shell [ -f /proc/cpuinfo ] && head /proc/cpuinfo), \
MAKE_PARALLEL_JOBS = $(if $(shell [ -f /proc/cpuinfo ] && head /proc/cpuinfo), \
$(shell grep -c ^processor /proc/cpuinfo), 2)
else
MAKE_PARALLEL_JOBS := -j $(MAKE_PARALLEL_JOBS)
endif
MAKE_PARALLEL_FLAGS ?= $(if $($(PACKAGE)_make_parallel_fails),,$(MAKE_PARALLEL_JOBS))
MAKE_PARALLEL_FLAGS ?= $(if $($(PACKAGE)_make_parallel_fails),,-j $(MAKE_PARALLEL_JOBS))
# Make command shorthand for packages & tools.
PACKAGE_MAKE = \
@ -805,7 +803,7 @@ pull-all:
make PLATFORM=$(PLATFORM) $(patsubst %,%-pull-all,$(ROOT_PACKAGES))
.PHONY: %-diff
%-diff:
%-diff:
@$(BUILD_ENV) ; \
d=$(call find_source_fn,$(PACKAGE_SOURCE)) ; \
$(call build_msg_fn,Git diff $(PACKAGE)) ; \
@ -814,12 +812,12 @@ pull-all:
else \
$(call build_msg_fn, $(PACKAGE) not a git directory) ; \
fi
# generate diffs for everything in source path
.PHONY: diff-all
diff-all:
diff-all:
@$(BUILD_ENV) ; \
$(call build_msg_fn,Generate diffs) ; \
for r in $(ABSOLUTE_SOURCE_PATH); do \
@ -917,7 +915,7 @@ basic_system_image_install = \
mkdir -p bin lib mnt proc root sbin sys tmp etc ; \
mkdir -p usr usr/{bin,sbin} usr/lib ; \
mkdir -p var var/{lib,lock,log,run,tmp} ; \
mkdir -p var/lock/subsys var/lib/urandom
mkdir -p var/lock/subsys var/lib/urandom
.PHONY: basic_system-image_install
basic_system-image_install: # linuxrc-install
@ -927,7 +925,7 @@ basic_system-image_install: # linuxrc-install
ROOT_PACKAGES = $(if $($(PLATFORM)_root_packages),$($(PLATFORM)_root_packages),$(default_root_packages))
.PHONY: install-packages
install-packages: $(patsubst %,%-find-source,$(ROOT_PACKAGES))
install-packages: $(patsubst %,%-find-source,$(ROOT_PACKAGES))
@$(BUILD_ENV) ; \
set -eu$(BUILD_DEBUG) ; \
d=$(MU_BUILD_ROOT_DIR)/packages-$(PLATFORM) ; \
@ -949,7 +947,7 @@ install-packages: $(patsubst %,%-find-source,$(ROOT_PACKAGES))
>& /dev/null ; \
else \
$(call build_msg_fn, NOT stripping symbols) ; \
fi
fi
# readonly root squashfs image
# Note: $(call build_msg_fn) does not seem to work inside of fakeroot so we use echo
@ -1089,7 +1087,7 @@ ccache-install:
$(MAKE) -C $(MU_BUILD_ROOT_DIR) ccache-build
mkdir -p $(TOOL_INSTALL_DIR)/ccache-bin
ln -sf $(MU_BUILD_ROOT_DIR)/build-tool-native/ccache/ccache \
$(TOOL_INSTALL_DIR)/ccache-bin/$(TARGET_PREFIX)gcc
$(TOOL_INSTALL_DIR)/ccache-bin/$(TARGET_PREFIX)gcc
TOOL_MAKE = $(MAKE) is_build_tool=yes
@ -1153,7 +1151,4 @@ distclean:
rm -rf $(MU_BUILD_ROOT_DIR)/*.deb
rm -rf $(MU_BUILD_ROOT_DIR)/*.rpm
rm -rf $(MU_BUILD_ROOT_DIR)/*.changes
rm -rf $(MU_BUILD_ROOT_DIR)/python
if [ -e /usr/bin/dh ];then (cd $(MU_BUILD_ROOT_DIR)/deb/;debian/rules clean); fi
rm -f $(MU_BUILD_ROOT_DIR)/deb/debian/*.install
rm -f $(MU_BUILD_ROOT_DIR)/deb/debian/changelog
rm -rf $(MU_BUILD_ROOT_DIR)/*.buildinfo

View File

@ -35,7 +35,7 @@
#
# Platform selects e.g. Linux config file
PLATFORM = native
PLATFORM = vpp
native_arch = native

View File

@ -155,7 +155,8 @@ endif
endif
endif
DPDK_EXTRA_CFLAGS += -L$(I)/lib -I$(I)/include
DPDK_EXTRA_CFLAGS += -I$(I)/include
DPDK_EXTRA_LDFLAGS += -L$(I)/lib
# assemble DPDK make arguments
DPDK_MAKE_ARGS := -C $(DPDK_SOURCE) -j $(JOBS) \
@ -289,6 +290,7 @@ dpdk-config: $(B)/.dpdk-config.ok
$(B)/.dpdk-build.ok: dpdk-config $(DPDK_BUILD_DEPS)
@if [ ! -e $(B)/.dpdk-config.ok ] ; then echo 'Please run "make config" first' && false ; fi
@rm -f $(B)/.*.install.ok #deals with build-root/Makefile line 709
@make $(DPDK_MAKE_ARGS) install
@touch $@

View File

@ -0,0 +1,99 @@
From: Xiaoyun Li <xiaoyun.li@intel.com>
To: qi.z.zhang@intel.com, beilei.xing@intel.com,
ciara.loftus@intel.com, dev@dpdk.org
Cc: Xiaoyun Li <xiaoyun.li@intel.com>, stable@dpdk.org
Subject: [dpdk-stable] [PATCH v3] net/i40e: fix TSO pkt exceeds allowed buf size issue
Date: Thu, 26 Dec 2019 14:45:44 +0800
Message-ID: <20191226064544.48322-1-xiaoyun.li@intel.com> (raw)
In-Reply-To: <20191223025547.88798-1-xiaoyun.li@intel.com>
Hardware limits that max buffer size per tx descriptor should be
(16K-1)B. So when TSO enabled, the mbuf data size may exceed the
limit and cause malicious behavior to the NIC. This patch fixes
this issue by using more tx descs for this kind of large buffer.
Fixes: 4861cde46116 ("i40e: new poll mode driver")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
---
v3:
* Reused the existing macros to define I40E_MAX_DATA_PER_TXD
v2:
* Each pkt can have several segments so the needed tx descs should sum
* all segments up.
---
drivers/net/i40e/i40e_rxtx.c | 45 +++++++++++++++++++++++++++++++++++-
1 file changed, 44 insertions(+), 1 deletion(-)
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 17dc8c78f..bbdba39b3 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -989,6 +989,24 @@ i40e_set_tso_ctx(struct rte_mbuf *mbuf, union i40e_tx_offload tx_offload)
return ctx_desc;
}
+/* HW requires that Tx buffer size ranges from 1B up to (16K-1)B. */
+#define I40E_MAX_DATA_PER_TXD \
+ (I40E_TXD_QW1_TX_BUF_SZ_MASK >> I40E_TXD_QW1_TX_BUF_SZ_SHIFT)
+/* Calculate the number of TX descriptors needed for each pkt */
+static inline uint16_t
+i40e_calc_pkt_desc(struct rte_mbuf *tx_pkt)
+{
+ struct rte_mbuf *txd = tx_pkt;
+ uint16_t count = 0;
+
+ while (txd != NULL) {
+ count += DIV_ROUND_UP(txd->data_len, I40E_MAX_DATA_PER_TXD);
+ txd = txd->next;
+ }
+
+ return count;
+}
+
uint16_t
i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
{
@@ -1046,8 +1064,15 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
* The number of descriptors that must be allocated for
* a packet equals to the number of the segments of that
* packet plus 1 context descriptor if needed.
+ * Recalculate the needed tx descs when TSO enabled in case
+ * the mbuf data size exceeds max data size that hw allows
+ * per tx desc.
*/
- nb_used = (uint16_t)(tx_pkt->nb_segs + nb_ctx);
+ if (ol_flags & PKT_TX_TCP_SEG)
+ nb_used = (uint16_t)(i40e_calc_pkt_desc(tx_pkt) +
+ nb_ctx);
+ else
+ nb_used = (uint16_t)(tx_pkt->nb_segs + nb_ctx);
tx_last = (uint16_t)(tx_id + nb_used - 1);
/* Circular ring */
@@ -1160,6 +1185,24 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
slen = m_seg->data_len;
buf_dma_addr = rte_mbuf_data_iova(m_seg);
+ while ((ol_flags & PKT_TX_TCP_SEG) &&
+ unlikely(slen > I40E_MAX_DATA_PER_TXD)) {
+ txd->buffer_addr =
+ rte_cpu_to_le_64(buf_dma_addr);
+ txd->cmd_type_offset_bsz =
+ i40e_build_ctob(td_cmd,
+ td_offset, I40E_MAX_DATA_PER_TXD,
+ td_tag);
+
+ buf_dma_addr += I40E_MAX_DATA_PER_TXD;
+ slen -= I40E_MAX_DATA_PER_TXD;
+
+ txe->last_id = tx_last;
+ tx_id = txe->next_id;
+ txe = txn;
+ txd = &txr[tx_id];
+ txn = &sw_ring[txe->next_id];
+ }
PMD_TX_LOG(DEBUG, "mbuf: %p, TDD[%u]:\n"
"buf_dma_addr: %#"PRIx64";\n"
"td_cmd: %#x;\n"

View File

@ -0,0 +1,49 @@
From 0b12d6f9be7fe4101223491716d291ad1bf6ec33 Mon Sep 17 00:00:00 2001
From: Matthew Smith <mgsmith@netgate.com>
Date: Fri, 31 Jan 2020 11:36:21 -0600
Subject: [PATCH] ixgbe: fix link state timing issue on fiber ports
With some models of fiber ports (e.g. X552 device ID 0x15ac), it
is possible when a port is started to experience a timing issue
which prevents the link from ever being fully set up.
In ixgbe_dev_link_update_share(), if the media type is fiber and the
link is down, a flag (IXGBE_FLAG_NEED_LINK_CONFIG) is set. A callback
to ixgbe_dev_setup_link_alarm_handler() is scheduled for 10us later
which should try to set up the link and clear the flag afterwards.
If the device is started before the flag is cleared, the scheduled
callback is canceled. This causes the flag to remain set and
subsequent calls to ixgbe_dev_link_update_share() return
without trying to retrieve the link state because the flag is set.
In ixgbe_dev_start(), after cancelling the callback, unset the flag
on the device to avoid this condition.
---
drivers/net/ixgbe/ixgbe_ethdev.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 03fc1f7..3c2936d 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2598,6 +2598,8 @@ static int eth_ixgbevf_pci_remove(struct rte_pci_device *pci_dev)
uint32_t *link_speeds;
struct ixgbe_tm_conf *tm_conf =
IXGBE_DEV_PRIVATE_TO_TM_CONF(dev->data->dev_private);
+ struct ixgbe_interrupt *intr =
+ IXGBE_DEV_PRIVATE_TO_INTR(dev->data->dev_private);
PMD_INIT_FUNC_TRACE();
@@ -2614,6 +2616,7 @@ static int eth_ixgbevf_pci_remove(struct rte_pci_device *pci_dev)
/* Stop the link setup handler before resetting the HW. */
rte_eal_alarm_cancel(ixgbe_dev_setup_link_alarm_handler, dev);
+ intr->flags &= ~IXGBE_FLAG_NEED_LINK_CONFIG;
/* disable uio/vfio intr/eventfd mapping */
rte_intr_disable(intr_handle);
--
1.8.3.1

View File

@ -0,0 +1,66 @@
From 6033eeec2b029d99d4c0e46065f311fbbb2a1f1b Mon Sep 17 00:00:00 2001
From: Lijian Zhang <Lijian.Zhang@arm.com>
Date: Wed, 18 Mar 2020 17:21:08 +0800
Subject: [PATCH] ixgbe: fix false link down timing issue
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This issue is observed with X520-2 NICs on FD.io Taishan server. After
VPP booting up and bringing up the interfaces with command set
interface state <interface> up, it still shows link down status from
the command show hardware-interfaces. However, the hardware link
status is actually up. dpdk_process() cannot get the hardware link
status correctly via rte_eth_link_get_nowait().
In ixgbe_dev_link_update_share(), if the media type is fiber and the
link is down, a flag (IXGBE_FLAG_NEED_LINK_CONFIG) is set. A callback to
ixgbe_dev_setup_link_alarm_handler() is scheduled trying to set up the
link and clear the flag afterwards.
If the device is started or stopped before the flag is cleared, the
scheduled callback is canceled. This causes the flag to remain set and
subsequent calls to ixgbe_dev_link_update_share() return without trying
to retrieve the link state because the flag is set.
When the callback is canceled by either interface start or stop
operation, in ixgbe_dev_cancel_link_thread(), after cancelling the
callback/thread, unset the flag on the device to avoid this condition.
Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
---
drivers/net/ixgbe/ixgbe_ethdev.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 23b3f5b0c..aa882cb8b 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4147,11 +4147,14 @@ static void
ixgbe_dev_cancel_link_thread(struct rte_eth_dev *dev)
{
struct ixgbe_adapter *ad = dev->data->dev_private;
+ struct ixgbe_interrupt *intr =
+ IXGBE_DEV_PRIVATE_TO_INTR(dev->data->dev_private);
void *retval;
if (rte_atomic32_read(&ad->link_thread_running)) {
pthread_cancel(ad->link_thread_tid);
pthread_join(ad->link_thread_tid, &retval);
+ intr->flags &= ~IXGBE_FLAG_NEED_LINK_CONFIG;
rte_atomic32_clear(&ad->link_thread_running);
}
}
@@ -4262,8 +4265,8 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
if (link_up == 0) {
if (ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) {
- intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;
if (rte_atomic32_test_and_set(&ad->link_thread_running)) {
+ intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;
if (rte_ctrl_thread_create(&ad->link_thread_tid,
"ixgbe-link-handler",
NULL,
--
2.17.1

View File

@ -0,0 +1,15 @@
diff --git a/lib/quicly.c b/lib/quicly.c
index 95d5f13..200515f 100644
--- a/lib/quicly.c
+++ b/lib/quicly.c
@@ -3551,6 +3551,10 @@ static int handle_ack_frame(quicly_conn_t *conn, struct st_quicly_handle_payload
QUICLY_PROBE(QUICTRACE_RECV_ACK_DELAY, conn, probe_now(), frame.ack_delay);
+ /* Detect and fix time skew */
+ if (now < largest_newly_acked.sent_at)
+ now = largest_newly_acked.sent_at;
+
/* Update loss detection engine on ack. The function uses ack_delay only when the largest_newly_acked is also the largest acked
* so far. So, it does not matter if the ack_delay being passed in does not apply to the largest_newly_acked. */
quicly_loss_on_ack_received(&conn->egress.loss, largest_newly_acked.packet_number, now, largest_newly_acked.sent_at,

View File

@ -9,6 +9,7 @@ This section provides information about the features that are provided for each
.. toctree::
:maxdepth: 1
vpp1908
vpp1904
vpp1901
vpp18.10

View File

@ -0,0 +1,140 @@
## Features for Release VPP 19.08
### Infrastructure
- API
- API language: new types and limits support
- Python API - add support for defaults
- Export ip_types.api for out-of-tree plugins use
- Refactor ipip.api with explicit types
- DPDK
- 19.05 integration
- Remove bonding code
- Rework extended stats
- Debugging & Servicability
- debug CLI leak-checker
- vlib: add "memory-trace stats-segment"
- vppapitrace JSON/API trace converter
- ARP: add arp-disabled node
- igmp: Trace more data from input packets
- ip: Trace the packet from the punt node
- Python API debug introspection improvements
- Pin dependencies for make test infra
- FEATURE.yaml meta-data infrastructure
- tcp: add cc stats plotting tools
- Packet tracer support for thread handoffs
- libmemif: support for multi-thread connection establishment
- svm
- fifo ooo reads/writes with multiple chunks
- support addition/removal of chunks to fifos
- vppinfra
- Mapped pcap file support
- More AVX2 and AVX512 inlines
- VLIB_INIT_FUNCTION sequencing rework
- refactor spinlocks and rwlocks
- add rbtree
- add doubly linked list
- rdma: bump rdma-core to v25.0
- stats
- Add the number of worker threads and per worker thread vector rates
- Support multiple workers for error counters
### VNET & Plugins
- New Plugins
- HTTP static page server with TLS support
- L3 cross connect
- acl: implement stat-segment counters
- arp: add feature arcs: arp-reply, arp-input, arp-proxy
- avf: improved logging and added 2.5/5 Gbps speeds
- bonding: NUMA-related improvements
- crypto: add support for AES-CTR cipher
- fib
- FIB Entry tracking
- Support the POP of a Pseudo Wire Control Word
- gbp
- Anonymous l3-out subnets support
- ARP unicast forward in gbp bridge domain
- An Endpoint can change sclass
- Consider data-plane learnt source better than control-plane
- VRF scoped contracts
- gso (experimental)
- Add support to pg interfaces
- Add support to vhost user
- Add support to native virtio
- Add support for tagged interfaces
- punt: allow to specify packets by IP protocol Type
- ip6-local: hop-by-hop protocol demux table
- ipsec
- intel-ipsec-mb version 0.52
- AH encrypt rework
- handle UDP keepalives
- support GCM in ESP
- virtio
- Refactor control queue support
- dhcp-client: DSCP marking for transmitted packets
- Idle resource usage improvements
- Allocate bihash virtual space on demand
- gre: don't register gre input nodes unless a gre tunnel is created
- gtpu: don't register udp ports unless a tunnel is created
- lacp: create lacp-process on demand
- lisp-cp: start lisp retry service on demand
- start the cdp period and dns resolver process on demand
- vat: unload unused vat plugins
- nat: api cleanup & update
- nsim: make available as an output feature
- load-balance performance improvements
- l2: Add support for arp unicast forwarding
- mactime
- Mini-ACLs
- Per-MAC allow-with-quota feature
- qos
- QoS dump APIs
- Store function
- rdma: add support for promiscuous mode (l2-switching and xconnect)
- sr: update the Segment Routing definition to be compliant with current in IETF
- udp-ping: disable due to conflict with mldv2
- vxlan-gpe: improve encap performance
- vom
- QoS support
- Bridge domain arp unicast forwarding flag
- Bridge domain unknown unicast flooding flag
### Host stack
- session
- API to support manual svm fifo resizing
- Improved session output scheduler and close state machine
- Transport and session cleanup notifications for builtin apps
- Session migration notifications for builtin apps
- Support for no session layer lookup transports (quic and tls)
- Ability to retrieve local/remote endpoint in transport vft
- Cleanup segment manager and fifo segment
- Fix vpp to app msg generation on enqueue fail
- Improve event logging
- Moved test applications to hsa plugin
- tcp
- Congestion control algorithm enhancements
- Delivery rate estimator
- ACK/retransmission refactor and pacing
- Add tcp-input sibling nodes without full 6-tuple lookup
- More RFC4898 connection statistics
- Allow custom output next node
- Allow custom congestion control algorithms
- quic
- Multi-thread support
- Logs readability improvements
- Multistream support
- tls
- Fix close with data and listen failures
- Handle TCP transport rests
- Support endpoint retrieval interface
- vcl
- support quic streams and "connectable listeners"
- worker unregister api
- fix epoll with large events batch
- ldp: add option to eanble transparent TLS connections
- udp:
- support close with data
- fixed session migration
- sctp
- add option to enable/disable default to disable
- moved from vnet to plugins

View File

@ -469,3 +469,132 @@ metadata changes, header checksum changes, and so forth.
This should be of significant value when developing new vpp graph
nodes. If new code mispositions b->current_data, it will be completely
obvious from looking at the dispatch trace in wireshark.
## pcap rx, tx, and drop tracing
vpp also supports rx, tx, and drop packet capture in pcap format,
through the "pcap trace" debug CLI command.
This command is used to start or stop a packet capture, or show the
status of packet capture. Each of "pcap trace rx", "pcap trace tx",
and "pcap trace drop" is implemented. Supply one or more of "rx",
"tx", and "drop" to enable multiple simultaneous capture types.
These commands have the following optional parameters:
- <b>rx</b> - trace received packets.
- <b>tx</b> - trace transmitted packets.
- <b>drop</b> - trace dropped packets.
- <b>max _nnnn_</b> - file size, number of packet captures. Once
<nnnn> packets have been received, the trace buffer buffer is flushed
to the indicated file. Defaults to 1000. Can only be updated if packet
capture is off.
- <b>max-bytes-per-pkt _nnnn_</b> - maximum number of bytes to trace
on a per-paket basis. Must be >32 and less than 9000. Default value:
512.
- <b>filter</b> - Use the pcap rx / tx / drop trace filter, which must
be configured. Use <b>classify filter pcap...</b> to configure the
filter. The filter will only be executed if the per-interface or
any-interface tests fail.
- <b>intfc _interface_ | _any_</b> - Used to specify a given interface,
or use '<em>any</em>' to run packet capture on all interfaces.
'<em>any</em>' is the default if not provided. Settings from a previous
packet capture are preserved, so '<em>any</em>' can be used to reset
the interface setting.
- <b>file _filename_</b> - Used to specify the output filename. The
file will be placed in the '<em>/tmp</em>' directory. If _filename_
already exists, file will be overwritten. If no filename is
provided, '<em>/tmp/rx.pcap or tx.pcap</em>' will be used, depending
on capture direction. Can only be updated when pcap capture is off.
- <b>status</b> - Displays the current status and configured
attributes associated with a packet capture. If packet capture is in
progress, '<em>status</em>' also will return the number of packets
currently in the buffer. Any additional attributes entered on
command line with a '<em>status</em>' request will be ignored.
- <b>filter</b> - Capture packets which match the current packet
trace filter set. See next section. Configure the capture filter
first.
## packet trace capture filtering
The "classify filter pcap | <interface-name> " debug CLI command
constructs an arbitrary set of packet classifier tables for use with
"pcap rx | tx | drop trace," and with the vpp packet tracer on a
per-interrface basis.
Packets which match a rule in the classifier table chain will be
traced. The tables are automatically ordered so that matches in the
most specific table are tried first.
It's reasonably likely that folks will configure a single table with
one or two matches. As a result, we configure 8 hash buckets and 128K
of match rule space by default. One can override the defaults by
specifiying "buckets <nnn>" and "memory-size <xxx>" as desired.
To build up complex filter chains, repeatedly issue the classify
filter debug CLI command. Each command must specify the desired mask
and match values. If a classifier table with a suitable mask already
exists, the CLI command adds a match rule to the existing table. If
not, the CLI command add a new table and the indicated mask rule
### Configure a simple pcap classify filter
```
classify filter pcap mask l3 ip4 src match l3 ip4 src 192.168.1.11"
pcap rx trace on max 100 filter
```
### Configure a simple interface packet-tracer filter
```
classify filter GigabitEthernet3/0/0 mask l3 ip4 src match l3 ip4 src 192.168.1.11"
[device-driver debug CLI TBD]
```
### Configure another fairly simple pcap classify filter
```
classify filter pcap mask l3 ip4 src dst match l3 ip4 src 192.168.1.10 dst 192.168.2.10
pcap tx trace on max 100 filter
```
### Clear all current classifier filters
```
classify filter del
```
### To inspect the classifier tables
```
show classify table [verbose]
```
The verbose form displays all of the match rules, with hit-counters.
### Terse description of the "mask <xxx>" syntax:
```
l2 src dst proto tag1 tag2 ignore-tag1 ignore-tag2 cos1 cos2 dot1q dot1ad
l3 ip4 <ip4-mask> ip6 <ip6-mask>
<ip4-mask> version hdr_length src[/width] dst[/width]
tos length fragment_id ttl protocol checksum
<ip6-mask> version traffic-class flow-label src dst proto
payload_length hop_limit protocol
l4 tcp <tcp-mask> udp <udp_mask> src_port dst_port
<tcp-mask> src dst # ports
<udp-mask> src_port dst_port
```
To construct **matches**, add the values to match after the indicated
keywords in the mask syntax. For example: "... mask l3 ip4 src" ->
"... match l3 ip4 src 192.168.1.11"

6
extras/http/setup.http Normal file
View File

@ -0,0 +1,6 @@
set term pag off
create tap host-if-name lstack host-ip4-addr 192.168.10.2/24
set int ip address tap0 192.168.10.1/24
set int state tap0 up
http static server www-root /scratch/fdio-site-fork/public uri tls://0.0.0.0/1234 cache-size 10m fifo-size 2048

7
extras/http/startup.cfg Normal file
View File

@ -0,0 +1,7 @@
unix {
interactive
}
tls {
use-test-cert-in-ca
}

View File

@ -114,7 +114,7 @@ typedef struct
```
5. Packet receive
- Api call memif\_rx\_burst will set all required fields in memif buffers provided by user application and dequeue received buffers.
- Api call memif\_rx\_burst will set all required fields in memif buffers provided by user application, dequeue received buffers and consume interrupt event on receive queue. The event is not consumed, if memif_rx_burst fails.
```C
err = memif_rx_burst (c->conn, qid, c->bufs, MAX_MEMIF_BUFS, &rx);
```

View File

@ -22,6 +22,7 @@ list(APPEND EXAMPLES_LIST
icmp_responder/main.c
icmp_responder-epoll/main.c
icmp_responder-mt/main.c
icmp_responder-mt_3-1/main.c
icmp_responder-eb/main.c
icmp_responder-zero-copy-slave/main.c
)
@ -33,4 +34,3 @@ foreach (EXAMPLE_SRC ${EXAMPLES_LIST})
target_include_directories(${EXECUTABLE} PRIVATE $<BUILD_INTERFACE:${HEADERS_DIR}>)
target_link_libraries(${EXECUTABLE} ${LIBMEMIF} ${CMAKE_THREAD_LIBS_INIT})
endforeach()

File diff suppressed because it is too large Load Diff

View File

@ -23,7 +23,7 @@
#define _LIBMEMIF_H_
/** Libmemif version. */
#define LIBMEMIF_VERSION "3.0"
#define LIBMEMIF_VERSION "3.1"
/** Default name of application using libmemif. */
#define MEMIF_DEFAULT_APP_NAME "libmemif-app"
@ -96,6 +96,12 @@ typedef enum
#define MEMIF_FD_EVENT_MOD (1 << 4)
/** @} */
/** \brief Memif per thread main handle
Pointer of type void, pointing to internal structure.
Used to identify internal per thread database.
*/
typedef void *memif_per_thread_main_handle_t;
/** \brief Memif connection handle
pointer of type void, pointing to internal structure
*/
@ -139,9 +145,14 @@ typedef void (memif_free_t) (void *ptr);
/** \brief Memif control file descriptor update (callback function)
@param fd - new file descriptor to watch
@param events - event type(s) to watch for
@param private_ctx - libmemif main private context. Is NULL for
libmemif main created by memif_init()
This callback is called when there is new fd to watch for events on
or if fd is about to be closed (user mey want to stop watching for events on this fd).
Private context is taken from libmemif_main, 'private_ctx' passed to memif_per_thread_init()
or NULL in case of memif_init()
*/
typedef int (memif_control_fd_update_t) (int fd, uint8_t events,
void *private_ctx);
@ -227,6 +238,24 @@ void memif_register_external_region (memif_add_external_region_t * ar,
memif_del_external_region_t * dr,
memif_get_external_buffer_offset_t * go);
/** \brief Register external region
@param pt_main - per thread main handle
@param ar - add external region callback
@param gr - get external region addr callback
@param dr - delete external region callback
@param go - get external buffer offset callback (optional)
*/
void memif_per_thread_register_external_region (memif_per_thread_main_handle_t
pt_main,
memif_add_external_region_t *
ar,
memif_get_external_region_addr_t
* gr,
memif_del_external_region_t *
dr,
memif_get_external_buffer_offset_t
* go);
/** @} */
/**
@ -246,7 +275,11 @@ typedef enum
#endif /* _MEMIF_H_ */
/** \brief Memif connection arguments
@param socket - memif socket handle, if NULL default socket will be used
@param socket - Memif socket handle, if NULL default socket will be used.
Default socket is only supported in global database (see memif_init).
Custom database does not create a default socket
(see memif_per_thread_init).
Memif connection is stored in the same database as the socket.
@param secret - otional parameter used as interface autenthication
@param num_s2m_rings - number of slave to master rings
@param num_m2s_rings - number of master to slave rings
@ -465,6 +498,28 @@ int memif_init (memif_control_fd_update_t * on_control_fd_update,
char *app_name, memif_alloc_t * memif_alloc,
memif_realloc_t * memif_realloc, memif_free_t * memif_free);
/** \brief Memif per thread initialization
@param pt_main - per thread main handle
@param private_ctx - private context
@param on_control_fd_update - if control fd updates inform user to watch new fd
@param app_name - application name (will be truncated to 32 chars)
@param memif_alloc - cutom memory allocator, NULL = default
@param memif_realloc - custom memory reallocation, NULL = default
@param memif_free - custom memory free, NULL = default
Per thread version of memif_init ().
Instead of using global database, creates and initializes unique database,
identified by 'memif_per_thread_main_handle_t'.
\return memif_err_t
*/
int memif_per_thread_init (memif_per_thread_main_handle_t * pt_main,
void *private_ctx,
memif_control_fd_update_t * on_control_fd_update,
char *app_name, memif_alloc_t * memif_alloc,
memif_realloc_t * memif_realloc,
memif_free_t * memif_free);
/** \brief Memif cleanup
Free libmemif internal allocations.
@ -473,6 +528,15 @@ int memif_init (memif_control_fd_update_t * on_control_fd_update,
*/
int memif_cleanup ();
/** \brief Memif per thread cleanup
@param pt_main - per thread main handle
Free libmemif internal allocations and sets the handle to NULL.
\return memif_err_t
*/
int memif_per_thread_cleanup (memif_per_thread_main_handle_t * pt_main);
/** \brief Memory interface create function
@param conn - connection handle for client app
@param args - memory interface connection arguments
@ -521,6 +585,19 @@ int memif_create (memif_conn_handle_t * conn, memif_conn_args_t * args,
*/
int memif_control_fd_handler (int fd, uint8_t events);
/** \brief Memif per thread control file descriptor handler
@param pt_main - per thread main handle
@param fd - file descriptor on which the event occured
@param events - event type(s) that occured
Per thread version of memif_control_fd_handler.
\return memif_err_t
*/
int memif_per_thread_control_fd_handler (memif_per_thread_main_handle_t
pt_main, int fd, uint8_t events);
/** \brief Memif delete
@param conn - pointer to memif connection handle
@ -592,6 +669,9 @@ int memif_tx_burst (memif_conn_handle_t conn, uint16_t qid,
@param count - number of memif buffers to receive
@param rx - returns number of received buffers
Consume interrupt event for receive queue.
The event is not consumed, if memif_rx_burst fails.
\return memif_err_t
*/
int memif_rx_burst (memif_conn_handle_t conn, uint16_t qid,
@ -608,6 +688,17 @@ int memif_rx_burst (memif_conn_handle_t conn, uint16_t qid,
*/
int memif_poll_event (int timeout);
/** \brief Memif poll event
@param pt_main - per thread main handle
@param timeout - timeout in seconds
Per thread version of memif_poll_event.
\return memif_err_t
*/
int memif_per_thread_poll_event (memif_per_thread_main_handle_t pt_main,
int timeout);
/** \brief Send signal to stop concurrently running memif_poll_event().
The function, however, does not wait for memif_poll_event() to stop.
@ -622,6 +713,15 @@ int memif_poll_event (int timeout);
*/
#define MEMIF_HAVE_CANCEL_POLL_EVENT 1
int memif_cancel_poll_event ();
/** \brief Send signal to stop concurrently running memif_poll_event().
@param pt_main - per thread main handle
Per thread version of memif_cancel_poll_event.
\return memif_err_t
*/
int memif_per_thread_cancel_poll_event (memif_per_thread_main_handle_t
pt_main);
/** \brief Set connection request timer value
@param timer - new timer value
@ -633,6 +733,19 @@ int memif_cancel_poll_event ();
*/
int memif_set_connection_request_timer (struct itimerspec timer);
/** \brief Set connection request timer value
@param pt_main - per thread main handle
@param timer - new timer value
Per thread version of memif_set_connection_request_timer
\return memif_err_t
*/
int
memif_per_thread_set_connection_request_timer (memif_per_thread_main_handle_t
pt_main,
struct itimerspec timer);
/** \brief Send connection request
@param conn - memif connection handle
@ -656,8 +769,22 @@ int memif_request_connection (memif_conn_handle_t conn);
\return memif_err_t
*/
int memif_create_socket (memif_socket_handle_t * sock, const char * filename,
void * private_ctx);
int memif_create_socket (memif_socket_handle_t * sock, const char *filename,
void *private_ctx);
/** \brief Create memif socket
@param pt_main - per thread main handle
@param sock - socket handle for client app
@param filename - path to socket file
@param private_ctx - private context
Per thread version of memif_create_sopcket.
\return memif_err_t
*/
int memif_per_thread_create_socket (memif_per_thread_main_handle_t pt_main,
memif_socket_handle_t * sock,
const char *filename, void *private_ctx);
/** \brief Delete memif socket
@param sock - socket handle for client app
@ -669,6 +796,15 @@ int memif_create_socket (memif_socket_handle_t * sock, const char * filename,
*/
int memif_delete_socket (memif_socket_handle_t * sock);
/** \brief Get socket filename
@param sock - socket handle for client app
Return constant pointer to socket filename.
\return cosnt char *
*/
const char *memif_get_socket_filename (memif_socket_handle_t sock);
/** @} */
#endif /* _LIBMEMIF_H_ */

File diff suppressed because it is too large Load Diff

View File

@ -120,6 +120,8 @@ typedef struct
memif_log2_ring_size_t log2_ring_size;
} memif_conn_run_args_t;
struct libmemif_main;
typedef struct memif_connection
{
uint16_t index;
@ -165,19 +167,25 @@ typedef struct
uint16_t use_count;
memif_socket_type_t type;
uint8_t *filename;
/* unique database */
struct libmemif_main *lm;
uint16_t interface_list_len;
void *private_ctx;
memif_list_elt_t *interface_list; /* memif master interfaces listening on this socket */
} memif_socket_t;
typedef struct
typedef struct libmemif_main
{
memif_control_fd_update_t *control_fd_update;
int timerfd;
int epfd;
int poll_cancel_fd;
struct itimerspec arm, disarm;
uint16_t disconn_slaves;
uint8_t app_name[MEMIF_NAME_LEN];
void *private_ctx;
memif_socket_handle_t default_socket;
memif_add_external_region_t *add_external_region;
@ -200,7 +208,6 @@ typedef struct
} libmemif_main_t;
extern libmemif_main_t libmemif_main;
extern int memif_epfd;
/* main.c */
@ -215,7 +222,7 @@ int memif_disconnect_internal (memif_connection_t * c);
/* map errno to memif error code */
int memif_syscall_error_handler (int err_code);
int add_list_elt (memif_list_elt_t * e, memif_list_elt_t ** list,
int add_list_elt (libmemif_main_t *lm, memif_list_elt_t * e, memif_list_elt_t ** list,
uint16_t * len);
int get_list_elt (memif_list_elt_t ** e, memif_list_elt_t * list,
@ -223,6 +230,8 @@ int get_list_elt (memif_list_elt_t ** e, memif_list_elt_t * list,
int free_list_elt (memif_list_elt_t * list, uint16_t len, int key);
libmemif_main_t *get_libmemif_main (memif_socket_t * ms);
#ifndef __NR_memfd_create
#if defined __x86_64__
#define __NR_memfd_create 319

View File

@ -71,7 +71,7 @@ memif_msg_send (int fd, memif_msg_t * msg, int afd)
static_fn int
memif_msg_enq_ack (memif_connection_t * c)
{
libmemif_main_t *lm = &libmemif_main;
libmemif_main_t *lm = get_libmemif_main (c->args.socket);
memif_msg_queue_elt_t *e =
(memif_msg_queue_elt_t *) lm->alloc (sizeof (memif_msg_queue_elt_t));
if (e == NULL)
@ -99,9 +99,8 @@ memif_msg_enq_ack (memif_connection_t * c)
}
static_fn int
memif_msg_send_hello (int fd)
memif_msg_send_hello (libmemif_main_t * lm, int fd)
{
libmemif_main_t *lm = &libmemif_main;
memif_msg_t msg = { 0 };
memif_msg_hello_t *h = &msg.hello;
msg.type = MEMIF_MSG_TYPE_HELLO;
@ -124,7 +123,7 @@ memif_msg_send_hello (int fd)
static_fn int
memif_msg_enq_init (memif_connection_t * c)
{
libmemif_main_t *lm = &libmemif_main;
libmemif_main_t *lm = get_libmemif_main (c->args.socket);
memif_msg_queue_elt_t *e =
(memif_msg_queue_elt_t *) lm->alloc (sizeof (memif_msg_queue_elt_t));
if (e == NULL)
@ -166,7 +165,7 @@ memif_msg_enq_init (memif_connection_t * c)
static_fn int
memif_msg_enq_add_region (memif_connection_t * c, uint8_t region_index)
{
libmemif_main_t *lm = &libmemif_main;
libmemif_main_t *lm = get_libmemif_main (c->args.socket);
memif_region_t *mr = &c->regions[region_index];
memif_msg_queue_elt_t *e =
@ -203,7 +202,7 @@ memif_msg_enq_add_region (memif_connection_t * c, uint8_t region_index)
static_fn int
memif_msg_enq_add_ring (memif_connection_t * c, uint8_t index, uint8_t dir)
{
libmemif_main_t *lm = &libmemif_main;
libmemif_main_t *lm = get_libmemif_main (c->args.socket);
memif_msg_queue_elt_t *e =
(memif_msg_queue_elt_t *) lm->alloc (sizeof (memif_msg_queue_elt_t));
if (e == NULL)
@ -250,7 +249,7 @@ memif_msg_enq_add_ring (memif_connection_t * c, uint8_t index, uint8_t dir)
static_fn int
memif_msg_enq_connect (memif_connection_t * c)
{
libmemif_main_t *lm = &libmemif_main;
libmemif_main_t *lm = get_libmemif_main (c->args.socket);
memif_msg_queue_elt_t *e =
(memif_msg_queue_elt_t *) lm->alloc (sizeof (memif_msg_queue_elt_t));
if (e == NULL)
@ -285,7 +284,7 @@ memif_msg_enq_connect (memif_connection_t * c)
static_fn int
memif_msg_enq_connected (memif_connection_t * c)
{
libmemif_main_t *lm = &libmemif_main;
libmemif_main_t *lm = get_libmemif_main (c->args.socket);
memif_msg_queue_elt_t *e =
(memif_msg_queue_elt_t *) lm->alloc (sizeof (memif_msg_queue_elt_t));
if (e == NULL)
@ -371,10 +370,11 @@ memif_msg_receive_init (memif_socket_t * ms, int fd, memif_msg_t * msg)
memif_list_elt_t *elt = NULL;
memif_list_elt_t elt2;
memif_connection_t *c = NULL;
libmemif_main_t *lm = &libmemif_main;
libmemif_main_t *lm = get_libmemif_main (ms);
uint8_t err_string[96];
memset (err_string, 0, sizeof (char) * 96);
int err = MEMIF_ERR_SUCCESS; /* 0 */
if (i->version != MEMIF_VERSION)
{
DBG ("MEMIF_VER_ERR");
@ -464,14 +464,14 @@ memif_msg_receive_init (memif_socket_t * ms, int fd, memif_msg_t * msg)
elt2.key = c->fd;
elt2.data_struct = c;
add_list_elt (&elt2, &lm->control_list, &lm->control_list_len);
add_list_elt (lm, &elt2, &lm->control_list, &lm->control_list_len);
free_list_elt (lm->pending_list, lm->pending_list_len, fd);
return err;
error:
memif_msg_send_disconnect (fd, err_string, 0);
lm->control_fd_update (fd, MEMIF_FD_EVENT_DEL, c->private_ctx);
lm->control_fd_update (fd, MEMIF_FD_EVENT_DEL, lm->private_ctx);
free_list_elt (lm->pending_list, lm->pending_list_len, fd);
close (fd);
fd = -1;
@ -483,7 +483,7 @@ static_fn int
memif_msg_receive_add_region (memif_connection_t * c, memif_msg_t * msg,
int fd)
{
libmemif_main_t *lm = &libmemif_main;
libmemif_main_t *lm = get_libmemif_main (c->args.socket);
memif_msg_add_region_t *ar = &msg->add_region;
memif_region_t *mr;
@ -517,7 +517,7 @@ memif_msg_receive_add_region (memif_connection_t * c, memif_msg_t * msg,
static_fn int
memif_msg_receive_add_ring (memif_connection_t * c, memif_msg_t * msg, int fd)
{
libmemif_main_t *lm = &libmemif_main;
libmemif_main_t *lm = get_libmemif_main (c->args.socket);
memif_msg_add_ring_t *ar = &msg->add_ring;
@ -580,7 +580,7 @@ static_fn int
memif_msg_receive_connect (memif_connection_t * c, memif_msg_t * msg)
{
memif_msg_connect_t *cm = &msg->connect;
libmemif_main_t *lm = &libmemif_main;
libmemif_main_t *lm = get_libmemif_main (c->args.socket);
memif_list_elt_t elt;
int err;
@ -598,10 +598,11 @@ memif_msg_receive_connect (memif_connection_t * c, memif_msg_t * msg)
{
elt.key = c->rx_queues[i].int_fd;
elt.data_struct = c;
add_list_elt (&elt, &lm->interrupt_list, &lm->interrupt_list_len);
add_list_elt (lm, &elt, &lm->interrupt_list,
&lm->interrupt_list_len);
lm->control_fd_update (c->rx_queues[i].int_fd, MEMIF_FD_EVENT_READ,
c->private_ctx);
lm->private_ctx);
}
}
@ -616,7 +617,7 @@ static_fn int
memif_msg_receive_connected (memif_connection_t * c, memif_msg_t * msg)
{
memif_msg_connect_t *cm = &msg->connect;
libmemif_main_t *lm = &libmemif_main;
libmemif_main_t *lm = get_libmemif_main (c->args.socket);
int err;
err = memif_connect1 (c);
@ -632,7 +633,7 @@ memif_msg_receive_connected (memif_connection_t * c, memif_msg_t * msg)
for (i = 0; i < c->run_args.num_s2m_rings; i++)
{
lm->control_fd_update (c->rx_queues[i].int_fd, MEMIF_FD_EVENT_READ,
c->private_ctx);
lm->private_ctx);
}
}
@ -658,7 +659,7 @@ memif_msg_receive_disconnect (memif_connection_t * c, memif_msg_t * msg)
}
static_fn int
memif_msg_receive (int ifd)
memif_msg_receive (libmemif_main_t * lm, int ifd)
{
char ctl[CMSG_SPACE (sizeof (int)) +
CMSG_SPACE (sizeof (struct ucred))] = { 0 };
@ -669,7 +670,6 @@ memif_msg_receive (int ifd)
int err = MEMIF_ERR_SUCCESS; /* 0 */
int fd = -1;
int i;
libmemif_main_t *lm = &libmemif_main;
memif_connection_t *c = NULL;
memif_socket_t *ms = NULL;
memif_list_elt_t *elt = NULL;
@ -827,8 +827,10 @@ memif_conn_fd_error (memif_connection_t * c)
int
memif_conn_fd_read_ready (memif_connection_t * c)
{
libmemif_main_t *lm = get_libmemif_main (c->args.socket);
int err;
err = memif_msg_receive (c->fd);
err = memif_msg_receive (lm, c->fd);
if (err != 0)
{
err = memif_disconnect_internal (c);
@ -840,7 +842,7 @@ memif_conn_fd_read_ready (memif_connection_t * c)
int
memif_conn_fd_write_ready (memif_connection_t * c)
{
libmemif_main_t *lm = &libmemif_main;
libmemif_main_t *lm = get_libmemif_main (c->args.socket);
int err = MEMIF_ERR_SUCCESS; /* 0 */
@ -869,7 +871,7 @@ memif_conn_fd_accept_ready (memif_socket_t * ms)
int addr_len;
struct sockaddr_un client;
int conn_fd;
libmemif_main_t *lm = &libmemif_main;
libmemif_main_t *lm = get_libmemif_main (ms);
DBG ("accept called");
@ -888,19 +890,19 @@ memif_conn_fd_accept_ready (memif_socket_t * ms)
elt.key = conn_fd;
elt.data_struct = ms;
add_list_elt (&elt, &lm->pending_list, &lm->pending_list_len);
add_list_elt (lm, &elt, &lm->pending_list, &lm->pending_list_len);
lm->control_fd_update (conn_fd, MEMIF_FD_EVENT_READ | MEMIF_FD_EVENT_WRITE,
ms->private_ctx);
lm->private_ctx);
return memif_msg_send_hello (conn_fd);
return memif_msg_send_hello (lm, conn_fd);
}
int
memif_read_ready (int fd)
memif_read_ready (libmemif_main_t * lm, int fd)
{
int err;
err = memif_msg_receive (fd);
err = memif_msg_receive (lm, fd);
return err;
}

View File

@ -39,7 +39,7 @@ int memif_conn_fd_error (memif_connection_t * c);
int memif_conn_fd_accept_ready (memif_socket_t * ms);
int memif_read_ready (int fd);
int memif_read_ready (libmemif_main_t *lm, int fd);
int memif_msg_send_disconnect (int fd, uint8_t * err_string,
uint32_t err_code);
@ -53,7 +53,7 @@ int memif_msg_send (int fd, memif_msg_t * msg, int afd);
int memif_msg_enq_ack (memif_connection_t * c);
int memif_msg_send_hello (int fd);
int memif_msg_send_hello (libmemif_main_t *lm, int fd);
int memif_msg_enq_init (memif_connection_t * c);

View File

@ -94,7 +94,7 @@ START_TEST (test_init_epoll)
ck_assert_ptr_ne (lm, NULL);
ck_assert_ptr_ne (lm->control_fd_update, NULL);
ck_assert_int_gt (lm->timerfd, 2);
ck_assert_int_gt (memif_epfd, -1);
ck_assert_int_gt (lm->epfd, -1);
if (lm->timerfd > 0)
close (lm->timerfd);

Some files were not shown because too many files have changed in this diff Show More