Commit Graph

3898 Commits

Author SHA1 Message Date
e3e2f07141 tls: add stop listen handler
Change-Id: I233d02a669b6a0504cd54590c6c8e4fefadc4713
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-03-05 08:06:50 +00:00
03f942a1cc NAT44 - unknown protocols work with forwarding
If forwarding is enabled, inbound packets on an outside
interface should not be dropped and instead pass on to
the FIB lookup. This works for TCP and UDP but not other
IP protocols. Enable it for unknown protocols.

Change-Id: I1da84b5633a36b3e5e64079754db2fcc50f29819
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2018-03-05 08:03:43 +00:00
599a16bf8a vlib: add PCI MSI-X interrupt support (vfio only)
Change-Id: Iae2ddf93d1705354175e3dcae26b66e6f98a5c32
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-04 19:54:15 +01:00
2060db832a vlib: map pci region by using vfio FD when vfio is used
Change-Id: Ib94e9e9e9fcdad9cdb0e3402b3de7d78bd644abe
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-04 18:32:21 +00:00
44bcc20fcf vlib: fix vlib_pci_get_device_info on when not running as root
While comment properly says that only first 64 bytes can be read, actual
code was returning error instead being happy with 64 bytes received.

Change-Id: I09c0d1d5c9fc8e1f6c59c093d81bb1ce1924281b
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-04 18:00:03 +00:00
7b18536084 vppinfra: fix clib_mem_vm_ext_alloc non-shared allocations
Change-Id: I6d049c0875b91f67f008dc04ae7efe2f8ddc276e
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-04 17:58:02 +00:00
30787378f4 VPPAPIGEN: Improve output module finding for out-of-tree builds.
Change-Id: I3b646d84586dd61018f71cbf21c971c97fda75c1
Signed-off-by: Ole Troan <ot@cisco.com>
2018-03-03 10:17:18 +00:00
258fefd92f netlink: Use nl_pid 0 to play nice with others.
While the netlink field is named nl_pid, and typically
contains a process id, setting it to a pid value directly
prevents other modules from also using a netlink socket.
On the other hand, setting it to 0 allows multiple modules
to use a netlink socket by letting the kernel assign the
nl_pid a value.

This allows the verito tap code to interact nicely with
the router plugin's librtnl after, say, tap-inject has
been enabled.

Change-Id: I9771929f34d15497a5f7b8c5fd78dac28e31383b
Signed-off-by: Jon Loeliger <jdl@netgate.com>
2018-03-03 10:16:39 +00:00
dcde92743e tls: clib_mem_alloc context to avoid dangling references
Change-Id: I1e3b48dfd21c9dbebdbcc0af0d6e888b416b3ac5
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-03-02 09:26:26 -08:00
d85075e6e4 make test: VCL extended test cases
- Add VCL cut thru uni-direction test over multiple sockets
- Add VCL cut thru bi-direction test over multiple sockets
- Add LDP cut thru uni-directional test over multiple sockets
- Add LDP cut thru bi-directional test over multiple sockets
- Add VCL thru host stack uni-direction test over multiple sockets
- Add VCL thru host stack bi-direction test over multiple sockets
- Add LDP thru host stack uni-directional test over multiple sockets
- Add LDP thru host stack bi-directional test over multiple sockets
- Fix validateResults to ensure worker_server process is killed if
  it still exists after running the test.

Change-Id: I77ea9acef172667558dbcec23af1e4c72b29f376
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-03-02 19:22:53 +00:00
05e4f9b377 make test: add "EXTENDED_TESTS" to help output.
Change-Id: I89540e93f3c8839bf6fc4363f4736e9c01d91927
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-03-02 19:22:10 +00:00
d7e4d75233 gitignore: negate "No core files" pattern in 'vpp-api/java'
The 'vpp-api/java' includes 'core' subdir which should be tracked.

This patch adds .gitignore for 'vpp-api/java'
to negate pattern that matches 'core' files/dirs,
introduced by https://gerrit.fd.io/r/#/c/9848/.

Change-Id: I4e10ca10a891a2d95d6b45e479ee8d2196749132
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2018-03-02 19:16:08 +00:00
30ec82161f Add RPM buildtime dependency on mbedtls-devel
Update RPM spec to know about it

Change-Id: I61c7c1ce96071e3b84d792c18ff8880217b14fce
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2018-03-02 16:48:25 +00:00
a51ccb5bb5 jvpp: object model for jvpp generator (VPP-1184)
Introduces JSON parser which builds object model of Java API.

Also rewrites JNI translation of typedefs
to use per type translation functions
instead of code inlining.

