8897 Commits

Author SHA1 Message Date
Vladimir Ratnikov
958919f363 nat: dslite ce mode in separate config entry
Previously dslite was moved to separate plugin folder
and CE mode was removed. But it still needed.
This patch adds CE option to separate config entry

Type: feature

Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com>
Change-Id: If153ae08fa385ba5a6605cb412e49bbb4d1db46c
2020-04-21 13:33:22 +00:00
Dave Barach
16e4a4a0ae vppinfra: bihash improvements
Template instances can allocate BIHASH_KVP_PER_PAGE data records
tangent to the bucket, to remove a dependent read / prefetch.

Template instances can ask for immediate memory allocation, to avoid
several branches in the lookup path.

Clean up l2 fib, gpb plugin codes: use clib_bihash_get_bucket(...)

Use hugepages for bihash allocation arenas

Type: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Signed-off-by: Damjan Marion <damarion@cisco.com>
Change-Id: I92fc11bc58e48d84e2d61f44580916dd1c56361c
2020-04-21 10:26:14 +00:00
Benoît Ganne
b9753540d2 sr: fix non-NULL terminated string overflow
Type: fix

Change-Id: Ia5ae0e893a5358f61353d20f444d88d79953e482
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-04-20 19:55:27 +00:00
Florin Coras
0e6199dfa2 svm: check if fifo free list index is valid on alloc
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Change-Id: Ib85c2f01dc7ec9858f2f88b89e209f989d78c5d9
2020-04-20 17:04:29 +00:00
Benoît Ganne
7ce23f25bb session: fix use-after-free in input node
Type: fix

Change-Id: Ie60b07abe76ad166f048f5885accd7038d8153b2
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-04-20 16:07:09 +00:00
Florin Coras
da302e4fce session: avoid rx notifications on accepting sessions
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iba37e528e968104c3ba9c8324438ba695ddddfd1
2020-04-20 14:47:02 +00:00
Florin Coras
f49cf470c5 vcl: ensure sessions are open on select events
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4d56b61af574dfdaf6028160ce331606bdf65609
2020-04-20 14:46:41 +00:00
Florin Coras
cbce80aaa3 vcl: expand vcl select maps in ldp if needed
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I56c487821233cebf2146745a4706cb573cc088a5
2020-04-20 14:46:23 +00:00
Klement Sekera
b86437b79b nat: remove unused code
Type: improvement

Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: If5c00faa309cf3e1ea8bdf8b23250041f6a499c4
2020-04-20 11:46:35 +00:00
Benoît Ganne
040d47c2cc gbp: fix l3-out anonymous test cleanup
Type: fix

Change-Id: Ib455b0a57f9b4f9cb82bb295c220270d0c6e5fe5
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-04-20 07:56:32 +00:00
Simon Zhang
c118229595 tls: fix Picotls tx hang issue
Type: fix

Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
Change-Id: Id84fbe412c99b39a0754b892ca971dd3e4434264
2020-04-20 01:12:34 +00:00
Florin Coras
701c099fad session: fix half-open cleanup
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I931d23cf617c8f24fe9a02982ab129785bbd184d
2020-04-19 19:20:19 +00:00
Benoît Ganne
101fc278c3 lisp: fix use-after-free
Type: fix

Change-Id: I42c3e3514ba50d40e09ee688d083f3e78fa0713a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-04-17 20:30:02 +00:00
Andreas Schultz
63551351b7 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
2020-04-17 19:09:28 +00:00
Florin Coras
e57df7c677 tcp: cubic as default cc algorithm
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I48ce827966667a767440149769eb1b24616ce4c1
2020-04-17 19:07:39 +00:00
Mohsin Kazmi
ce21599c8a virtio: fix to use chained descriptors when missing indirect descriptor
Some vhost-backed missing the VIRTIO_RING_F_INDIRECT_DESC feature.
Previously, vpp doesn't support jumbo frames using chained descriptors.
This patch fixes this issue.

Type: fix

Change-Id: I20487e201e88ea136b556ac84dde058019ab3e78
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-04-17 16:36:45 +00:00
Alexander Chernavin
82fc98fa45 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>
2020-04-17 15:05:25 +00:00
Florin Coras
d50ff7fba1 session tcp: track half open in app wrk
Type: improvement

Do extra checks when establishing an active connect and cleanup pending
connects if application detaches.

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ibe9349db57b313ba2aa5ea3960ef5cf755f5098a
2020-04-17 14:58:23 +00:00
Florin Coras
ce815deb72 vcl: fix app destroy
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I21daa87b1a301142270a1bf20680dd9e9395aac9
2020-04-17 12:05:39 +00:00
Yu Sun
6f5b72ec01 vppinfra: install missing tw_timer_2t_2w_512sl header file
Type: improvement

