odp4vpp.git
7 years agoodp: Update readme file and include odp patches 62/10762/2 1707
Michal Mazur [Wed, 21 Feb 2018 19:25:30 +0000 (20:25 +0100)]
odp: Update readme file and include odp patches

Restore odp-linux section in readme file as it can now be build with
minor modification. Required patches are included in odp directory.
Slightly improve other sections.

Change-Id: I2e7f8bc7802627bc15b07b81ddf2e9b4f72f5d41
Signed-off-by: Michal Mazur <mkm@semihalf.com>
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoplugins: odp: [WA] Force inline mode of ODP timer 61/10761/1
Michal Mazur [Tue, 20 Feb 2018 16:48:07 +0000 (17:48 +0100)]
plugins: odp: [WA] Force inline mode of ODP timer

This is a workaround for following VPP error:
  "Program terminated with signal SIGUSR1, User defined signal 1."
It changes mode of timers used by ODP schedule mode.

By default inline_timers is false and timer_res_init (odp_timer.c) is
called to adjust timer resolution. This function uses SIGUSR1 during
the process which collides with VPP as it uses the same signal for
communication with clients. This patch causes inline_timers to be set
and disables adjustment of timer resolution.

Change-Id: Ic2225ba736f506a86832519f9c4154cee9c06056
Signed-off-by: Michal Mazur <mkm@semihalf.com>
7 years agoplugins: odp: delete aad field initialization 59/10759/1
Szymon Sliwa [Tue, 20 Feb 2018 17:22:51 +0000 (18:22 +0100)]
plugins: odp: delete aad field initialization

Due to some bugs in the old odp-dpdk aad field needed to be
manually initialized to 0. That is no longer true, what's more
odp does not contain this field, thus making it impossible to compile.
Due to above mentioned reasons, delete this.

Change-Id: I5ec9278d44e49991fad741a43100da4b64823bf3
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoplugins: odp: Add error checks in IPsec nodes 59/10659/5
Szymon Sliwa [Wed, 14 Feb 2018 12:40:01 +0000 (13:40 +0100)]
plugins: odp: Add error checks in IPsec nodes

Change-Id: I62cba4a845c91b208420f3f6b20781d75976c113
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoodp: Add information about the new ipsec nodes to README.vppodp 31/10431/9
Szymon Sliwa [Tue, 6 Feb 2018 15:58:09 +0000 (16:58 +0100)]
odp: Add information about the new ipsec nodes to README.vppodp

Change-Id: I7a9a436d00d04e68c36284de0897e62b838f8506
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoplugins: odp: ipsec: fix style of crypto_inpuc.c 58/10658/5
Szymon Sliwa [Mon, 19 Feb 2018 15:03:21 +0000 (16:03 +0100)]
plugins: odp: ipsec: fix style of crypto_inpuc.c

Change-Id: I89cdac40c9f768f42443406cebf7257c3e139b47
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoplugins: odp: Cosmetic changes in the IPsec implementation 57/10657/5
Szymon Sliwa [Wed, 7 Feb 2018 12:06:25 +0000 (13:06 +0100)]
plugins: odp: Cosmetic changes in the IPsec implementation

1) renamed ipsec_api to enable_odp_ipsec, for consistency
2) added crude ASSERTs to make sure the configuration is sane
3) removed passing ipsec_api as argument, as this is a global flag now
4) reorder code - put ipsec initialization before putting
   workers in polling mode
5) remove not used recycle vector from esp_encrypt.c/esp_decrypt.c
6) change clib_error_return to clib_error in ipsec.c, as
   clib_error_return silently passes when 0 is the first argument

Change-Id: Id2c6da985e872f12c8409918fb9cc6113b486d10
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoplugins: odp: rename functions and change trace content 29/10429/4
Szymon Sliwa [Thu, 1 Feb 2018 09:03:28 +0000 (10:03 +0100)]
plugins: odp: rename functions and change trace content

Change-Id: I1f71fae3af5e36b710c8c978d8b9b74ea802e012
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoplugins: odp: remove copying the ip header twice 28/10428/3
Szymon Sliwa [Wed, 31 Jan 2018 18:00:26 +0000 (19:00 +0100)]
plugins: odp: remove copying the ip header twice

Change-Id: Ib32d9df19bb9b0db1b3a0d30d991f1a1f11d66c7
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoplugins: odp: Add support for IPsec inline operation 79/10279/3
Szymon Sliwa [Wed, 24 Jan 2018 13:05:06 +0000 (14:05 +0100)]
plugins: odp: Add support for IPsec inline operation

To use inline mode put inline flag in the odp section
of the startup.conf file, like this:

odp {
    enable-odp-ipsec
    inline
}

Falls back to lookaside mode.

Change-Id: I1292a7254b25a15b25285773a43bae112394827d
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoplugins: odp: Add asynchronous IPsec API nodes 78/10278/3
Szymon Sliwa [Tue, 23 Jan 2018 13:30:49 +0000 (14:30 +0100)]
plugins: odp: Add asynchronous IPsec API nodes

To use asynchronous mode put async in the odp section
of the startup.conf file, like this:

odp {
    enable-odp-ipsec
    async
}

Falls back to synchronous mode.

Change-Id: Iacfdc03158228f4385511e6736fb24a97284320c
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoplugins: odp: Add new nodes using ODP IPsec API 61/10161/4
Szymon Sliwa [Fri, 5 Jan 2018 15:26:31 +0000 (16:26 +0100)]
plugins: odp: Add new nodes using ODP IPsec API

