3573 Commits

Author SHA1 Message Date
Neale Ranns
76447a740a Adj Delegates; don't store raw pointers
... you'd think I'd have leanred by now...

Change-Id: I65c54feb2ec016baa07ed96c81ab8f60277c3418
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-02-21 08:34:12 +00:00
Steve Shin
8a3e575dfc Fix reset the vlan flags when main interface is deleted.
The dot1q_vlans & dot1ad_vlans should be reset to 0 when main interface
is deleted. Otherwise, VPP will crash if the same interface index is reused
without attaching the sub interface on it.

Change-Id: I484d4a8892ff4241a3a32b22189746193d5f2594
Signed-off-by: Steve Shin <jonshin@cisco.com>
2018-02-20 21:40:59 +00:00
Marco Varlese
f3ab4896ed SCTP: congestion control
This patch addresses the requirements depicted by section 7.1.1 and
7.1.2 of the RFC 4960. Specifically, it implements the Slow-start and
Congestion-avoidance policies.
The patch also took care of correctly implementing some 'formatting'
functions required - for instance - in packet(s) tracing.

Change-Id: I68eade1b30345de3acb3ac8a653a5ef76eb6d2ac
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-20 21:13:03 +00:00
Damjan Marion
6525c7f902 vppinfra: autogerate vector typedefs and basic inline functions
Change-Id: Ie9f611fa6a962b0937245f5cc949571ba11c5604
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-20 21:11:06 +00:00
Dave Barach
ad099335c1 Reset expired timer vector length after callback
Otherwise, in a "catch-up / multiple tick" case, the code will repeatedly
hand previously-processed expired timer handles to the user callback.

Change-Id: Idef4f242279ea41cb557bb6cff5984de02a6503d
Signed-off-by: Dave Barach <dave@barachs.net>
2018-02-20 16:14:10 +00:00
Keith Burns (alagalah)
9b79377ac1 vppcomm refactor
- server_[tx|rx]_fifo renamed to [tx|rx]_fifo
- is_cut_thru etc no longer required, vpp session layer works it out
- logic to flip tx/rx fifos in vppcom no longer required
- allocation of memory in vppcom no longer required (if(0) at moment for testing)
- clean up of some uneeded vars

- fixstyle

Change-Id: I266561a6e4b08edb875c98582b22616c295d5a81
Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2018-02-20 15:34:54 +00:00
Damjan Marion
927b0714d7 vppinfra: CLIB_HAVE_VEC128 mandates SSE4.2
Change-Id: I6511110d0472203498a4f8741781eeeeb4f90844
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-20 08:53:19 +01:00
Dave Wallace
cfcf2f476a make test: Add VPP VCL cut-thru test.
Change-Id: Id3ec196bfeb90b141123adee97f15d9712351680
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-02-19 21:51:59 +00:00
Nitin Saxena
fa957142be dpdk: Fix MTU calc for NICs that support mtu<9216
Problem: rte_eth_dev_set_mtu() returns with failure from ThunderX NICVF
DPDK PMD driver which supports MTU less than ETHERNET_MAX_PACKET_BYTES.
rte_eth_dev_set_mtu() being called twice from dpdk_lib_init(): one via
dpdk_device_setup() and second in dpdk_lib_init() itself. Currently
dpdk_lib_init() passes vnet_hardware_interface->max_packet_bytes as an
argument to rte_eth_dev_set_mtu() without consulting dev_info.max_rx_pktlen.
NICs like i4oe, ixgbe can support MTU much greater than 9216 hence its not
a problem for those NICS.

Fix: This patch calculates dpdk_device->port_conf.rxmode.max_rx_pkt_len,
vnet_hardware_interface->max_packet_bytes and MTU by consulting
dev_info.max_rx_pktlen.

Change-Id: If04bbfae49ee971dac0063ff1835e4a9c3087865
Signed-off-by: Nitin Saxena <nitin.saxena@cavium.com>
2018-02-19 20:14:51 +00:00
Damjan Marion
c6969b55e4 Use neutral vector code for ethernet_frame_is_tagged
Also it removes ethernet_frame_is_any_taged implemebntation
which seems to be equally costly compared to two
invocations of ethernet_frame_is_tagged.

