2912 Commits

Author SHA1 Message Date
Hongjun Ni
4e5ceefb55 Separate CP and DP fib table for PPPoE
CP table: link_table
DP table: session_table

Change-Id: I2adbfd8f6a63d51d00d6dd291f32aebf20d13e4d
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
2017-10-06 08:22:50 +00:00
Sergio Gonzalez Monroy
db93cd9713 dpdk/ipsec: rework plus improved cli commands
This patch reworks the DPDK ipsec implementation including the cryptodev
management as well as replacing new cli commands for better usability.

For the data path:
 - The dpdk-esp-encrypt-post node is not necessary anymore.
 - IPv4 packets in the decrypt path are sent to ip4-input-no-checksum instead
 of ip4-input.

The DPDK cryptodev cli commands are replaced by the following new commands:
 - show dpdk crypto devices
 - show dpdk crypto placement [verbose]
 - set dpdk crypto placement (<device> <thread> | auto)
 - clear dpdk crypto placement <device> [<thread>]
 - show dpdk crypto pools

Change-Id: I47324517ede82d3e6e0e9f9c71c1a3433714b27b
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2017-10-05 09:54:34 +00:00
Dave Barach
7939f90460 Clean up "show api ring" debug CLI
Add a primary svm_region_t pointer to the api_main_t so we can always
find the primary region, even when processing an API message from a
memfd segment.

Change-Id: I07fffe2ac1088ce44de10a34bc771ddc93af967d
Signed-off-by: Dave Barach <dave@barachs.net>
2017-10-05 09:51:41 +00:00
Neale Ranns
6f63115603 Distributed Virtual Router Support
A distributed virtual router works by attmpeting to switch a packet, but on failing to find a local consumer (i.e. the packet is destined to a locally attached host) then the packet is sent unmodified 'upstream' to where the rest of the 'distributed' router is present. When L3 switching a packet this means the L2 header must not be modifed. This patch adds a 'l2-bridge' object to the L3 FIB which re-injects packets from the L3 path back into the L2 path - use with extreme caution.

Change-Id: I069724eb45956647d7980cbe40a80a788ee6ee82
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-10-05 09:50:26 +00:00
Christophe Fontaine
d3c008d108 [aarch64] Fixes CLI crashes on dpaa2 platform.
- always use 'va_args' as pointer in all format_* functions
- u32 for all 'indent' params as it's declaration was inconsistent

Change-Id: Ic5799309a6b104c9b50fec309cba789c8da99e79
Signed-off-by: Christophe Fontaine <christophe.fontaine@enea.com>
2017-10-04 17:31:13 +00:00
Marco Varlese
9bce0f6d7c Packages dependencies: added clang3_8 and indent packages
Change-Id: I4ed2d5f7e743369e2a41cfcb93b016d928cfed95
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2017-10-04 15:03:12 +00:00
Klement Sekera
6b6bd9d0b2 checkstyle: add clang-format dependency, fix bug
Change-Id: I608d3b73700d57652b015a9fc09300e99386a37f
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-10-04 15:02:29 +00:00
Neale Ranns
d867a7cf6b Set MAC address needs the HW interface index
Change-Id: I7b175d57b85e626aab00221b6dac0498aebcbeae
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-10-04 15:01:49 +00:00
Damjan Marion
206243c1b7 dpdk: use vpp physmem allocator for dpdk buffers
This allows us to have single contignuous allocation for DPDK buffers
with single mmap FD, so buffer memory can be easily shared with diffrent
process.

As a consequence dpdk socket-mem is no longer in charge for allocating
buffer memory, but still we need some space allocated for dpdk
structures so default socket-mem is reduced form 256 to 64 MB.

For a default of 16K buffers per numa node, physmem allocation is now
40MB, so basically this change reduces footprint from 256MB per socket
to 48 (64 + 40).