Signed-off-by: Yu Sun <yusun2@cisco.com>
Change-Id: I68aea7c5776c5b31081c98388df4133d2062218a
2020-04-17 12:02:16 +00:00
Mohsin Kazmi
206acf84d6 tap: add initial support for tun
Type: feature

Change-Id: I699a01ac925fe5c475a36032edb7018618bb4dd4
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-04-17 11:28:14 +00:00
Benoît Ganne
95eb01fdc6 fib: fix use-after-free
Type: fix

Change-Id: Ie7081d977dd0d3e7d09bc0d1b4d53863288e443b
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-04-16 17:17:12 +00:00
Benoît Ganne
ea9bc28592 ipsec: fix use-after-free
Type: fix

Change-Id: I1068ff1d03883addb5fe1005a8b608eab17e4168
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-04-16 17:16:36 +00:00
Benoît Ganne
77100efb37 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>
2020-04-16 17:16:11 +00:00
Benoît Ganne
bd7f3422bb 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>
2020-04-16 17:15:03 +00:00
Andreas Schultz
063f2b86ed udp: fix buffer trace
Type: fix

Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
Change-Id: I774ca50582281cb3cc5e43417e74d178bf4909bd
2020-04-16 16:20:43 +00:00
Filip Varga
1a0a897706 nat: scavenging functionality removed
Type: refactor

Change-Id: I9f743ba2818e1b1c5004c3575925cc7b479948d8
Signed-off-by: Filip Varga <fivarga@cisco.com>
2020-04-16 14:05:46 +02:00
Damjan Marion
8daeea9a5d vppinfra: don't use memcmp to compare keys in cuckoo
Type: improvement
Change-Id: I7e11bf72be5fad5967724c038eb649a261294ca0
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-04-15 19:34:11 +00:00
Damjan Marion
88bcba80d5 vppinfra: delay bucket2 calc in cuckoo search
There is no need to calculate bucket2 if there is hit on bucket1

Type: improvement
Change-Id: Id01c37963497668c0160068501294568a181d011
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-04-15 19:34:03 +00:00
Damjan Marion
7edc86d005 vppinfra: add clib_cuckoo_search_inline_with_hash function
Type: improvement
Change-Id: I547263ae954506f11101666ff768524fbfdb579e
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-04-15 19:33:45 +00:00
Dave Barach
08eb2bb205 pg: set vnet buffer flags in pg streams
See .../extras/pg/checksum_offload.pg for a nontrivial example, which
deliberately sets bogus ip and udp checksums in the generated packets,
then fixes the mess with (software emulated) hardware checksum
offload.

Validated via "pcap dispatch trace on max 1000 buffer-trace pg-input 100".
Packets stuffed into loop1-output have the configured bogus ip and udp
checksums. vnet_calc_checksums_inline(...) fixes the checksums, which
are correct when packets visit loop1-tx.

The packet generator is a dumb robot in this regard. If you ask for a
ridiculous flag combination - example: ip4 and ip6 - your mileage may
vary.

Type: feature

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I6d9e790f373bcd9e445a89113ca8e4c8f9aa9419
2020-04-15 19:19:29 +00:00
Damjan Marion
4422753b9f vppinfra: install missing cuckoo hash header files
Type: improvement
Change-Id: Ifb4eec00fd4f1d19e4b0af802d015a35e402e0af
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-04-15 17:23:50 +00:00
Florin Coras
77ea42b31a session: detach session from app on cleanup
Type: fix

Avoids unwanted notifications.

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ifff27fb0d3644194e3bb3f91d7ed1fd02c6730cd
2020-04-15 15:00:05 +00:00
Neale Ranns
92d0eacefb urpf: Allow locally generated packets on TX
Type: fix

Change-Id: I87d301aec20b9f5b34997b394493c796188fce14
Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-04-15 14:55:42 +00:00
Florin Coras
1e8d949781 tcp: allow local port sharing if 5-tuple available
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id0c4b46247e7419a328387678a4753cfb1e42d75
2020-04-15 14:04:04 +00:00
Dave Barach
1bd2c019eb misc: refactor calc_checksums
Merge two mildly incompatible static inlines, and rename the results
vnet_calc_checksums_inline (...).

The resulting inline has three additional parameters: int is_ip4, int
is_ip6, and int with_gso. All calls manage to pass one or more as
compile-time constants, which causes a certain amount of code to
disappear in each instantiation.

