vpp.git
6 years agoacl-plugin: unapply the ACLs if interface is being deleted 53/6653/4
Andrew Yourtchenko [Thu, 11 May 2017 10:33:54 +0000 (12:33 +0200)]
acl-plugin: unapply the ACLs if interface is being deleted

(HC2VPP-137 is the client behavior triggering this)

If the user does not unapply the ACLs off the interface,
but deletes the interface, the subsequent reuse of the
sw_if_index might find itself with the datapath
hooked up for ACL processing even though there is
no ACL configured. The fix is to unapply any ACLs
in the callback which is called upon the sw_if_index
addition/deletion.

Change-Id: Icea413d7fbf1ef891844a4818626e1b34fe79cbf
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit 4c72e629e5ace392390a9d6109594254525064f7)

6 years agodpdk: Enable hardware CRC strip for Intel VFs 11/6711/4
Damjan Marion [Mon, 15 May 2017 16:35:37 +0000 (18:35 +0200)]
dpdk: Enable hardware CRC strip for Intel VFs

Change-Id: I60a7795761fe74ae5d57dacd03c343ddb77434d4
Signed-off-by: Damjan Marion <damarion@cisco.com>
6 years agoAdd GTP-U plugin. VPP-694 50/6150/23
Hongjun Ni [Wed, 12 Apr 2017 11:21:16 +0000 (19:21 +0800)]
Add GTP-U plugin. VPP-694

Basic GTP-U feature

Change-Id: I31226f890a92c5303ac06e112ed7820cae52d9bd
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
6 years agomemif: migrate memif to use vnet device infra APIs 10/6710/2
Steven [Mon, 15 May 2017 16:33:11 +0000 (09:33 -0700)]
memif: migrate memif to use vnet device infra APIs

Migrate memif to use vnet device infra APIs. No new function is added.

Change-Id: I70e440d2ae1e673876365041f31fe78997aceecf
Signed-off-by: Steven <sluong@cisco.com>
6 years agodpdk: improve error handling during device initialization 51/6651/6
Damjan Marion [Thu, 11 May 2017 14:53:02 +0000 (16:53 +0200)]
dpdk: improve error handling during device initialization

Change-Id: Ib390164abb07ca0d38fd49e7e2e6b4e9ea856405
Signed-off-by: Damjan Marion <damarion@cisco.com>
6 years agoaf_packet: support changing the mtu size 95/6695/5
Ray Kinsella [Mon, 15 May 2017 10:52:43 +0000 (11:52 +0100)]
af_packet: support changing the mtu size

Added support to the af_packet device to change the MTU size.

Change-Id: I9c9e1e17323721f3efccf70a10b753e12eef94d5
Signed-off-by: Ray Kinsella <ray.kinsella@intel.com>
6 years agojvpp: fix memory allocation for variable lenght messages (VPP-841) 09/6709/4
Marek Gradzki [Fri, 12 May 2017 16:24:34 +0000 (18:24 +0200)]
jvpp: fix memory allocation for variable lenght messages (VPP-841)

Change-Id: I9a46125e3cf9815c08cf8cca17713ec6e9121eae
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
(cherry picked from commit 307cfd8eb14ff7df04316ffa56f2c2481d650d7e)

6 years agoFix builtin tcp client 06/6706/4
Dave Barach [Mon, 15 May 2017 14:11:39 +0000 (10:11 -0400)]
Fix builtin tcp client

Change-Id: I83a1b02a73fd159f14cca04fed3993f571475a00
Signed-off-by: Dave Barach <dbarach@cisco.com>
6 years agoAdd a missing byte-swap call in ACL intf dump. 73/6673/4
Jon Loeliger [Fri, 12 May 2017 19:03:16 +0000 (14:03 -0500)]
Add a missing byte-swap call in ACL intf dump.

Change-Id: I87495d95dc6c5a36ff6d2ae05203e22e43403bf6
Signed-off-by: Jon Loeliger <jdl@netgate.com>
6 years ago[plugins/dpdk] Support for CLIB_HAVE_64 (aarch64) 70/6670/4
Christophe Fontaine [Wed, 5 Apr 2017 09:49:07 +0000 (11:49 +0200)]
[plugins/dpdk] Support for CLIB_HAVE_64 (aarch64)

For platforms which do not support u8x32, such as aarch64,
add an alternative implementation of 'dpdk_buffer_init_from_template'.

Change-Id: Ia7e8d0a5985fa5925e063ed6e890208c73e39933
Signed-off-by: Christophe Fontaine <christophe.fontaine@enea.com>
6 years agoL2BD/API:fix bd dump to ignore unknown bd_id 79/6679/4
Eyal Bari [Sun, 14 May 2017 07:38:39 +0000 (10:38 +0300)]
L2BD/API:fix bd dump to ignore unknown bd_id

Change-Id: I417dfeba902ca8c3a080773942d4d2ce4335a9c1
Signed-off-by: Eyal Bari <ebari@cisco.com>
6 years agomove to CSIT 170504 84/6684/3
Neale Ranns [Sun, 14 May 2017 19:54:19 +0000 (12:54 -0700)]
move to CSIT 170504

