vpp.git
4 years agolacp: mark is_mp_safe for show and dump binary API 44/22244/2
Steven Luong [Fri, 16 Aug 2019 03:30:23 +0000 (20:30 -0700)]
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 cda35b38d7b690a63a17967268e8c1339a16dfd2)

4 years agointerface: Remove residual dpdk bonding code 40/22240/2
Steven Luong [Tue, 27 Aug 2019 14:43:27 +0000 (07:43 -0700)]
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 5ad541eeaa428c6a88c40e2088cdaabc0748c9df)

4 years agotcp: fix byte tracker samples flush 36/22236/2
Florin Coras [Fri, 23 Aug 2019 17:28:01 +0000 (10:28 -0700)]
tcp: fix byte tracker samples flush

Type: fix

Change-Id: I3b4cb8fc17387693d6ad6cdef004ca99cd56bc23
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 92f190a802b6999ce68696032e556aa75171e1cc)

4 years agoipsec: Add 'detail' option to 'sh ipsec sa' 41/22241/2
Neale Ranns [Tue, 27 Aug 2019 12:47:17 +0000 (12:47 +0000)]
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 670027a50682b88c3082aad70072139ce87a0d52)

4 years agoip: reassembly: remove unnecessary code 38/22238/3
Klement Sekera [Tue, 27 Aug 2019 09:20:33 +0000 (09:20 +0000)]
ip: reassembly: remove unnecessary code

Type: refactor

Change-Id: I30cb324006c3c6ab88d01c044cf80fab3a34f13a
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit 8e9e0eccb280619f10d287dad3f79541ade03adc)

4 years agoip: fix merge issue 35/22235/3
Klement Sekera [Thu, 22 Aug 2019 11:34:33 +0000 (11:34 +0000)]
ip: fix merge issue

Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Idd64b0b3eedb7179f6d316b66cea8160ad577990
Type: fix
Fixes: 630ab5846bceddf8d663e9f488a2dc0378949827
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit 95e091b268212c4bc7153d1526fdffd3ce1d647a)

4 years agoip: reassembly: send packet out on correct worker 24/22224/4
Klement Sekera [Fri, 19 Jul 2019 09:14:19 +0000 (09:14 +0000)]
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 630ab5846bceddf8d663e9f488a2dc0378949827)

4 years agotests: support worker threads 23/22223/3
Klement Sekera [Wed, 31 Jul 2019 13:14:16 +0000 (13:14 +0000)]
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 4ecbf105a4290de9917b1ded14b0854c68cbd655)

4 years agovlib: fix null pointer crash on strncmp 34/22234/2
Steven Luong [Wed, 21 Aug 2019 18:35:27 +0000 (11:35 -0700)]
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 ab4899257a77edecfbf9a97cf67acc26a2133119)

4 years agolb: fix memcpy error issue 51/22251/1
Yulong Pei [Fri, 23 Aug 2019 09:24:13 +0000 (17:24 +0800)]
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 71f36067ca923fa4eb10060d6f6878f5fa864673)

4 years agosr: fix sr_set_encap_source reply 32/22232/2
Vratko Polak [Wed, 21 Aug 2019 16:40:03 +0000 (18:40 +0200)]
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 1096b46d9bfeb4f4c6c3bcd7b12b1d99c5da54a4)

4 years agohsa: move udp_echo to vpp_echo 22/22222/2
Nathan Skrzypczak [Mon, 12 Aug 2019 14:12:48 +0000 (16:12 +0200)]
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 dee4c2e40333580a5a8817ed217807db48224399)

4 years agomisc: missing ntohl for bond_slave's custom dump 25/22225/2
Steven Luong [Tue, 20 Aug 2019 18:39:00 +0000 (11:39 -0700)]
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 58caa37dcac3cef95279f8b2c82082b1a2af6a62)

4 years agoavf: fix init when num_rx_queues > num_tx_queues 26/22226/2
Damjan Marion [Tue, 20 Aug 2019 15:51:22 +0000 (17:51 +0200)]
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 017002ae357a05ca1ae1b7d8fbc7bbc8063c9e34)

4 years agotcp: add option for always on event logging 30/22230/2
Florin Coras [Tue, 20 Aug 2019 14:09:31 +0000 (07:09 -0700)]
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 a436a42221280888acd09858c7353e694c359bca)

