vpp.git
6 years agoFIB path preference 86/7586/3
Neale Ranns [Sat, 15 Jul 2017 14:37:25 +0000 (07:37 -0700)]
FIB path preference

Paths are given a preference, lowest value is 'best'. Only paths that are up are up contribute to fprwarding - that's unchanged. What's new is that of the path's that re up only those that have the best preference contribute. A poor man's primary and backup. It's not true primary/backup function because the FIB must converge before the lower preference paths are used.

Change-Id: Ie4453c4a7b1094c6c2b51fe1594b8302103bb68e
Signed-off-by: Neale Ranns <nranns@cisco.com>
6 years agoDHCP client option 61 "client_id" 29/7629/3
Neale Ranns [Tue, 18 Jul 2017 16:26:53 +0000 (09:26 -0700)]
DHCP client option 61 "client_id"

the existing seeting of client_id to a VPP version number was unused and so overridden

Change-Id: If9ebea936336f1fcca8d07e67186c95f8f8f0ccd
Signed-off-by: Neale Ranns <nranns@cisco.com>
6 years agoDHCP client - remove interface address when DHCP de-configured 27/7627/2
Neale Ranns [Tue, 18 Jul 2017 15:23:32 +0000 (08:23 -0700)]
DHCP client - remove interface address when DHCP de-configured

Change-Id: I63c59e3c13859b51999d283774f7783ef0a6a5ed
Signed-off-by: Neale Ranns <nranns@cisco.com>
6 years agoTCP/UDP checksum offload API 51/7351/6
Dave Barach [Thu, 29 Jun 2017 13:30:15 +0000 (09:30 -0400)]
TCP/UDP checksum offload API

Change-Id: I2cb6ce4e29813f6602b14e6e61713fb381fbcef8
Signed-off-by: Dave Barach <dave@barachs.net>
6 years agoTEST:add l2bd nd term tests 19/7419/2
Eyal Bari [Wed, 5 Jul 2017 11:31:30 +0000 (14:31 +0300)]
TEST:add l2bd nd term tests

Change-Id: I67633175d50a70a0b8ae4f85c659b93070f8e1fb
Signed-off-by: Eyal Bari <ebari@cisco.com>
6 years agoFix unlinking of /dev/shm files. 99/7399/5
Dave Wallace [Mon, 3 Jul 2017 17:11:38 +0000 (13:11 -0400)]
Fix unlinking of /dev/shm files.

- api-segment prefix not used when unlinking shm files
- unlink root region on exit if no clients referenced
- stale reference to freed segment name
- don't add fake client to /db unless CLIB_DEBUG > 2
- turn off the gmond plugin
- clean up unused vars in vpp/api

Change-Id: I66451fcfd6ee64a12466c2d6c209050e3cdb74b7
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Signed-off-by: Dave Barach <dave@barachs.net>
6 years agoAdjust replication context to match vnet_buffer(b) 85/7585/2
Dave Barach [Sat, 15 Jul 2017 12:56:22 +0000 (08:56 -0400)]
Adjust replication context to match vnet_buffer(b)

Fixes a coverity warning, albeit not a serious issue.

Change-Id: I0fa28342ac4b222c1ba7f7f2befde455fd42d682
Signed-off-by: Dave Barach <dave@barachs.net>
6 years agoFixes and improved tcp/session debugging 55/7555/8
Florin Coras [Thu, 13 Jul 2017 05:24:57 +0000 (01:24 -0400)]
Fixes and improved tcp/session debugging

- Fix rx sack option parsing
- Add session sack scoreboard tracing and replaying
- Add svm fifo tracing and replaying
- Scoreboard/svm fifo ooo segment reception fixes
- Improved overall debugging

Change-Id: Ieae07eba355e66f5935253232bb00f2dfb7ece00
Signed-off-by: Florin Coras <fcoras@cisco.com>
6 years agovnet_buffer_t flags cleanup 73/7573/5
Damjan Marion [Thu, 13 Jul 2017 19:19:27 +0000 (21:19 +0200)]
vnet_buffer_t flags cleanup

Change-Id: I123eccea98abafeb31f25d2a162501e2eded60d4
Signed-off-by: Damjan Marion <damarion@cisco.com>
6 years agoIntroduce l{2,3,4}_hdr_offset fields in the buffer metadata 72/7572/4
Damjan Marion [Thu, 13 Jul 2017 16:53:27 +0000 (18:53 +0200)]
Introduce l{2,3,4}_hdr_offset fields in the buffer metadata

To save space in the first cacheline following is changed:

- total_length_not_including_first_buffer moved to the 2nd cacheline.
This field is used only when VLIB_BUFFER_TOTAL_LENGTH_VALID and
VLIB_BUFFER_NEXT_PRESENT are both set.

- free_list_index is now stored in 4bits inside flags, which
allows up to 16 free lists. In case we need more we can store index
in the 2nd cachelin

Change-Id: Ic8521350819391af470d31d3fa1013e67ecb7681
Signed-off-by: Damjan Marion <damarion@cisco.com>
6 years agoflowprobe: Fixed assert error with less than 1 second passive timer 82/7182/6
Andrew Li [Sun, 18 Jun 2017 19:11:57 +0000 (12:11 -0700)]
flowprobe: Fixed assert error with less than 1 second passive timer

When passive timer has less than 1 second left, it'll be forcifully
changed to 0 when converting from f64 to u64. As a result the
assertion will fail at the beginning of the passive timer start
fuction. This commit fixed this bug by adding a check of the delta.

Change-Id: I899b6e0ab4967dcecc821daf7e812dbbc90969ce
Signed-off-by: Andrew Li <zhaoxili@cisco.com>
6 years agodpdk: update build 44/7044/3
Sergio Gonzalez Monroy [Tue, 6 Jun 2017 14:29:16 +0000 (15:29 +0100)]
dpdk: update build

Current optional DPDK PMDs are:
- AESNI MB PMD (SW crypto)
- AESNI GCM PMD (SW crypto)
- MLX4 PMD
- MLX5 PMD

This change will always build DPDK SW crypto PMDs and required SW crypto
libraries, while MLX PMDs are still optional and the user has to build
required libraries.

Now the configure script detects if any of the optional DPDK PMDs were
built and link against their required libraries/dependencies.

Change-Id: I1560bebd71035d6486483f22da90042ec2ce40a1
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
6 years agoVPP-895 multi-thread: fix vpp crash on show runtime 23/7523/2
Igor Mikhailov (imichail) [Tue, 4 Jul 2017 00:01:50 +0000 (17:01 -0700)]
VPP-895 multi-thread: fix vpp crash on show runtime

In multi-threaded model (e.g. 1 main and 1 worker threads),
after an ethernet interface is deleted (e.g. vhost-user interface),
'show runtime' command produces garbled output and sometimes
leads to vpp crash.