Change-Id: Ic8cfe83930a18411545b37a12b14aac89affd04f
Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-10-04 10:46:51 +00:00
Neale Ranns
7b7ba572ab Dump of deag/lookup routes has is_drop=1 (VPP-995)
Change-Id: I58772a83e22885a9ea8a7a981d2bcb4b31a050d2
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-10-04 09:53:41 +00:00
Jakub Grajciar
e2a4f07200 libmemif: memif_rx_burst fix
Change-Id: I2f488fef828df8915b57552567e1be79efe69700
Signed-off-by: Jakub Grajciar <Jakub.Grajciar@pantheon.tech>
2017-10-04 09:48:00 +00:00
Steven
9fefa9a697 memif: crash on slave mode
Crash was seen on recent image with this BT on top of the stack

(gdb) bt full
    (mif=0x7fffb6226568) at
    /vpp/build-data/../src/plugins/memif/memif.c:297
        ring = 0x0 <<<<<<<<<<
        i = 0
        j = 0
        buffer_offset = 65792
        r = 0x7fffb5e59f80
        alloc = {flags = 1, name = 0x7fffb449f965 "memif region",
          size = 4260096, numa_node = 0, addr = 0x7fff41dac000,
          fd = 11,
          log2_page_size = 12, n_pages = 1041}
        err = 0x0
        __FUNCTION__ = "memif_init_regions_and_queues"

The crash happened at this line.
      ring = memif_get_ring (mif, MEMIF_RING_S2M, i);
      ring=>head = ring->tail = 0; <=====

Please note that the crash is caused by dereferencing NULL rinng.
Put breakpoint into the function. I notice that
mif->regions[0].shm is not initialized.

(gdb) p mif->regions[0].shm
$8 = (void *) 0x0

It looks like we forgot to set shm after clib_mem_vm_ext_alloc().
Add the missing cide and the crash is fixed.

Change-Id: Ib722a6c241c77acfa8e33962106b57faa50e1ea7
Signed-off-by: Steven <sluong@cisco.com>
2017-10-04 09:46:26 +00:00
Jan Gelety
62549fec3b Update CSIT tests 170926 -> 171002
- update of CSIT operational branch to be used for VPP-patch test

Change-Id: I6331016b17b0811bf0ea1be03c5782428514a01a
Signed-off-by: Jan Gelety <jgelety@cisco.com>
2017-10-04 09:44:53 +00:00
Anton Ivanov
3eab064e3f VPP-1001 - update AF Packet Driver to for modern kernels
1. Add VNET headers support for checksumming - required
to operate correctly on any recent Linux

2. Bypass QDISC on transmit - improves performance by ~ 5%.
Enabled only if the macro is detected - apparently not
present on archaic distributions.

This still does not solve all issues with TSO - it can be
fixed only by going to tpacket v3 and dynamic rx ring as
well as significant changes in the TX (sendmmsg?).

Change-Id: Iea14ade12586c0a8da49e6dd1012108a08bc85b3
Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
2017-10-04 09:42:23 +00:00
Matthew Smith
2802953096 Add API support to dump IPsec SAs
Add an API request message type to dump IPsec SAs. Either
all IPsec SAs can be dumped or it can be limited to a single
SA ID (numeric ID set at creation time - not an index).
Add a handler for incoming messages with the new request type.
Add an API response message type containing the data
for an IPsec SA.
Add VAT support for new message type.

Change-Id: Id7828d000efc637dee7f988a87d3f707a8b466b7
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2017-10-04 09:37:03 +00:00
Florin Coras
780fc39506 api: fix internal client registrations
Makes sure vlib_rp and shmem_hdr are initialized for internal
registrations. They are needed for keepalive msg exchanges.

Change-Id: I805dec2d2aa84b1efdc1fdd692fc1d94389b776e
Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-10-03 23:53:35 +00:00
John Lo
5a6508d726 Update L2FIB entry timestamp only if BD aging enabled (VPP-1002)
Change L2 learning path so it update stale timestamp in MAC entry
only if aging is enabled on the BD for the MAC entry.

