7525 Commits

Author SHA1 Message Date
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
Florin Coras
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 45b7973dddc9f1b50d7f20cc1abe150b2ad9931f)
2019-11-15 07:20:32 +00:00
Paul Vinciguerra
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 43d8cf6fad25ed8d53be38f824739c59a3aff716)
2019-11-15 07:18:59 +00:00
Paul Vinciguerra
8ef3741a27 dpdk: use local logger
Type: fix

Change-Id: I44922f70aef6a3c53f0f56c6d0656502c8fd69b2
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
(cherry picked from commit 59c110736bb173b9d65ced3020ea794daa0ff000)
2019-11-15 07:18:38 +00:00
Florin Coras
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 3b5e222f8a4d0ccd4ec4eace2551491f13de85d9)
2019-11-15 07:15:44 +00:00
Benoît Ganne
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 cf7803d2e864fb71f14943a544ac309d3d0510cb)
2019-11-15 07:15:07 +00:00
Dave Wallace
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 2456433df46ae99dfbcec6260d14e592b5823c83)
2019-11-15 07:12:43 +00:00
Florin Coras
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 ef7cbf6adf1882af4d4ae8657632d4a2a59efcb2)
2019-11-15 07:11:33 +00:00
Yulong Pei
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 45495480c8165090722389b08075df06ccfcd7ef)
2019-11-15 07:11:04 +00:00
Florin Coras
ab46b6a03b tcp: fix retransmit with no sacks
Type: fix

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

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

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

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

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

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
Jianlin Lv
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
Chenmin Sun
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 5bec5f7860dafcef6aefd50b74de15d08910c6f4)
2019-11-05 10:47:31 +00:00
Benoît Ganne
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 4354317bf3592d81fcafd94e33b320c3e49f45d3)
2019-11-05 10:46:54 +00:00