Change-Id: If1c95f8267cd34b807ec07e0d675cbd0db2fdf9f
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-19 20:14:30 +00:00
Damjan Marion
829ee53995 virtio: add missing tx lock when running multithreaded
Change-Id: I373f429c53c6f66ad38322addcfaccddb7761392
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-19 16:40:01 +00:00
Dave Wallace
b5a86eed8b VCL: config api prefix using env var.
- Configure vpp api prefix using VCL_API_PREFIX
  environment variable.
- Prepend api prefix to vpp api filename when
  connecting to vpp.
- Fix stale vcl_cfg ptr after heap allocation.
- Cleanup misleading warning messages wrt.
  reading the vcl config file.

Change-Id: I908c9b567ff4f6f0c21ae43a4627a1a3202a3290
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-02-19 14:57:39 +00:00
Damjan Marion
1d3ab72941 dpdk: bump to 18.02
Change-Id: I3764f57a4b8df96d6bd20753b86fc0119d833bd9
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-19 13:21:09 +00:00
Neale Ranns
d79a43c7f4 Adjacency Delegate updates
- Register new type (for use from puglins)
- Memory for delegate is provided by delegate provider

Change-Id: I5ece86b1fe84e3028a5c853871476c4ba015b2eb
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-02-19 12:21:00 +00:00
Mohsin Kazmi
d91d14095b VOM: acl: Some necessary fixes
It:
  1. changes ethertype_rule_t to hold actual objects instead of
reference to them.
  2. fixes acl_ethertype 'update' function
  3. fixes pretty-print of acl-list-update.
  4. adds l3-acl update unit test.

Change-Id: Iec72212806e96bd0574b46b563de79f0744cb248
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-02-19 10:09:49 +00:00
Damjan Marion
3a59382233 vlib: fix pci init
Change-Id: I2b8c1ad5c594aeca5dc44647ab8f8061362c9284
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-18 16:26:52 +00:00
Damjan Marion
1e33663e25 fix format_hexdump
Change-Id: I9710be2e722d716e22d989b3417fb49d2db0848a
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-18 16:26:39 +00:00
Klement Sekera
ebbaf55e09 make test: add test framework debugging
New option TEST_DEBUG=1 turns on test framework debugging, which
currently consists of printing difference in allocated objects/memory
and also creates reference graphs for any unfreed VppPapiProvider/VPP
objects - these take a lot of memory and thus should be freed regularly.

Change-Id: I29db0c1341009d4b5c5df9222d14f3095883fd0f
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-02-17 20:42:49 +00:00
Klement Sekera
545be52c79 make test: detect child crash
This change causes parent process to detect child crash in seconds
instead of waiting for timeout to pass.

Change-Id: Ib45e86b7fc97e687d99c554be4212aaeea781dcc
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-02-17 20:42:49 +00:00
Klement Sekera
49bec57f25 vpp_papi: remove legacy way of calling VPP APIs
This allows VPP to define APIs which conflict with internal
function names used in vpp_papi without issues.

Change-Id: I56c21814e1c11fa2aa6bcd95adb3fdeacd304e8e
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-02-17 20:42:49 +00:00
Klement Sekera
180402d114 vpp_papi: reduce memory leaks
This changes makes unused VPP objects collectable by garbage collector,
allowing running all `make test` tests again instead of python crashing
due to running out of memory.

Change-Id: I0e271c2b3f195d9d3b64840f9f11144da0fe967d
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-02-17 20:42:49 +00:00
Marco Varlese
54432f8c0a SCTP: 'multi-home' support
This patch addresses the SCTP requirement for multiple sub-connections
to implement the so called 'multi-homed' scenario.