Change-Id: I8b636ff57b6e6c3f4cfd2d77d930524559046dd9
Signed-off-by: Neale Ranns <nranns@cisco.com>
6 years agoFix vnet_interface_counters API definition 13/5413/4
Aloys Augustin [Fri, 17 Feb 2017 13:55:29 +0000 (14:55 +0100)]
Fix vnet_interface_counters API definition

The api specification had u8 as data type, which caused the python
binding to fail.
Fixes VPP-642

Change-Id: I9ba97959740d44c8f4a12db9356d0d1bcd709a73
Signed-off-by: Aloys Augustin <aloys.augustin@polytechnique.org>
Signed-off-by: Ole Troan <ot@cisco.com>
6 years agoFix FIB recursion loops via cover (VPP-842) 74/6674/2
Neale Ranns [Sat, 13 May 2017 12:52:58 +0000 (05:52 -0700)]
Fix FIB recursion loops via cover (VPP-842)

Change-Id: Ia91c3e8cb27b9e4c1cccefc0a4857dd9995450ab
Signed-off-by: Neale Ranns <nranns@cisco.com>
6 years agodpdk: revert dpdk 17.05 change which causes virtio issues 90/6690/1
Damjan Marion [Mon, 15 May 2017 10:32:15 +0000 (12:32 +0200)]
dpdk: revert dpdk 17.05 change which causes virtio issues

This patch is causing DPDK to provide bad MAC address
for legacy virtio interfaces.

Change-Id: I526cd35a38164ede80a8ab6decb9e0d1ebfad723
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoValidate ip6 interface fib tables early on 43/6643/3
Florin Coras [Wed, 10 May 2017 19:32:53 +0000 (12:32 -0700)]
Validate ip6 interface fib tables early on

This should avoid random crashes due to reception of packets (multicast
in particular) before ip6 addresses are configured on the interfaces.

Change-Id: Ibcf1a5a2ae2fa75f8b57da1b2f09f32c081210d7
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agodpdk: bump to dpdk 17.05 48/6648/3
Damjan Marion [Thu, 11 May 2017 12:55:43 +0000 (14:55 +0200)]
dpdk: bump to dpdk 17.05

Change-Id: I19744387859129c6b8dc104041af158bf5f1d988
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoHandle RST of TCP connections in SYN-RCVD state, VPP-822 44/6644/2
Florin Coras [Wed, 10 May 2017 19:29:14 +0000 (12:29 -0700)]
Handle RST of TCP connections in SYN-RCVD state, VPP-822

Change-Id: Ieb0c1e690d6ae082cfedb276252a31fab480e561
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agomake test: support coverage for out-of-tree plugins 47/6647/1
Klement Sekera [Thu, 11 May 2017 04:55:32 +0000 (06:55 +0200)]
make test: support coverage for out-of-tree plugins

Change-Id: Ibd7828b1e1c699630ff450122d8aa317b1c9da26
Signed-off-by: Klement Sekera <ksekera@cisco.com>
7 years agoAllow to override the build date 83/6583/3
Bernhard M. Wiedemann [Wed, 3 May 2017 13:15:15 +0000 (15:15 +0200)]
Allow to override the build date

using the SOURCE_DATE_EPOCH env var
to make vpp package builds reproducible.

See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

Change-Id: Iae0935c9bb4ccdfdb65600be543945a88f2e137f
Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
7 years agovnet: introduce error state for sw interfaces 41/6641/3
Damjan Marion [Wed, 10 May 2017 18:09:31 +0000 (20:09 +0200)]
vnet: introduce error state for sw interfaces

Interfaces with error state are not allowed to go admin up

Change-Id: I09fc09a5b28130aead219dccbc2e0f30ea7414cf
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agocompletelly deprecate os_get_cpu_number, replace new occurences 42/6642/4
Damjan Marion [Wed, 10 May 2017 19:06:28 +0000 (21:06 +0200)]
completelly deprecate os_get_cpu_number, replace new occurences

Change-Id: I82c663bc0866c6c68ba354104b0bb059387f4b9d
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoMulti-thread enablement for the debug cli http server 40/6640/3
Dave Barach [Wed, 10 May 2017 17:34:04 +0000 (13:34 -0400)]
Multi-thread enablement for the debug cli http server

Change-Id: Iec1f739fe24c722d0db6c10cc81b5e8333067ea1
Signed-off-by: Dave Barach <dbarach@cisco.com>
7 years agodoxygen: Fix some paths 39/6639/2
Chris Luke [Wed, 10 May 2017 15:40:27 +0000 (11:40 -0400)]
doxygen: Fix some paths

- Add missing src dir.
- Exclude 'src/examples' from siphon processing so that example cli commands
  don't end up in user documentation.

Change-Id: I46a6ad759fa8220d305b007a9506956365fc79bd
Signed-off-by: Chris Luke <chrisy@flirble.org>
7 years agoL2BD/TEST:fix l2bd multiinstance test 34/6634/2
Eyal Bari [Wed, 10 May 2017 13:08:19 +0000 (16:08 +0300)]
L2BD/TEST:fix l2bd multiinstance test