4 years agovcl: fix ldp_set_app_name overflow 31/22231/1
Benoît Ganne [Wed, 21 Aug 2019 16:27:23 +0000 (18:27 +0200)]
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 747b3d8b0e045edb166738ecde99dcc951212988)

4 years agoquic: fix rx_callback refactoring 87/22187/2
Nathan Skrzypczak [Mon, 19 Aug 2019 15:49:56 +0000 (17:49 +0200)]
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 1682b51c416561b083d84194d49ff617e070eb47)

4 years agohsa: move tcp_echo to vpp_echo 88/22188/2
Nathan Skrzypczak [Mon, 12 Aug 2019 10:02:25 +0000 (12:02 +0200)]
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 a8462fbca3bdfa5da602f7787f83bbdf8da64d5d)

4 years agotests: Revert "Tests: Example duplicate code refactoring." 90/22190/2
Klement Sekera [Wed, 24 Jul 2019 12:40:37 +0000 (12:40 +0000)]
tests: Revert "Tests: Example duplicate code refactoring."

This reverts commit 6955595a577e1b7d316b5b69267bf1d1d951a4ab. 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 947a85c7792b14d4cc84b0d25c953102435069e5)

4 years agovppapigen: remove python2 support 89/22189/2
Paul Vinciguerra [Wed, 7 Aug 2019 02:02:45 +0000 (22:02 -0400)]
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 2cd3cc8a605a062c7900dbcc3fad53d04723c298)

4 years agotcp: forward conn resets through tcp-output 91/22191/1
Florin Coras [Mon, 19 Aug 2019 01:09:28 +0000 (18:09 -0700)]
tcp: forward conn resets through tcp-output

Type: refactor

Change-Id: I5718853d89ebeae9d66be975a803a3674bec5986
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit df36f4963f1a590ce9a02f048507c3d4590580ae)

4 years agotests: fix test-checkstyle to check plugin tests 86/22186/2
Dave Wallace [Sat, 21 Sep 2019 03:53:22 +0000 (03:53 +0000)]
tests: fix test-checkstyle to check plugin tests

Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I93eb0ae4338247fa2479f8e419483d1593436dc7

4 years agovppinfra: Update "show cpu" output for AArch64 chips 70/22170/3
Nitin Saxena [Thu, 28 Mar 2019 09:12:31 +0000 (14:42 +0530)]
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 c9122f97398b11f8be0256901a0cbd83dc3b6511)

4 years agodpdk: fix ipsec coverity warning 73/22173/2
Matthew Smith [Fri, 16 Aug 2019 16:30:02 +0000 (11:30 -0500)]
dpdk: fix ipsec coverity warning

Type: fix
Fixes: 5025d40a1134272ab57c3c3f10311e31a65cd63c

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 c458f5c09a21cc905aa1b53eda30736e52426418)

4 years agovlib: fix vlib_buffer_main_init_numa_node memory leak. 72/22172/2
Guanghua Zhang [Sun, 18 Aug 2019 00:35:04 +0000 (08:35 +0800)]
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 785daf4f847a786ba618e3017752567f20f0be1c)

4 years agobuild: fix vpp compilation failure on ThunderX2 and Amp 71/22171/2
Jianlin Lv [Thu, 27 Jun 2019 05:50:30 +0000 (13:50 +0800)]
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 416e32cf9292b899cbed28ec29836517eb942206)

4 years agoip: leverage existing vlib_buffer_advance 69/22169/2
Zhiyong Yang [Wed, 26 Jun 2019 02:41:55 +0000 (22:41 -0400)]
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 a6659214aa7be7fe9fa04fbdc744affaaa8324ec)

4 years agonsh: rewrite nsh_output_inline 68/22168/2
Zhiyong Yang [Wed, 24 Jul 2019 05:43:39 +0000 (01:43 -0400)]
nsh: rewrite nsh_output_inline

Type: style

Change-Id: I0c870eddb427efa26cd5b52daf12b13c3927976a
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
(cherry picked from commit e16f6a77eb18f1e9b61f987089c82fe38bc317b2)

4 years agordma: add support for MAC changes 67/22167/2
Benoît Ganne [Mon, 12 Aug 2019 09:44:20 +0000 (11:44 +0200)]
rdma: add support for MAC changes

Type: feature