The reason is because vlib_node_rename() frees and reallocates node's
'n->name' vector, however the change is not propagated into copies
of the node on worker threads.

Change-Id: Ibf22422913b7f2df22f70f3b2fe8dafd34c1dd06
Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
(cherry picked from commit 02989064e4c26a4940a5292ba6c47023e6dd3131)

6 years agodpdk: fix dpdk_buffer_pool_create name 94/7494/3
Chris Luke [Fri, 7 Jul 2017 18:57:07 +0000 (14:57 -0400)]
dpdk: fix dpdk_buffer_pool_create name

- vnet_buffer_pool_create should probably be named
  dpdk_buffer_pool_create since that is what it does.
- Its prototype should also be in a DPDK plugin header, not in
  vlib/buffer_funcs.h, since the implementation is in the plugin
  and nobody else should be calling it.

Change-Id: I7ba259afa4b888bc94f3ad257305e286b41e7370
Signed-off-by: Chris Luke <chrisy@flirble.org>
6 years agoUse clib_crc32c_uses_intrinsics instead of __SSE4_2__ 65/7565/3
Christophe Fontaine [Mon, 10 Jul 2017 13:23:06 +0000 (15:23 +0200)]
Use clib_crc32c_uses_intrinsics instead of __SSE4_2__

clib_crc32c is not limited to x86 platforms.

Change-Id: I5f6d5fdd4af80f9fe696d3317453fa58760df1db
Signed-off-by: Christophe Fontaine <christophe.fontaine@enea.com>
6 years agoFix typo for non x86 platforms. 64/7564/2
Christophe Fontaine [Mon, 10 Jul 2017 13:21:10 +0000 (15:21 +0200)]
Fix typo for non x86 platforms.

Change-Id: Ic31b388cb972fb5f8a3fc42a5412401c3ee3e487
Signed-off-by: Christophe Fontaine <christophe.fontaine@enea.com>
6 years agoFix crash with worker threads on 4K VXLAN/BD setup (VPP-907) 63/7563/1
John Lo [Wed, 12 Jul 2017 23:56:45 +0000 (19:56 -0400)]
Fix crash with worker threads on 4K VXLAN/BD setup (VPP-907)

Cleanup mapping of interface output node for the l2-output node
when interface is configured to L2 or L3 modes. The mapping is
now always done in the main thread as part of API/CLI processing,
instead of initiate mapping in the forwarding path which can be
in the worker threads.

Change-Id: Ia789493e7d9f5c76d68edfaf34db43f3e3f53506
Signed-off-by: John Lo <loj@cisco.com>
(cherry picked from commit bea5ebf205e0bec922bf26c6c1a6a9392b4cad67)

6 years agoDecrease steps necessary to upgrading RPM packages fixed 48/7248/3
Kristina Nevolnikova [Wed, 21 Jun 2017 12:20:42 +0000 (14:20 +0200)]
Decrease steps necessary to upgrading RPM packages fixed
in %postun part and not call sysctl when VPP package is
upgrading provide by condition for sysctl --system
in %post part.

Change-Id: I549803864699e4a81cf589befe296d585e1c6d2b
Signed-off-by: Kristina Nevolnikova <knevolnikova@frinx.io>
6 years agoDeprecate support for flattened output nodes 73/7373/5
Damjan Marion [Fri, 30 Jun 2017 17:53:03 +0000 (19:53 +0200)]
Deprecate support for flattened output nodes

Change-Id: Id117e219146d9994340fb38c00233ea67db8929b
Signed-off-by: Damjan Marion <damarion@cisco.com>
6 years agodpdk: prefetch 2nd cacheline of rte_mbuf during tx 22/7522/2
Damjan Marion [Tue, 11 Jul 2017 15:13:37 +0000 (17:13 +0200)]
dpdk: prefetch 2nd cacheline of rte_mbuf during tx

Change-Id: I0db02dd0147dbd47d4296fdb84280d0e7d321f3c
Signed-off-by: Damjan Marion <damarion@cisco.com>
6 years agoHorizontal (nSessions) scaling draft 16/7316/26
Dave Barach [Mon, 26 Jun 2017 15:35:07 +0000 (11:35 -0400)]
Horizontal (nSessions) scaling draft

- Data structure preallocation.
- Input state machine fixes for mid-stream 3-way handshake retries.
- Batch connections in the builtin_client
- Multiple private fifo segment support
- Fix elog simultaneous event type registration
- Fix sacks when segment hole is added after highest sacked
- Add "accepting" session state for sessions pending accept
- Add ssvm non-recursive locking
- Estimate RTT for syn-ack
- Don't init fifo pointers. We're using relative offsets for ooo
  segments
- CLI to dump individual session

Change-Id: Ie0598563fd246537bafba4feed7985478ea1d415
Signed-off-by: Dave Barach <dbarach@cisco.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
6 years agoL2INPUT:fix features mask cailculation 15/7515/2
Eyal Bari [Tue, 11 Jul 2017 11:24:37 +0000 (14:24 +0300)]
L2INPUT:fix features mask cailculation

Change-Id: I84cea7530b01302a0adeef95b4924f54dc2e41ec
Signed-off-by: Eyal Bari <ebari@cisco.com>
6 years agomemif: avoid double buffer free 13/7513/1
Damjan Marion [Tue, 11 Jul 2017 10:05:06 +0000 (12:05 +0200)]
memif: avoid double buffer free

Change-Id: I902f54618c4e1f649af11497c1cb10922e43755a
Signed-off-by: Damjan Marion <damarion@cisco.com>
6 years agoSNAT: fixed bug in fallback to 3-tuple key for non TCP/UDP sessions 98/7498/2
Matus Fabian [Mon, 10 Jul 2017 06:31:41 +0000 (23:31 -0700)]
SNAT: fixed bug in fallback to 3-tuple key for non TCP/UDP sessions

Change-Id: I1c4d5f92ec841b1cfe1a33eab4bb94e4001d0411
Signed-off-by: Matus Fabian <matfabia@cisco.com>
6 years agoAPI:fix arp/ND event messages - remove context 99/7499/3
Eyal Bari [Mon, 10 Jul 2017 07:12:13 +0000 (10:12 +0300)]
API:fix arp/ND event messages - remove context

context causes the message to be treated as a reply by the python API

Change-Id: Icf4d051a69f5a2cb9be5879accfe030ebcd650a8
Signed-off-by: Eyal Bari <ebari@cisco.com>
6 years agovlib: store buffer memory information in the buffer_main 03/7503/3
Damjan Marion [Mon, 10 Jul 2017 13:06:17 +0000 (15:06 +0200)]
vlib: store buffer memory information in the buffer_main

