8851 Commits

Author SHA1 Message Date
Vladimir Isaev
18a4a37164 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
2020-03-21 12:09:38 +00:00
Filip Tehlar
2d82281821 ikev2: fix l2 interface
Type: fix

Change-Id: Ic6457da31846721e334f144f15d404575eeb73e5
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-03-21 12:08:29 +00:00
Mohsin Kazmi
529f0e97b6 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>
2020-03-21 12:06:26 +00:00
Filip Tehlar
e5d34919b4 ikev2: add support for custom ipsec-over-udp port
Type: feature

Change-Id: Ifee2b3dca85ea915067b9285e3636802bf0c19a8
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-03-21 11:50:03 +00:00
Mohsin Kazmi
7f6d145acc 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: I57323303349f6a385e412ee22772ab979ae8edbf
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-03-21 11:36:04 +00:00
Jieqiang Wang
76c6159d83 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>
2020-03-21 11:34:43 +00:00
Florin Coras
34177e8763 tcp: avoid spurious retransmit attempt
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6ce6fb0fe0ceb8a70b6a13e6a72fdb842bfded7a
2020-03-20 20:25:37 +00:00
Benoît Ganne
72f4921c8e rdma: ring db only once per vector on tx
Type: improvement

Change-Id: I09b017d60bc38ff8a4a7a73aff42b27611bd8955
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-03-20 17:40:36 +00:00
Andreas Schultz
1a8c43778f session: export session_alloc_for_connection
Type: refactor

Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
Change-Id: I45c6f434065ab0ad8ada3184b5a875a32a1b3faa
2020-03-20 14:45:01 +00:00
Jawahar Santosh Gundapaneni
62ad2aaff3 ip: provide extern declaration for ip punt nodes
Type: fix

Signed-off-by: Jawahar Santosh Gundapaneni <jgundapa@cisco.com>
Change-Id: Ife0f7749a72cc834a3d811f8cf6b5a0840157014
2020-03-20 13:59:48 +00:00
Jakub Grajciar
f872e9e99c ip: ip API types coverity fix
Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: I6b2c7550ae5918c27b02b1173533d2042c6c15c7
2020-03-20 13:48:50 +01:00
Florin Coras
27bb99ec80 tcp: move accept init to separate reusable function
Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5120eb321e9e2050eb64dca9e2dfb6256ff2b62d
2020-03-19 15:44:04 +00:00
Florin Coras
6080e0d15e tcp: force deschedule if no send space available
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iae9f118f710153b6c0e390265039db7434e67ed8
2020-03-19 14:48:15 +00:00
Florin Coras
70f879d285 session tcp udp: consolidate transport snd apis
Type: improvement

Use only one api to retrieve transport send parameters. Additionally,
allow transports to request postponing and descheduling of events.

With this, tcp now requests descheduling of sessions when the
connections are stuck probing for zero snd_wnd

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I722c974f3e68fa15424c519a1fffacda43af050c
2020-03-19 14:46:01 +00:00
Florin Coras
7fd59cc79c tcp: count dupacks with no sacks
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia2e29b4776c0f8df666da39a14c5ef2fa1693c21
2020-03-19 14:45:35 +00:00
Jakub Grajciar
7dd63e5cc1 ip: change ip API enums address_family and ip_proto size to u8
Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: I73d27520726543d6375caad76a841339f68c3533
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-03-19 12:49:55 +01:00
Neale Ranns
f14578972a fib: format functions for path
Type: improvement

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Ib7a9e457cb2462e6ce9e5e2af53d1f997f4ae6cf
2020-03-19 07:55:52 +00:00
Dave Barach
6d97e62c00 build: add snap packaging (experimental)
Type: feature

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I5a5efde5378f63d89d82d71ae009c7595aaa800c
2020-03-18 16:14:52 +00:00
Jon Loeliger
6a32ce3264 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: faf22cb303b65e2a6bf8dad959d7f5ee6d031c4f

Change-Id: Iebcf35fdd421293dccbcaefadef767f7e139438e
Signed-off-by: Jon Loeliger <jdl@netgate.com>
2020-03-18 15:53:24 +00:00
ShivaShankarK
b0f956c255 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
2020-03-18 10:14:42 +00:00
Neale Ranns
03c254ec70 fib: Always install all routers mcast addresses
Type: improvement

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Ia8dff15855a81cf29729bdaa3ff28fbe3254fa97
2020-03-17 18:38:29 +00:00
Ryujiro Shibuya
64e96613d2 svm: fifo test
Type: feature