Change-Id: I5803b52d12e56f2ccc1316e89ece6f1c5898810a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 0dcafcc505dccb9243c90c57a20295d4f0afce29)

4 years agodpdk: add TSO support in dpdk plugin. 66/22166/2
Chenmin Sun [Wed, 17 Jul 2019 14:29:44 +0000 (22:29 +0800)]
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 de5ed58fdb72536ed928e12990a08104e1f89f51)

4 years agodpdk: QAT devices update, add c4xxx and xeon d15xx 62/22162/2
Jim Thompson [Mon, 12 Aug 2019 07:03:38 +0000 (02:03 -0500)]
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 4d843b9940a8fbcd0b54c8a66916b9ba66e4f2c9)

4 years agordma: add support for input feature arcs 61/22161/2
Benoît Ganne [Wed, 7 Aug 2019 11:35:29 +0000 (13:35 +0200)]
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 74eba446b1e71f7fe5bac29cf30d4363a9b8b0cd)

4 years agosession: add explicit reset api 60/22160/2
Florin Coras [Sat, 17 Aug 2019 00:48:44 +0000 (17:48 -0700)]
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 dfb3b8771292e4c863ca266856aa2b5eb7cc7518)

4 years agotcp: set cc_algo on connection alloc 59/22159/2
Florin Coras [Fri, 16 Aug 2019 16:44:00 +0000 (09:44 -0700)]
tcp: set cc_algo on connection alloc

Type: feature

Change-Id: Ie00329b11e26cab5db64b9c006171d283854c8ef
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 12f6936cd8f69f17820ef749515fcf4d50001c60)

4 years agotcp: allow cc algos to set pacing rate 58/22158/2
Florin Coras [Fri, 16 Aug 2019 17:33:49 +0000 (10:33 -0700)]
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 d206724e78d99aee5d91d43fb0832d51d70eb57a)

4 years agovppapigen: fix missing vla check for union class 76/22176/1
Ole Troan [Wed, 18 Sep 2019 10:12:47 +0000 (12:12 +0200)]
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 d5a78a5310ff25c0c34ce5773acd8211d48f59f6)
Signed-off-by: Ole Troan <ot@cisco.com>
4 years agobonding lacp: deleting virtual interface which was enslaved may cause crash 38/22138/2
Steven Luong [Mon, 5 Aug 2019 16:47:58 +0000 (09:47 -0700)]
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 bac326cb7c5f8856786ca046df8cfa3be9f53926)

4 years agodevices: vhost-user crashes displaying show trace for deleted interface 37/22137/2
Steven Luong [Thu, 15 Aug 2019 21:30:16 +0000 (14:30 -0700)]
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 5cd987dda679fe50b9cd7a834bb9162db39ade78)

4 years agohsa: Refactor quic_echo to allow other protocols 46/22146/2
Nathan Skrzypczak [Mon, 5 Aug 2019 11:43:31 +0000 (13:43 +0200)]
hsa: Refactor quic_echo to allow other protocols

Type: refactor

Change-Id: Iaef9091e1d057110530255e644fad1c298418966
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
4 years agoquic: quic_app_rx_callback refactor. 36/22136/2
Mathias Raoul [Tue, 6 Aug 2019 11:08:51 +0000 (13:08 +0200)]
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 f85770c4a190babdb47cb1cdc87467eaccac1f0b)

4 years agomisc: fix pcap rx/tx status command 51/22151/2
Dave Barach [Thu, 19 Sep 2019 13:11:38 +0000 (09:11 -0400)]
misc: fix pcap rx/tx status command

Type: fix
Ticket: VPP-1775

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I48a1c385ccfabca84dfb61aac526c7f67d9822d3

4 years agoipsec: fix missed IPSEC_INTEG_ALG_MD5_96 35/22135/2
Dmitry Vakhrushev [Wed, 14 Aug 2019 04:12:33 +0000 (00:12 -0400)]
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 77cc14a2b29a65073539e6e3f4683a380875b3dc)

4 years agodpdk: ipsec tunnel support for ip6-in-ip4 34/22134/2
Matthew G Smith [Tue, 6 Aug 2019 13:43:50 +0000 (08:43 -0500)]
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 5025d40a1134272ab57c3c3f10311e31a65cd63c)