Currently, buffer index is calculated as a offset to the physmem
region shifted by log2_cacheline size.

When DPDK is used we "hack" physmem data with information taken from
dpdk mempool. This makes physmem code not usable with DPDK.

This change makes buffer memory start and size independent of physmem
basically allowing physmem to be used when DPDK plugin is loaded.

Change-Id: Ieb399d398f147583b9baab467152a352d58c9c31
Signed-off-by: Damjan Marion <damarion@cisco.com>
6 years agoVPP-904: fixes zero length CLI parameters parse 06/7506/2
Alexander Kotov [Mon, 10 Jul 2017 15:23:31 +0000 (18:23 +0300)]
VPP-904: fixes zero length CLI parameters parse

Change-Id: I21fbc9aff2b97a8b3f4cbed202c00b6d84557a6e
Signed-off-by: Alexander Kotov <kot@yandex.ru>
6 years agomemif: mask interrupts on startup if we are in the polling mode 27/7427/3
Damjan Marion [Wed, 5 Jul 2017 16:13:10 +0000 (18:13 +0200)]
memif: mask interrupts on startup if we are in the polling mode

Change-Id: Ief02eb1109a1bc463665d9747e9fa4e0c0e3d7e0
Signed-off-by: Damjan Marion <damarion@cisco.com>
6 years agovlib: fix issues with PCI handling code 04/7504/2
Damjan Marion [Mon, 10 Jul 2017 13:38:21 +0000 (15:38 +0200)]
vlib: fix issues with PCI handling code

- PCI devices not properly discovered
- vlib_pci_bus_master_enable () not working

Change-Id: I7433ab1b19b890b8900635b43037b9a2017a1921
Signed-off-by: Damjan Marion <damarion@cisco.com>
6 years agoformat: Check for NaN when rendering doubles 96/7496/1
Chris Luke [Sun, 9 Jul 2017 18:30:25 +0000 (14:30 -0400)]
format: Check for NaN when rendering doubles

- The result of 0.0/0.0 was being rendered as a lot of
  zeroes in the integer portion, as in this example:

  DBGvpp# show physmem
  0: 16 objects, 576k of 582k used, 3k free, 0 reclaimed, 2k overhead,
  16380k capacity
       alloc. from small object cache: 0 hits 0 attempts (0.00%) replacements 0
       alloc. from free-list: 0 attempts, 0 hits (0.00%), 0 considered (per-attempt 0.00)
       alloc. from vector-expand: 16
       allocs: 16 73643.06 clocks/call
       frees: 0 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.00 clocks/call

- Add two macros to vppinfra/math.h that use compiler builtins to check
  for NaN and Infinity and then use them in format_float().

Change-Id: Iccc03997e6e33d6b888d1e7e20cd78df0cfd02e8
Signed-off-by: Chris Luke <chrisy@flirble.org>
6 years agoAPI: Add Python3 support to vpp_papi.py 88/7488/4
Ole Troan [Fri, 7 Jul 2017 14:06:08 +0000 (16:06 +0200)]
API: Add Python3 support to vpp_papi.py

Change-Id: I0657b3f7578eb1b4d9a1ecabc14dc0f0e4647c65
Signed-off-by: Ole Troan <ot@cisco.com>
6 years agolldp packet transmission on a bonded interface 95/7495/2
Steve Shin [Fri, 7 Jul 2017 21:57:46 +0000 (14:57 -0700)]
lldp packet transmission on a bonded interface

LLDP packets are dropped at interface output node if each slave's link
is configured as the LLDP interface. The admin state is configured and
managed by the bonded interface, so slave link's state is down by default.
The checking for the admin state UP should be ignored for the slave link.

Change-Id: I06ca250f42fcb8cc50e0ea3a3817a2c5b56865df
Signed-off-by: Steve Shin <jonshin@cisco.com>
6 years agoETH:optimized double is_tagged check 18/7118/4
Eyal Bari [Tue, 13 Jun 2017 05:42:35 +0000 (08:42 +0300)]
ETH:optimized double is_tagged check

a double version of is_tagged, uses "free lanes" in _mm_cmpeq_epi16
to check a second tag

this code was not yet tested for performance

Change-Id: I640017e1cc75c85a33d196ee911a7e4a512d9849
Signed-off-by: Eyal Bari <ebari@cisco.com>
6 years agoSNAT: Fallback to 3-tuple key for non TCP/UDP sessions (VPP-884) 42/7442/2
Matus Fabian [Thu, 6 Jul 2017 12:37:49 +0000 (05:37 -0700)]
SNAT: Fallback to 3-tuple key for non TCP/UDP sessions (VPP-884)

Change-Id: I4868ff6e81c579b29d3ea066976ae145f8b83e9e
Signed-off-by: Matus Fabian <matfabia@cisco.com>
6 years agoUnlink /dev/shm files on application detach. 32/7432/4
Dave Wallace [Wed, 5 Jul 2017 18:30:46 +0000 (14:30 -0400)]
Unlink /dev/shm files on application detach.

Change-Id: Ieb5522cd5cb27bcbce808d4cd6df5248716da43c
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
6 years agoDHCP complete event sends mask length 72/7472/1
Neale Ranns [Thu, 6 Jul 2017 08:39:05 +0000 (01:39 -0700)]
DHCP complete event sends mask length

Change-Id: I4a529dfab5d0ce6b0bbc0ccbbd89c6b109dbf917
Signed-off-by: Neale Ranns <nranns@cisco.com>
6 years agoVPP-902: LISP-CP: Wrong size in one_l2_arp_entries_get message. 41/7441/3
Ole Troan [Thu, 6 Jul 2017 12:25:38 +0000 (14:25 +0200)]
VPP-902: LISP-CP: Wrong size in one_l2_arp_entries_get message.

Change-Id: I56bf6b46527f9465d78ed7c08b6e216e50c135ec
Signed-off-by: Ole Troan <ot@cisco.com>
6 years agodpdk: add FiftyGigabitEtherenet interface support 18/7418/2
Damjan Marion [Wed, 5 Jul 2017 00:04:36 +0000 (02:04 +0200)]
dpdk: add FiftyGigabitEtherenet interface support

Change-Id: Ied8b26179cdf4add34440a9c396cb821716cfb8e
Signed-off-by: Damjan Marion <damarion@cisco.com>
6 years agodevices: show interface rx-placement displays the wrong information (VPP-894) 79/7379/2
Steven [Fri, 30 Jun 2017 14:15:02 +0000 (07:15 -0700)]
devices: show interface rx-placement displays the wrong information (VPP-894)

show interface rx-placement somtimes displays the wrong interface names.
This happens when there exists subinterfaces in VPP.

The problem is due to the function show_interface_rx_placement_fn is calling
format_vnet_sw_if_index_name with hw_if_index instead of sw_if_index.