Change-Id: I7babe986ceef3c030d8ef9185076c42b405f7b0f
Signed-off-by: John Lo <loj@cisco.com>
2017-10-03 18:59:25 +00:00
eyal bari
c6038c91ad L2FIB,TEST:add max macs in event test
Change-Id: Ied72d44f8695af524751ffc54196cc3ac1addc85
Signed-off-by: Eyal Bari <ebari@cisco.com>
2017-10-03 17:17:16 +00:00
Florin Coras
a096f2d182 tcp: updates to connection closing procedure (VPP-996)
- add separate TIME_WAIT time constant
- fix output node for TIME_WAIT acks
- ensure snd_nxt is snd_una_max after retransmitting fin
- debugging improvements

Change-Id: Ic947153346979853f2526824b229126e47aead86
Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-10-03 11:05:55 +00:00
Matej Perina
b4d3c96f89 jvpp: added logs for sending and receiving event messages (VPP-982)
Change-Id: I47f9d12d934378f18c6f841b902af2a64ee7b187
Signed-off-by: Matej Perina <mperina@cisco.com>
2017-10-03 11:04:18 +00:00
Dave Barach
59b2565cd9 Repair vlib API socket server
- Teach vpp_api_test to send/receive API messages over sockets
- Add memfd-based shared memory
- Add api messages to create memfd-based shared memory segments
- vpp_api_test supports both socket and shared memory segment connections
- vpp_api_test pivot from socket to shared memory API messaging
- add socket client support to libvlibclient.so
- dead client reaper sends ping messages, container-friendly
- dead client reaper falls back to kill (<pid>, 0) live checking
  if e.g. a python app goes silent for tens of seconds
- handle ping messages in python client support code
- teach show api ring about pairwise shared-memory segments
- fix ip probing of already resolved destinations (VPP-998)

We'll need this work to implement proper host-stack client isolation

Change-Id: Ic23b65f75c854d0393d9a2e9d6b122a9551be769
Signed-off-by: Dave Barach <dave@barachs.net>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-10-03 11:03:47 +00:00
Jon Loeliger
35ffa3e8f6 Propagate duplicate IF addr add/del error up to API.
Identify and complain when the same IP prefix is assigned
to two different SW interfaces:

    vpp# set int ip address TenGigabitEthernet6/0/0 1.2.3.4/32
    vpp# set int ip address TenGigabitEthernet6/0/1 1.2.3.4/32
    set interface ip address: Prefix 1.2.3.4/32 already found on
	interface TenGigabitEthernet6/0/0

Change-Id: I1aee1b6a7ddd00d3109a53d8e1b6ce97bf45e372
Signed-off-by: Jon Loeliger <jdl@netgate.com>
2017-10-03 10:15:53 +00:00
Dave Wallace
e2efd12b84 make test: Copy api_post_mortem.$$ file tmp test dir for archiving.
Change-Id: I4baf89ef383dbc2f309081a6b56b13ebcb8fc2df
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2017-10-03 03:06:12 +00:00
Eyal Bari
24db0ec78f L2-FIB:add mac learn events test
fixes an issue where events were not sent if BD doesn't enable  mac aging

Change-Id: Iddc53cb5c45e560633e6c5cff2731dccfc70ad5b
Signed-off-by: Eyal Bari <ebari@cisco.com>
2017-10-02 01:29:44 +00:00
Dave Wallace
981fadf928 make test: Create link to failed test dir on timeout.
- Also change default coredump configuration from
  "coredump-size unlimited" to "full-coredump"

Change-Id: Iefedc2636f2d9696b7575b34e91dd7be49f601fa
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2017-09-30 19:54:54 -04:00
Dave Wallace
25dc16715e make test: archive failed test data with build logs.
- Fix invocation of compress_failed.sh
- Fix compress_failed to copy compressed results
  files to $WORKSPACE/archives and return failure
  exit code.

Failed test case data will be copied to logs.fd.io
and found in the archives/<make test data dir>-FAILED
directory in the build log link in the
vpp-verify-master-ubuntu1604 jenkins job page.

For example:
https://logs.fd.io/production/vex-yul-rot-jenkins-1/vpp-verify-master-ubuntu1604/7353/archives/