Change-Id: Ibce18f216e9d2bebe318992c441bf278e16aad17
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-17 09:45:28 +00:00
Jon Loeliger
a250882b8f memif: VPP-1172: Ensure memif_create reply contains sw_if_index
Change-Id: If5cd2e913770adac4e7320f54584da63012f925d
Signed-off-by: Jon Loeliger <jdl@netgate.com>
2018-02-16 09:57:23 -06:00
Ole Troan
793c7fe5fc Adj: VFTs for adjacency sub-blocks
Change-Id: I85602b0178315023bb512babdd5b7dd4263a322d
Signed-off-by: Ole Troan <ot@cisco.com>
2018-02-16 13:45:05 +00:00
Neale Ranns
c819fc612f Allow providers to override glean behaviour
and update glean address on local interface MAC change

Change-Id: I530826d60c7e9db2b0fa2d45754139d82c5ea807
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-02-16 02:44:08 -08:00
John Lo
25d417f286 Minor VXLAN/GRE Tunnel Encap Optimization and Cleanup
Change-Id: I62a2a6524b72115a4239fbd7dc9ac8fdc35e20ed
Signed-off-by: John Lo <loj@cisco.com>
2018-02-16 08:10:06 +00:00
John DeNisco
9fa5cf4669 Add iperf VM/vhost creation
Change-Id: I27a59203f406120558f73bfcc12dca8835ae6361
Signed-off-by: John DeNisco <jdenisco@cisco.com>
2018-02-16 08:09:27 +00:00
Keith Burns (alagalah)
56a0d06cb4 VPP modified some state checking logic
Change-Id: I5daff79a31f2db33ed55edd54ce043a61f6c6209
Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2018-02-16 05:24:29 +00:00
Florin Coras
ae9533a80e session: fix fifo allocation for empty connect seg-managers
Change-Id: Ibc5b1149f3fbbe3dfe1f069ab69bfed7de660582
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-02-15 07:29:49 -08:00
Ole Trøan
438f630944 Revert "Allow interface types to override glean adjacency behaivour"
This reverts commit 8b30e471df4d42214619e1d6c50cc8298426b45f.

Change-Id: I99edb236eb0a7f8ba3fba333c3481a710ebcb59c
Signed-off-by: Ole Troan <ot@cisco.com>
2018-02-15 22:12:03 +00:00
Ole Trøan
909c26bda6 Revert "Adj: VFTs for adjacency sub-blocks"
This reverts commit a44b015aa012d3b07ed873925d47c6d5955b7dd2.

Change-Id: I2d76bc0844f58e5ddf3f3a4326b86076f46e3751
Signed-off-by: Ole Troan <ot@cisco.com>
2018-02-15 22:02:01 +00:00
Ole Troan
a44b015aa0 Adj: VFTs for adjacency sub-blocks
Change-Id: I19390f87343bacea84b49fc5d08af38875fdafdd
Signed-off-by: Ole Troan <ot@cisco.com>
2018-02-15 19:13:26 +00:00
Mohsin Kazmi
4ca80c49f6 VOM: Fix broken Makefile
Typo mistake broken the makefile which results in missing
vom headers in system.

Change-Id: Ic2e5f742f0e38140559138b4aa7564f8c25b73e4
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-02-15 17:07:22 +00:00
Marco Varlese
2802bd7544 SCTP: coverity warning fix
Change-Id: I1f8a325eac2a9e2c825996f04026ae86259a7ddd
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-15 16:05:14 +00:00
Neale Ranns
8b30e471df Allow interface types to override glean adjacency behaivour
update the glean adj on a local interface MAC change

Change-Id: Ia5c5cde424ed0fea3431532cc5abf22b364bbab5
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-02-15 14:22:33 +00:00
Damjan Marion
07510dd1a8 dpdk: add support for DPDK 18.02, deprecate 17.08
17.11 is still default.

Change-Id: I524d232579db8a59c717c5d760398b6b7f811d03
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-15 12:38:16 +00:00
John Lo
a43ccaefc3 Optimize GRE Tunnel and add support for ERSPAN encap
Change GRE tunnel to use the interface type where the same encap
node is used as output node for all GRE tunnels, instead of having
dedicated output and tx node for each tunnel. This allows for more
efficient tunnel creation and deletion at scale tested at 1000's
of GRE tunnels.