Created two new nodes for encryption/decryption,
based on user preferences we can use them to accellerate
IPsec by offloading it to hardware or optimized software
implementations

To use the new nodes two flags are needed in the odp
section of the startup.conf file, like this:

To use the new nodes put the enable-odp-ipsec flag to
startup.conf file, like this:

odp {
enable-odp-ipsec
}

Change-Id: Ib4bbc481efad7e90d63994580b57849b74400947
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoplugins: odp: ipsec: Fix multiple issues 56/10656/1
Szymon Sliwa [Wed, 14 Feb 2018 14:57:48 +0000 (15:57 +0100)]
plugins: odp: ipsec: Fix multiple issues

1) added casts on assignment to post_crypto.next_index
   as the type of the field changed
2) removed checking result when crypto operation is
   asynchronous as it make no sense
3) fixed bug which could cause issues when some of the
   operations are done synchronously and some
   asynchronously

Change-Id: I123d70402c0210b11dfc2d0fff2c72aa100ce838
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoFixes to changes in vnet/buffer.h 55/10655/1
Szymon Sliwa [Wed, 14 Feb 2018 14:53:00 +0000 (15:53 +0100)]
Fixes to changes in vnet/buffer.h

Change ethertype from double u8 to u16 for consistency, and next_index to u8,
for consistency with next_index defined int the ipsec field of this union.

Change-Id: I9315bbdd95e23290b37da53267b94a5ddacc85d7
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoplugins: odp: ipsec: add error check 54/10654/1
Szymon Sliwa [Mon, 19 Feb 2018 10:56:25 +0000 (11:56 +0100)]
plugins: odp: ipsec: add error check

Add a check if crypto operation was successful

Change-Id: Iaa7c4df89aab309a4c85300240d245b4cdb30533
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoplugins: odp: ipsec: style changes 53/10653/1
Szymon Sliwa [Mon, 19 Feb 2018 10:53:47 +0000 (11:53 +0100)]
plugins: odp: ipsec: style changes

1) add footer to check style
2) fix style
3) change the TODO note to a more descriptive one

Change-Id: I232c937c13bc0d5f206ebb4426b50bebc512a192
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoplugins: odp: ipsec: Del GRE as it was not tested 52/10652/1
Szymon Sliwa [Mon, 19 Feb 2018 11:52:16 +0000 (12:52 +0100)]
plugins: odp: ipsec: Del GRE as it was not tested

In case of trying to add GRE to the IPsec implementation, be careful as the
post_crypto and ipsec fields of the vnet_buffer union overlap, and both are
needed for the ODP based ipsec with GRE.

Change-Id: If20fa9d78f2879264c02922f21bc204fba1ab616
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoplugins: odp: Refactor the authentication function mapping 77/10277/2
Szymon Sliwa [Tue, 9 Jan 2018 14:45:22 +0000 (15:45 +0100)]
plugins: odp: Refactor the authentication function mapping

Change-Id: Ib0c3e2ceebb3b3929f3f0b96b8a40d07c896d70f
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoplugins: odp: Add support for IPv6 IPsec 95/9895/9
Szymon Sliwa [Thu, 7 Dec 2017 18:16:57 +0000 (19:16 +0100)]
plugins: odp: Add support for IPv6 IPsec

Change-Id: I229128ccd88c1cf608e20507ca26752b9c0495f5
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoplugins: odp: Add support for async crypto mode 10/9610/17
Szymon Sliwa [Fri, 26 Jan 2018 11:30:41 +0000 (12:30 +0100)]
plugins: odp: Add support for async crypto mode

By default ipsec picks asynchronuous crypto. After the operation it may
turn out that the operation was performed synchronously anyways, in such
case the packet is send further by the esp_* node because there will be
no notification event sent about the crypto completion.

To use asynchronous mode put async in the odp section
of the startup.conf file,
like this:

odp {
async
}

Falls back to synchronous mode.

Change-Id: I5301df5f1c93a5ccd53a9c0ed2c4cacb9ca5fdd4
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoAdd a member to vnet_buffer union for odp based crypto 27/10427/1
Szymon Sliwa [Tue, 6 Feb 2018 12:17:02 +0000 (13:17 +0100)]
Add a member to vnet_buffer union for odp based crypto

Change-Id: Ib865a59c1124a50f0bd7c6e597f45190c26fa5f9
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoplugins: odp: Add tunnel mode 09/9509/18
Szymon Sliwa [Tue, 14 Nov 2017 15:50:11 +0000 (16:50 +0100)]
plugins: odp: Add tunnel mode

Change-Id: I8be5f8aa63da8fdf4b2043ba9cd048f2269e4e99
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoplugins: odp: Remove copying from the esp_{encrypt, decrypt} 59/9059/18
Szymon Sliwa [Tue, 24 Oct 2017 11:47:18 +0000 (13:47 +0200)]
plugins: odp: Remove copying from the esp_{encrypt, decrypt}

Change-Id: I5d71505e221e837c7569963fda674e970e5ee31d
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoplugins: odp: Add ODP-IPsec node 39/8739/18
Szymon Sliwa [Wed, 23 Aug 2017 15:42:22 +0000 (17:42 +0200)]
plugins: odp: Add ODP-IPsec node

Based heavily on the src/vnet/ipsec.

Reuses the pure software VPP IPsec implementation
CLI command. To use enable-odp-crypto needs to be
present in the odp section of startup configuration,
like this:

odp {
enable-odp-crypto
}

Currenlty only IPv4 is supported, and only in transport
mode.

Authentication headers are not supported, this limitation
is inherited from VPP.

