2892 Commits

Author SHA1 Message Date
Dave Wallace
86b8e26b33 vcl-ldpreload: test script enhancements
Change-Id: Iff302a35cd5d35bf0671a63e8ba81a0c60a231eb
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2017-10-19 14:27:51 +00:00
Klement Sekera
41a9e51f65 make test: control sanity via SANITY=yes|no option
Allow skipping sanity when using DEBUG=gdb/gdbserver options to speed
up development process by supplying SANITY=no option to make test.

Change-Id: I6e619229f6866b22bdeb75654b4e750232ae22bd
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-10-19 12:36:03 +00:00
Marco Varlese
5e5028ed57 Add GENEVE tunnel maintainer.
Change-Id: I30bbba4119accee2c157fb5b8202da3c87c59805
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2017-10-19 08:03:55 +00:00
Marek Gradzki
0164a06d81 Remove unused 'not_last' parameter from ip_add_del_route
Vat supports setting value for the parameter, but
'not_last' is ignored by ip_add_del_route handler,
so can be removed.

This patch
- updates ip.api,
- removes vat handlers
- updates vpp_papi_provider.py
  (also mpls_route_add_del with unused not_last)

Change-Id: Ife15de123db4bc8247103a29b90bce1988e46534
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2017-10-19 07:31:16 +00:00
Dave Barach
7bee773e71 VPP-1024: rewrite buffer trajectory tracer
Use a proper u16 * vector to capture node indices, since vpp w/
plugins now exceeds 255 graph nodes

Change-Id: Ic48cad676fa3a6116413ddf08c083dd9660783f1
Signed-off-by: Dave Barach <dave@barachs.net>
2017-10-19 04:35:54 +00:00
Dave Wallace
9c4b5b28b1 VCL-LDPRELOAD: fix iperf3 socket_test.sh
Change-Id: Ib6b52917af717d3341429163fb9ecc903cf717fb
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2017-10-19 04:35:37 +00:00
Eyal Bari
17142b2030 TEST,SPAN:add broadcast+QiniQ tests
Change-Id: I89c6923370af97bbd09db81a33b6d17f9424a049
Signed-off-by: Eyal Bari <ebari@cisco.com>
2017-10-18 23:52:41 +00:00
Filip Tehlar
8d7a0b9b92 LISP: fix crash when sending NSH map-request message, ONE-32
Change-Id: Ief8c3d3bec116e9f884981fb52af528f98b5f6ff
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2017-10-18 21:53:56 +00:00
Pierre Pfister
0906c5cfed Plugin for IP-Address to Interface Punting
This plugin provides per-ip address to interface punting.

When at least one rule is defined, the plugin receives all packets
which destination is one of VPP's address but which was not processed
by VPP (e.g., a TCP packet on a port that is not open, or a packet
for a protocol which is not attached).

Based on the set of configured rules, the destination address of each
packet is used to send the packet on the associated interface.

This plugin allows multiple containers to use
VPP's TCP stack (or other features provided by VPP) while still
being able to receive additional packets.

Change-Id: I3e69bb7d98183bf5163cb9ecb564cb482de252ce
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
2017-10-18 19:27:58 +00:00
Dave Barach
0091611c3c VPP-930: add missing ntohl to send_ip6_fib_details(...)
Change-Id: I0c1671f3eaf2dad084e3ac9fb124c9ed78273f50
Signed-off-by: Dave Barach <dave@barachs.net>
2017-10-18 10:54:56 -04:00
Andrew Yourtchenko
ec46b7c60e ipsec: use boolean or vs. bitwise or to avoid compiler error
Ubuntu 17.04, gcc version 6.3.0 20170406 (Ubuntu 6.3.0-12ubuntu2),
"make build" fails with the few of the errors below:

error: suggest parentheses around comparison in operand of ‘|’
[-Werror=parentheses]
        is_aead = (sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_128 |

Solution: use the logical rather than the bitwise or.

Change-Id: Iffcc1ed2e68b14b248159cb117593d32c623c553
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2017-10-18 12:55:00 +00:00
Dave Barach
cf5e848d69 CSIT-844: fix binary api rx pthread heap push/pop
We need to push/pop the rx pthread's heap without affecting other
thread(s).

Search clib_per_cpu_mheaps, locate an unused slot. Duplicate the main
thread heap pointer in that slot, and set __os_thread_index
appropriately.

Miscellaneous cleanups. Print exec_inband results as a vector, instead
of as a format string. Don't bail out of vpp_api_test with results
pending, e.g. at the end of a vpp_api_test script. Even though vpp
will eventuallly garbage-collect them, We don't want to leave
allocated reply messages lurking in the api message allocation
rings...

Change-Id: I0e8a25d1ff0d3700249dc330d079db16c2fcbc55
Signed-off-by: Dave Barach <dave@barachs.net>
2017-10-18 11:47:29 +00:00
Dave Wallace
965fec9089 session: fix connect corner case crash.
Change-Id: I54ced42749432335183ee3085a9ccc5f95a87ae9
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2017-10-17 21:49:17 +00:00
Dave Barach
b9f2cf0bff VPP-1032: fix coverity warnings
Change-Id: Ic3a0c51e5408921051deaf2e50372d9654574b27
Signed-off-by: Dave Barach <dave@barachs.net>
2017-10-17 15:19:22 -04:00
John DeNisco
a3db0782d4 Initial commit for phase 2, Add some simple validation.
Change-Id: I5b1d5600cdef4b05cc7c2f1cddb60aed2cc49ac2
Signed-off-by: John DeNisco <jdenisco@cisco.com>
2017-10-17 16:48:26 +00:00
Eyal Bari
cdeb7f2ae0 TEST,SPAN: add rx+tx span test
also refactored verify function

Change-Id: Ib93c99c833dd7c75e416374530c631f954957d98
Signed-off-by: Eyal Bari <ebari@cisco.com>
2017-10-17 16:15:29 +00:00
Dave Wallace
80b48a61b8 VCL_LDPRELOAD: Add unit test scripts.
Change-Id: I5fbb3339a6dbd7b40fecf66bfda3fd3249b4a90c
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2017-10-17 16:09:25 +00:00
Dave Wallace
68a40c868d VCL: refactor VCL_LDPRELOAD env vars.
- Update vcl-ldpreload references to use $WS_ROOT.

Change-Id: I8e79f7c5e330eda6548a2baf84613b0a4d360811
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2017-10-17 16:09:23 +00:00
Marco Varlese
556033a069 Add API versioning to GENEVE tunnel implementation.
Change-Id: I5974e5545d74af53c27938c8cdbae12745c38a54
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2017-10-17 10:33:49 +02:00
Florin Coras
ade70e459d session: return local transport endpoint in connect reply
Change-Id: I7794d5a0774017da4c1c15f45783a18754994ac8
Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-10-17 08:09:55 +00:00
Jan Gelety
0178efd690 Update CSIT tests 171002 -> 171017
- update of CSIT operational branch to be used for VPP-patch test

Change-Id: Ib098170bbcdbbb01c25ef197d9181cfd826d2854
Signed-off-by: Jan Gelety <jgelety@cisco.com>
2017-10-17 08:08:22 +00:00
Florin Coras
ec44e34bfe session: fix build when debugging is on
Change-Id: I193832a0cd0557fffc034a1223f67fa64a4d45ae
Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-10-16 20:49:05 -07:00
Florin Coras
3cbc04bea0 udp: refactor udp code
Change-Id: I44d5c9df7c49b8d4d5677c6d319033b2da3e6b80
Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-10-16 21:41:11 +00:00
Dave Barach
0cb01bde49 DNS name resolver improvements
- Cache intermediate CNAME records
- Bug fixes

Change-Id: I06dcb558212fc5e9434281493c872577cf9b83e1
Signed-off-by: Dave Barach <dave@barachs.net>
2017-10-16 21:23:39 +00:00
Steven
0d004aaaed LDPRELOAD: Remove hack code in getpeername
Now the real implementation of getpeername is there, we
remove the hack version of getpeername in LDPRELOAD.

Change-Id: I8fa2ba93d346f78d04129a87ee17a834cba537da
Signed-off-by: Steven <sluong@cisco.com>
2017-10-16 11:03:51 -07:00
Filip Tehlar
5908e18faa LISP: fix map-request counters, ONE-25
Change-Id: I198f58a84c4692408f9205052af24ee22df7aeaa
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2017-10-16 16:05:10 +00:00
Marek Gradzki
c7fc97ad85 jvpp: stop plugin intialization on first mismatch
Java bindings use get_message_id from jvpp-common
to detect if messages known at compile time
are avaliable at runtime.

In case of missing entry, Java exception is propagated
via JNI using (*env)->ThrowNew.

But this function does not end code execution so,
in order to prevent unexpected behaviour
(e.g. calling vl_msg_api_set_handlers with id == 0),
get_message_id caller should do it manually.

Change-Id: I2edb5013fd3658dcdd77a867b5cdf62e559ee071
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2017-10-16 14:18:09 +00:00
Gabriel Ganne
f90813d64c lb plugin - fix format() type mismatches
* (vip - lbm->vips) is u64; change format from [%u] to [%lu]
* vip->plen is u8, but format looks for u32; add exlicit cast
  (this cast was done implicitely)

On ARM platforms, these prevent a loop in the second call to
format_white_space() which would get an invalid (huge) indent value;
the result *looked like* an infinite loop.

Change-Id: I675ef2f98e4ba3d9e8aef12022d38b1d22981da8
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
2017-10-16 09:17:32 +02:00
Steven
2199aab742 VCL/LDPRELOAD: getpeername and getsockname
Add support for getpeername and getsockname system calls

Change-Id: Ie22787b967bb2a5fead0f5fcffd779e4f39b3302
Signed-off-by: Steven <sluong@cisco.com>
2017-10-15 20:21:27 -07:00
Dave Barach
fa77e8fb1c Fix minor issues in clib_spinlock_unlock()
Change-Id: I20ce799c9dd57332c06003b466ee7c36169bce98
Signed-off-by: Dave Barach <dave@barachs.net>
2017-10-15 22:14:15 +00:00
Florin Coras
d172a62365 ip: avoid arp assert if out of buffers (VPP-1030)
Change-Id: Ia31b978c6c1619c3e0075a84fcbbb6ccbf1c0076
Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-10-15 20:20:03 +00:00
Florin Coras
d0a5972213 Revert "Enforce FIB table creation before use"
This reverts commit f9342023c19887da656133e2688a90d70383b0c5.

Reverting to unblock master. No idea why jjb +1ed this patch! On closer inspection it looks like it -1ed it and subsequently changed opinion. CSIT tests should be fixed before re-merging. 

Change-Id: I26608912a962c52083073e16c7c9d2cc44a3cc8d
Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-10-15 18:28:43 +00:00
Matus Fabian
46ade03146 NAT: fix delete of sessions for 1:1 NAT if 1 worker (VPP-1023)
Change-Id: I2446c646de7f227f9438dd7ef93a455ba5af0102
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2017-10-14 09:14:59 +00:00
Gabriel Ganne
e3ea79747a change format_get_indent() to use u32 instead of uword
This follows commit d3c008d108aa2187d1a2afe2833b4de25ca2c2ab by
Christophe Fontaine.

Change-Id: I0c4df40df44be2ac0ab25817fa050a1f619eca4d
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
2017-10-14 09:13:39 +00:00
Thomas F Herbert
41988e58ba Fix bug with temporary directory when building rpms.
Fixes bug introduced in commit 5349f94d.

JIRA: VPP-1014

Change-Id: Ia18f4c6f5f1124306cce790a36f6de970d186687
Signed-off-by: Thomas F Herbert <therbert@redhat.com>
(cherry picked from commit 8c5bfbcc09f44f3ed2b87b0b5c257fbb7b735f97)
2017-10-14 09:12:32 +00:00
Thomas F Herbert
e41289115f Deps added to Makefile must also be in spec file.
Deps are required for Fedora too.

This patch is merged in version stable/17.10.
It should also be merged in master because it
fixes breaking rpm builds in some circumstances.

JIRA: VPP-1015

Cherry-picked from stable/1710

Change-Id: I10807069742cdd6b09a0f34d9d05e9cae4146ec3
Signed-off-by: Thomas F Herbert <therbert@redhat.com>
2017-10-14 09:12:12 +00:00
Matthew Smith
75d856096f Add API call to set keys on IPsec tunnel intf
There was already a CLI command and a libvnet function
to set the keys on an existing IPsec tunnel interface.
Expose this via the API.

Change-Id: I226a9616f680fc022f04447177a2e8232690657f
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2017-10-14 09:11:52 +00:00
Neale Ranns
054c03ac9c Source Lookup progammable via API
Change-Id: I5d5d4f22b6369d504455a644f73076d772fbcfb4
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-10-14 09:11:42 +00:00
Steven
d77275307b vhost: crash under heavy traffic condition due to memory corruption (VPP-1016)
With heavy traffic, tx code path may crash due to memory corruption

Thread 5 "vpp_wk_2" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff3995c700 (LWP 2505)]
0x00007ffff73675e8 in vhost_user_if_input (vm=0x7fffb5f5bf9c,
    vum=0x7ffff7882a40 <vhost_user_main>, vui=0x7fffb65570c4, qid=0,
    node=0x7fffb6577dac, mode=VNET_HW_INTERFACE_RX_MODE_POLLING)
    at /home/sluong/vpp-master/vpp/build-data/../src/vnet/devices/virtio/vhost-user.c:1610
