Commit Graph

3730 Commits

Author SHA1 Message Date
Mohsin Kazmi 41fd68d945 vppinfra: Remove empty file
Change-Id: I3908cc112b40d4bb52da18e7c3ac5ae0af455f87
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-02-14 15:17:06 +00:00
Dave Wallace 5ba5837b15 make-test: use api custom-dump to reduce log size.
- Reduce log size by using "api trace custom-dump" instead
  of "api trace dump".
- Fix custom-dump output of cli_inband_t api message to include
  cli command being executed.

New output:
DBGvpp# api trace custom-dump /tmp/test
vl_api_memclnt_delete_t:
index: 2
handle: 0x301d8e10
SCRIPT: memclnt_create name vpp_api_test
SCRIPT: sw_interface_dump all
SCRIPT: control_ping
SCRIPT: exec show run

Old output:
DBGvpp# api trace dump /tmp/test
---------- trace 0 -----------
vl_api_memclnt_delete_t:
index: 33554432
handle: 0x108e1d3000000000
---------- trace 1 -----------
vl_api_memclnt_create_t:
name: vpp_api_test
input_queue: 0x808e1d3000000000
context: 0
ctx_quota: 0
---------- trace 2 -----------
vl_api_sw_interface_dump_t:
_vl_msg_id: 61
client_index: 33554432
context: 0
name_filter_valid: 0
---------- trace 3 -----------
vl_api_control_ping_t:
_vl_msg_id: 712
client_index: 33554432
context: 0
---------- trace 4 -----------
vl_api_cli_inband_t:
_vl_msg_id: 715
client_index: 33554432
context: 0
length: 9

Change-Id: If740c861649a3a59b8cc7a777c23c3cf94b8ff87
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-02-14 15:13:00 +00:00
Matthew Smith 6d2f214dab NAT44 out2in DHCP client next node
Call vnet_feature_next() for DHCP replies instead of using
default ip4-lookup. This allows DHCP replies to reach an
outside interface if it's configured as a DHCP client.

Change-Id: Icce1cd68b21256fcd6b1fad6792c06578b0e4e36
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2018-02-14 14:49:14 +00:00
Eyal Bari 554075a51f vxlan:remove interface recycle mechanism
vxlan interfaces no longer create tx nodes and are "cheap" to create and delete

Change-Id: I7628d8ce86ec88609ed08162c94f5bc95df0d9f4
Signed-off-by: Eyal Bari <ebari@cisco.com>
2018-02-14 14:14:32 +00:00
Matus Fabian 16f0546cad NAT44: run NAT nodes after ACL (VPP-1160)
NAT input features run after acl-plugin-in-ip4-fa
NAT output features run after acl-plugin-out-ip4-fa