Change-Id: If864182ec656cc6c6353be642e22910a4fc89870
Signed-off-by: Eyal Bari <ebari@cisco.com>
7 years agoAdd crc32c inline function, allows compilation on 32-bit systems 52/6452/6
Damjan Marion [Wed, 26 Apr 2017 11:05:05 +0000 (13:05 +0200)]
Add crc32c inline function, allows compilation on 32-bit systems

32-bit code still can use crc32c instructions, but it operates
on 32 registers

Change-Id: I9bb6b0b59635d6ea6a753584676ebcf59c8f6584
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agodpdk: refactor interface speed detection 27/6627/3
Damjan Marion [Tue, 9 May 2017 17:50:26 +0000 (19:50 +0200)]
dpdk: refactor interface speed detection

- Adds VirtualFucntionEthernet for VFs
- Enables MLX4 driver

Change-Id: I163300e68edbe033227f641bdfcfe5918cbe58cf
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoMake reproducible build possible 85/6585/3
Marco Varlese [Wed, 3 May 2017 15:37:46 +0000 (17:37 +0200)]
Make reproducible build possible

For downstream consumption is important to have a way to specify the date or
the user or the hostname to particular values so to have reproducible builds
and/or packages.

Change-Id: I134288662b6cfbbe26bba7d8bc6be8511b34360c
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
7 years agodevice: Add callback for set interface rx-mode 28/6628/4
Steven [Tue, 9 May 2017 23:19:50 +0000 (16:19 -0700)]
device: Add callback for set interface rx-mode

- When the interface rx-mode is changed via CLI, the corresponding device
may want to know about it and to reset the driver. This patch is to add
the callback.

- In the function vnet_hw_interface_set_rx_mode, it appears it is missing
a line
  hw->rx_mode_by_queue[queue_id] = mode

because the function is checking if the new mode is the same as
hw->rx_mode_by_queue which is initialized to POLLING. So if the function is
called to change the mode to interrupt, it just returns without doing
anything. This is the check that I am talking about in the same function.

  if (hw->rx_mode_by_queue[queue_id] == mode)
    return 0;

Change-Id: Iaca2651c43e0ae3fda6fd8dc128e247b0851cc65
Signed-off-by: Steven <sluong@cisco.com>
7 years agoSNAT: move API code to separate file 35/6635/2
Matus Fabian [Wed, 10 May 2017 13:37:47 +0000 (06:37 -0700)]
SNAT: move API code to separate file

Move API source code from snat.c to snat_api.c

Change-Id: I1c4439eb5d2e3f43695ecc4d300eccd148105c15
Signed-off-by: Matus Fabian <matfabia@cisco.com>
7 years agovppinfra: optimize and simplify splat inline functions 25/6625/6
Damjan Marion [Tue, 9 May 2017 15:45:50 +0000 (17:45 +0200)]
vppinfra: optimize and simplify splat inline functions

Example for u32x4 case:
Old code generates 2 instructions:

vmovd  %edi,%xmm0
vpunpckldq %xmm0,%xmm0,%xmm0
vpunpcklqdq %xmm0,%xmm0,%xmm0

New code uses only one instruction:
mov    %edi,-0x4(%rsp)
vbroadcastss -0x4(%rsp),%xmm0

Change-Id: I989dc3025f5fe3f6c880972389ded11f31e2f3f6
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoImprove TCP option handling, VPP-757 29/6629/4
Florin Coras [Wed, 10 May 2017 01:54:52 +0000 (18:54 -0700)]
Improve TCP option handling, VPP-757

Change-Id: Ica634536387d1196366ec96c52770287fcab0768
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agoBuiltin debug cli http server 18/6618/6
Dave Barach [Mon, 8 May 2017 23:15:03 +0000 (19:15 -0400)]
Builtin debug cli http server

Visit http://<vpp-ip>/show/interface or similar.

Change-Id: I076b4661cf19d1b94bb01efdadb5849446be915e
Signed-off-by: Dave Barach <dave@barachs.net>
7 years agoIgnore data in RST segments, VPP-723 20/6620/5
Florin Coras [Tue, 9 May 2017 07:52:37 +0000 (00:52 -0700)]
Ignore data in RST segments, VPP-723

Change-Id: I01650b3b10b79ec549be0d5eceb0e318c06fcb50
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agoProduce vpp_papi*.egg for virtual environments 16/6616/2
Igor Mikhailov (imichail) [Mon, 8 May 2017 21:00:01 +0000 (14:00 -0700)]
Produce vpp_papi*.egg for virtual environments

Produce vpp_papi*.egg so that virtual environments (e.g. virtualenv)
could install vpp_papi inside them.

Change-Id: I9664d119a64f4968de44a7a430aec4879ed02b16
Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
7 years agoGenerate test paths for lib and lib64 subdirectories 30/6630/1
Igor Mikhailov (imichail) [Wed, 10 May 2017 06:27:14 +0000 (23:27 -0700)]
Generate test paths for lib and lib64 subdirectories

wildcard produces empty paths when 'make test' is run
from a clean tree: install-<tag>-native directories
don't exist yet.

