7541 Commits

Author SHA1 Message Date
jiangxiaoming
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 ff31ac6809d9913ebd2f58a3a4153a0f419b9a77)
2019-12-01 17:05:25 +00:00
Benoît Ganne
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 ab9b9a5c0e3257136701cde6cdfdc66c35bf8f3d)
2019-12-01 12:54:54 +00:00
Benoît Ganne
ecb1634fa0 virtio: fix use-after-free
Type: fix

Change-Id: Ic67d9da65d937f56ecf994a5504c6351624b32ff
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 8f011830b2e01dfdbf8449b3145a4dd806b5515f)
2019-12-01 12:54:11 +00:00
Benoît Ganne
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 0b91bd6c52460c3bff9ae7b1c0405d258a016c32)
2019-11-28 10:17:39 +00:00
Florin Coras
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 52be67435eb4615b899950b42b8ff72d258fbcb3)
2019-11-28 10:06:34 +00:00
Neale Ranns
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 1976f36b09ead86874feb630277dfaeceed9c0fe)
2019-11-28 10:05:50 +00:00
Alexander Chernavin
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 aa27dcb84cb312277370b77370a69b2a3596c4c5)
2019-11-28 10:02:33 +00:00
Carl Smith
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 e16707b5b2195fda47c1a3db7ba61f30055d2dbc)
2019-11-28 09:56:15 +00:00
Carl Smith
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 592a909a302262cf4088a5468b8e427f577725e8)
2019-11-28 09:51:10 +00:00
Lijian Zhang
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 b15d796dbf1da6a229df4e10a3a2bdd700f0354e)
2019-11-28 09:46:03 +00:00
Florin Coras
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 f8461bfb4822ca20f64df19dfbb3170e99f7e89d)
2019-11-28 09:40:58 +00:00
Florin Coras
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 f1653e62fe41e3df429aadaaab22d0cc8aaa227a)
2019-11-28 09:39:19 +00:00
Srikanth Akula
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 cf4c2102d9dc3ccc939cca1137b24a75341f1b0c)
2019-11-28 09:37:41 +00:00
Florin Coras
67bb7ca004 session tcp: refactor pacer time
Type: refactor

Change-Id: Ic1c3e1f7987702cd88972acc34849dc1f585d5fe
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit a8e71c8981f039588a7ca94e6ab66b4ebac784a5)
2019-11-28 09:30:38 +00:00
haiyanx1.zhang
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 419d31f817af0436c699c0b565e2d6a058c487db)
2019-11-28 09:24:10 +00:00
Dave Barach
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 5932ce17e128c096fcc56eb04b27e780da3cf255)
2019-11-28 09:19:08 +00:00
Filip Tehlar
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
Benoît Ganne
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 6545df7913b53d71415c7c9643cb824c2ffbaaa7)
2019-11-19 12:17:48 +00:00
Florin Coras
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 8a754f1a55fb16a4d42efd5c606e5a07b4afffe9)
2019-11-18 13:49:06 +00:00
Neale Ranns
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 320dfcf2aa8f4617b51a2bb15f3d0f93ee62d4dc)
2019-11-18 13:45:06 +00:00
Benoît Ganne
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 318fbfe89d4143824cec1ed81f9f7fbcddc21639)
2019-11-18 13:43:02 +00:00
Benoît Ganne
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 a03c7d5b9280e1cd5d89cb7cc15bd05b56062c95)
2019-11-18 13:38:33 +00:00
Dave Barach
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 320998a8126766c0db92d9c7652f765f9565a7b5)
2019-11-18 13:37:23 +00:00
Florin Coras
636a840758 tcp: avoid retransmits post reset
Type: fix

Change-Id: Ib6a8f5ca597389700e5746f089a5cec7eee65ab5
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit fd4c3fe364becc02527ed5f9088d904c7bc34a6f)
2019-11-18 13:34:53 +00:00
Benoît Ganne
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 a50892e1504401e243076f08d9077675eb0b030e)
2019-11-18 13:32:59 +00:00
Damjan Marion
4cf238b9d7 tap: fix cli parser
Type: fix