VPP has the concept of sw_if_index and hw_if_index. Each serves a different
purpose. When there is no subinterfaces, both hw_if_index and sw_if_index
may happen to have the same value. But don't count on it. When the API calls
for sw_if_index, we must pass the sw_if_index although the hw_if_index has
the same type which the compiler does not catch. Passing hw_if_index for an
API which requires sw_if_index may have an unpredictable result such as
described in the VPP-894 and sometimes it may even crash if the particular
index does not exist.

Change-Id: I76c4834f79b88a1c20684fcba64f14b2da142d77
Signed-off-by: Steven <sluong@cisco.com>
(cherry picked from commit bafa4d048439fdbcc0bd577e43a2784d1b89bfc5)

6 years agounix: mkdir VPP_RUN_DIR before opening a socket in it 34/7434/2
Chris Luke [Wed, 5 Jul 2017 22:02:53 +0000 (18:02 -0400)]
unix: mkdir VPP_RUN_DIR before opening a socket in it

Change https://gerrit.fd.io/r/#/c/7230/ added a Unix domain
CLI socket in the default startup.conf; however unless you
had previously run VPP with the DPDK plugin enabled the
directory that it is created in. /run/vpp, would not exist
and startup would fail. This directory is typically hosted
in a tmpfs ramdisk and is thus ephemeral.

This patch adds a function that attempts to mkdir VPP_RUN_DIR
and uses it in both the DPDK plugin and the CLI code if the
CLI socket is to be created in that directory.

Change-Id: Ibbf925819099dce2b5eb0fa238b9edca1036d6fd
Signed-off-by: Chris Luke <chrisy@flirble.org>
6 years agovppinfra: revert clib_memcpy optimization 28/7428/2
Damjan Marion [Wed, 5 Jul 2017 16:15:08 +0000 (18:15 +0200)]
vppinfra: revert clib_memcpy optimization

Looks like some compiler versions are producing wrong code when we are
copying 9-16 bytes so reverting back to the original code.

Change-Id: I74b5fa54a3b01f6288648f1cb0926030edd3b26f
Signed-off-by: Damjan Marion <damarion@cisco.com>
6 years agoSend GARP/NA on bonded intf slave up/down if in active-backup mode 09/7309/4
John Lo [Mon, 26 Jun 2017 05:40:20 +0000 (01:40 -0400)]
Send GARP/NA on bonded intf slave up/down if in active-backup mode

If a bonded interface is in active-backup mode and configured with
IPv4 and/or IPv6 addresses, on slave interface link up/down, send
a GARP packet if configured with an IPv4 address and an unsolcited
NA if configured with an IPv6 address. These packets can help with
faster route convergence in the next hop router/switch.

Change-Id: I68ccb11a4a40cda414704fa08ee0171c952befa2
Signed-off-by: John Lo <loj@cisco.com>
6 years agoVPP-900: VPP is released under the Apache 2.0 License (ASL 2.0). Update RPM specfile... 31/7431/2
Billy McFall [Wed, 5 Jul 2017 13:33:30 +0000 (09:33 -0400)]
VPP-900: VPP is released under the Apache 2.0 License (ASL 2.0). Update RPM specfile to reflect the proper license.

Change-Id: I9e8d1643ea65afd91a0cd5ad9545248575e32617
Signed-off-by: Billy McFall <bmcfall@redhat.com>
(cherry picked from commit 01d2b4b13ad719934e1e6999f9ed6c7c36a815ff)

6 years agoBuffer name inconsistently used a cstring/vec (VPP-901) 30/7430/1
Chris Luke [Wed, 5 Jul 2017 16:57:10 +0000 (12:57 -0400)]
Buffer name inconsistently used a cstring/vec (VPP-901)

Spotted in the output of CLI command "show buffers", the name field
sometimes had trailing garbage, the hall sign of a string not being
terminated. In this case it was being inconsistently used as a cstring
or a vec.

- CLI printf needs %v to print the vec srring
- vlib_buffer_create_free_list_helper tried to use
  clib_mem_is_heap_object() to detect a vec object, wheras it should
  use clib_mem_is_vec()

Change-Id: Ib8b242a0c5a18924b8af7e8e1432784eebcf572c
Signed-off-by: Chris Luke <chrisy@flirble.org>
6 years agoAdd API support for LLDP config/interface set 78/7378/4
Steve Shin [Sat, 1 Jul 2017 04:16:20 +0000 (04:16 +0000)]
Add API support for LLDP config/interface set

Add API methods to configure LLDP and set interface to enable/disable.
Also add port description TLV for LLDP.

Change-Id: Ib959d488c2ab8a0069f143558871f41fcc43a5d3
Signed-off-by: Steve Shin <jonshin@cisco.com>
6 years agoacl-plugin: VPP-897: applying of large number of ACEs is slow 96/7396/2
Andrew Yourtchenko [Mon, 3 Jul 2017 10:32:44 +0000 (12:32 +0200)]
acl-plugin: VPP-897: applying of large number of ACEs is slow

When applying ACEs, in the new hash-based scheme, for each ACE
the lookup in the hash table is done, and either that ACE is added
to the end of the existing list if there is a match,
or a new list is created if there is no match.

Usually ACEs do not overlap, so this operation is fast, however,
the fragment-permit entries in case of a large number of ACLs
create a huge list which needs to be traversed for every other
ACE being added, slowing down the process dramatically.

The solution is to add an explicit flag to denote the first
element of the chain, and use the "prev" index of that
element to point to the tail element. The "next" field
of the last element is still ~0 and if we touch that
one, we do the linear search to find the first one,
but that is a relatively infrequent operation.

Change-Id: I352a3becd7854cf39aae65f0950afad7d18a70aa
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit 204cf74aed51ca07933df7c606754abb4b26fd82)

6 years agoTEST:add L2BD arp term tests 81/7381/4
Eyal Bari [Sun, 2 Jul 2017 15:33:16 +0000 (18:33 +0300)]
TEST:add L2BD arp term tests

Change-Id: I42414da9663ecfc8dfe5baf3e6615cf3b9b02e22
Signed-off-by: Eyal Bari <ebari@cisco.com>
6 years agoacl-plugin: fix acl plugin test failing sporadically (VPP-898) 09/7409/2
Andrew Yourtchenko [Mon, 3 Jul 2017 14:25:37 +0000 (16:25 +0200)]
acl-plugin: fix acl plugin test failing sporadically (VPP-898)

The "acl_plugin" tests has one of the tests sporadically fail with the following traceback:

r.reply.decode().rstrip('\x00') UnicodeDecodeError: 'ascii' codec can't decode byte
0xd8 in position 20666: ordinal not in range(128)