Change-Id: I3b3bbd86cf7eda18f2c698f85b834f82b1a19065
Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
7 years agodpdk: refactor setup, start, stop code 18/6518/4
Damjan Marion [Fri, 28 Apr 2017 15:10:38 +0000 (17:10 +0200)]
dpdk: refactor setup, start, stop code

Change-Id: I0fec86914ec027383ff511b7092beac2363f55f7
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoFix remaining 32-bit compile issues 65/6465/10
Damjan Marion [Wed, 26 Apr 2017 13:32:12 +0000 (15:32 +0200)]
Fix remaining 32-bit compile issues

Change-Id: I9664214652229b663c3e3ba7406b4ede96bfb123
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoAPI support for IPsec tunnel interface creation 67/6567/3
Matthew Smith [Tue, 2 May 2017 21:20:41 +0000 (16:20 -0500)]
API support for IPsec tunnel interface creation

Change-Id: I8c9f886cb95e92adbe1c646844789ca0a6bb6140
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
7 years agoAdd missing format_ip6_address() functions to plugin_api. 17/6617/2
Jon Loeliger [Mon, 8 May 2017 21:53:44 +0000 (16:53 -0500)]
Add missing format_ip6_address() functions to plugin_api.

Specifically, the ACL plugin needed format_ip6_address()
and the ip46 variant as well.

Change-Id: Iec35b8acd4cab4bcbc73053dcca2ee91bd9c72cd
Signed-off-by: Jon Loeliger <jdl@netgate.com>
7 years agoAdd support for tcp/session buffer chains 13/6613/11
Florin Coras [Mon, 8 May 2017 02:12:02 +0000 (19:12 -0700)]
Add support for tcp/session buffer chains

Change-Id: I01c6e3dc3a1b2785df37bb66b19c4b5cbb8f3211
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agodpdk: use speed_capa to detect i40e device speed 14/6614/2
Damjan Marion [Mon, 8 May 2017 16:19:45 +0000 (18:19 +0200)]
dpdk: use speed_capa to detect i40e device speed

Change-Id: I1decca6fb5ce6de74ccbcd5a262ebd3db6f55cdc
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agovlib: do not unbind devices already bound to vfio-pci 15/6615/1
Damjan Marion [Mon, 8 May 2017 16:37:54 +0000 (18:37 +0200)]
vlib: do not unbind devices already bound to vfio-pci

Change-Id: I739bed5b9d9504d18ee88206e29ebc4ba1b47d28
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoL2FIB:CLI/API to flush all non-static entries 91/6591/8
Eyal Bari [Thu, 27 Apr 2017 11:07:55 +0000 (14:07 +0300)]
L2FIB:CLI/API to flush all non-static entries

added CLI l2fib flush-mac all
added API l2fib_flush_all
flushes all non static l2fib entries on all valid BDs

Change-Id: Ic963c88f4bed56308c03ab43106033132a0e87be
Signed-off-by: Eyal Bari <ebari@cisco.com>
7 years agoAvoid active connection prevent timeout of idle conns after it 64/6564/4
Andrew Yourtchenko [Tue, 2 May 2017 18:08:51 +0000 (20:08 +0200)]
Avoid active connection prevent timeout of idle conns after it

Fix a logic error related to timing out of the connections
following the active one. To avoid this class of issue in
the future, create corresponding testcases, as well as some
trivial sanity testcases for both IPv4 and IPv6.

Since these tests are timing-dependent and take up time,
mark them as extended tests.

Change-Id: I2c72bad5efda7db8aa9cb05801fe47928dc47927
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
7 years agoRemove L2 GPE interface from bridge when deleting, VPP-833 04/6604/3
Florin Coras [Fri, 5 May 2017 07:24:16 +0000 (00:24 -0700)]
Remove L2 GPE interface from bridge when deleting, VPP-833

Change-Id: I32725006e9235a02cada5b0ad8974bfc4274339f
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agoInclude TCP options in segment size computation 03/6603/3
Florin Coras [Thu, 4 May 2017 21:25:50 +0000 (14:25 -0700)]
Include TCP options in segment size computation

Ensure that TCP data plus options does not exceed peer's advertised MSS.

Change-Id: I0de824cb3619346f0394dd694942fc1cf33a82b7
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agoFix TCP loss recovery, VPP-745 88/6588/6
Florin Coras [Thu, 4 May 2017 04:09:42 +0000 (21:09 -0700)]
Fix TCP loss recovery, VPP-745

Allows pure loss recovery retransmits only on timeout.

Change-Id: I563cdbf9e7b890a6569350bdbda4f746ace0544e
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agolcov is an EPEL rpm (at least for Centos) 90/6590/2
Igor Mikhailov (imichail) [Thu, 4 May 2017 07:09:42 +0000 (00:09 -0700)]
lcov is an EPEL rpm (at least for Centos)

Change-Id: I064a78df6a2cf734bb7c54f80682690c203a0a98
Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
7 years agoFix mac check issue for vitual tunnel interface with no mac address 77/6577/3
Hongjun Ni [Wed, 26 Apr 2017 10:40:55 +0000 (18:40 +0800)]
Fix mac check issue for vitual tunnel interface with no mac address