Add support for ERSPAN encap as another tunnel type, in addition
to the existing L3 and TEB types. The GRE ERSPAN encap supported
is type 2 thus GRE encap need to include sequence number and GRE-
ERSPAN tunnel can be created with user secified ERSPAN session ID.
The GRE tunnel lookup hash key is updated to inclue tunnel type
and session ID, in addition to SIP/DIP and FIB index.
Thus, GRE-ERSPAN tunnel can be created, with the appropriate
session ID, to be used as output interface for SPAN config to
send mirrored packets.

Change interface naming so that all GRE tunnels, irrespective of
tunnel type, uses "greN" where N is the instance number. Removed
interface reuse on tunnel creation and deletion to enable unfied
tunnel interface name.

Add support of user specified instance on GRE tunnel creation.
Thus, N in the "greN" interface name can optionally be specified
by user via CLI/API.

Optimize GRE tunnel encap DPO stacking to bypass load-balance DPO
node since packet output on GRE tunnel always belong to the same
flow after 5-tupple hash.

Change-Id: Ifa83915744a1a88045c998604777cc3583f4da52
Signed-off-by: John Lo <loj@cisco.com>
2018-02-15 11:07:56 +00:00
Florin Coras
5fda7a3925 session: avoid session handle conflict with vcl
Change-Id: I7f5a3b8d92ef07d60315bab6e560eba49ea07249
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-02-15 10:53:33 +00:00
Marco Varlese
fae4039ad2 SCTP: fix corrupted buffers seen in output node
The issue observed in the output-node was actually
caused by one of the input-node pushing buffers to
the output node when not required. That is the case
with the parsing/handling of incoming packets like
the COOKIE_ACK, HEARTBEAT_ACK, DATA, SACK which do
not require a response to be sent to the other peer.
In all the mentioned cases the packets (buffers) need
to be consumed and dropped instead of heading to the
output-node.

Change-Id: I3dcbe5de1cedb2ab8b06fff4364749b525cc7ac6
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-15 10:11:57 +01:00
Marco Varlese
a38783e0d1 SCTP: refactoring
This patch takes care of some refactoring, including the initialization
of the timestamp to calculate the RTO, the output state-machine
validation which can be enabled (disabled by default) when debugging and
some clean-up of unused fields.
It also addresses the requirement of Karn's algorithm when computing the
RTO.

Change-Id: I6b875152369bff23cad085708cec1f7e1151cfa8
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-15 07:31:01 +00:00
Dave Barach
4941fcc23a Reenable dhcp client detect when lease expires
We disable the client detect feature when we bind a DHCP address. Turn
it back on again when the lease expires.  Otherwise, if the DHCP
server replies after an outage, we'll never see the reply.

Add dhcp packet tx counters, by packet type

Change-Id: Id54b05647d5d7bd8d3ab99e6584ee86d9e4ff7f9
Signed-off-by: Dave Barach <dave@barachs.net>
2018-02-14 19:06:24 -05:00
Florin Coras
f8f516a8b0 session: support local sessions and deprecate redirects
Memfd backed shared memory segments can only be negotiated over sockets.
For such scenarios, the existing redirect mechanism that establishes
cut-through sessions does not work anymore as the two peer application
do not share such a socket.

This patch adds support for local sessions, as opposed to sessions
backed by a transport connection, in a way that is almost transparent to
the two applications by reusing the existing binary api messages.
Moreover, all segment allocations are now entirely done through the
segment manager valloc, so segment overlaps due to independent
allocations previously required for redirects are completely avoided.
The one notable characteristic of local sessions (cut-through from app
perspective) notification messages is that they carry pointers to two
event queues, one for each app peer, instead of one. For
transport-backed sessions one of the queues can be inferred but for
local session they cannot.

Change-Id: Ia443fb63e2d9d8e43490275062a708f039038175
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-02-14 00:54:43 -08:00
Neale Ranns
7758bf68a0 VOM: build with plugins disabled
Change-Id: I1384d16deb3fa38b988dd2fc98f436124e381536
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-02-14 16:12:06 +00:00
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