Supported crypto algorithms are
aes-cbc-128 for encryption, and
sha-512-256, sha-256-128, sha1-96 for authentication

Change-Id: I08c66f96a73d8cb4ef1095f181ddf47506abc39a
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
7 years agoplugins: odp: Fix minor bugs 70/10370/2
Michal Mazur [Wed, 31 Jan 2018 21:01:33 +0000 (22:01 +0100)]
plugins: odp: Fix minor bugs

1) Remove function vlib_buffer_set_known_state because
   it is not multi-thread safe.
2) Stop all worker threads before deleting interfaces.
3) Fix style of odp_packet_exit function.
4) Fix infinite loop in odp_config.

Change-Id: I4463b4e416e440ac326ddaac8e46a95d17b202d2
Signed-off-by: Michal Mazur <mkm@semihalf.com>
7 years agoplugins: odp: Fix deletion of IF with more Rx queues 14/10314/1
Michal Mazur [Mon, 29 Jan 2018 19:59:47 +0000 (20:59 +0100)]
plugins: odp: Fix deletion of IF with more Rx queues

Change-Id: I5abeddbc20da4528e811537d071de96a2800e016
Signed-off-by: Michal Mazur <mkm@semihalf.com>
7 years agoplugins: odp: Get address range from pool info 03/10103/4
Michal Mazur [Fri, 12 Jan 2018 19:24:06 +0000 (20:24 +0100)]
plugins: odp: Get address range from pool info

Adjust ODP plugin for Caterpillar release.
Address range of packet pool can be obtained using odp_pool_info API.

Change-Id: I0b0175cce4d9e44ca27709d1dbca560a4a72b5a1
Signed-off-by: Michal Mazur <mkm@semihalf.com>
7 years agoplugins: odp: Add support for buffer recycling 80/10080/4
Michal Mazur [Thu, 11 Jan 2018 17:32:32 +0000 (18:32 +0100)]
plugins: odp: Add support for buffer recycling

Buffers with VLIB_BUFFER_RECYCLE flag set should not be freed.
They are replicated on send and sent back to vlib for processing.

Change-Id: If381884fa7c898253f35dc3a39feeb4eb1529286
Signed-off-by: Michal Mazur <mkm@semihalf.com>
7 years agoplugins: odp: Add support for free list of buffers 96/9996/3
Michal Mazur [Thu, 4 Jan 2018 20:13:02 +0000 (21:13 +0100)]
plugins: odp: Add support for free list of buffers

Free lists are required by some VPP nodes e.g. IPv6.
Update copyrigths as lots of code were imported from src/vlib/buffer.c

Change-Id: Ie4c56d3a3104624fe77a04069fe3ba1281d3f0cb
Signed-off-by: Michal Mazur <mkm@semihalf.com>
7 years agoplugins: odp: Fix error when all interfaces removed 95/9995/2
Michal Mazur [Thu, 4 Jan 2018 20:12:15 +0000 (21:12 +0100)]
plugins: odp: Fix error when all interfaces removed

Packet pool cannot be destroyed when last interface is deleted
because it will not be reallocated on creation of a new interface.

Change-Id: Iec7b03b4413fc6602a7a1493ffd706f4c4dd1309
Signed-off-by: Michal Mazur <mkm@semihalf.com>
7 years agoodp: Update readme file 94/9994/1
Michal Mazur [Thu, 4 Jan 2018 20:10:23 +0000 (21:10 +0100)]
odp: Update readme file

Remove odp-linux from supported implementations.

Change-Id: Ie83ab7314bcbd359bb3071743b9eb2b8d3df6a5e
Signed-off-by: Michal Mazur <mkm@semihalf.com>
7 years agoplugins: odp: Remove 'platform-params' option 93/9993/1
Michal Mazur [Thu, 4 Jan 2018 16:05:21 +0000 (17:05 +0100)]
plugins: odp: Remove 'platform-params' option

ODP platform can now be configured using environment variable
ODP_PLATFORM_PARAMS. Remove the option from startup config file.

Change-Id: I9d550dabd32c691a031bb88d5453c8146d5fbce8
Signed-off-by: Michal Mazur <mkm@semihalf.com>
7 years agoPreserve environment variables when starting VPP 92/9992/1
Michal Mazur [Thu, 4 Jan 2018 15:11:24 +0000 (16:11 +0100)]
Preserve environment variables when starting VPP

Environment variables may contain configuration for platform drivers.
They were lost when starting VPP using 'make run/debug' commands.

Change-Id: I47d71b1d47a33cb8386f106bac215208e7030b1d
Signed-off-by: Michal Mazur <mkm@semihalf.com>
7 years agoFix and improve Rx Scheduler mode 05/9905/1
Michal Mazur [Tue, 19 Dec 2017 11:11:47 +0000 (12:11 +0100)]
Fix and improve Rx Scheduler mode

Fix support of atomic mode and add two new modes: parallel and ordered.
Three modes of synchronization between threads are supported now:
 - parallel - no synchronization between events
 - ordered - relative sequence of events is restored in output queues
 - atomic - only a single thread may process events from a single queue

Change-Id: I9399aa601f0927042ac0f7f1e5f265f4d47724b8
Signed-off-by: Michal Mazur <mkm@semihalf.com>
7 years agoMore optimizations for Tx and Rx loops 88/9588/7
Michal Mazur [Sun, 26 Nov 2017 18:28:55 +0000 (19:28 +0100)]
More optimizations for Tx and Rx loops

  1) Parse multiple output packets in loop.
  2) Remove checking for error flags, they are never set because
     ODP parser is disabled.
  3) Do not call vlib_buffer_advance if not necessary.
  4) Remove lock in TX path. Queues are synchronized by ODP.
  5) Optimize detection of packet type.
  6) Create a wrapper for call to odp_packet_user_area.