Change-Id: I6ce21317fcaa25781199f4329be815f076ab8b09
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
7 years agoFix L2FIB learn counter and memory cleanup of mac_by_ip6 hash table 12/6612/2
John Lo [Fri, 5 May 2017 16:35:25 +0000 (12:35 -0400)]
Fix L2FIB learn counter and memory cleanup of mac_by_ip6 hash table

Fix global_learn_count to be incremented or decremented by add and
deletion of non-static MAC entries from L2FIB only. Without this fix,
the counter may reach the threshold of 1M and stop MAC leanring even
though number of MAC entries in L2FIB is less than the threshold.

Cleanup indirect hash key memory used by mac_by_ip6 hash table on
BD deletion.

Change-Id: I13986c4e6304c7956122520dd3f83d6bb6e65a15
Signed-off-by: John Lo <loj@cisco.com>
7 years agoip6_to_ip4.h coverity fix 10/6610/1
Matus Fabian [Fri, 5 May 2017 11:57:16 +0000 (04:57 -0700)]
ip6_to_ip4.h coverity fix

Change-Id: Ia11fa42d1f2b21a6195e7dc890f958830f83d3a7
Signed-off-by: Matus Fabian <matfabia@cisco.com>
7 years agoSNAT: Additional tests for SNAT interfaces without a configured ip address 94/6594/3
Martin Gálik [Thu, 4 May 2017 11:35:04 +0000 (04:35 -0700)]
SNAT: Additional tests for SNAT interfaces without a configured ip address

Change-Id: I7edea5d7b105ba66e0e04d509968b92cfb64c84a
Signed-off-by: Martin Gálik <magalik@cisco.com>
7 years agoFirst commit SR MPLS 83/6383/14
Pablo Camarillo [Mon, 24 Apr 2017 15:51:56 +0000 (17:51 +0200)]
First commit SR MPLS

Change-Id: I961685a2a0e4c314049444c64eb6ccf877c278dd
Signed-off-by: Pablo Camarillo <pcamaril@cisco.com>
7 years agoNAT64: Move IPv6-IPv4 virtual reassembly code from MAP-T to common library (VPP-708) 55/6555/11
Matus Fabian [Tue, 2 May 2017 10:15:22 +0000 (03:15 -0700)]
NAT64: Move IPv6-IPv4 virtual reassembly code from MAP-T to common library (VPP-708)

Change-Id: I9ad636f80bf109ffac9ca1b6d80d5f2c31f2076a
Signed-off-by: Matus Fabian <matfabia@cisco.com>
7 years agoFixes and improvements in session hashtable keys 89/6589/3
Clement Durand [Thu, 4 May 2017 06:33:55 +0000 (08:33 +0200)]
Fixes and improvements in session hashtable keys

Fix in v6 keys :
* The copy of the keys was only partial

A few suggestions are applied in this commit :
* Since there are not so many unused fields, we avoid to memset 0 and prefer
  setting the unused fields to 0.
* By using a cast, it seems painless to avoid allocating a structure for the
  keys creation.

Change-Id: Iaee6f036f2a979cceaeb297d98ce6c307a5ac029
Signed-off-by: Clement Durand <clement.durand@polytechnique.edu>
7 years agoFix coverity issue 95/6595/1
Filip Tehlar [Thu, 4 May 2017 12:52:42 +0000 (14:52 +0200)]
Fix coverity issue

Change-Id: I8110b2a1d7bf8a818c7e9b6f95c3f60324e8ccab
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
7 years agoLISP: group mapping records in map-register message 79/6579/2
Filip Tehlar [Wed, 3 May 2017 08:12:44 +0000 (10:12 +0200)]
LISP: group mapping records in map-register message

Change-Id: I546c761acfbf880717163a035aa691b04337b7bf
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
7 years agoFix RPM_DEPENDS for all rpm distros after 28ea251 47/6547/2
Igor Mikhailov (imichail) [Tue, 2 May 2017 07:03:09 +0000 (00:03 -0700)]
Fix RPM_DEPENDS for all rpm distros after 28ea251

Change-Id: I58ffdf75f361ff830c2b0c6400ccd012a4d16d3d
Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
7 years agoFix vnet unit tests 53/6553/3
Filip Tehlar [Wed, 26 Apr 2017 14:09:06 +0000 (16:09 +0200)]
Fix vnet unit tests

Change-Id: Ibe55e4399c6b78d83268d7c49ed498cab7bfdb43
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
7 years agoL2FIB:flush interface learned macs on down 62/6362/6
Eyal Bari [Thu, 20 Apr 2017 11:45:17 +0000 (14:45 +0300)]
L2FIB:flush interface learned macs on down

Change-Id: I80a723f55fcf2ecc3209a35e8297c88b45b1abfb
Signed-off-by: Eyal Bari <ebari@cisco.com>
7 years agoA sprinkling of const in vlibmemory/api.h and friends 79/6479/3
Neale Ranns [Wed, 26 Apr 2017 20:59:20 +0000 (13:59 -0700)]
A sprinkling of const in vlibmemory/api.h and friends

Change-Id: I953ebb37eeec7de0c4a6b00258c3c67a83cbc020
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agochange ip4_drop_node node register coding format 68/6568/1
flyingeagle23 [Wed, 3 May 2017 03:29:53 +0000 (11:29 +0800)]
change ip4_drop_node node register coding format