Change-Id: I38ee9efd23774cce7790565825527cca9ba6f200
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 0ba86cb1bdcc273ebc3d5a92f765639a64894a7a)
2019-11-18 13:32:08 +00:00
Christian Hopps
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 d58419f19b33560d224471bc16674a525427308e)
2019-11-18 13:30:59 +00:00
Fan Zhang
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 bc2e640db7533394a3de7bdffd78fadf2a2ffd9f)
2019-11-18 13:30:35 +00:00
Florin Coras
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 c9dff181c8d135b95a12297c44bb4aa87b95b21d)
2019-11-18 13:29:09 +00:00
Andrew Yourtchenko
93feaa2fff tests: make threads in punt tests join when finished
The 42693521f6046997133c8f63bcfc9d615d96f69d 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 3f8c87132d63c14f1ba90d7db6cf2a2aba0f8cb9)
2019-11-18 13:28:35 +00:00
Filip Varga
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 5854b43de4c04a7c52b0cf03cd548c9cac86c325)
2019-11-18 13:19:19 +00:00
Ryujiro Shibuya
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 3ea17d54a9a00c81bc672a7be1d48b765ac87ed2)
2019-11-18 13:18:20 +00:00
Klement Sekera
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 45a95dd782b91e9ae5665b5f95be4b6d7f99b879)
2019-11-18 13:17:57 +00:00
Jakub Grajciar
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 718a19b8f9aa3dca26aaf4eb6bd9f60eb6376d30)
2019-11-18 13:17:43 +00:00
Andrew Yourtchenko
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 42693521f6046997133c8f63bcfc9d615d96f69d)
2019-11-18 13:17:27 +00:00
Benoît Ganne
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 f7f49640bbb4339d71f8b713b04b8f401d5fc270)
2019-11-18 13:17:12 +00:00
Christian Hopps
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 2e8b0618b12d317f2a4632e69a0663dcd8dde472)
2019-11-18 13:16:39 +00:00
IJsbrand Wijnands
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 bf103d99e651f3b221361f6d964ae84870fd7a6b)
2019-11-18 13:16:21 +00:00
Florin Coras
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 dd97a48d9fac91c7f16a31aa661dd6c968c3b760)
2019-11-18 13:15:56 +00:00
Alexander Kabaev
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 feda545105106d673fdca61028331c86eeb1f408)
2019-11-18 13:15:39 +00:00
Dave Wallace
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 b1a81aa67942aa1b5a97a4199310c9ffeaab1f5f)
2019-11-18 13:14:44 +00:00
Dave Wallace
af62709c74 tests: decode worker stdout/stderr output
Type: fix

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

Change-Id: Ibd122a4565c067627c4bbc8cac7df2d5b6497392
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit dbc9c599b9d4453c7433ac59dd21f088778e024b)
2019-11-18 13:12:13 +00:00
Florin Coras
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 2a7ea2ee92d6dc4800ee21323d3324a9e8449dcf)
2019-11-18 12:31:58 +00:00
Neale Ranns
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 1afe95272672ae0ff42109a9a682907fd169973e)
2019-11-15 07:42:36 +00:00
Dave Wallace
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 b101058890d66c960713fc7c203094fb54643755)
2019-11-15 07:42:11 +00:00
Benoît Ganne
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 972d71da8683259c238b3b0e69665655f2d35b70)
2019-11-15 07:36:27 +00:00
Filip Tehlar
dea724f796 ikev2: fix traffic selector match
Type: fix

Change-Id: I81ab3dcd03f397b3d275da6cfa094e048ad92f95
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit cb3cfe876b3bbe2f360e3b32a43a060bdcb8bf9e)
2019-11-15 07:25:14 +00:00
Florin Coras
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 2d0b2bbb97d57cb4bac30e4f3138b70c277aee47)
2019-11-15 07:22:59 +00:00
Dave Barach
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 a1f5a956e5b2cfeb591dcdfb34d23ebed84d0bca)
2019-11-15 07:22:16 +00:00