Adding a very simple test case just to confirm that setting fifo size
same as the current in-use size would result no space to enqueue, which
is zero-window in the TCP.

Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com>
Change-Id: I6d60449386eaa270f801d2046cc7e546f843bf34
2020-03-17 17:06:56 +00:00
Neale Ranns
3ec09e9243 ip: ip_address_t uses ip46_address_t
Type: improvement

type re-use.

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Ic2a2e6babf9ae66a1e53aec53a6cd157e1893dc8
2020-03-17 14:04:02 +00:00
Damjan Marion
6844985078 ipsec: initialize algs to none in 'create ipsec tunnel' cli
Type: fix
Change-Id: I901c9384710eee5847b3fbce060c78e115ba4169
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-03-17 12:32:58 +00:00
Jakub Grajciar
933fcf4893 api: API cleanup
Use consistent API types.

Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: Ic108311e09c56cc2b3db63d5850598b6896a7897
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-03-17 07:51:40 +00:00
Neale Ranns
6ca2ac3f80 arp: Restore CLI for setting ARP proxy entries
Type: fix

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: I3a21afef86990c1198ffcc47ffe2dba8a97125ee
2020-03-16 21:27:11 +00:00
Damjan Marion
aaa65a12e4 rdma: optimize tx wqe_init
Type: improvement
Change-Id: I7f28a3f03ab1ea8461c52743c61dc23a57965237
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-03-16 19:09:39 +00:00
Benoît Ganne
dc812d9a71 rdma: introduce direct verb for Cx4/5 tx
Direct Verb allows for direct access to NIC HW rx/tx rings. This patch
introduce TX direct verb support for Mellanox ConnectX-4/5 adapters.
'dv' mode must be explicitely selected at interface creation to benefit
from this.

Type: feature

Change-Id: If830ba9f33db73299acdbddc68b5c09eaf6add98
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-03-16 19:09:39 +00:00
Damjan Marion
dd648aac06 rdma: add Mellanox mlx5 Direct Verbs receive support
Type: feature
Change-Id: I3f287ab536a482c366ad7df47e1c04e640992ebc
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-03-16 19:09:39 +00:00
Ryujiro Shibuya
d35887297d svm: chunk alloc stats
Type: feature

Showing number of allocated chunks by size, in addition to the freelist chunks by size.

Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com>
Change-Id: I50f7b695a217f132d5f0b307182a34752d3fe1dc
2020-03-16 18:19:34 +00:00
Simon Zhang
3cfed05891 tls: refactor Picotls ctx_read function to reduce one time memory copy
Type: refactor

Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
Change-Id: I7a952fd95e49468a0d1c763b3e289648c93539da
2020-03-16 12:39:27 +00:00
Jakub Grajciar
7c0eb56f40 vxlan: vxlan/vxlan.api API cleanup
Use consistent API types.

Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: I7f6f37ec6eed780322e2488d6eb0f5681945ba09
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-03-16 09:18:46 +00:00
Alexander Chernavin
cd5a4a035c map: fix translation of icmp4 error messages
ICMP error messages are translated to ICMPv6 error messages with
erroneous destination address in the outer IPv6 header because sender
port is used instead of receiver port.

Both source and destination addresses in the inner IPv6 header are
translated erroneously because source and destination addresses of the
inner IPv4 header are getting zeroed during the translation.

With this commit, use receiver port for translation and save addresses
of the inner IPv4 header before translation of the inner header.

Type: fix

Change-Id: I1e93d54c1bbc154b401adcbb0fb661299655d01a
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2020-03-15 11:37:17 +00:00
Klement Sekera
1e844aa1ce nat: test cleanup
Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I5ec761bfcdc13a8238b83ff46c2f1c53ec0e79d8
2020-03-15 11:36:17 +00:00
Simon Zhang
88da0a3054 tls: small refactor for Picotls engine ctx_write function
Type: refactor

Change-Id: I761fc764e6771dc95eb64614479c27fd44016690
Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
2020-03-13 15:21:09 +00:00
Elias Rudberg
dd9aedaf37 nat: in2out/out2in handoff node index bugfix
This fixes a bug in the initialization of handoff_out2in_index and
handoff_in2out_index where the node index for out2in was set to the
in2out node, and vice versa.

Type: fix

Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Change-Id: I983ddd3b3cec06f4cb3fb95b2a9cda4ab6d1270f
2020-03-13 14:24:43 +00:00
Florin Coras
178ecc0a9a vlib: add verbose sh node option
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I915dace4afe07ac3281f248ef7468fa5247c9668
2020-03-13 13:56:40 +00:00
Pablo Camarillo
2b2a40cf3f sr: SRv6 coverity
Fixes 4 coverity issues

Type: fix