Change-Id: Ib50c9be9a62d67824b58ef2cd443b7fc59471655
Signed-off-by: Michal Mazur <mkm@semihalf.com>
7 years agoRead ODP configuration from VPP startup config 39/8239/10
Michal Mazur [Mon, 21 Aug 2017 13:01:42 +0000 (15:01 +0200)]
Read ODP configuration from VPP startup config

  1) Allow to setup size of allocated memory, number of packets in the
     pool, number of packets in transmit burst and delay in scheduler
     mode from VPP startup file.
     More details are in template: src/vpp/conf/startup.conf
  2) Separate Rx mode from Tx mode. Traffic Manager is not supported.
  3) Devices defined in VPP startup are automatically created at start.

Change-Id: I1f8a3c2900f56cb23ce6997d311cfe55e1c2078c
Signed-off-by: Michal Mazur <mkm@semihalf.com>
7 years agoAdd support for multiple Rx and Tx queues 62/8462/10
Michal Mazur [Tue, 19 Sep 2017 18:18:41 +0000 (20:18 +0200)]
Add support for multiple Rx and Tx queues

 1) Incoming packets can be spread across multiple worker
    threads based on IP and TCP/UDP headers.
 2) Multiple output queues are used in Burst mode if supported
    by hardware (checked in interface capabilities)
 3) Synchronization of output traffic can be disabled due to
    multiple Tx queues - one for each thread.

Change-Id: Ib5ee18103c860eae3b56ffc453a5953c729bb521
Signed-off-by: Michal Mazur <mkm@semihalf.com>
7 years agoOptimize Rx and Tx paths 95/8395/8
Michal Mazur [Mon, 11 Sep 2017 14:20:21 +0000 (16:20 +0200)]
Optimize Rx and Tx paths

1) Handle multiple ODP packets at once in receive loop
2) Wait to collect as many RX buffers as possible in single vector
3) Add prefetch of received and transmitted buffers
4) Disable parser, classifier and synchronization of RX queues
   Synchronization of Tx queues can also be disabled if 2 ports used.

Change-Id: I65ed49ef2b60278022712e10a83f6ca24360694e
Signed-off-by: Michal Mazur <mkm@semihalf.com>
7 years agoCreate worker threads using ODP API (direct in/out mode) 06/8006/10
Michal Mazur [Fri, 11 Aug 2017 19:18:05 +0000 (21:18 +0200)]
Create worker threads using ODP API (direct in/out mode)

This patch allows VPP to run multiple worker threads compatible with ODP.
By default a single thread is assigned to each interface but this
can be changed using "set interface rx-placement" command.
Only Direct input/output mode without RSS is supported.

Change-Id: Ia6af7e5af4950159eb28b7d56bc9c8d34b80f8d4
Signed-off-by: Michal Mazur <mkm@semihalf.com>
7 years agoMove odp_packet_main structure to shared memory. 05/8005/9
Michal Mazur [Fri, 11 Aug 2017 18:40:47 +0000 (20:40 +0200)]
Move odp_packet_main structure to shared memory.

This structure contains data shared among multiple threads and
must be globally accessible.

Change-Id: Ibde8222e9ed3f61561f7902750a1716da5c0bd81
Signed-off-by: Michal Mazur <mkm@semihalf.com>
7 years agoAdd initial support for ODP buffers. 36/7836/10
Michal Mazur [Fri, 11 Aug 2017 19:11:12 +0000 (21:11 +0200)]
Add initial support for ODP buffers.

Based on patch from Sreejith Surendran Nair.

Change-Id: I32ff73871ce0439378a7e3f0f9a93ac169e770cb
Signed-off-by: Michal Mazur <mkm@semihalf.com>
Signed-off-by: Sreejith Surendran Nair <srsurend@cisco.com>
Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
7 years agovlib: Add pointer to driver data to vlib_buffer_t 31/9731/1
Michal Mazur [Tue, 5 Dec 2017 14:18:08 +0000 (15:18 +0100)]
vlib: Add pointer to driver data to vlib_buffer_t

Change-Id: I97617d84eb5ba6403bc2d8f87d8c76a086413094
Signed-off-by: Michal Mazur <mkm@semihalf.com>
7 years agoFix style of ODP plugin and add Linaro copyrights 36/9436/1
Michal Mazur [Tue, 7 Nov 2017 18:49:02 +0000 (19:49 +0100)]
Fix style of ODP plugin and add Linaro copyrights

Change-Id: I5c86cd0a1150ba2e915ce3413c67c504740356b3
Signed-off-by: Michal Mazur <mkm@semihalf.com>
7 years agoMerge "Introducing ODP plugin node" into 1707
Sachin Saxena [Wed, 5 Jul 2017 05:16:22 +0000 (05:16 +0000)]
Merge "Introducing ODP plugin node" into 1707

7 years agoIntroducing ODP plugin node 19/7219/3
Sachin Saxena [Thu, 15 Jun 2017 09:04:30 +0000 (14:34 +0530)]
Introducing ODP plugin node

Change-Id: I364fa14ade5282ec828662894041f9cc784ace7c
Signed-off-by: srsurend <srsurend@cisco.com>
Signed-off-by: sachin saxena <sachin.saxena@nxp.com>
7 years agoUpdating .gitreview for current repo. 63/7163/1 odp_vpp
Sachin Saxena [Thu, 15 Jun 2017 09:04:30 +0000 (14:34 +0530)]
Updating .gitreview for current repo.