Not covered:
- integrate with vappigen plugin (VPP-1154) or vapi parser (VPP-1155)
- use better templating engine (VPP-480)
- improvements of generator structure (e.g. VPP-1186)

Change-Id: I9e12d76c2f3c6ee041669f58e8a37917f656aa90
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2018-03-02 15:22:34 +00:00
371ca50a74 session: first approximation implementation of tls
It consists of two main parts. First, add an application transport type
whereby applications can offer transport to other applications. For
instance, a tls app can offer transport services to other applications.
And second, a tls transport app that leverages the mbedtls library for
tls protocol implementation.

Change-Id: I616996c6e6539a9e2368fab8a1ac874d7c5d9838
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-03-02 12:54:31 +00:00
9e6356962a tapv2: CLI and binary API fixes
1. When interface create encouners an error (see test below),
the same id cannot be used again.
This is due to hash_set is called too early in the function. After the
hash entry is set, there are different errors may cause the interface
create to be aborted. But we didn't remove the hash entry when error is
encountered. The fix is to move the hash_set call near the end which has
no more "goto error"

DBGvpp# create tap id 1 rx-ring-size 1021 tx-ring-size 1021
create tap id 1 rx-ring-size 1021 tx-ring-size 1021
create tap: ring size must be power of 2
DBGvpp# create tap id 1 rx-ring-size 1024 tx-ring-size 1024
create tap id 1 rx-ring-size 1024 tx-ring-size 1024
create tap: interface already exists
DBGvpp#

2. multiple issues exist with api_format.c with the below command

binary-api tap_create_v2 id 4 hw-addr 90:e2:ba:76:cf:2f rx-ring-size 1024 tx-ring-size 1024

- hw_addr is not taken due to the test for random mac is inverted
- id is an integer, not a string
- integer values were not converted to network format

Change-Id: I5a669d702a80ad158517df46f0ab089e4d0d692e
Signed-off-by: Steven <sluong@cisco.com>
2018-03-02 09:08:01 +00:00
204591d1bd NAT44: interface output feature and service host direct access (VPP-1176)
forwarding mode:
session initiaded from service host - translate
session initiaded from remote host - do not translate

Change-Id: I48170ee8e4ad14d3d3083ee31a40ef8d10d6ff32
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2018-03-02 08:48:40 +00:00
8996cb6f77 Change tcp config to reflect some recent changes.
Change-Id: Ic151be9ff7114c1fdec22d5ad056654960cf12b2
Signed-off-by: John DeNisco <jdenisco@cisco.com>
2018-03-01 15:06:31 -05:00
465c087c58 SCTP: API to delete a sub-connection
This patch adds an API to delete a sub-connection following a SRC/DST IP
mapping as required by the RFC4960.

Change-Id: I7673dd07352557442ffeed6c6c00da274b24953d
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-03-01 17:43:00 +00:00
6ee4051139 6RD: Rewritten 6RD RFC5969 support.
Change-Id: Ic30fbcb2630f39e45345d7215babf5d7ed4b33a0
Signed-off-by: Ole Troan <ot@cisco.com>
2018-03-01 14:37:11 +00:00
62bab658e7 STN: Fix stn_rules_dump/details to follow API convention
Change-Id: I94f6c35bf751d25ca7fe7c67054e676a3ad2241b
Signed-off-by: Ole Troan <ot@cisco.com>
2018-03-01 14:35:39 +00:00
2bf8b8154d Fix ERSPAN encap to set EN bits in the header and add test case
For ERSPAN encap, both bits in the EN field of the header should
be set to indicate any VLAN tag in the original Ethernet frame is
preserved.
Added SPAN L2 test case where the mirrored packet output is a GRE
ERSPAN tunnel.

Change-Id: Ie7a40992a9278469c24aa6fa9e122b4505797d10
Signed-off-by: John Lo <loj@cisco.com>
2018-03-01 13:09:57 +00:00
3c6a976325 SCTP: API to add a sub-connection
This patch adds an API to add a sub-connection following a SRC/DST IP
mapping as required by the RFC4960.
At the same time, it changes the way the next available sub-connection
is being calculated: rather than having an index in the parent
connection which is prone to many issues at run-time, the next available
sub-connection is being calculated by looking at the state of the set
sub-connections and if marked as DOWN it means that is an available slot
to be used.

Change-Id: I662be6a247bfbbe8bf9aaf3f485183c07ef862fe
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-03-01 11:43:52 +00:00
afddd83ca1 PAPI: pycodestyle on vpp_papi.py
Change-Id: I15cf4a9fd2d2518df4bfffc1ba3c556a87ca5afa
Signed-off-by: Ole Troan <ot@cisco.com>
2018-03-01 11:08:34 +00:00
477e91a6d6 session: zero out ips in local endpoint lookup only if local
Change-Id: I3425b1533b3d31210166e7b3798685464ad1c489
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-03-01 02:55:32 +00:00
9f11c0108b make test: Add VCL LD_PRELOAD tests
- Refactor test code into VclTestCase object.
- Add LDP cut thru and thru host stack tests.