4 years agostats: refactor header files 33/22133/2
Dave Barach [Wed, 14 Aug 2019 13:35:41 +0000 (09:35 -0400)]
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 531969ef614bdc15c45dae0f1b5e90afaf86eb7b)

4 years agogbp: add local l3out redirect to local SEP unit test 44/22144/2
Benoît Ganne [Fri, 2 Aug 2019 15:57:08 +0000 (17:57 +0200)]
gbp: add local l3out redirect to local SEP unit test

Type: test

Change-Id: Ia6dad86d02f6f665a3e6960812b2527eaabb65f1
Signed-off-by: Benoît Ganne <bganne@cisco.com>
4 years agoip: allow addrs from the same prefix on intf 32/22132/1
Matthew Smith [Wed, 7 Aug 2019 16:46:30 +0000 (11:46 -0500)]
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 6c92f5babdc3c52cf343509fc9cf9d8a9a3df390)

4 years agomisc: 19.08.1 Release Notes 29/21829/9 v19.08.1
Andrew Yourtchenko [Thu, 5 Sep 2019 14:54:13 +0000 (14:54 +0000)]
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>
4 years agomemif: always enable zero-copy when creating memif using API 01/22101/3
Jakub Grajciar [Wed, 4 Sep 2019 08:32:49 +0000 (10:32 +0200)]
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 63882357549a39c7be4b23b48418b8febb5b0e12)

4 years agobuild: fix rpm python 3 depends 11/22111/2
Ed Kern [Tue, 17 Sep 2019 19:19:42 +0000 (13:19 -0600)]
build: fix rpm python 3 depends

Type: fix

Change-Id: Ie6eaccb27779bb14c0a23764a16cd22f0a72e379
Signed-off-by: Ed Kern <ejk@cisco.com>
(cherry picked from commit c63c0166ee5a4e23cb286a97ae4f196f2020e3fa)

4 years agoapi: split vl_api_prefix into two 15/22015/1
Ole Troan [Wed, 11 Sep 2019 15:49:08 +0000 (17:49 +0200)]
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>
4 years agomisc: clean up "pcap [rx|tx] trace" debug CLI 65/21965/2
Dave Barach [Mon, 9 Sep 2019 20:38:17 +0000 (16:38 -0400)]
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 b97641c79f4aaf0069268c550f263167ddea2b34)

4 years agodpdk: initialize rte_mbuf during mempool dequeue 38/21938/1
Damjan Marion [Fri, 6 Sep 2019 12:24:36 +0000 (14:24 +0200)]
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>
4 years agodpdk: fix extended stats 78/21778/2
Filip Tehlar [Tue, 3 Sep 2019 14:21:05 +0000 (14:21 +0000)]
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>
4 years agovlib: clean up the "pcap dispatch trace" debug CLI 84/21884/4
Dave Barach [Thu, 29 Aug 2019 22:01:30 +0000 (18:01 -0400)]
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 e5948fb49a6eeaf437323cc1043a350cd33bcd47)

4 years agoapi: enforce vla is last and fixed string type 62/21762/2
Ole Troan [Fri, 23 Aug 2019 20:55:18 +0000 (22:55 +0200)]
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 e5ff5a36dd126ee57dca4e0b03da2f7704e0a4f5)
Signed-off-by: Ole Troan <ot@cisco.com>
4 years agoip: fix udp/tcp checksum corner cases 83/21883/1
Dave Barach [Wed, 4 Sep 2019 16:09:32 +0000 (12:09 -0400)]
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 c4abafd83df38051765352785b146277734701f4)

4 years agotap: revert clean-up when linux will delete the tap interface 34/21834/2
Mohsin Kazmi [Thu, 5 Sep 2019 18:17:30 +0000 (20:17 +0200)]
tap: revert clean-up when linux will delete the tap interface

Type: fix
Ticket: VPP-1766

revert e4ac48e792f4eebfce296cfde844ee73b1abd62f

Change-Id: I03feea4008a47859d570ad8d1d08ff3f30d139ef
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
4 years agocrypto: add '-maes' compile switch 23/21823/2
Benoît Ganne [Fri, 9 Aug 2019 12:07:23 +0000 (14:07 +0200)]
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 561be280feb6a10834bf50e0813cc0ad3c635067)