Change-Id: I48adc6605d97821eb3f02f10a0afa4a7ab7a8a59
Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
7 years agoacl-plugin: shrink the L2 classifier tables used for traffic redirect
Andrew Yourtchenko [Thu, 8 Jun 2017 16:59:24 +0000 (18:59 +0200)]
acl-plugin: shrink the L2 classifier tables used for traffic redirect

The previous iteration of the code used the L2 classifier tables for session storage,
as a result, the table allocations were pretty big. The new ACL plugin
datapath uses the tables just as a redirection mechanism, without adding any
entries. Thus, the tables can be much smaller.

Change-Id: Ieec4a5abf0abda6e513ab4e675f912f14d47e671
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
7 years agoVPP-874: fix coverity warnings in tw_timer_template.c
Dave Barach [Tue, 13 Jun 2017 21:04:28 +0000 (17:04 -0400)]
VPP-874: fix coverity warnings in tw_timer_template.c

Best guess, tested carefully, should do no harm. Clang doesn't
complain either way; it's not certain that this patch will make the
coverity warnings in tw_timer_template.c disappear.

Change-Id: I75aa0cfd8970751e823a1165df2a755e947c4cf9
Signed-off-by: Dave Barach <dave@barachs.net>
7 years agoETH:fix l2_len/vlan count mismatch for > 2 tags
Eyal Bari [Tue, 13 Jun 2017 09:09:37 +0000 (12:09 +0300)]
ETH:fix l2_len/vlan count mismatch for > 2 tags

l2_len was not updated for the third tag
as the ethernet node retracts by the vlan count after parse_header (using
ethernet_buffer_header_size) it ends up pointing before the ethernet header

+ some minor cleanups

Change-Id: I4ccaedd33928912e5d837376f146503b27071741
Signed-off-by: Eyal Bari <ebari@cisco.com>
7 years agoFlowprobe - tests speed-up
Pavel Kotucek [Mon, 12 Jun 2017 06:26:13 +0000 (08:26 +0200)]
Flowprobe - tests speed-up

Updated test to reduce tests runtime.

Change-Id: I7904628fc19d349d6c26502e49d4c990cb8816ff
Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
7 years agoFIB walk process - wake-up rate unnecessarily high
Neale Ranns [Sat, 10 Jun 2017 08:43:44 +0000 (01:43 -0700)]
FIB walk process - wake-up rate unnecessarily high

Change-Id: I7dedf283c83c7f0e0b7642f095b68bc0b40898cf
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agoSNAT: fix 1:1 NAT without port hairpinning TCP checksum update
Matus Fabian [Fri, 9 Jun 2017 09:33:30 +0000 (02:33 -0700)]
SNAT: fix 1:1 NAT without port hairpinning TCP checksum update

Change-Id: I5077fcf3671a6116b475f87e43120efc10ecaa08
Signed-off-by: Matus Fabian <matfabia@cisco.com>
7 years agomemif: fix crash during interface delete
Damjan Marion [Mon, 12 Jun 2017 19:38:35 +0000 (21:38 +0200)]
memif: fix crash during interface delete

Change-Id: Ide6d26d6fcc81be6f26ac0abe2cd0d6a0838cfe6
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoL2FIB:fix crash in show with deleted subif entries
Eyal Bari [Mon, 12 Jun 2017 14:07:22 +0000 (17:07 +0300)]
L2FIB:fix crash in show with deleted subif entries

after deleting a sub interface it's l2fib entries are left with a dangling
sw_if_index (while waiting for the ager to delete them).
changed "show l2fib" to reflect that state with "Deleted" as the interface name.

added sleep in test_l2_fib as a workaround for packets still passing after flush
will investigate...

Change-Id: Id998d7d3c6a073ef5005c5f3009e1cfb7febf7db
Signed-off-by: Eyal Bari <ebari@cisco.com>
7 years agothree-level timer wheel implementation w/ overflow vector
Dave Barach [Wed, 7 Jun 2017 19:18:23 +0000 (15:18 -0400)]
three-level timer wheel implementation w/ overflow vector

prep work for s/timing_wheel/tw_timer/ in the vlib process model

Change-Id: I763f4968a8fce1764a3778b12def0afbd30086b1
Signed-off-by: Dave Barach <dave@barachs.net>
7 years agomemif: complete refactor of socket handling code
Damjan Marion [Mon, 5 Jun 2017 13:37:58 +0000 (15:37 +0200)]
memif: complete refactor of socket handling code

Change-Id: I4d41def83a23f13701f1ddcea722d481e4c85cbc
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoFix build breakge post 6956
Neale Ranns [Mon, 12 Jun 2017 13:12:26 +0000 (06:12 -0700)]
Fix build breakge post 6956

Change-Id: I0ab0e3e40b00ed5c2a34f5c23d04b596c1e9aa5f
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agoNAT64: bug fix
Matus Fabian [Mon, 12 Jun 2017 09:29:39 +0000 (02:29 -0700)]
NAT64: bug fix

ICMP to ICMPv6 error message inner UDP packet translation
delete ST entries when deleting static BIB entry

Change-Id: I2a28631ac040e20827a692331506cd8254f70916
Signed-off-by: Matus Fabian <matfabia@cisco.com>
7 years agoUpdate CSIT tests 170605 -> 170612
Jan Gelety [Mon, 12 Jun 2017 10:06:51 +0000 (12:06 +0200)]
Update CSIT tests 170605 -> 170612

- update of CSIT operational branch to be used for VPP-patch test