This occurs in the newly added "show acl-plugin table" debug CLI.
This CLI has only the numeric outputs, so the conclusion is that it is
the incorrect termination (trailing zero) that might be most probably
causing it. The other acl-plugins show commands also
lack the zero-termination termination, so fix all of them.
The particularity of this command vs. the other acl-plugin debug CLIs
is that the accumulator is freed and allocated multiple times,
this might explain the issue is not seen with them.

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

6 years agoSNAT: fix failing test_session_limit_per_user (VPP-896) 00/7400/1
Matus Fabian [Mon, 3 Jul 2017 08:21:38 +0000 (01:21 -0700)]
SNAT: fix failing test_session_limit_per_user (VPP-896)

Change-Id: Idf46a03803125babd9bb880363686359fbcca27d
Signed-off-by: Matus Fabian <matfabia@cisco.com>
(cherry picked from commit 860af5ad2b023f9c57d622a7a9d3bd0099e480b1)

6 years agoRefactor API message handling code 83/7083/10
Klement Sekera [Fri, 9 Jun 2017 04:06:49 +0000 (06:06 +0200)]
Refactor API message handling code

This is preparation for new C API. Moving common stuff to separate
headers reduces dependency issues.

Change-Id: Ie7adb23398de72448e5eba6c1c1da4e1bc678725
Signed-off-by: Klement Sekera <ksekera@cisco.com>
6 years agotop-level Makefile improvements 60/7360/4
Damjan Marion [Fri, 30 Jun 2017 09:51:41 +0000 (11:51 +0200)]
top-level Makefile improvements

- auto-execute startup.vpp file if exists
- add DPDK_CONFIG=<string> to speficy custom config for autogenerated
  startup.conf, e.g. DPDK_CONFIG="no-pci"
- add DISABLED_PLUGINS=<comma separated list> option

e.g.

make DISABLED_PLUGINS=dpdk,acl run

or
export DISABLED_PLUGINS=dpdk,acl
make run

Change-Id: Ib0891d27aeae16b69b67c4c3e893bb3dbde5e7e1
Signed-off-by: Damjan Marion <damarion@cisco.com>
6 years agoVPP-893: handle multiple simultaneous event registrations 71/7371/2
Dave Barach [Fri, 30 Jun 2017 12:46:24 +0000 (08:46 -0400)]
VPP-893: handle multiple simultaneous event registrations

Change-Id: I8cd90820624987dbef848935e2de86fa66a86c17
Signed-off-by: Dave Barach <dave@barachs.net>
6 years agoVPP debug image with worker threads hit assert on adding IP route with traffic (VPP... 66/7366/2
Neale Ranns [Thu, 29 Jun 2017 07:19:08 +0000 (00:19 -0700)]
VPP debug image with worker threads hit assert on adding IP route with traffic (VPP-892)

When stacking DPOs the VLIB graph is also updated to add the edge between the nodes, if this edge does not yet exist. This addition should be done with the workers stopped.

Change-Id: I327e4d7d26f0b23eb280f17e4619ff2093ff7940
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit c02bd03ddf5eec9e9c79811360685f13e4ba8ee1)

6 years agomemif: API message handler registration bug-fix 67/7367/1
Jakub Grajciar [Fri, 30 Jun 2017 11:48:02 +0000 (13:48 +0200)]
memif: API message handler registration bug-fix

- removed memif details message from memif API

Change-Id: I21185e7678f375cc10639cdbc3ad2fd84bc95459
Signed-off-by: Jakub Grajciar <grajciar.jakub@gmail.com>
6 years agoLLDP: properly parse lldp cmds from startup config 34/7334/2
Klement Sekera [Wed, 28 Jun 2017 11:35:30 +0000 (13:35 +0200)]
LLDP: properly parse lldp cmds from startup config

Change-Id: I0e6c86bd923fcf7cf16f948b9869a5927e6d3745
Signed-off-by: Klement Sekera <ksekera@cisco.com>
6 years agoFix SIGBUS on aarch64 26/7226/3
Christophe Fontaine [Tue, 20 Jun 2017 11:57:47 +0000 (13:57 +0200)]
Fix SIGBUS on aarch64

A call to 'clib_smp_swap (&((dq)->interrupt_pending), 0)' was creating
a SIGBUS.
Instead of making dq->interrupt_pending aligned on 64bits, we reduce the size
from uword (u64) to u32, as the number of pending interrupts will never
go above max of u32.

Change-Id: Ifa5a6d3b7adee222329a671be01305cf50853b33
Signed-off-by: Christophe Fontaine <christophe.fontaine@enea.com>
6 years agoswitch vlib process model to tw_timer_template timer impl 26/7126/3
Dave Barach [Tue, 13 Jun 2017 12:48:31 +0000 (08:48 -0400)]
switch vlib process model to tw_timer_template timer impl

Change-Id: I36bb47faea55a6fea7af7ee58d87d8f6dd28f93d
Signed-off-by: Dave Barach <dave@barachs.net>
6 years agoL2-LEARN:fix l2fib entry seq num not updated on hit (VPP-888) 08/7308/3
Eyal Bari [Sun, 25 Jun 2017 11:42:33 +0000 (14:42 +0300)]
L2-LEARN:fix l2fib entry seq num not updated on hit (VPP-888)

fixed instability in l2bd_multi_instnce test - sometimes failing with extra
packets captured

it appears l2-learn was not updating hit entries but rather a copy of them.

if the ager did not have a chance to run before the test was running the
learning cycle - entries were not updated with the packet's seq num - causing
packets to flood when hitting the stale seq_num in l2-fwd - hence the extra
packets

fixed handling of filter entries

revert workaround for instability in test

Change-Id: I16d918e6310a5bf40bad5b7335b2140c2867cb71
Signed-off-by: Eyal Bari <ebari@cisco.com>
(cherry picked from commit 25ff2ea3a31e422094f6d91eab46222a29a77c4b)

6 years agoFLOWPROBE: Add flowstartns, flowendns and tcpcontrolbits 30/7130/3
Ole Troan [Tue, 13 Jun 2017 19:15:40 +0000 (21:15 +0200)]
FLOWPROBE: Add flowstartns, flowendns and tcpcontrolbits

- fixed problem with tcp_flag
- changed flowtimestamp into NTP format
Change-Id: I4ef05d6c69c5c078a0c80d59c5ccb0c85b924ba6
Signed-off-by: Ole Troan <ot@cisco.com>
6 years agoUpdate CSIT tests 170622 -> 170626 11/7311/2
Jan Gelety [Mon, 26 Jun 2017 08:17:37 +0000 (10:17 +0200)]
Update CSIT tests 170622 -> 170626

- update of CSIT operational branch to be used for VPP-patch test