4 years agogbp: add unknown remote EP redirect unit test 15/21815/2
Benoît Ganne [Wed, 31 Jul 2019 12:15:57 +0000 (14:15 +0200)]
gbp: add unknown remote EP redirect unit test

Type: test

Change-Id: I1dfbeef08a4f112551450682fc4040820251485b
Signed-off-by: Benoît Ganne <bganne@cisco.com>
4 years agogbp: add remote EP redirect to remote SEP unit test 14/21814/1
Benoît Ganne [Fri, 2 Aug 2019 14:36:35 +0000 (16:36 +0200)]
gbp: add remote EP redirect to remote SEP unit test

Type: test

Change-Id: I4dd685f9acd4d467e0967e6fdd428558ffc8b209
Signed-off-by: Benoît Ganne <bganne@cisco.com>
4 years agoquic: handle session migration notifications 91/21791/1
Aloys Augustin [Thu, 1 Aug 2019 13:22:07 +0000 (15:22 +0200)]
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 243e1933bbecce0a251a5ff71c12dced9e30823f)

4 years agoethernet: fix dmac check avx2 loop condition 67/21767/1
Matthew Smith [Tue, 3 Sep 2019 21:45:33 +0000 (16:45 -0500)]
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: 8d6f34e2b1cbfde5702e88686631527d5e1e10a0

Change-Id: Ib673f45917a0dea461987fdc8f0ca318b749fb1a
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit a6d4e3135b70db1b1df3f8852e1e229d13c24e72)

4 years agovppinfra: add bihash_init2 22/21722/2
Dave Barach [Tue, 3 Sep 2019 14:57:19 +0000 (10:57 -0400)]
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 bdf9b97774f02458ede6b7c7ae2d5728bddba000)

4 years agotap: interface rx counter not increment correct 28/21728/2
Steven Luong [Fri, 30 Aug 2019 17:49:44 +0000 (10:49 -0700)]
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 efa119db3910e77f79eb005c67f8c01b473b40a1)

4 years agovmxnet3: interface rx counter not increment correctly 30/21730/1
Steven Luong [Fri, 30 Aug 2019 18:22:13 +0000 (11:22 -0700)]
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 ddf625d6035d9e472bcb1a2b0197f6fd30278583)

4 years agonat: handoff traffic matching for dynamic NAT 65/21665/2
Filip Varga [Mon, 12 Aug 2019 12:24:39 +0000 (14:24 +0200)]
nat: handoff traffic matching for dynamic NAT

Type: feature

Change-Id: I5c5af6f9acb340cc674323305104b8ce23e6d21d
Signed-off-by: Filip Varga <fivarga@cisco.com>
(cherry picked from commit 22bb417e91c7bdf639b24b5edd321028f56ea04a)

4 years agoacl: perform a sanity check of ACL rules before creating ACL 40/21640/2
Andrew Yourtchenko [Mon, 26 Aug 2019 12:25:42 +0000 (12:25 +0000)]
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>
4 years agoip: ip6_preflen_to_mask incorrect result for prefix len > 64 42/21642/2
Andrew Yourtchenko [Mon, 26 Aug 2019 12:58:48 +0000 (12:58 +0000)]
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 59ac9c23c47962fbbd935e7075ff7ee89e955847)

4 years agogso: fix segmentation when gso_size greater than vlib buffer size 41/21541/2
Mohsin Kazmi [Thu, 22 Aug 2019 16:40:28 +0000 (18:40 +0200)]
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 3f1964d2d2847c5307694fe8daea0a7eef1e2733)

4 years agodpdk: enable checksum offload for Intel SRIOV NIC drivers 39/21639/1
John Lo [Thu, 29 Aug 2019 19:40:26 +0000 (15:40 -0400)]
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 03598c4bcc639cbfc9afa13c5b4e52440f9eae2b)

4 years agoavf: properly set irq queue masks 39/21539/1
Damjan Marion [Thu, 22 Aug 2019 11:36:15 +0000 (13:36 +0200)]
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 2ca9a84bd00f2aee642d0147c1b99d4be5725a70)