Change-Id: I0e19f085153ca00ddb46e016cff742b42eca15a0
Signed-off-by: Jan Gelety <jgelety@cisco.com>
7 years agoRemove calls to crc_u32 and add clib_crc32c for armv8+crc
Christophe Fontaine [Wed, 31 May 2017 09:27:19 +0000 (11:27 +0200)]
Remove calls to crc_u32 and add clib_crc32c for armv8+crc

crc_u32 was not defined for non x86_64 with SSE4.2 processors.

Calls to "crc_u32" are removed and replaced by either a call to
clib_crc32c or a call to clib_xxhash, as the result is not used
as a check value but as a hash.

Change-Id: I3af4d68e2e5ebd0c9b0a6090f848d043cb0f20a2
Signed-off-by: Christophe Fontaine <christophe.fontaine@enea.com>
7 years agoNAT64: coverity fix
Matus Fabian [Fri, 9 Jun 2017 11:55:54 +0000 (04:55 -0700)]
NAT64: coverity fix

Change-Id: I08544b2f06f993c8a6435901232a0616d0548b94
Signed-off-by: Matus Fabian <matfabia@cisco.com>
7 years agoFix coverity issue
Filip Tehlar [Fri, 9 Jun 2017 13:25:57 +0000 (15:25 +0200)]
Fix coverity issue

Change-Id: Ib62ee0eacd6c91dc4cd95835efe901079754ef42
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
7 years agoMPLS: cannot delete a path from the CLI
Neale Ranns [Fri, 9 Jun 2017 19:41:00 +0000 (12:41 -0700)]
MPLS: cannot delete a path from the CLI

Change-Id: I7f85870ef99405727312a5de6839c8875c9fa1c5
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agoFix gpe coverity issue (VPP-874)
Florin Coras [Fri, 9 Jun 2017 17:22:22 +0000 (10:22 -0700)]
Fix gpe coverity issue (VPP-874)

Change-Id: I70fb60619a0a02d891276ea6c7ac277ba2b26fa3
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agoImplement sack based tcp loss recovery (RFC 6675)
Florin Coras [Thu, 25 May 2017 01:03:56 +0000 (18:03 -0700)]
Implement sack based tcp loss recovery (RFC 6675)

- refactor existing congestion control code (RFC 6582/5681). Handling of ack
  feedback now consists of: ack parsing, cc event detection, event handling,
  congestion control update
- extend sack scoreboard to support sack based retransmissions
- basic implementation of Eifel detection algorithm (RFC 3522) for
  detecting spurious retransmissions
- actually initialize the per-thread frame freelist hash tables
- increase worker stack size to 2mb
- fix session queue node out-of-buffer handling
  - ensure that the local buffer cache vec_len matches reality
  - avoid 2x spurious event requeues when short of buffers
  - count out-of-buffer events
- make the builtin server thread-safe
- fix bihash template threading issue: need to paint -1 across uninitialized
  working_copy_length vector elements (via rebase from master)

Change-Id: I646cb9f1add9a67d08f4a87badbcb117980ebfc4
Signed-off-by: Florin Coras <fcoras@cisco.com>
Signed-off-by: Dave Barach <dbarach@cisco.com>
7 years agoSample plugin: Add sample plugin documentation
Ray Kinsella [Thu, 8 Jun 2017 14:54:19 +0000 (15:54 +0100)]
Sample plugin: Add sample plugin documentation

Added some user documentation to sample plugin.

Change-Id: I518910f80499307e8fcac8dcef7baaeab5ea8e35
Signed-off-by: Ray Kinsella <ray.kinsella@intel.com>
7 years agoacl-plugin: wrap a verbose debug message in the appropriate conditional
Andrew Yourtchenko [Fri, 9 Jun 2017 09:06:11 +0000 (11:06 +0200)]
acl-plugin: wrap a verbose debug message in the appropriate conditional

Change-Id: Ibd57cb617642e42d4c4d64f186479702b8a81900
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
7 years agodpdk: fix ipsec coverity warning
Sergio Gonzalez Monroy [Thu, 8 Jun 2017 12:04:47 +0000 (13:04 +0100)]
dpdk: fix ipsec coverity warning

CID 170475

Change-Id: I9748dd56bdcb62e68d8f672e5b1619a3be400b8f
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
7 years agoNAT64: ICMP error support
Matus Fabian [Thu, 8 Jun 2017 12:24:28 +0000 (05:24 -0700)]
NAT64: ICMP error support

Added ICMP error messages translation.
Added check for multi thread (not supported yet, so init failed).
Added API definition for custom NAT64 refix.

Change-Id: Ice2f04631af63e594aecc09087a1cf59f3b676fb
Signed-off-by: Matus Fabian <matfabia@cisco.com>
7 years agoLISP: add NSH support
Filip Tehlar [Tue, 30 May 2017 05:14:46 +0000 (07:14 +0200)]
LISP: add NSH support

Change-Id: I971c110ed126f1a24a963f9d3b88cf8f8c308816
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
7 years agoacl-plugin: remove clib_warnings on plugin init
Andrew Yourtchenko [Thu, 8 Jun 2017 16:42:02 +0000 (18:42 +0200)]
acl-plugin: remove clib_warnings on plugin init

Change-Id: Ic3c9a914a588824b8abd6668961f731432083c4f
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
7 years agoAdd gpe native-forward static route support
Florin Coras [Thu, 8 Jun 2017 04:50:57 +0000 (21:50 -0700)]
Add gpe native-forward static route support

Change-Id: I744e7d64d94dbb302f2c1246663480f720672ee2
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agoP2P Ethernet - API
Pavel Kotucek [Thu, 8 Jun 2017 06:46:10 +0000 (08:46 +0200)]
P2P Ethernet - API