Change-Id: Id4fdf2abf3bae3b14cdc6489ca16d2007da78d07
Signed-off-by: flyingeagle23 <wang.hui56@zte.com.cn>
7 years agoPrevent Bridge Domain operations on BD 0. 61/6561/2
Jon Loeliger [Tue, 2 May 2017 16:06:23 +0000 (11:06 -0500)]
Prevent Bridge Domain operations on BD 0.

The default bridge domain, 0, is created automatically
with static features.  It should be modified by neither
the CLI nor the API.  So add tests for, and reject any
operation on BD 0.  The new API error message BD_NOT_MODIFIABLE
is returned in such cases.

Change-Id: Iaf3dd80c4f43cf41689ca55756a0a3525420cd12
Signed-off-by: Jon Loeliger <jdl@netgate.com>
7 years agoUse per-protocol default flow-hash config when the FIB table index is not known 62/6562/2
Neale Ranns [Tue, 2 May 2017 17:15:19 +0000 (10:15 -0700)]
Use per-protocol default flow-hash config when the FIB table index is not known

Change-Id: If088e75801831befc6bddb77ea20abe9288b93c4
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agoFix TCP tx when snd_wnd < smss 65/6565/2
Florin Coras [Tue, 2 May 2017 19:40:39 +0000 (12:40 -0700)]
Fix TCP tx when snd_wnd < smss

Fixes VPP-728, VPP-729, VPP-730

Change-Id: Ie8c6c0dd006f98527525e87d19b508bb8d39db69
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agoBFD: don't crash if interface is deleted 60/6560/3
Klement Sekera [Tue, 2 May 2017 05:38:01 +0000 (07:38 +0200)]
BFD: don't crash if interface is deleted

Instead, drop the BFD session associated with it..

Change-Id: Ie09877d5c94844be2e833900d9dde7f23edaf8cd
Signed-off-by: Klement Sekera <ksekera@cisco.com>
7 years agoAllow local/for-us replications for IP multicast routes on the CLI 63/6563/2
Neale Ranns [Tue, 2 May 2017 17:17:17 +0000 (10:17 -0700)]
Allow local/for-us replications for IP multicast routes on the CLI

Change-Id: I046d9402b79fdbc6a6663199ffff8e40a278fd51
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agoAdd interface rx mode commands, unify rx mode and placement CLI 19/6519/4
Damjan Marion [Fri, 28 Apr 2017 10:29:15 +0000 (12:29 +0200)]
Add interface rx mode commands, unify rx mode and placement CLI

Change-Id: Ib506c3e9d66170f29e3266ad6dc4d32b829befba
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agodpdk: remove unused code 20/6520/2
Damjan Marion [Fri, 28 Apr 2017 15:19:16 +0000 (17:19 +0200)]
dpdk: remove unused code

Change-Id: I16dcc0de2553c6c1eb87dd1ec4c8d3c649e6f285
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoTCP ooo reception fixes 44/6444/5
Florin Coras [Wed, 26 Apr 2017 07:08:42 +0000 (00:08 -0700)]
TCP ooo reception fixes

- Improve svm fifo handling of out-of-order segments
- Ensure tsval_recent is updated only if rcv_las falls withing the
  segments's sequence space
- Avoid directly dropping old ACKs
- Improve debugging

Change-Id: I88dbe2394a0ad7eb389a4cc12d013a13733953aa
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agodpdk: cryptodev support enabled by default 48/5848/4
Sergio Gonzalez Monroy [Wed, 22 Mar 2017 16:11:06 +0000 (16:11 +0000)]
dpdk: cryptodev support enabled by default

This patch slightly modifes how to enable DPDK Cryptodev.

The startup option 'enable-cryptodev' has been removed and unless not enough
cryptodevs are found, DPDK cryptodev will be enabled by default.

Change-Id: Ic0ac507802cdc0eeb51f065e04ec43a1885617cf
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
7 years agoFix hostname fencepost error in dhcp_compl_event_callback. 17/6517/1
Jon Loeliger [Fri, 28 Apr 2017 02:20:51 +0000 (21:20 -0500)]
Fix hostname fencepost error in dhcp_compl_event_callback.

Hostnames are limited to 63 characters and a NUL terminator.

Change-Id: Ie1724d83675cca5e8cdfcd99d8e56e530a044d5d
Signed-off-by: Jon Loeliger <jdl@netgate.com>
7 years agoaf_packet: reflect admin device state on host 33/6333/7
Ray Kinsella [Fri, 21 Apr 2017 11:24:43 +0000 (12:24 +0100)]
af_packet: reflect admin device state on host

Setting the interface state in VPP on an af_packet device, was not being
reflected on the host. This implied the user had to set the device state
in VPP and then on the host, in order to put the interface into an 'up'
state. This changes makes the device state consisent in VPP and the host.

Change-Id: I6dc6aee79503e04576683db937b861337a2b375b
Signed-off-by: Ray Kinsella <ray.kinsella@intel.com>
7 years agoFix memory leak on deletion of BD (bridge domain) 10/6510/2
John Lo [Fri, 28 Apr 2017 04:33:36 +0000 (00:33 -0400)]
Fix memory leak on deletion of BD (bridge domain)