Change-Id: I3e429f3884953908209e5f2d4e7a254dc7ccb720
Signed-off-by: Jan Gelety <jgelety@cisco.com>
6 years agoVPP-889: MAP Stats API/CLI crashes when no domains. 17/7317/2
Ole Troan [Mon, 26 Jun 2017 16:12:37 +0000 (18:12 +0200)]
VPP-889: MAP Stats API/CLI crashes when no domains.

Change-Id: Ib7824bfc08cb3c8f20258379e1a1f2c159c4f687
Signed-off-by: Ole Troan <ot@cisco.com>
6 years agoVPP crash on creating vxlan gpe interface. VPP-875 67/7267/5
Hongjun Ni [Thu, 22 Jun 2017 16:18:40 +0000 (00:18 +0800)]
VPP crash on creating vxlan gpe interface. VPP-875

Change-Id: I6b19634ecb03860a7624d9408e09b52e95f47aef
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
6 years agoAdd Maintainers for Vxlan-gpe feature 87/7287/3
Hongjun Ni [Fri, 23 Jun 2017 09:38:49 +0000 (17:38 +0800)]
Add Maintainers for Vxlan-gpe feature

Change-Id: I3f42e9bbd816a6e2192cc65eeb10a4681cf9e29a
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
6 years agomemif: If rx/tx_queues are unset, use default values 66/7266/3
Milan Lenco [Thu, 22 Jun 2017 07:10:07 +0000 (09:10 +0200)]
memif: If rx/tx_queues are unset, use default values

The standard behaviour for binary API is that zeroed arguments are
treated as if the default values were set. This way the configurator
does not need to know what default values are.
This, however, wasn't the case for rx_queues and tx_queues in
memif_create binary API message.

Change-Id: Ib588b472823f6bbb5ef12a798d68b0dda6dd2139
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
6 years agoRewrite vppctl in C 30/7230/6
Damjan Marion [Tue, 20 Jun 2017 14:35:29 +0000 (16:35 +0200)]
Rewrite vppctl in C

- removes python dependency
- removes vpp_api_test dependency
- communicates over unix socket
- properly detects terminal size and type
- responds on terminal resize

Change-Id: I46c0a49f9b5f9ef8a0a31faec4fc5d49aa3ee02e
Signed-off-by: Damjan Marion <damarion@cisco.com>
6 years agomake: Fix parallel building with some container platforms (VPP-880) 49/7149/4
Chris Luke [Wed, 14 Jun 2017 15:24:41 +0000 (11:24 -0400)]
make: Fix parallel building with some container platforms (VPP-880)

With some Linux container platforms /proc/cpuinfo reads as an empty
file. (Aside: stat on /proc/cpuinfo always indicates a length of
zero bytes, regardless of its content).

This has the effect that the make '-j' parameter being passed the
unhelpful value of '0' both in build-root/Makefile and dpdk/Makefile.
Make complains with the error:

  make: the '-j' option requires a positive integer argument

This patch checks for '0' and replaces it with '2' as a reasonable
number of jobs to run in parallel when the CPU count isn't known
(and assumed to be one). It also makes the value determination
consistent between VPP and DPDK (2*ncpu).

Change-Id: I78b89420114a825fab4d339e4f9291d486b7b9c8
Signed-off-by: Chris Luke <chrisy@flirble.org>
6 years agoIP4/IP6 FIB: fix crash during interface delete 39/7139/4
Pavel Kotucek [Wed, 14 Jun 2017 11:56:55 +0000 (13:56 +0200)]
IP4/IP6 FIB: fix crash during interface delete

after deleting a sub interface with IP4/IP6 address vpp crash

Change-Id: Ie768ca845b9e2394f61e2a8e9722a80a788746e7
Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
6 years agoUpdate master revision to 17.10 86/7286/1
Neale Ranns [Thu, 22 Jun 2017 21:43:55 +0000 (14:43 -0700)]
Update master revision to 17.10

Change-Id: I0b74cad60be4edace5c3636922cfb9c26cfde9ff
Signed-off-by: Neale Ranns <nranns@cisco.com>
6 years agoUpdate lisp map record default ttl to 24h 60/7260/2 v17.10-rc0
Florin Coras [Wed, 21 Jun 2017 23:27:01 +0000 (16:27 -0700)]
Update lisp map record default ttl to 24h

Change-Id: Ib8c72f8e08e89357b64f2f69ab70d60d3a7ec506
Signed-off-by: Florin Coras <fcoras@cisco.com>
6 years agoImprove svm fifo and tcp tx path performance (VPP-846) 93/7193/9
Florin Coras [Mon, 19 Jun 2017 16:26:09 +0000 (12:26 -0400)]
Improve svm fifo and tcp tx path performance (VPP-846)

- multiarch on svm fifo
- avoid ip lookup on tx

Change-Id: Iab0d85204a710979417bca1d692cc47877131203
Signed-off-by: Florin Coras <fcoras@cisco.com>
Signed-off-by: Dave Barach <dbarach@cisco.com>
6 years agoExport and Install GTP-U API file 97/7197/5
Hongjun Ni [Tue, 20 Jun 2017 15:09:32 +0000 (23:09 +0800)]
Export and Install GTP-U API file

Change-Id: I064d22277a0334c63f3d5072b1584b93e327b331
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
6 years agoacl-plugin: clean up the code enabling/disabling acl-plugin processing on interface 77/7277/2
Andrew Yourtchenko [Thu, 22 Jun 2017 12:51:06 +0000 (14:51 +0200)]
acl-plugin: clean up the code enabling/disabling acl-plugin processing on interface

Multiple subsequent calls to vnet_feature_enable_disable() to enable the feature
cause the feature to be inserted into the processing graph multiple times in a row.
This might be argued to be a bug in that function, but enabling already enabled feature
is suboptimal anyway, so avoid that. The existing tests already catch this issue whenever
the ASSERT() part of this patch was added.

Change-Id: Ia2c06f7dc87bbe05795c2c7b7d19ea06270ce150
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
6 years agoUpdate CSIT tests 170612 -> 170622 62/7262/2
Jan Gelety [Thu, 22 Jun 2017 06:06:53 +0000 (08:06 +0200)]
Update CSIT tests 170612 -> 170622

- update of CSIT operational branch to be used for VPP-patch test

Change-Id: I5645ebfaa32599797e4edf83b2281270ea4a8376
Signed-off-by: Jan Gelety <jgelety@cisco.com>
6 years agoNAT64: documentation 70/7270/1
Matus Fabian [Thu, 22 Jun 2017 10:03:53 +0000 (03:03 -0700)]
NAT64: documentation

added CLI command documentation
added NAT64 user documentation page

Change-Id: I3df400013800fe16351e02db7762ee3f92b195ff
Signed-off-by: Matus Fabian <matfabia@cisco.com>
6 years agoVNET:explicitly pad l2_classify 52/7252/3
Eyal Bari [Wed, 21 Jun 2017 12:32:13 +0000 (15:32 +0300)]
VNET:explicitly pad l2_classify