Type: refactor
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I1a2a0e353b9a7bca20bc81318e8c915617261e1a
2020-04-15 11:00:26 +00:00
Dave Barach
69eeadc03f vat: fix socket connection
vat_socket_connect(...) needs to set the api main client index. The M2
helper macro needed to allocate a buffer of size sizeof(*mp) + n, not
sizeof(*mp).

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I7abf35d2ba045d82765bd27f88899287fd351602
2020-04-14 21:40:46 +00:00
Florin Coras
1bd461615f session: avoid all session cleanup on unlisten
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ifff49366ad538bf2dd64487cae17e7457dff064f
2020-04-14 14:44:50 +00:00
Neale Ranns
d724e4f43b urpf: Unicast reverse Path Forwarding (plugin)
Type: feature

 - move the IP4 code to plugin
 - add ip6 support
 - add suport for uRPF on TX
 - add tests

Change-Id: I074c2debc486d3e79c12fad4b8dbd72c41e841a0
Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-04-14 09:40:48 +00:00
Matthew Smith
dc3e966485 ipsec: validate number of input sas
Type: fix

There is a statically allocated array for inbound SAs which can hold
4 IDs. The input parameter containing the IDs of th inbound SAs is a
vector and Its possible to pass a vector with more than 4 elements
and write the memory past the end of the array. Fail if more than 4
SAs are passed in the vector.

Change-Id: I0c9d321c902d6366b8aff816d04e343dcbd110eb
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-04-14 07:37:28 +00:00
Florin Coras
4fde4ae036 session: remove ho with fifos support
Type: refactor

UDPC (removed) was the only consumer.

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I2812bf58d3c68fe021ec73acaa1bd00ef3172846
2020-04-13 16:58:11 +00:00
Dave Barach
c74b43c807 buffers: configurable buffer fault injector
When configured at compile time via the cmake
VPP_BUFFER_FAULT_INJECTOR option, the buffer allocator will appear to
fail a certain fraction of the time.

By default, the allocator succeeds 80% of the time. Detailed command
line configuration options are available, but only when the image has
been compiled with cmake option described above:

    vlib { buffer-alloc-success-rate [0.0 ... 1.0]
           buffer-alloc-success-seed <nnnn> }

Modify vlib_buffer_pool_create(...) so 0 is always an invalid buffer
index.

Debug images: add checks for bad buffer index enqueues, and also
verify that f->n_vectors doesn't accidentally map one or more
instances of the frame poison pattern 0xfefefefe.

Type: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Iab939858014463d1e664682805013d334d6fcbe5
2020-04-13 15:54:31 +00:00
Dave Barach
c54162981c dhcp: fix unicast pkts, clean up state machine
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
2020-04-13 14:51:18 +00:00
Florin Coras
111666766d session: cleanup debug code
Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie6c03195019fe18c547b22f4387d7f2b14b71461
2020-04-13 03:04:45 +00:00
Srikanth Akula
7357043d2a session: adding debug events
Type: feature

Enhancing the debugging capability of tcp session layer by measing time spent for various events.
This is meant only for debugging purpose

Signed-off-by: Srikanth Akula <srakula@cisco.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I9f401881b345bcae5f7d8050338637fd47b3723b
Signed-off-by: Srikanth Akula <srakula@cisco.com>
2020-04-13 00:34:05 +00:00
Simon Zhang
c39150df4d tls: make ctx_write function return the length of enqueue
Type: fix

Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
Change-Id: Ia8656fe2c48799e53c1b2c064009848ad3457659
2020-04-11 18:10:25 +00:00
ShivaShankarK
35acaac184 fib: fix accessing empty dpo pool elements
Type: fix

Signed-off-by: ShivaShankarK <shivaashankar1204@gmail.com>
Change-Id: Iee88a2101ce42d7f1cdb65df532c349d14829e4c
2020-04-11 17:07:43 +00:00
Florin Coras
256779c857 udp: remove connected udp transport proto
Type: refactor

To reproduce functionality, use udp in combination with
TRANSPORT_CFG_F_CONNECTED transport flag set in connect and listen
parameters.

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id88470c38326f8168b9646b0de49a674e0f4266f
2020-04-10 19:52:04 +00:00
Aloys Augustin
92e131468b quic: fix clean stream close
Properly close the stream sending side instead of resetting the entire
stream.

Change-Id: I2daca7e507daa7bf9cd6a27fa8828a9ea7d175f9
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2020-04-10 17:04:46 +00:00
Florin Coras
bc1a1a7347 udp: fix local node no port error counter
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie0c5a86aedfa38fdcbb835aee7c9e91d59b222d6
2020-04-10 15:23:02 +00:00