Change-Id: I1e4487a0d6fdb99a90b8db640d9ad0e0eb7347a5
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2018-02-14 13:35:04 +00:00
Eyal Bari f9cda7d3ef vnet:remove duplicate interface function macro
Change-Id: I0ee18df69d5fe833c746d0d1e14aac14338a6e42
Signed-off-by: Eyal Bari <ebari@cisco.com>
2018-02-13 18:45:48 +00:00
Klement Sekera dcbea0b74b BFD: make CLI consume only one line at a time
This makes it possible to add BFD commands to scripts executed via
`exec' CLI.

Change-Id: Id0ed6c09baee6f8ac9ff183d305a470f55a1f885
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-02-13 16:30:19 +00:00
Mohsin Kazmi 49c7f0ca17 VOM: ACL: Add Object Model for acl ethertype
Change-Id: I2b572ebd4b7bb26381f127912a4cc0825c04fc34
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-02-13 11:16:32 +01:00
Igor Mikhailov (imichail) 26f341a839 Fix the order of RFC2685 fields in the output.
Also, output VSS info with names according to RFC6607 (3.5).

Change-Id: I27a383515aca1a74dced2363a0c407b2791e5f05
Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
2018-02-12 13:45:51 -08:00
Matthew Smith 7a19283421 Fix DHCP client crash with worker threads
Crash occurring With a worker thread configured and dhcp
client active on an interface. When a DHCP reply packet
is received, call to ethernet_get_main() from
dhcp_proxy_to_client_input() was causing a crash.
Replaced with a call to vnet_get_ethernet_main().

Once that was resolved, calling dhcp_client_acquire_address()
from a worker thread also caused a crash. Changed so the main
thread will do the address/route configuration.

Change-Id: Ib23984787102dea8cf6cfcde86188a751f15c1e1
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2018-02-12 19:34:17 +00:00
Marco Varlese 18b631560b SCTP: fix build errors on ubuntu bionic
Change-Id: I070771794be92fd9a6e800ca0022e52d592cd1a4
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-12 13:05:36 +00:00
Neale Ranns ffd78d1ef8 Improve MTU handling
- setting MTU on an interface updates the L3 max bytes too
- value cached in the adjacency is also updated
- MTU exceeded generates ICMP to sender

Change-Id: I343ec71d8e903b529594c4bd0543f04bc7f370b3
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-02-12 11:23:33 +00:00
Eyal Bari 2d6f66e174 dpdk:fix trace to follow feature arc
Change-Id: Icd2184dec16d30cdcc689ca37c834b5df2f0a1a3
Signed-off-by: Eyal Bari <ebari@cisco.com>
2018-02-12 11:22:24 +00:00
Marek Gradzki d05b926dc2 vppapigen: simplify JSON format for services
Use

"services": {
  "foo_request": {
    "reply": "foo_request_reply"
   },
   "foo_dump": {
     "reply": "foo_details",
     "stream": true
   }
},

instead of:

"services": [
  {
    "foo_request": {
      "reply": "foo_request_reply"
     }
  },
  {
    "foo_dump": {
      "reply": "foo_details",
      "stream": true
    }
  }
],

Change-Id: I1d8e6bb4d41541b7f7f63242935f2ed4467fc52b
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2018-02-09 20:13:18 +01:00
Dave Wallace 2a8652701d LD_PRELOAD: Refactor nomenclature (vcom -> ldp).
Change-Id: Id3891fe2873b631f8f69c1ca2905968130678561
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-02-09 18:25:11 +00:00
Steve Shin 9fa881ff87 acl-plugin: Stale classify table after deleting macip ACL
Classify table for output node should be cleaned up
after deleting macip ACL.

Change-Id: Ibbc46c8465bec02fe6fa6a8d33a1f06bcf28e9ad
Signed-off-by: Steve Shin <jonshin@cisco.com>
2018-02-09 13:29:32 +00:00
Neale Ranns bc27d1be24 GBP plugin
Group Base Policy (GBP) defines:
 - endpoints: typically a VM or container that is connected to the
              virtual switch/router (i.e. to VPP)
 - endpoint-group: (EPG) a collection of endpoints
 - policy: rules determining which traffic can pass between EPGs a.k.a
            a 'contract'

Here, policy is implemented via an ACL.
EPG classification for transit packets is determined by:
 - source EPG: from the packet's input interface
 - destination EPG: from the packet's destination IP address.

Change-Id: I7b983844826b5fc3d49e21353ebda9df9b224e25
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-02-09 13:17:54 +00:00
Chun Li ef56fae51a ip4_forward: set pkt error in case potential memory corrupt
Change-Id: Ib9eb65d2ba166f5883a8ce8d37298c696113f2be
Signed-off-by: Chun Li <chunl2@cisco.com>
2018-02-09 13:14:46 +00:00
Chun Li 15e598c76e memif: fix crash caused by zero pkt len in memif and clear dirty cache while interface reconnect.
Change-Id: Ifc7eb2494a22c334d8899422545fca1a4bba4d05
Signed-off-by: Chun Li <chunl2@cisco.com>
2018-02-09 09:08:01 +00:00
Andrew Yourtchenko 08118f00e1 classifier-based ACL: testcases for L2 ACLs + fix the enabling of outbound L2 ACL
There was no test coverage for the L2 ACL (other than indirect by
means of ACL plugin tests), so the enabling of the outbound ACL
got fumbled throughout the revisions of the refactoring.

Fix both issues - the error and the lack of test coverage for L2 ACL.

Change-Id: Ib7f42780ef84b4a4f70bd88d7319aeeda866cf06
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-02-08 22:34:29 +00:00
Gabriel Ganne 97cabc9691 Geneve - reduce unit-test run time
Reduce the number of tunnels created/destroyed to reduce the load of the tests
without changing the code covered.
These are functional tests, not performance tests.

This reduced the test time down to 10s from 4 minutes on my machine.

Change-Id: Ifcaddc0b0628a21392c5cb247196f56bc28a53a2
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
2018-02-08 22:21:36 +00:00
Damjan Marion 508cabcec8 virtio: reset vnet header on tx
Change-Id: Ib04a8787038fb536470a04d99fdc165102edfb5a
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-08 22:20:12 +00:00
Haiyang Tan 2ae5135e4c vhostuser: Fix vhostuser file descriptor leak
In the case that vhostuser server accepted more than one client connection,
'vui->clib_file_index' will be overwritten directly without release the possible
existed resource, so file descriptor leak occurs

Change-Id: I89d08133dae31a12a815df2631334dbf0aefeb1e
Signed-off-by: Haiyang Tan <haiyang.tan.dev@gmail.com>
2018-02-08 20:33:17 +00:00
Gabriel Ganne b81831d122 add CLIB_HAVE_VEC128 with NEON intrinsics (VPP-1127)
Enable CLIB_HAVE_VEC128 if both aarch64 and __ARM_NEON
ie. armv8 only, not armv7

Add more neon compare intrinsics wrappers.
I only add simple intrinsics wrappers. More complex ones can be added
later as they are needed, with performance tests on the corresponding
feature to back them up.

Remove wrongly added 128bits definitions defined on both armv7 and armv8
without concern for NEON instructions presence.

Notable correspondinf code activations:
* MHEAP_FLAG_SMALL_OBJECT_CACHE in mheap.c
* ip4 fib mtrie leaves access
* enable ixge plugin compilation for aarch64
  (conf still disables it by default)

Change-Id: I99953823627bdff6f222d232c78aa7b655aaf77a
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
2018-02-08 20:32:31 +00:00
Andrew Yourtchenko c43b3f9864 acl-plugin: add whitelisted ethertype mode (VPP-1163)
Currently, ACL plugin largely does not care about the
ethertypes other than 0x0800 (IPv4) and 0x86dd (IPv6),
the only exception being 0x0806 (ARP), which is
dealt with by the MACIP ACLs.

The other ethertypes in L2 mode are just let through.

This adds a new API message acl_interface_set_etype_whitelist,
which allows to flip the mode of a given interface
into "ethertype whitelist mode": the caller of this message
must supply the two lists (inbound and outbound) of the ethertypes
that are to be permitted, the rest of the ethertypes are
dropped.

The whitelisting for a given interface and direction takes
effect only when a policy ACL is also applied.

This operates on the same classifier node as the one used for
dispatching the policy ACL, thus, if one wishes for most of the
reasonable IPv4 deployments to continue to operate within
the whitelist mode, they must permit ARP ethertype (0x0806)

The empty list for a given direction resets the processing
to allow the unknown ethertypes. So, if one wants to just
permit the IPv4 and IPv6 and nothing else, one can add
their ethertypes to the whitelist.

Add the "show acl-plugin interface" corresponding outputs
about the whitelists, vat command, and unittests.

Change-Id: I4659978c801f36d554b6615e56e424b77876662c
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-02-08 15:51:46 +00:00
Marco Varlese be2251b0c5 SCTP: shutdown phase
This patch addresses some bugs discovered with the shutdown phase which
were causing the actual chunks not to leave the output_node.
While fixing the issue some minor refactoring was also performed to
align the internal functions to a 'common' design.

Change-Id: Ieac4f6e78cffad2e6982536f8e9f190a66f328f7
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-08 10:03:23 +00:00
Dave Wallace c04cbf16cc VCL: remove vrf from vppcom api.
Change-Id: I6d91c8051de786fb8781cd0750ea9c350036b306
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-02-08 10:02:31 +00:00
Dave Barach e7d212fe41 Minimize bihash memory consumption
Reference-count the number of entries in each bucket. If the reference
count goes to zero, free the backing store.

Add long-term churn-testing to test_bihash_template.c, thanks to
Andrew Yourtchenko for the initial implementation.

Change-Id: I4fbd9229cacfaba8027a85cbf87b74afdead6e39
Signed-off-by: Dave Barach <dave@barachs.net>
2018-02-08 10:02:16 +00:00
Andrew Yourtchenko db3c480e37 acl-plugin: VPP-1088: add support for egress filter in macip ACLs
This is the second patch, using the new functionality from the change 10002
in order to implement the egress filtering on the MACIP ACLs.

This adds an action "2" which means "add also egress filtering rules for this
MACIP ACL.

The reason for having the two choices is that the egress filtering really takes
care of a fairly corner case scenario, and I am not convinced that
always adding the performance cost of the egress lookup check is worth it.

Also, of course, not breaking the existing implementations is a nice plus,
too.

Change-Id: I3d7883ed45b1cdf98d7303771bcc75951dff38f0
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-02-08 10:01:26 +00:00
Andrew Yourtchenko 1c6e5cf690 acl-plugin: an elog-based tracing implementation for troubleshooting the conn cleaner threads interactions
This replaces some of the early-stage commented-out printf()s with
an elog-based debug collector.

It is aimed to be "better than nothing" initial implementation to be available
in the field. It will be refined/updated based on use. This initial code
is focused on the main/worker threads interactions, hence uses just
the worker tracks.

This code adds a developer debug CLI "set acl-plugin session table event-trace 1",
which allows to gather the events pertaining to connection cleaning.
The CLI is deliberately not part of the online help, as the express
declaration that the semantics/trace levels, etc. are subject to change
without notice.

Change-Id: I3536309f737b73e50639cd5780822dcde667fc2c
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-02-08 10:01:09 +00:00
Vijayabhaskar Katamreddy acbde66437 ip: move lookup inline functions to header file
Needed to allow other code paths to reuse them.

Change-Id: I9e469527c6b2e9a6fec7af5f17d8b400a2e85826
Signed-off-by: Vijayabhaskar Katamreddy <vkatamre@cisco.com>
2018-02-08 09:58:10 +00:00
Keith Burns (alagalah) 5368efa045 Fix bug with glibc epoll fd
Change-Id: I0b8ebe2c47fdd1e23a91723a7b454a0c1c8b996e
Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2018-02-07 22:52:52 +00:00
Keith Burns (alagalah) df41cf62d8 Update gitignore for cmake
Change-Id: Icd50432a60e194c0526a7d28b93e99ceb6f2013b
Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2018-02-07 21:23:20 +00:00
Jon Loeliger 3d460bd9be VXLAN: Allow user to specify a custom vxlan tunnel instance id.
If one is not selected by the user, the next available id
will be allocated, thus maintaining backward compatibility.

Change-Id: I4691ed0638b8072f9cfa9f20b9fe4f981e708800
Signed-off-by: Jon Loeliger <jdl@netgate.com>
2018-02-07 19:24:56 +00:00
Andrew Yourtchenko fe99a7eeb9 acl-plugin: multicore: send the interrupts to thread0 too
The thread0 in some configurations can handle the traffic.
Some of the previous fixes accomodated for that, but
the interrupt sending for connection clearing
was not adapted to that, resulting in a deadlock
during clearing of all connections...

Change-Id: I32b4c7bac09c91c22b796baab843bdaf41f7045c
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-02-07 19:16:02 +00:00
Nitin Saxena d3cb7ba2ab vhost: Added ARMV8 NEON version of function map_guest_mem()
(VPP-1085)

The NEON implementation searches particular address in
VHOST_MEMORY_MAX_NREGIONS regions. Searching two regions at a
time.

Change-Id: Icc3c6746bc98e3a1fa71424e51b64f62efbfdc74
Signed-off-by: Nitin Saxena <nitin.saxena@cavium.com>
2018-02-07 18:47:00 +00:00
Pierre Pfister 8cedff2f46 af_packet: Fix lock position
In multi-worker cases, af-packet tx was subject to a pretty
serious race condition as the device lock was obtained
after some queue values were read from queue.

Result could go from packet loss to queue inconsistency, leading
to tx being stuck for 'some time'.

The fix is really simple. Finding the problem was not...

Change-Id: Ib18967b7459a8609428a56de934c577cea87b165
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
2018-02-07 18:46:28 +00:00
Andrew Yourtchenko 815d7d5637 classifier-based ACL: refactor + add output ACL
For implementation of MACIP ACLs enhancement (VPP-1088), an outbound
classifier-based ACL would be needed. There was an existing incomplete
code for outbound ACLs, it looked almost exact copy of input ACLs, minus
the various enhancements, trying to sync that code seemed error-prone
and cumbersome to maintain in the longer run.

This change refactors the input+output ACLs processing into a unified
routine (thus any changes will have effect on both), and also adds
the API to set the output interface ACL, with the same format
and semantics as the existing input one (except working on output
ACL of course).

WARNING: IP outbound ACL in L3 mode clobbers the ip.* fields
in the vnet_buffer_opaque_t, since the code is using l2_classify.*
The net_buffer (p0)->ip.save_rewrite_length is rescued into
l2_classify.pad.l2_len, and used to rewind the header in case of
drop, so that ipX_drop prints something sensible.

Change-Id: I62f814f1e3650e504474a3a5359edb8a0a8836ed
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-02-07 18:01:09 +00:00
Damjan Marion dac03527f6 Refactor vlib_buffer flags
Change-Id: I853386aebfe488ebb10328435b81b6e3403c5dd0
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-07 15:07:51 +00:00
Marco Varlese f429a93d95 SCTP: address coverity-scan warnings
Change-Id: Iba7c398a398e24b96eb536bbcefa841bd153a205
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-07 13:46:15 +00:00
Chun Li 5dca5465f5 libmemif: cleanup queue info while memif connecting
Change-Id: I4265fd0606f87f80f43f7f59ced1c3a73de82776
Signed-off-by: Chun Li <chunl2@cisco.com>
2018-02-07 10:02:20 +08:00
Damjan Marion bb17f3c2fc Fix clang -Wvarargs compile errors
error: passing an object that undergoes default argument promotion to
'va_start' has undefined behavior [-Werror,-Wvarargs]

Change-Id: Id342beea916ec73e29e399087532caecfa19055f
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-06 20:16:42 +00:00
Damjan Marion 547ecf631e Fix clang implicit conversion errors
Change-Id: I1771a1cca2a4bc394677b2a18f14c47f0633fa77
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-06 20:15:56 +00:00
Damjan Marion ceab7882f8 vlib: epoll on worker threads
This patch teaches worer threads to sleep and to be waken up by
kernel if there is activity on file desctiptors assigned to that thread.

It also adds counters to epoll file descriptors and new
debug cli 'show unix file'.

Change-Id: Iaf67869f4aa88ff5b0a08982e1c08474013107c4
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-06 18:17:46 +00:00
Marco Varlese df5a99cef1 SCTP: handling of heartbeating and max-retransmits
This patch address the need to send/receive heartbeats between peers.
At the same time, the number of unacked heartbeats is tracked and when
the peer requests to send DATA to the remote-peer the value of unacked
heartbeats needs to be checked against the maximum value allowed for
retransmissions. If the unacked heartbeats value is higher then the
remote-peer is considered unreachable and the connetion needs to be
shutdown.

Change-Id: I2b1a21c26775e734dbe82486f40982ed5702dc63
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-06 17:44:23 +00:00
Klement Sekera e060ed1e18 make test: don't test/set parameters in docker
Do not set UDS related system parameters if DOCKER_TEST is set to "True"
as docker environment doesn't contain the necessary /proc/... entries.

Change-Id: Id85e4512c7bba6b3feb6e6fd1fbe1e05aa10a341
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-02-06 15:39:57 +00:00
Neale Ranns f051072f85 BIER: fix support for longer bit-string lengths
Change-Id: I2421197b76be58099e5f8ed5554410adff202109
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-02-06 12:44:08 +00:00
Dave Wallace 7e2c31aba2 VCL: Fix type in trace output.
Change-Id: I7834e676c23a697a12a6e06111c68450ba787fc9
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-02-06 12:34:02 +00:00
Marco Varlese f47276f6fc SCTP: missing spinlock init when multiple threads
When the number of threads results being more than 1, the spinlock
structure requires to be initialized otherwise subsequent calls to
the "lock" API (clib_spinlock_lock_if_init) would result in a void
operation.

Change-Id: Ia268c4687252e41962bb3f1217f0a849d8c40385
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-06 12:33:32 +00:00
Steve Shin bbd41cd5da Reflexive ACL support on ICMP
Normally session keys are generated by mirroring the packets sent.
ICMP message type should be used and inverted for the stateful ACL.

Supported ICMP messages with this patch:
 - ICMPv4: Echo/Timestamp/Information/Address Mask requests
 - ICMPv6: Echo request/Node Information Queury

The invmap & valid_new tables can be modified to make any other
ICMP messages to be reflexive ACL.

Change-Id: Ia47b08b79fe0a5b1f7a995af78de3763d275dbd9
Signed-off-by: Steve Shin <jonshin@cisco.com>
2018-02-06 12:29:37 +00:00