Change-Id: I77412aa8c17b45b1533604e7bfe8fe052ed0f80a
Signed-off-by: Eyal Bari <ebari@cisco.com>
6 years agoIntroduce default rx mode for device drivers 49/7249/5
Damjan Marion [Wed, 21 Jun 2017 12:29:44 +0000 (14:29 +0200)]
Introduce default rx mode for device drivers

If interface is down and queues are not configured then we are not able
to change rx-mode. This change introducess default mode which is stored
per interface and applied if driver wants.

Change-Id: I70149c21c1530eafc148d5e4aa03fbee53dec62f
Signed-off-by: Damjan Marion <damarion@cisco.com>
6 years agoacl-plugin: the second and subsequent ACEs incorrect endianness when custom-dump... 25/7225/2
Andrew Yourtchenko [Tue, 20 Jun 2017 11:54:57 +0000 (13:54 +0200)]
acl-plugin: the second and subsequent ACEs incorrect endianness when custom-dump and in VAT (VPP-885)

Add the missing function to convert the entire array of rules in the respective _endian functions,
rather than just the first rule.

Change-Id: Ic057f27ff7ec20150595efca1a48b74e5850f52b
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
6 years agoacl-plugin: CLI to clear all sessions 42/7242/3
Andrew Yourtchenko [Wed, 21 Jun 2017 09:24:25 +0000 (11:24 +0200)]
acl-plugin: CLI to clear all sessions

It is useful to have the CLI to clear the existing sessions.
There was a work-in-progress CLI but it did not work properly.
Fix it and split into a separate "clear acl-plugin sessions",
and add a unit test into the extended connection-oriented tests.

Change-Id: I55889165ebcee139841fdac88747390903a05394
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
6 years agoacl-plugin: use ethernet_buffer_header_size() to determine the size of the ethernet... 45/7245/2
Andrew Yourtchenko [Wed, 21 Jun 2017 10:20:39 +0000 (12:20 +0200)]
acl-plugin: use ethernet_buffer_header_size() to determine the size of the ethernet header

When extracting the 5-tuple, use the ethernet_buffer_header_size() so we can correctly
handle the case of subinterfaces, etc.

Change-Id: Ied73fde98d6b313e9eeab2aff4f22daa50a6cbbf
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
6 years agoacl-plugin: fix coverity issue 170476 59/7259/2
Andrew Yourtchenko [Wed, 21 Jun 2017 17:34:02 +0000 (19:34 +0200)]
acl-plugin: fix coverity issue 170476

Remove the unnecessary variable assignment which coverity detected.

Change-Id: I66ac20a8495400ac59192ddb72f16c95f6b4d03c
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
6 years agoacl-plugin: fix coverity issue 166801 58/7258/1
Andrew Yourtchenko [Wed, 21 Jun 2017 17:26:59 +0000 (19:26 +0200)]
acl-plugin: fix coverity issue 166801

A typo resulted in a value being overwritten and flagged as unused, fix the typo.

Change-Id: I512ba94321afb80d12c71ebbb0eec42d9fa6f299
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
6 years agoNAT64: custom prefix 55/7255/2
Matus Fabian [Wed, 21 Jun 2017 13:15:18 +0000 (06:15 -0700)]
NAT64: custom prefix

Change-Id: If397b49861468eed29b964fa64b186f80eb0eceb
Signed-off-by: Matus Fabian <matfabia@cisco.com>
6 years agomemif: minor changes in memif.h 53/7253/3
Damjan Marion [Wed, 21 Jun 2017 12:54:52 +0000 (14:54 +0200)]
memif: minor changes in memif.h

Change-Id: Iff550fd65f6e559b9fdfbbd53ef92d287c18166c
Signed-off-by: Damjan Marion <damarion@cisco.com>
6 years agoAdd option to create clib_socket with group write permissions 44/7244/2
Damjan Marion [Wed, 21 Jun 2017 10:01:37 +0000 (12:01 +0200)]
Add option to create clib_socket with group write permissions

Also allow group write as default for CLI socket connections.

Change-Id: I6af1f277f70581358cd9241bf0f5cb0752fe250f
Signed-off-by: Damjan Marion <damarion@cisco.com>
6 years agoAdd knob to specify effective group id (gid) for VPP process 43/7243/2
Damjan Marion [Wed, 21 Jun 2017 09:57:07 +0000 (11:57 +0200)]
Add knob to specify effective group id (gid) for VPP process

Change-Id: Icf9bd4abda058fb380f1a25d5fe3917ffb38b1c4
Signed-off-by: Damjan Marion <damarion@cisco.com>
6 years agoARP: ignore non-connected routes and non-interface sources when determing if source... 44/7144/5
Neale Ranns [Wed, 14 Jun 2017 13:50:08 +0000 (06:50 -0700)]
ARP: ignore non-connected routes and non-interface sources when determing if source is connected

Change-Id: I39fb0ec44cc322eaa12c0ff0700fc405d3982bfc
Signed-off-by: Neale Ranns <nranns@cisco.com>
6 years agoacl-plugin: fix coverity error 171135 29/7229/2
Andrew Yourtchenko [Tue, 20 Jun 2017 13:13:12 +0000 (15:13 +0200)]
acl-plugin: fix coverity error 171135

The code path which sets the sw_if_index aimed to restrict the output
did not set the flag to trigger that output.

Change-Id: I0a1a3977fdddbce9a276960df43fed745d099ca0
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
6 years agoacl-plugin: vat: acl_interface_list_dump confusing/incorrect output in case n_input... 27/7227/2
Andrew Yourtchenko [Tue, 20 Jun 2017 12:40:44 +0000 (14:40 +0200)]
acl-plugin: vat: acl_interface_list_dump confusing/incorrect output in case n_input == 0

The logic to print the line " output " is wrong for the case of n_input == 0,
and the applied ACLs are printed as if they were applied on input.
One may still figure out the truth by looking at the n_input value above,
but it is confusing.

Change-Id: I7b4a4d548e569994678dd1e139eb829456548b88
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
6 years agoL2-VTR: add vtr tests 23/7023/6
Eyal Bari [Tue, 6 Jun 2017 11:18:55 +0000 (14:18 +0300)]
L2-VTR: add vtr tests

re-enable l2 fib flush tests
reorder l2bd multi instance tests - move flags test as last
enabling of uu-flood will now flood when entry is stale

Change-Id: I052663ec3eb4acee5f296fb7525dd535924e0003
Signed-off-by: Eyal Bari <ebari@cisco.com>
6 years agovlib: make runtime_data handling thread-local 71/7171/7
Igor Mikhailov (imichail) [Fri, 16 Jun 2017 03:47:48 +0000 (20:47 -0700)]
vlib: make runtime_data handling thread-local