On BD deletion, free memory used by members vector and mac_by_ip4
and mac_by_ip6 hash tables.

Change-Id: Ied467e79bb6636fd8788bdeddee660c66391bb7e
Signed-off-by: John Lo <loj@cisco.com>
7 years agovhost: Disallow duplicate path name for vhost interface 38/6438/3
Steven [Tue, 25 Apr 2017 23:16:00 +0000 (16:16 -0700)]
vhost: Disallow duplicate path name for vhost interface

When creating or modifying a vhost interface, verify if the path name
already existed and reject the command.

Change-Id: I8b2d33b77c847f774492874f7d194fa72c488479
Signed-off-by: Steven <sluong@cisco.com>
7 years agodpdk: cleanup, move APIs to separate .c file 09/6509/1
Damjan Marion [Thu, 27 Apr 2017 19:12:17 +0000 (21:12 +0200)]
dpdk: cleanup, move APIs to separate .c file

Change-Id: Id632ff1b30be808d9f270e2f77260391569fbda2
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoLISP: fix deleting of locators, VPP-713 99/6499/2
Filip Tehlar [Thu, 27 Apr 2017 12:29:27 +0000 (14:29 +0200)]
LISP: fix deleting of locators, VPP-713

Change-Id: I4a2d24b7124dc9afaf81f29e06e43235a103a320
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
7 years agoVPP-716: IKEv2 responder fails to authenticate initiator 77/6477/3
Matthew Smith [Wed, 26 Apr 2017 20:42:39 +0000 (15:42 -0500)]
VPP-716: IKEv2 responder fails to authenticate initiator

Fix handling of IDi and IDr when processing payloads in ikev2_process_auth_req

Change-Id: If0d4441dc89f08f3753f38987406c002d43558ec
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
7 years agoCGN: Send ICMP error packet if user is out of sessions available 87/6487/2
Martin Gálik [Thu, 27 Apr 2017 09:13:26 +0000 (02:13 -0700)]
CGN: Send ICMP error packet if user is out of sessions available

Change-Id: I19a6015fde7342588cfa9c7a4f07016aa339cc72
Signed-off-by: Martin Gálik <magalik@cisco.com>
7 years agovnet: update help message for intfc state 85/6485/2
Ray Kinsella [Thu, 27 Apr 2017 08:57:00 +0000 (09:57 +0100)]
vnet: update help message for intfc state

Add useful help information on set interface state.

Change-Id: Ibcdcea2849ccaee4cc72bf38d79102beb0d4be11
Signed-off-by: Ray Kinsella <ray.kinsella@intel.com>
7 years agoioam: adding missing setup api msg crc table 89/6489/2
Shwetha Bhandari [Thu, 27 Apr 2017 08:43:10 +0000 (14:13 +0530)]
ioam: adding missing setup api msg crc table

Change-Id: Ic95fe6179de1151796188813cc595187d4c842a0
Signed-off-by: Shwetha Bhandari <shwethab@cisco.com>
7 years agojapi: fix compilation on 32-bit systems 59/6459/2
Damjan Marion [Wed, 26 Apr 2017 12:25:56 +0000 (14:25 +0200)]
japi: fix compilation on 32-bit systems

Change-Id: Ia7cb986544a13cc17b43b2f0948482deb02e8fb5
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years ago[VPP-711] uri_tcp_test when master bind fail we met a display issue about retval 50/6450/3
flyingeagle23 [Wed, 26 Apr 2017 12:22:04 +0000 (20:22 +0800)]
[VPP-711] uri_tcp_test when master bind fail we met a display issue about retval

Change-Id: I320c9079576af5494c8336880a173e1f0ff096ad
Signed-off-by: flyingeagle23 <wang.hui56@zte.com.cn>
7 years ago[VPP-710] tcp TCP_TIMER_ESTABLISH timeout_handler occur segment fault 48/6448/2
flyingeagle23 [Wed, 26 Apr 2017 12:06:52 +0000 (20:06 +0800)]
[VPP-710] tcp TCP_TIMER_ESTABLISH timeout_handler occur segment fault

Change-Id: Ie43b8f1c91600d44dff67e9348fb2fe83efc60c2
Signed-off-by: flyingeagle23 <wang.hui56@zte.com.cn>
7 years agovhost: Fix mmap size calculation 00/6300/3
Pierre Pfister [Thu, 20 Apr 2017 13:34:00 +0000 (15:34 +0200)]
vhost: Fix mmap size calculation

I had a bug where a requested size of 1G was resulting in
an aligned size of '1G + 2M', resulting in an OOM error.

Previous code was adding one huge page size
when memory is already aligned.

Change-Id: Idd3aa0e9b893fb3efccba6ae1c7161e26d3f9456
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
7 years agoMove scripts to extras/ 47/6447/2
Damjan Marion [Wed, 26 Apr 2017 08:38:14 +0000 (10:38 +0200)]
Move scripts to extras/