Change-Id: Ife9a0737115e69c0a8441e3bb0133af1528d909b
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2017-09-30 01:53:26 -04:00
Klement Sekera
d3e671e0db make test: fix/disable VAPI tests on centos
Workaround old `check' library on centos.
Disable building/running of C++ VAPI test as centos's gcc can't compile
our C++ code (vapi.hpp) due to bug.

Change-Id: If9da9c7f1bc076f7cdfb9bd3016dfe60a08afa36
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-09-29 12:59:19 +02:00
Steven
0ff5c563d5 cdp/lldp: punt for no buffer
When making a call to vlib_packet_template_get_packet(), it
is possible to get back a NULL if the system runs out of buffer.
This can happen when there is buffer leaks. But don't crash
just because we run out of buffers, just punt.

Change-Id: Ie90ea41f3dda6e583d48959cbd18ff124158d7f8
Signed-off-by: Steven <sluong@cisco.com>
2017-09-28 16:38:56 -07:00
Klement Sekera
905e250baf C++ API: remove deprecated throw lists
Change-Id: Ia58664438c9dc949884a794bd123555a13a02e6c
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-09-28 15:53:30 +00:00
Klement Sekera
958b750cea drop python3 dependency
Change-Id: I99c2c1d0d5b96f33efdb58dd3a2897a752e65349
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-09-28 06:31:53 +02:00
Florin Coras
a3bae4edcd Update package version
Change-Id: Ic9bc303b65c95a0e06f90c75b067056b0b11e654
Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-09-27 23:31:07 -07:00
Chris Luke
64ebb5ff13 General documentation updates
- We now have several developer-focused docs, so create an index page
  for them.
- Rework several docs to fit into the index structure.
- Experiment with code highlighting; tweak the CSS slightly to make
  it slightly nicer to look at.

Change-Id: I4185a18f84fa0764745ca7a3148276064a3155c6
Signed-off-by: Chris Luke <chrisy@flirble.org>
2017-09-28 01:04:56 +00:00
Steven
4ff586d1c6 tun/tap: Bad packets sent to kernel via tun/tap interface
It was observed that under heavy traffic, VPP accidentally sent traffic
with the wrong source and destination to the tun/tap interface. Traffic
appears to be sent to the wrong direction. This problem is only
seen when worker thread is configured.

When worker thread is used, TX and RX may reside in different
core. Yet both TX and RX threads are sharing the same global variable,
namely iovecs without any mutex or memory barrier protection.
This creates a race condition when heavy traffic is blasted to VPP,
like 1000 pps.

We could create a mutex or memory barrier to ensure atomic memory access.
But why bother? It is a lot cheaper to just decouple the iovecs such
that TX and RX have their own iovecs.

Change-Id: I86a5a19bd8de54d54f32e1f0845bae6a81bbf686
Signed-off-by: Steven <sluong@cisco.com>
2017-09-28 00:09:15 +00:00
Matej Perina
75a17ecddc VPP-990 remove registered handler if control ping fails
Change-Id: I5ca5763f0dc0a73cc6f014b855426b7ac180f356
Signed-off-by: Matej Perina <mperina@cisco.com>
v18.01-rc0
2017-09-27 20:55:50 +00:00
Filip Tehlar
a4980b8f3e LISP: add API handlers for set/get transport protocol
Change-Id: Ib675164c475edcdbe3013df7b847adf5e050c53f
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2017-09-27 18:27:46 +00:00
Akshaya N
535f0bfe02 VLAN support on host(af-packet) interface.
On host interface if a VLAN tagged packet is received, linux kernel removes
the VLAN header from packet byte stream and adds metadata in tpacket2_hdr.
This patch explicitely checks for the presense of VLAN metadata and adds it
in VPP packet.

Change-Id: I0ba35c1e98dbc008ce18d032f22f2717d610c1aa
Signed-off-by: Akshaya N <akshaya@rtbrick.com>
2017-09-27 18:22:37 +00:00
Dave Wallace
d51020cdfc Update vagrant centos config to CentOS 7.4
Change-Id: I45c1227b53ba9e57b94f1bc68de939cd3ce9d619
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2017-09-27 17:54:10 +00:00
Steve Shin
45c40dbb2c Fix: unnecesary uio binding for Mellanox NIC
UIO binding is not required for Mellanox NIC and calling vlib_pci_bind_to_uio()
should be skipped.

Change-Id: I10ea457bc3c8d4be8117dec51d5bd940ee416a44
Signed-off-by: Steve Shin <jonshin@cisco.com>
2017-09-27 17:12:44 +00:00
Chris Luke
879ace3d3b Various fixes for issues found by Coverity (VPP-972)
174267: Revisit this string termination issue
174816: Add check for NULL when trace is enabled
177211: Add notation that mutex is not required here
177117: Added check for log2_page_size == 0 and returns an error if so
163697,163698: Added missing sw_if_index validation

Change-Id: I5a76fcf6505c785bfb3269e353360031c6a0fd0f
Signed-off-by: Chris Luke <chrisy@flirble.org>
2017-09-27 17:08:08 +00:00
Andrew Yourtchenko
987abe9eeb acl-plugin: take 2 at VPP-991 fix, this time with a test case which verifies it.
The replacement of [] with pool_elt_at_index and subsequent fixing it
was incorrect - it was equivalent to &[], since it returns a pointer to
the element. I've added VPP-993 previously to create a testcase,
so this commit partially fulfills that one as well.

Change-Id: I5b15e3ce48316f0429232aacf885e8f7c63d9522
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2017-09-27 16:07:20 +00:00
Klement Sekera
a61d125198 make test: clean ext binaries when doing test-wipe
Change-Id: I9f5212ee670ea91c6b35f1406c256d0687b9c6b5
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-09-27 15:46:30 +00:00
Jan Gelety
891c94d5d3 Update CSIT tests 1700906 -> 170926
- update of CSIT operational branch to be used for VPP-patch test

Change-Id: If582dc7c5e37bd3cda7ba4858e98fc504e2b7b1e
Signed-off-by: Jan Gelety <jgelety@cisco.com>
2017-09-27 14:20:05 +00:00
Marco Varlese
625a9fac50 Fix SUSE dependencies to contemplate both python and python3 scripts.
Change-Id: Ib677955448833dfeb1291490340f5ea1e417213b
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2017-09-26 22:25:07 +00:00
Florin Coras
84275e9655 tcp: update snd_nxt after congestion recovery
Change-Id: I2cf4c4850b9c3c093a7dce0cec89b9f710f69393
Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-09-26 19:03:00 +00:00
Dave Barach
69128d0209 Add thread-safe event signaller, use RPC where required
Update ping code to use the new function

Change-Id: Ieb753b23f8402cbe5667c22747896784c8ece937
Signed-off-by: Florin Coras <fcoras@cisco.com>
Signed-off-by: Dave Barach <dave@barachs.net>
2017-09-26 17:17:09 +00:00
Klement Sekera
8a398bbae2 checkstyle: ignore old clang-format (centos)
Change-Id: Iecf35bd9fd760856e32eb1c0c9542ffbed472379
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-09-26 16:11:31 +00:00
Klement Sekera
d94c3e5b3c make test: don't recompile ext if not needed
Skip recompilation of test binaries from test/ext if these are
up-to-date. This speeds up repeated test runs.

Change-Id: I96dbfafc372398e3d858d8419219ef35c47bd0f3
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-09-26 15:41:50 +00:00
Matej Perina
6912a051c4 jvpp: lowering verbosity level for jvpp tests
Change-Id: Ie38dad209cce6d546379b4a5e449b34fbcadf171
Signed-off-by: Matej Perina <mperina@cisco.com>
2017-09-26 14:43:59 +00:00
Matus Fabian
7865b5c8a4 NAT: remove worker_by_in lookup hash table (VPP-992)
Change-Id: I3873d3e411bf93cac82e73a0b8e3b22563aaf217
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2017-09-26 01:29:05 -07:00
Andrew Yourtchenko
51d2651e4a acl-plugin: test: move the API calls to vpp_papi_provider.py
Change-Id: I1d3818027b8a1fcb1ec12016e3476b5c22a2d5a5
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2017-09-26 07:49:08 +00:00