API for P2P Ethernet feature

Change-Id: Id0280f42b9ce2428262e79c4dc309595037cd10e
Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
7 years agoNAT64: Add NAT64 support for snat plugin (VPP-699)
Matus Fabian [Tue, 6 Jun 2017 11:53:28 +0000 (04:53 -0700)]
NAT64: Add NAT64 support for snat plugin (VPP-699)

Basic NAT64 feature (no hairpinning, no multi-thread).

Change-Id: I392fccbce93e70c117f4a9a7ec7cf08d6c537f2d
Signed-off-by: Matus Fabian <matfabia@cisco.com>
7 years agoSmall update to session API
Florin Coras [Wed, 7 Jun 2017 21:18:48 +0000 (14:18 -0700)]
Small update to session API

Change-Id: I6a566d1dc9531b790bdcb00edc73516f86daeb72
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agomake test: improve debugability
Klement Sekera [Wed, 7 Jun 2017 06:19:47 +0000 (08:19 +0200)]
make test: improve debugability

Introduce faulthandler to print stack trace to stderr on python crash.
Don't disable automatic garbage collection to decrease the chances of
running out of memory.

Change-Id: I6927a5f6ea9569735d084d4ed3d258950a400d74
Signed-off-by: Klement Sekera <ksekera@cisco.com>
7 years agoVPP-874: fix coverity warning in vnet_classify.c
Dave Barach [Wed, 7 Jun 2017 12:32:51 +0000 (08:32 -0400)]
VPP-874: fix coverity warning in vnet_classify.c

Change-Id: Icffd2862eadbe9ddfb3ee34f3cb19c9324b3d9b4
Signed-off-by: Dave Barach <dave@barachs.net>
7 years agoacl-plugin: add a plugin-specific control-ping message api and make the test code...
Andrew Yourtchenko [Tue, 6 Jun 2017 12:50:03 +0000 (14:50 +0200)]
acl-plugin: add a plugin-specific control-ping message api and make the test code use it

This fixes the undesirable pause in the dump commands in case there is nothing to dump.

Change-Id: I0554556c9e442038aa2a1ed8c88234f21f7fe9b9
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
7 years agoacl-plugin: make the ACL plugin multicore-capable
Andrew Yourtchenko [Wed, 17 May 2017 19:27:03 +0000 (21:27 +0200)]
acl-plugin: make the ACL plugin multicore-capable

Add the logic to be able to use stateful ACLs in a multithreaded setup.

Change-Id: I3b0cfa6ca4ea8f46f61648611c3e97b00c3376b6
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
7 years agoVPP-873: fix vector expansion bug in dispatch_pending_node
Dave Barach [Wed, 7 Jun 2017 12:18:49 +0000 (08:18 -0400)]
VPP-873: fix vector expansion bug in dispatch_pending_node

The main interior graph-node dispatch loop had a longstanding dangling
vector element reference:

for (i = 0; i < _vec_len (nm->pending_frames); i++)
   cpu_time_now = dispatch_pending_node (vm, nm->pending_frames + i,
                               cpu_time_now);

Passing a pointer to a vector element (nm->pending_frames + i) has
considerable comedic potential if there's any chance that the vector
could expand.

dispatch_pending_node() calls dispatch_node(), and indirectly any
interior graph node dispatch function. If that node happens to expand
nm->pending_frames by filling in a new frame, nm->pending_frames can
expand.

After calling the node dispatch function, dispatch_node() does the
following:

  nf = vec_elt_at_index (nm->next_frames, p->next_frame_index);

If nm->pending_frames expands during dispatch function execution, p is
a dangling reference to freed memory.

By luck, the TCP stack managed to allocate a fresh frame which
included "old-p," which caused p->next_frame_index to be filled with
the new-frame poison pattern 0xfefefefe.

This has been broken from day 1, summer 2007, first use of the
third-generation vector processing library.

Change-Id: Ideb6363bb060c4e8bf9b901882c318bd83853121
Signed-off-by: Dave Barach <dave@barachs.net>
7 years agoVPP-872 and End.T function for SRv6
Pablo Camarillo [Tue, 6 Jun 2017 13:18:12 +0000 (15:18 +0200)]
VPP-872 and End.T function for SRv6

Fixes VPP-872 and adds support for End.T

Change-Id: I3c32cb6e412f37babe1abd293c0b6b49367fc2a9
Signed-off-by: Pablo Camarillo <pcamaril@cisco.com>
7 years agoacl-plugin: fix coverity error in acl_test.c
Andrew Yourtchenko [Wed, 7 Jun 2017 10:30:48 +0000 (12:30 +0200)]
acl-plugin: fix coverity error in acl_test.c

Attempting to supply within a VAT CLI to add the ACLs a rule count
override with no rules to add would result in null pointer dereference
as we attempt to copy those rules to the message.
Add the check to avoid copy if the source pointer is null
(i.e. if there are no rules to copy from).
This commit fixes coverity errors 166797 and 166792.

Change-Id: Icabe060d961ba07dc41f63b8e17fca12ff82aa29
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
7 years agodpdk: ipsec fixes
Sergio Gonzalez Monroy [Wed, 17 May 2017 10:43:41 +0000 (11:43 +0100)]
dpdk: ipsec fixes

- Fix buffer trace from esp_decrypt node
- Fix VLIB_REGISTER_NODE macro format
- Remove unnecessary code since we do not reconfigure graph
  unless requirements are met