Change-Id: I2abd6367915d4652fcf45025bd251046f3f206ab
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agovhost: core dump on quit with worker threads 37/6437/2
Steven [Tue, 25 Apr 2017 20:49:51 +0000 (13:49 -0700)]
vhost: core dump on quit with worker threads

Patch 6347 removed the socket file when the interface is deleted and
when VPP process is exitting. The CLI for deleting the interface has
builtin vlib_worker_thread_barrier_sync to prevent the worker
threads from running. Unfortunately, the CLI quit does not have the
builtin vlib_worker_thread_barrier_sync. As a result, it may cause the
worker thread to crash.

The fix is to add the vlib_worker_thread_barrier_sync in vhost_user_exit.

Change-Id: I1eff81170e131098f1799662f0ab48d6fca3def7
Signed-off-by: Steven <sluong@cisco.com>
7 years agoIP Flow Hash Config fixes 13/6313/5
Neale Ranns [Fri, 21 Apr 2017 08:07:59 +0000 (01:07 -0700)]
IP Flow Hash Config fixes

- the flow hash config is (and was) cached on the load-balance object so the fib_table_t struct is not used a switch time. Therefore changes to the table's flow hash config need to be propagated to all load-balances and hance all FIB entries in the table.
- enable API for setting the IPv6 table flow hash config
- use only the hash config in the fib_table_t object and not on the ipX_fib_t
- add tests.

Change-Id: Ib804c11162c6d4972c764957562c372f663e05d4
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agoCGN: Session dump, test naming for ports fixed 51/6451/2
Martin Gálik [Tue, 25 Apr 2017 08:25:08 +0000 (01:25 -0700)]
CGN: Session dump, test naming for ports fixed

Change-Id: Ib542b2b3ee023fbe3d0e01ceaf4b4ab7a0ec80dc
Signed-off-by: Martin Gálik <magalik@cisco.com>
7 years agoCGNAT: close session API and CLI commands. 76/6376/3
Martin Gálik [Wed, 19 Apr 2017 08:12:27 +0000 (01:12 -0700)]
CGNAT: close session API and CLI commands.

Change-Id: I9c8636bd2c4b8da2907e8e4a4f2be1a2c3a8e0bb
Signed-off-by: Martin Gálik <magalik@cisco.com>
7 years agoExit if plugin load attempt fail 33/6433/2
Damjan Marion [Tue, 25 Apr 2017 19:07:52 +0000 (21:07 +0200)]
Exit if plugin load attempt fail

This happens mainly if plugin contains unresolved symbol.
Such situation typically leads on crash a bit later so it is better
to exit immediatelly and display meaningful error message.

Change-Id: I4abd9a9089a4863400bf609e8d3fd7cebab92913
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoSession/tcp coverity fixes 36/6436/2
Florin Coras [Tue, 25 Apr 2017 18:58:06 +0000 (11:58 -0700)]
Session/tcp coverity fixes

Change-Id: Ic5467df16e870b49c49678b1dbb40f4a2390b3c9
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years ago"autoreply" flag: autogenerate standard xxx_reply_t messages 87/6387/3
Dave Barach [Mon, 24 Apr 2017 14:46:54 +0000 (10:46 -0400)]
"autoreply" flag: autogenerate standard xxx_reply_t messages

Change-Id: I72298aaae7d172082ece3a8edea4217c11b28d79
Signed-off-by: Dave Barach <dave@barachs.net>
7 years agoAdd sack tx unit test 94/6394/2
Florin Coras [Tue, 25 Apr 2017 07:05:27 +0000 (00:05 -0700)]
Add sack tx unit test

Change-Id: Ib91db6e531231bdc52b0104673a912bee024872f
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agoLISP: clean DP when deleting locators in use 24/6324/3
Filip Tehlar [Fri, 21 Apr 2017 10:05:58 +0000 (12:05 +0200)]
LISP: clean DP when deleting locators in use

Change-Id: Ia8736916bf59006bc581fe477db51ddd6bcc15e5
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
7 years agoAdd support for 32-bit x86 compilation in Makefiles 89/6389/2
Damjan Marion [Mon, 24 Apr 2017 18:48:53 +0000 (20:48 +0200)]
Add support for 32-bit x86 compilation in Makefiles

Change-Id: Ida73678b47b685abef4e81b5cad9fc13eb330850
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoFix structure alignment with 32-bit pointers 91/6391/2
Damjan Marion [Mon, 24 Apr 2017 18:58:29 +0000 (20:58 +0200)]
Fix structure alignment with 32-bit pointers

Change-Id: I740de6c0f12dab452b4349e3bf89ff976a6268c0
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoDefine cache line size for x86 32-bit 90/6390/2
Damjan Marion [Mon, 24 Apr 2017 18:52:35 +0000 (20:52 +0200)]
Define cache line size for x86 32-bit

Change-Id: Ie70e805f342bda69207b9df9543f1eccb5e69612
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoBD:unify bridge domain creation code 98/6098/5
Eyal Bari [Fri, 7 Apr 2017 20:14:17 +0000 (23:14 +0300)]
BD:unify bridge domain creation code

Change-Id: I29082e7a0c556069180a157e55b3698cf8cd38c7
Signed-off-by: Eyal Bari <ebari@cisco.com>