Signed-off-by: Pablo Camarillo <pcamaril@cisco.com>
Change-Id: Ib3ef1df3e5d601d7751445ae1c9603bb6ce0f80c
2020-03-13 13:34:31 +00:00
Dave Barach
7e86947d77 devices: netlink create the object if missing
Type: fix
Fixes: b49bc1a

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I3dd81a2484c8b4925fd07556576c29d1cde337e1
2020-03-13 08:33:00 -04:00
Filip Varga
a73f2d6f53 nat: timed out session scavenging upgrade
Patch changes the behavior of session scavenging and fixes multiple
nat issues. Allows proper session clearing and removes issue with lingering sessions
in session db. Patch also updates and fixes CLI/API calls for better readability
of session state metrics. Fixes security issue that would allow attacker to
reuse timed out session in both directions (in2out/out2in).

Type: improvement

Signed-off-by: Filip Varga <fivarga@cisco.com>
Change-Id: I78897585a2a57291fad5db6d457941aa0a0457bd
2020-03-13 11:17:13 +00:00
Neale Ranns
c27b436732 dpdk-ipsec: Fix for multipoint IPSEC
Type: fix

fetch the sa_index from the correct location

Change-Id: I351035ee0226c47585995ff9122320fd5c73ec53
Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-03-13 07:20:42 +00:00
Klement Sekera
de57ca3eac tests: avoid unnecessary rebuilds
Improve dependency tracking on vapi_test directory so that vapi_c_test
rebuild doesn't force vapi_cpp_test rebuild and vice versa.

Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I00094c6374981333858ddbe6ae934cfda3b33a36
2020-03-13 02:03:44 +00:00
Benoît Ganne
e7e1b32520 rdma: cleanup rdma-core build
Type: improvement

Change-Id: I298bbb81c753d60288ac63bebf2bdfea323af68b
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-03-12 21:29:47 +00:00
Florin Coras
0269fa14d6 svm: cleanup chunk and fifo allocation
Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I2426211f48b242e51aeb1edc87c1cd21c526dbfa
2020-03-12 21:21:32 +00:00
Dave Barach
197180031b vppinfra: refactor clib_timebase_t
Add a clib_time_t * argument to clib_timebase_init(...), to encourage
client code to share the vlib_main_t's clib_time_t object.

Display the current day / date in GMT via the "show time" debug CLI.

Fix the test framework so it processes the new "show time" output format.

Type: refactor

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I5e52d57eb164b7cdb6355362d520df6928491711
2020-03-12 20:55:17 +00:00
Dave Barach
7a91b0e264 vppinfra: remove time jump workaround
A partial revert of gerrit 25729. The last_run_time == 0.0 check is
necessary and remains in place.

Type: fix
Fixes: 3d9f134

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I3d2c9f90b2bc867f02c4749a5b19f997b84185b9
2020-03-12 14:43:36 -04:00
Chenmin Sun
f3468975d8 dpdk: tx/rx burst function description refactor
DPDK provides two new APIs to retrieve information about the Tx/Rx
packet burst mode:
rte_eth_tx_burst_mode_get
rte_eth_rx_burst_mode_get

This patch leverages these two APIs to describe the tx/rx mode.

Currently, Intel X710/E810 and Mellanox Mlx5 support the new APIs.
For NICs that don't support the new APIs, still use the original way
to print their tx/rx function name

Type: refactor

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: Ibe47f5debe3b3f17f462fbf9834394e22845cc08
2020-03-12 17:50:11 +00:00
Matthew Smith
30fa5d1e17 vrrp: unit tests do not run by default
Type: fix
Fixes: 39e9428b90

VRRP unit tests fail sometimes for changes which have not touched any
code related to VRRP. There were some timing-related changes recently
which probably made the VRRP tests, which rely on a VR changing state
within a certain amount of time, start failing.

Set the VRRP tests to only run with the extended tests rather than
running by default. This is temporary so VRRP will not cause spurious
build failures while a proper solution is figured out.

Change-Id: I5826ea39b944dfb9b0ca4bdfa2ebbe86d269f935
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-03-12 10:52:08 -05:00
Fan Zhang
ce266ad574 vlib: fix unix cli SIGSEGV for empty line input
When logging is enabled, an empty line input (press Enter only)
will cause SIGSEGV. This patch fixes the problem by checking
the command length first.

Type: fix

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Change-Id: Ib4cbd1c7bfd6a694e289d28958875c7d2356a93e
2020-03-12 12:51:00 +00:00
Jakub Grajciar
cd01fb4237 policer: API cleanup
Use consistent API types.

Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: Ia14f33992353b419b70b55beed63ab8ed6a2e837
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-03-12 12:28:47 +00:00