Change-Id: Ic1c2afffb8265e40a6ced0c8a58775c05fadc9e2
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
7 years agodpdk: fix ipsec coverity warnings
Sergio Gonzalez Monroy [Wed, 7 Jun 2017 08:13:06 +0000 (09:13 +0100)]
dpdk: fix ipsec coverity warnings

CID 161044 and 161045

Change-Id: I50a450e231e387f05e354e3b07dc777ab864d018
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
7 years agoAdd support for memif API to VAT.
Milan Lenco [Fri, 31 Mar 2017 08:16:31 +0000 (10:16 +0200)]
Add support for memif API to VAT.

Change-Id: I01dc439fc84f9213e55ba56982eff34474637115
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
7 years agoFix coverity error in IP4 Mtrie.
Neale Ranns [Tue, 6 Jun 2017 13:52:14 +0000 (06:52 -0700)]
Fix coverity error in IP4 Mtrie.

Change-Id: I586a758a8b4b0ea5ca030b2df2796f5acb49e154
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agoPackets recieved on VLAN-0 map to the main interface
Neale Ranns [Tue, 30 May 2017 14:30:04 +0000 (07:30 -0700)]
Packets recieved on VLAN-0 map to the main interface

Change-Id: I21b1ad39275495d4d006023b58f630a213445854
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agoFix coverity issue
Filip Tehlar [Tue, 6 Jun 2017 13:32:52 +0000 (15:32 +0200)]
Fix coverity issue

Change-Id: I5f7dc38beb96b600be67599049f951d8a17ff8da
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
7 years agoUpdate CSIT tests 170529 -> 170605
Jan Gelety [Tue, 6 Jun 2017 07:41:06 +0000 (09:41 +0200)]
Update CSIT tests 170529 -> 170605

- update of CSIT operational branch to be used for VPP-patch test

Change-Id: I49396105470609422f28a49211012fcd9f252587
Signed-off-by: Jan Gelety <jgelety@cisco.com>
7 years agoRework vxlan-gpe to support FIB 2.0 and bypass mode
Hongjun Ni [Sat, 27 May 2017 12:23:09 +0000 (20:23 +0800)]
Rework vxlan-gpe to support FIB 2.0 and bypass mode

Change-Id: I0324f945bdb4dd3b19151be6f3ce24a47a000104
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
7 years agoFix lisp map-notify parsing
Florin Coras [Mon, 5 Jun 2017 22:38:50 +0000 (15:38 -0700)]
Fix lisp map-notify parsing

Change-Id: Ib22ffee3d8ac63af171d032c2ffcb44a2e42400c
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agovlib: add screen-256color CLI terminal type
Damjan Marion [Mon, 5 Jun 2017 19:56:12 +0000 (21:56 +0200)]
vlib: add screen-256color CLI terminal type

Change-Id: Ia78e69e5e8ed18020314aef321b94ac37037799b
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agovlib: add unix_file_del_by_index function
Damjan Marion [Mon, 5 Jun 2017 19:54:46 +0000 (21:54 +0200)]
vlib: add unix_file_del_by_index function

Change-Id: I9eca5f9d1c1ae62d5ba5fb36f2f97434dbaf334e
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agovppinfra: fix vec_validate_init_empty_aligned macro
Damjan Marion [Mon, 5 Jun 2017 19:53:39 +0000 (21:53 +0200)]
vppinfra: fix vec_validate_init_empty_aligned macro

Change-Id: Ieafd00c7d03fe5c090808c7af4aa2f86974a092e
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoSNAT: fix ICMP hairpinning
Matus Fabian [Mon, 5 Jun 2017 12:55:48 +0000 (05:55 -0700)]
SNAT: fix ICMP hairpinning

Change-Id: I9d63133bd1db72917571ade868040c4597c896a1
Signed-off-by: Matus Fabian <matfabia@cisco.com>
7 years agoMore GCC-7 errors
Marco Varlese [Mon, 5 Jun 2017 15:59:24 +0000 (17:59 +0200)]
More GCC-7 errors

The Wmaybe-uninitialized is the new error included with Wall.
This patch addresses the warning and fixes it.

Change-Id: I8fdf9ff2d236c46b717024a14874fbbbad8af303
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
7 years agoLISP-GPE: return index of newly created fwd entry, VPP-868
Filip Tehlar [Mon, 5 Jun 2017 11:40:13 +0000 (13:40 +0200)]
LISP-GPE: return index of newly created fwd entry, VPP-868

Change-Id: I4fc45097cb994ab6a59503d9fcfb693d1c7ec442
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
7 years agoLISP: fix GPE entry dump, VPP-871
Filip Tehlar [Mon, 5 Jun 2017 07:50:38 +0000 (09:50 +0200)]
LISP: fix GPE entry dump, VPP-871

Change-Id: Ifcd6d2caecce29c8b4605d06b9df82b36a403e74
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
7 years agoFix typo for specifying table_id on ping.
wenxian li [Sun, 4 Jun 2017 13:52:07 +0000 (13:52 +0000)]
Fix typo for specifying table_id on ping.

Change-Id: I76d399915c76ec68d8a401e11c14dc15c55291e4
Signed-off-by: wenxian li <wofanli@gmail.com>
7 years agoFix for gcc7
Marco Varlese [Wed, 31 May 2017 12:00:37 +0000 (14:00 +0200)]
Fix for gcc7

When building VPP code with gcc7 a warning (threated as error) is encountered and the build fails.
This patch addressed the compilation issue.

Change-Id: I49af9288a84d91ec8145da07c00aefb5333ec418
Signed-off-by: Marco Varlese <marco.varlese@suse.com>