1610		  bi_current = (vum->cpus[thread_index].rx_buffers)
	                       [vum->cpus[thread_index].rx_buffers_len];
(gdb) p vum->cpus[thread_index].rx_buffers_len
$2 = 793212607
(gdb)

Apparently, some code accidentally wrote the bad value in rx_buffers_len.
rx_buffers_len should never be greater than 1024 since that is how many buffers
we request each time.

After debugging many hours, I discovered that the memory corruption happens
in the tx code path right here on line 2176.

	  {
	    vhost_copy_t *cpy = &vum->cpus[thread_index].copy[copy_len];
	    copy_len++;
	    cpy->len = bytes_left;
	    cpy->len = (cpy->len > buffer_len) ? buffer_len : cpy->len;
	    cpy->dst = buffer_map_addr;
	    cpy->src = (uword) vlib_buffer_get_current (current_b0) +
	      current_b0->current_length - bytes_left;

(gdb) p cpy
$3 = (vhost_copy_t *) 0x7fffb554077c
(gdb) p copy_len
$4 = 1025
(gdb) p &vum->cpus[3].rx_buffers_len
$8 = (u32 *) 0x7fffb5540784

copy_len is picking up the index entry 1024 before it was incremented. copy array has only
1024 members (0 - 1023 are valid).
The assignment here in cpy surely causes memory corruption. It is only discovered later
when the memory location that it corrupted is used.

The condition for the crash is to transmit jumbo frames under heavy volume. Since ring
size is 1024, with one packet taking up one index for frame size (less 2048), it does
not cause overflow. With jumbo frames, it requires multiple indices for one packet,
it can cause the overflow under heavy traffic.

The fix is to do copy out when we have 1000 entries in the array to avoid
overflow.

Change-Id: Iefbc739b8e80470f1cf13123113f8331ffcd0eb2
Signed-off-by: Steven <sluong@cisco.com>
2017-10-14 09:11:19 +00:00
Georgina Sheehan
781b99ddc9 plugins/dpdk: align memory to avoid potential segfault and false sharing
Made Update to src/plugins/dpdk/buffer.c

Change-Id: I87bb8f38974a7be274c1b1d205f5513e7d068e48
Signed-off-by: Georgina <georgina.sheehan@intel.com>
2017-10-14 09:10:29 +00:00
Brian Brooks
40b655c370 Use AESNI=y only on x86_64 machines
This fixes the native build on arm64 machines.

Change-Id: I89bff01beedb4c8e26ac55fab2dd1ed39754bf26
Signed-off-by: Brian Brooks <brian.brooks@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
2017-10-14 09:09:57 +00:00
Dave Barach
903651caf3 VPP-1029: Don't call clib_longjmp(...) directly from the SIGTERM handler
It's way too easy to imagine leaving a mutex or a spin-lock held in
the /vpe-api shared-memory segment, or elsewhere. Set a volatile
variable and check it in a safe place...

Change-Id: I9d91c38cffeb921143c272162d055c9c24a6c312
Signed-off-by: Dave Barach <dave@barachs.net>
2017-10-14 09:08:41 +00:00
Neale Ranns
f9342023c1 Enforce FIB table creation before use
last i the serise of the use of the FIB table create/delete API. VPP now forces the tables to have been explicitly creted before they are used.

Change-Id: Ifde3b1bbb76697a01ab71bce4f5264e6d1725467
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-10-13 23:43:35 +00:00
Steve Shin
69cce16653 acl-plugin: display "::" for INADDR6_ANY on ACL output
INADDR6_ANY should be displayed as "::" instead of "0.0.0.0"(ipv4 format).

Change-Id: I24ec7b6febbfeca5db7ff894f455ecb73d954334
Signed-off-by: Steve Shin <jonshin@cisco.com>
2017-10-13 23:05:37 +00:00
Steven
bd187a8272 LDPRELOAD: Add TCP_KEEPIDLE, TCP_KEEPINTVL, and SO_KEEPALIVE
Implement the subject setsockopt by passing them to VCL

Change-Id: Ida5136cb3a51d2bf30080e8c4af4239681ed2184
Signed-off-by: Steven <sluong@cisco.com>
2017-10-13 21:04:44 +00:00
Dave Barach
6545716c07 VPP-1027: DNS name resolver
This patch is a plausible first-cut, suitable for initial testing by
vcl (host stack client library).

Main features;
- recursive name resolution
- multiple ip4/ip6 name servers
- cache size limit enforcement
  - currently limited to 65K
- ttl / aging
- static mapping support
- show / clear / debug CLI commands

Binary APIs provided for the following:
- add/delete name servers
- enable/disable the name cache
- resolve a name

To Do list:
- Respond to ip4/ip6 client DNS requests (vs. binary API requests)
- Perf / scale tuning
  - map pending transaction ids to pool indices, so the cache
    can (greatly) exceed 65K entries
- Security improvements
  - Use unpredictable dns transaction IDs, related to previous item
  - Make sure that response-packet src ip addresses match the server
- Add binary APIs
  - deliver raw response data to clients
  - control recursive name resolution
- Documentation

Change-Id: I48c373d5c05d7108ccd814d4055caf8c75ca10b7
Signed-off-by: Dave Barach <dave@barachs.net>
2017-10-13 20:20:09 +00:00
Andrew Yourtchenko
7e550693df acl-plugin: split the "show" commands and add an option to show ACLs by interface
From the troubleshooting perspective, it is nice to immediately know
the ACEs for the ACLs applied to an interface, so implement that.

To make the CLI more friendly, split each of the "show" variants
into an independent _cmd function with the distinct CLI path.

Change-Id: I519e4799083c04e8f0fcdf3e262a73493be4b690
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2017-10-13 19:14:23 +00:00
Steven
b59f227ab0 LDPRELOAD: Add ioctl, fcntl, and setsockopt support
Add support for the following system calls:

ioctl (FIONREAD)
fcntl (F_GETFL)
fcntl (F_SETFL)
setsockopt (SOL_IPV6, IPV6_V6ONLY)
setsockopt (SOL_TCP, TCP_NODELAY)
setsockopt (SOL_SOCKET, SO_REUSEADDR)
setsockopt (SOL_SOCKET, SO_BROADCAST)

This patch supersedes https://gerrit.fd.io/r/#/c/8765/

Change-Id: I5d5309d9f43d93a990b389d8cb667631de1903fe
Signed-off-by: Steven <sluong@cisco.com>
2017-10-13 16:46:51 +00:00
Steven
bccd339a59 VCL: Add SET_KEEPALIVE, SET_TCP_KEEPIDLE, and SET_TCP_KEEPINTVL
Add the subject enums to unblock LDPRELOAD. Just the enums,
no real implementation yet.

Change-Id: Ia3ec576c2779ee20956a37f0adebc06f16d1fe7f
Signed-off-by: Steven <sluong@cisco.com>
2017-10-12 20:44:15 -07:00
Sergio Gonzalez Monroy
2096063b08 dpdk/ipsec: coverity fixes
Change-Id: Ica3bc74ffbb1c0df4e198b0abff8df10cdeb2182
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2017-10-12 18:19:18 +00:00