Change-Id: I2b16473df108004c79cc86fe1b7a789485b2dc5b
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-03-01 02:49:22 +00:00
7c172cb245 Adjust vpp-selinux-policy postinstall
Only run semodule command on hosts where selinux
is enabled.

Change-Id: I7bcfc758e44bb0f41ec657ad395352ddb92766eb
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2018-02-28 21:47:43 +00:00
0b8567331c tapv2: abort in tap_create_if (VPP-1179)
The following command sequences cause the crash:

create tap id 0 rx-ring-size 1024 tx-ring-size 1024
create tap id 1 rx-ring-size 1024 tx-ring-size 1024
set interface state tap0 up
set interface state tap1 up
delete tap tap0
delete tap tap1
create tap id 0 rx-ring-size 1024 tx-ring-size 1024

0: /home/sluong/vpp2/vpp/build-data/../src/vnet/interface_funcs.h:46
 (vnet_get_hw_interface) assertion `! pool_is_free (vnm->interface_main.hw_interfaces, _e)' fails

The reason for the crash is because when the tap interface is deleted,
the code does not remove the entry from the device queue. But the interface
is deleted anyway from vnet_main.interface_main.hw_interfaces.
When an interface is created again, it may encounter
the deleted entry in the device queue and crash. Notice create and delete a
single entry does not cause a crash. Need to create and delete 2 interfaces
to create a "hole" in the device queue.

Change-Id: I42ce0b7943d73b3eab32a16751a0a3183de62d9f
Signed-off-by: Steven <sluong@cisco.com>
2018-02-28 21:42:31 +00:00
a608b60641 at af_packet input, drop partial packets to prevent l4 checksum deadloop at ouptut
Change-Id: I6f75b7328fd0aa71d00a701e36c8b4ad06bff3c4
Signed-off-by: Chaoyu Jin <chjin@cisco.com>
2018-02-28 10:15:53 -08:00
3f8562eaab Fix SELinux capabilities. Creating a tap interface with 'tap connect' was returning an error when VPP was launched as a service (tested on CentOS 7.3). Adding 'net_admin' to SELinux capabilities for VPP solves the issue.
Change-Id: Icd0529b49adb86e7b371283a6f39af03816951c5
Signed-off-by: Victor Nguyen <victong2@cisco.com>
2018-02-28 14:35:30 +00:00
8c5f67f2b8 SCTP: handle COOKIE while in SHUTDOWN phase
This patch address the requirement to handle a COOKIE chunk whilst in
SHUTDOWN phase. The COOKIE shouldn't just be dropped but an OPERATION
ERROR chunk shall be sent to the peer to inform about the current
situation.

Change-Id: I1a47652402d49cfee3b0c810304d7902f3a62f40
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-28 05:54:43 +00:00
ac0932d26c vnet/interface: vnet_(put|get)frame_to_sw_interface is not worker thread aware
When heavy traffic is running using worker threads, it may crash here

DBGvpp# 0: /home/sluong/vpp3/vpp/build-data/../src/vlib/main.c:1128 (dispatch_pending_node) assertion `f->flags & VLIB_FRAME_PENDING' fails

Thread 1 "vpp_main" received signal SIGABRT, Aborted.
0x00007ffff5d50428 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/unix/sysv/linux/raise.c:54
54	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb)

No crash was observed if only main thread was used.

Change-Id: I96f8b02ec23accc85c0f1ddecfeff6043b5e3c2b
Signed-off-by: Steven <sluong@cisco.com>
2018-02-27 15:15:02 -08:00
0aa14ed8f5 memif: Fix a message initialization problem in VAT
The VAT calls to MEMIF_SOCKET_FILENAME_ADD_DEL erroneously
cleared the message memory after the M() macro call and
thus lost their message id.  Don't do that.

While in the neighborhood, prevent a string copy from
referencing data that doesn't belong to the filename string.

Change-Id: Ib4309608ed617ef4f193880ecf4a0b35fda65e51
Signed-off-by: Jon Loeliger <jdl@netgate.com>
2018-02-27 20:53:14 +00:00
b95bc05fce sctp: sctp_output.c failed to compile when VLIB_BUFFER_TRACE_TRAJECTORY is enabled
Fixed a typo in sctp_push_header(). It was inherited from tcp_output.c