4 years agotests: move plugin tests to src/plugins/*/test 93/21493/1
Dave Wallace [Thu, 22 Aug 2019 00:32:29 +0000 (00:32 +0000)]
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 a43c93f8554ad7418e31be3791b3fb71232f60ac)

4 years agodns: cherry-pick 21444, 21468 from master 87/21487/1
Dave Barach [Fri, 23 Aug 2019 14:53:01 +0000 (10:53 -0400)]
dns: cherry-pick 21444, 21468 from master

Type: refactor
Ticket: VPP-1752

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ieaec721056531ba0c70538c9bf97769a0e80aefd

4 years agomisc: 19.08 new features 20/21420/2 v19.08
Andrew Yourtchenko [Tue, 20 Aug 2019 16:31:34 +0000 (16:31 +0000)]
misc: 19.08 new features

The full RELEASE.md diff is b610f2022c9f4e10a922e7b57c80ec77cd45d021

Change-Id: Ide6d85d41bdc836a03390a50ab94f6ebbaae0b28
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
4 years agodevices: skip checksum calculation if guest supports checksum offload 24/21424/1
Steven Luong [Wed, 7 Aug 2019 04:51:34 +0000 (21:51 -0700)]
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 a75ad876401a700127ebf234fc422e76fcd57b4c)

4 years agotcp: default to debug disabled 16/21416/2
Florin Coras [Tue, 20 Aug 2019 14:14:00 +0000 (07:14 -0700)]
tcp: default to debug disabled

Type:fix
Ticket:VPP-1737

Change-Id: Ib5c33f0bdb3a8b1c2585135fcc8c07b151e47df3
Signed-off-by: Florin Coras <fcoras@cisco.com>
4 years agodns: handle multiple replies for single requests 10/21410/2
Dave Barach [Mon, 19 Aug 2019 22:15:51 +0000 (18:15 -0400)]
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 e8d2dcb6a619f0884ece2284a286f21b3aa77e5a)

4 years agomisc: VPP 19.08 Release Notes 66/21366/6
Andrew Yourtchenko [Sat, 17 Aug 2019 14:57:13 +0000 (14:57 +0000)]
misc: VPP 19.08 Release Notes

Change-Id: I81c7ad50c66b4b8d690e87aad1f3c16af065fc85
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
4 years agodhcp: resolver process node index in main_t 40/21340/2
Dave Barach [Thu, 15 Aug 2019 19:14:14 +0000 (15:14 -0400)]
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 018c14b7dbc5a910693f150045bfa803c4ae4eec)

4 years agogso: fix l3 and l4 header offset in case of tagged interface 69/21369/2
Mohsin Kazmi [Mon, 29 Jul 2019 09:39:26 +0000 (11:39 +0200)]
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 14bea1bb6505c0134dd5d2a18bcc436ce72cd149)

4 years agogso: fix the segmentation to use current_data offset 68/21368/1
Mohsin Kazmi [Tue, 13 Aug 2019 16:23:26 +0000 (18:23 +0200)]
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 0a5734372d7176146126f83f51b0b9062f90fe94)

4 years agogso: remove the ip checksum flag in case of ipv6 59/21359/2
Mohsin Kazmi [Wed, 14 Aug 2019 14:23:17 +0000 (16:23 +0200)]
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 7dfcf7f1f504f5e8283c54a428805cc3a4aa8da9)

4 years agotcp: fix cc algo name parsing 60/21360/1
Florin Coras [Fri, 16 Aug 2019 02:55:03 +0000 (19:55 -0700)]
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 d25d364d2bc146d3e17ab7c4d558bcb0ce138b89)

4 years agovlib: copy trace_handle in vlib_buffer_copy/clone() functions 39/21339/1
John Lo [Tue, 13 Aug 2019 22:18:21 +0000 (18:18 -0400)]
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 6631780422787166550b9871c46a94c160416324)
Signed-off-by: John Lo <loj@cisco.com>
4 years agoacl: fix stats-segment counters validation on acl update 29/21329/3
Andrew Yourtchenko [Thu, 15 Aug 2019 12:26:17 +0000 (12:26 +0000)]
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: f995c7122ba0d024b17bc3232e8edd18d5e25088
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
4 years agotcp: extend protocol configuration 10/21310/2 v19.08-rc2
Florin Coras [Mon, 12 Aug 2019 21:17:47 +0000 (14:17 -0700)]
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 9094b5c319d3f072d3c248fe7c876e4048c13ac2)

4 years agosvm: fix svmtool and svmdbtool segment fault. 82/21282/2
Guanghua Zhang [Mon, 12 Aug 2019 01:04:35 +0000 (09:04 +0800)]
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 60f16c22b44625d517830b4266a225d3abaccefc)

4 years agogbp: do not scan gbp bihash if not instantiated 90/21290/1
Benoît Ganne [Tue, 6 Aug 2019 11:47:21 +0000 (13:47 +0200)]
gbp: do not scan gbp bihash if not instantiated

Type: fix
Fixes: 32dcd3b2f227dec638c39ade0c58d6741d83ec30

Change-Id: I42550fcc5b3fa486a05770d3e220d7a86315628e
Signed-off-by: Benoît Ganne <bganne@cisco.com>
4 years agosession: fix enqueue notification on 32bit systems 81/21281/1
Florin Coras [Tue, 13 Aug 2019 15:35:39 +0000 (08:35 -0700)]
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 5d8a806144fbf46c0575ef24ae081724dfbdbe75)

4 years agopapi: Revert vpp-api-python to py2, add py3 pkg 48/21248/3
Ian Wells [Sat, 10 Aug 2019 00:27:19 +0000 (17:27 -0700)]
papi: Revert vpp-api-python to py2, add py3 pkg

A previous commit, ca3d38ae18c21ce37212f0d5d5f4a1702429e70c, 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 13cef0cc2cba4cff22bb5a860a8709cb3cfd35b2)

4 years agofib: add adj_midchain.h to the list of files to install in the include path 27/21227/4
Alberto Compagno [Mon, 12 Aug 2019 09:43:19 +0000 (11:43 +0200)]
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

4 years agohttp_static: manual cherry-pick 21231,21246 47/21247/2
Dave Barach [Mon, 12 Aug 2019 17:49:46 +0000 (13:49 -0400)]
http_static: manual cherry-pick 21231,21246

Type: fix
Ticket: VPP-1736

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ie34d1b7d7030c160972f3173a4401ef632e38633

4 years agotcp: handle fin+rst+syn in closing state 44/21244/2
Florin Coras [Mon, 12 Aug 2019 02:49:05 +0000 (19:49 -0700)]
tcp: handle fin+rst+syn in closing state

Type: fix
Ticket: VPP-1736

Change-Id: I32d4d4a5de04e89087f4ab4a5c425eda572932a8
Signed-off-by: Florin Coras <fcoras@cisco.com>
4 years agohttp_static: tls support 32/21232/3
Dave Barach [Tue, 6 Aug 2019 21:38:13 +0000 (17:38 -0400)]
http_static: tls support

Type: refactor
Ticket: VPP-1736

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I45745e568cd943293d0015a61f67ec799b6804d8
(cherry picked from commit 6b53fd5163de7d1f452b472ec3ad945f4dbd694c)

4 years agoapi: vppapitrace JSON/API trace converter 03/21203/3
Ole Troan [Tue, 30 Jul 2019 13:38:13 +0000 (15:38 +0200)]
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 edfe2c0079a756f5fb1108037c39450e3521c8bd)
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
4 years agovlib: fix vlib_buffer_copy to preserve buffer flags bit 10/21210/1
John Lo [Wed, 7 Aug 2019 23:30:29 +0000 (19:30 -0400)]
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 8ed2d524aa401a89547a1e059528f8a34bb8895f)

4 years agotls: mark as no lookup transport 00/21200/2
Florin Coras [Fri, 9 Aug 2019 00:38:26 +0000 (17:38 -0700)]
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 d09236d17d86a5d50166b2017f8f30a560c6e1b8)

4 years agoudp: fix rx event generation 02/21202/2
Florin Coras [Wed, 7 Aug 2019 01:28:49 +0000 (18:28 -0700)]
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 9cbf6818b37275199b6c0ebef0ef3d8ecaac0a3b)

4 years agosession: allow closed transports to send 99/21199/2
Florin Coras [Thu, 8 Aug 2019 02:12:38 +0000 (19:12 -0700)]
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 a678974cc52ac61dd6094c3f6649f9e3202be1cb)

4 years agotls: handle transport reset 01/21201/1
Florin Coras [Thu, 8 Aug 2019 04:39:27 +0000 (21:39 -0700)]
tls: handle transport reset

Type:fix

Change-Id: I5994fb53dc4b9fd58920b3d67472c38b41db27c2
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit f03c49413f270386d46a82dd9a3bce819cf81250)