Change-Id: Ic2f2dc234199a5f882846880cbacff20fc8d477b
Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
6 years agoParenthesize the usage of the macro argument within vec_search() macro definition 17/7217/2
Andrew Yourtchenko [Tue, 20 Jun 2017 10:26:23 +0000 (12:26 +0200)]
Parenthesize the usage of the macro argument within vec_search() macro definition

Change-Id: I488d7c2b864c0e3661c8abf0363e4b97984d4974
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
6 years agoSNAT: unknow protocol hairpinning fix 00/7200/2
Matus Fabian [Tue, 20 Jun 2017 08:45:49 +0000 (01:45 -0700)]
SNAT: unknow protocol hairpinning fix

Change-Id: I15813167e7c8529f229143de4a8f64f0fb530951
Signed-off-by: Matus Fabian <matfabia@cisco.com>
6 years agoVPP-879 MAP: s/u32 is_add/u8 is_add in map.api 38/7138/3
Ole Troan [Wed, 14 Jun 2017 11:12:33 +0000 (13:12 +0200)]
VPP-879 MAP: s/u32 is_add/u8 is_add in map.api

Change-Id: If35171005e409f77bed4cc16eccb66a85aae5dfb
Signed-off-by: Ole Troan <ot@cisco.com>
6 years agoL2FWD:fix seq_num overwritten + validate l2fib entries when forwarding 36/7136/6
Eyal Bari [Wed, 14 Jun 2017 10:11:20 +0000 (13:11 +0300)]
L2FWD:fix seq_num overwritten + validate l2fib entries when forwarding

l2_classify memeber table_index was overlaid over l2.l2fib_seq_num
which over written when table_index gets initialized in l2_input_classify

solved by overlaying both table_index and opaque_index as only one is used

seperated l2fib seq num from l2_input configs
for better handling of theoretical ABA issue where an entry for a deleted
interface is considered valid by the ager because a different interface with
same sw_if_index and seq_num was created before the ager got a chance to delete

Change-Id: I7b0eeded971627406f1c80834d7e02c0ebe62136
Signed-off-by: Eyal Bari <ebari@cisco.com>
6 years agoNAT64: change not supported multi threading behaviour 88/7188/2
Matus Fabian [Mon, 19 Jun 2017 12:28:27 +0000 (05:28 -0700)]
NAT64: change not supported multi threading behaviour

Disable CLI/API commands instead of error message on startup.

Change-Id: I313ed6e2ea009f573afb5e08b0e85ed1f9091dc3
Signed-off-by: Matus Fabian <matfabia@cisco.com>
6 years agomemif: add ip mode 29/7129/7
Damjan Marion [Fri, 16 Jun 2017 20:06:00 +0000 (22:06 +0200)]
memif: add ip mode

In IP mode memif interface is L3 point-to-point interfaces and
we don't pass l2 header. There is no l2 header rewrite operation and
received packets are sent straight to ip4-input / ip6-input nodes.

Change-Id: I4177f3fce3004da7ecf14d235006ae053fcf3f09
Signed-off-by: Damjan Marion <damarion@cisco.com>
6 years agoOverall tcp performance improvements (VPP-846) 93/7093/19
Florin Coras [Sat, 10 Jun 2017 04:07:32 +0000 (21:07 -0700)]
Overall tcp performance improvements (VPP-846)

- limit minimum rto per connection
- cleanup sack scoreboard
- switched svm fifo out-of-order data handling from absolute offsets to
  relative offsets.
- improve cwnd handling when using sacks
- add cc event debug stats
- improved uri tcp test client/server:  bugfixes and added half-duplex mode
- expanded builtin client/server
- updated uri socket client/server code to work in half-duplex
- ensure session node unsets fifo event for empty fifo
- fix session detach

Change-Id: Ia446972340e32a65e0694ee2844355167d0c170d
Signed-off-by: Florin Coras <fcoras@cisco.com>
6 years agoSNAT: NAT packet with unknown L4 protocol if match 1:1 NAT 87/7187/2
Matus Fabian [Mon, 19 Jun 2017 11:28:04 +0000 (04:28 -0700)]
SNAT: NAT packet with unknown L4 protocol if match 1:1 NAT

Change-Id: Ic81c6098d615fdb6a874e532921efd833fed872c
Signed-off-by: Matus Fabian <matfabia@cisco.com>
6 years agoacl-plugin: bihash-based ACL lookup 58/6858/18
Andrew Yourtchenko [Wed, 24 May 2017 11:20:47 +0000 (13:20 +0200)]
acl-plugin: bihash-based ACL lookup

Add a bihash-based ACL lookup mechanism and make it a new default.
This changes the time required to lookup a 5-tuple match
from O(total_N_entries) to O(total_N_mask_types), where
"mask type" is an overall mask on the 5-tuple required
to represent an ACE.

For testing/comparison there is a temporary debug CLI
"set acl-plugin use-hash-acl-matching {0|1}", which,
when set to 0, makes the plugin use the "old" linear lookup,
and when set to 1, makes it use the hash-based lookup.

Based on the discussions on vpp-dev mailing list,
prevent assigning the ACL index to an interface,
when the ACL with that index is not defined,
also prevent deleting an ACL if that ACL is applied.

Also, for the easier debugging of the state, there are
new debug CLI commands to see the ACL plugin state at
several layers:

"show acl-plugin acl [index N]" - show a high-level
ACL representation, used for the linear lookup and
as a base for building the hashtable-based lookup.
Also shows if a given ACL is applied somewhere.

"show acl-plugin interface [sw_if_index N]" - show
which interfaces have which ACL(s) applied.

"show acl-plugin tables" - a lower-level debug command
used to see the state of all of the related data structures
at once. There are specifiers possible, which make
for a more focused and maybe augmented output:

"show acl-plugin tables acl [index N]"
show the "bitmask-ready" representations of the ACLs,
we well as the mask types and their associated indices.

"show acl-plutin tables mask"
show the derived mask types and their indices only.

"show acl-plugin tables applied [sw_if_index N]"
show the table of all of the ACEs applied for a given
sw_if_index or all interfaces.

"show acl-plugin tables hash [verbose N]"
show the 48x8 bihash used for the ACL lookup.

Change-Id: I89fff051424cb44bcb189e3cee04c1b8f76efc28
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
6 years agoNAT64: Hairpinning (VPP-699) 62/7162/3
Matus Fabian [Thu, 15 Jun 2017 09:28:50 +0000 (02:28 -0700)]
NAT64: Hairpinning (VPP-699)

Change-Id: I83a6c277fa211ac2c2ca2d603650c992886af0a7
Signed-off-by: Matus Fabian <matfabia@cisco.com>