Change-Id: I810fcb4c24cfd3d54f15da72a5184cfc4df24592
Signed-off-by: Steven <sluong@cisco.com>
2018-02-27 20:12:55 +00:00
3a758b0af8 VOM: interface: Fix the vhost user interface
Change-Id: I38904dafb4110322ec0138f7a5b3a65c96426b2b
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-02-27 19:41:41 +00:00
42996c0fcd make test: refactor vcl test cases
- Reduce replicated code in test cases
- Configure separate namespace secrets for thru hoststack
  test case to validate namespace secret functionality.
- Pass per-instance environment variables to Worker class
  init function.

Change-Id: I3cd5d4538f105cbfb09671c4d761541b40714b8f
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-02-27 18:23:05 +00:00
10e369986a SRv6: API uses table-IDs not FIB indicies
Change-Id: Iacbf7593ef9c03000db502e68335ac3ae18995d7
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-02-27 12:45:36 +00:00
22ac59b591 Added u8x16,u32x4,u64x2 variants of _zero_byte_mask(x) for ARM/NEON platform. VPP-1129
Change-Id: I954acb56d901e42976e71534317f38d7c4359bcf
Signed-off-by: Adrian Oanca <adrian.oanca@enea.com>
2018-02-26 22:28:50 +00:00
200fa32213 SCTP: Handle a COOKIE ECHO/ACK when a TCB Exists
This patch addresses the requirements depicted in section 5.2.4 of the
RFC 4960. It also takes care of handling the ERROR chunk and obviously
the STALE COOKIE error.

Change-Id: I6b88a9371546b18a52abac22f7c593a5f16be838
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-26 22:27:50 +00:00
eacf3cfdaf SCTP: handle INIT corner-case handling
As per RFC4960 the INIT chunk could be received in unexpected scenarios
and - depending on the state of the internal state-machine - the INIT
chunk requires different treatment.
This patch addresses section 5.2.1 and 5.2.2 of the RFC4960.

Change-Id: Ib23ef490c6a5ca3da6c46a9584b75e7577cb7042
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-26 22:27:50 +00:00
2ae03d2f8f Fix current data offset to use vlib_buffer_get_current in input/output ACL
vlib_buffer_get_current() should be used for current data offset in ACL.
This is required for output ACL where packets are decoded through a vxlan tunnel rx node.

Change-Id: I6f739f251c3eb0d59ee4ae0da97aa04ddf667468
Signed-off-by: Steve Shin <jonshin@cisco.com>
2018-02-26 11:43:31 -08:00
f9a968e2f9 vlib: use vfio fd for accessing PCI config space
Change-Id: Id5c76a529ab9969334207790babcdc420a9c58ad
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-26 13:19:16 +00:00
767fcb6742 Python: addressing PEP8 deprecation
PEP8 has been deprecated and python users are being asked to migrate to
pycodestyle.

Change-Id: I52d5f7b2bf72156216a9966e8322ec58763f24d4
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-26 12:05:10 +00:00
cbcc84ba66 update BIER scapy patch to match the scapy repo PR
Change-Id: I4953b8444b49d1ad445c98a199ae8fd1635e24a5
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-02-26 11:29:22 +00:00
e0a3544ae5 IPv6 MLD; pointer address used as hash key
Change-Id: I7b2f52b2b2ce13f27bddc8750b8fc564bf6ab73e
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-02-26 10:51:44 +00:00
7c748bbe40 vnet: add 25G interface speed flag
Change-Id: I1d3ede2b043e1fd4abc54f540bb1d3ac9863016e
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-26 06:32:10 +00:00
a373149eef vlib: add vlib_buffer_free_from_ring
Change-Id: I63f7b14cd63eac9e64cace5d941190096ad148dc
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-26 06:31:16 +00:00
dc09133c33 vnet: add vnet_device_input_have_features function
Change-Id: I28cfa7f7f5e4938146478c4a5cc5ad18612aadaa
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-26 06:30:52 +00:00
3c7fdc089b vlib: fix formatting in pci_config.h
Change-Id: I5ce40f82e42be19f0f4d882ab194e5a25980adc1
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-26 06:30:31 +00:00
3e57d78a9a Fix bug in dpdk_crypto_session_disposal()
The expression to determine whether to delete a session
from the disposal list only evaluates true if some,
but not all, of the sessions in the list were freed.
When all sessions in the list are freed, it evaluates
false and the sessions are left in the list to be freed
again later, which can result in a session pool element
that was reallocated to a different SA being freed,
breaking crypto for the newer SA.

Add an 'else' that handles the case where all sessions
were freed.

Change-Id: I3ae54d5b3bfc3658bf406caa50646924baaae589
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2018-02-25 22:04:27 +00:00