vpp.git
5 years agoMAP: Move MAP-E/T to a plugin. 85/13185/11
Ole Troan [Fri, 22 Jun 2018 09:32:12 +0000 (11:32 +0200)]
MAP: Move MAP-E/T to a plugin.

Only remaining traces of MAP in the src/vnet is now in buffer.h.
Awaiting a new buffer opaque API (hint, hint).

Change-Id: Ie165561484731f1d7ed6e0f604b43624e06db3f0
Signed-off-by: Ole Troan <ot@cisco.com>
5 years agoVCL: Refactor VCL test (part 1) 98/13198/5
Dave Wallace [Mon, 25 Jun 2018 01:21:21 +0000 (21:21 -0400)]
VCL: Refactor VCL test (part 1)

Change-Id: I6a326e24ed953b1cef63bd4010a3bedd6c4a7b1c
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
5 years agomake test: fix RETRIES when setUpClass throws 86/13186/12
Klement Sekera [Fri, 22 Jun 2018 11:19:45 +0000 (13:19 +0200)]
make test: fix RETRIES when setUpClass throws

This change adds handling of special case when setUpClass throws. In
this case TestResults receives a mock object called _ErrorHolder.
By parsing its description, we find test class name and use it to lookup
the test class in test suite to be able to add it to the list of failures
for re-running.

Change-Id: I656f21e38aa450fc567cdcbcf6e586967f947a64
Signed-off-by: Klement Sekera <ksekera@cisco.com>
5 years agomake test: fix broken interfaces #2 95/13195/6
Klement Sekera [Sun, 24 Jun 2018 08:30:37 +0000 (10:30 +0200)]
make test: fix broken interfaces #2

Change-Id: I9d5b5d925fd2c09a1113fc51e433a16d729a241b
Signed-off-by: Klement Sekera <ksekera@cisco.com>
5 years agoRevert "Revert "make test: fix broken interfaces"" 97/13197/1
Klement Sekera [Sun, 24 Jun 2018 20:49:33 +0000 (22:49 +0200)]
Revert "Revert "make test: fix broken interfaces""

This reverts commit c8efa29b6f9a91381897b54f1147daf922ed7164.

Change-Id: I1d5c5773d5f86a63073e255336bd9de628e26179
Signed-off-by: Klement Sekera <ksekera@cisco.com>
5 years agoRevert "Revert "ipsec: VPP-1316 calculate IP/TCP/UDP inner checksums"" 96/13196/1
Klement Sekera [Sun, 24 Jun 2018 20:49:55 +0000 (22:49 +0200)]
Revert "Revert "ipsec: VPP-1316 calculate IP/TCP/UDP inner checksums""

This reverts commit e0d2bd6bd7fc59c0c6ac48195d7f825dc99bfd91.

Change-Id: If491e16f9ea66b2493a6a7c7f3c684ed585f8f51
Signed-off-by: Klement Sekera <ksekera@cisco.com>
5 years agoTx feature node, for accounting purposes 91/13191/4
Dave Barach [Fri, 22 Jun 2018 17:14:08 +0000 (13:14 -0400)]
Tx feature node, for accounting purposes

Switch to combined allow/drop counters
Show matching ip4 neighbor address if known
Add static-allow mactime entries for unknown mac addresses
Add the "clear mactime" command

Change-Id: Ib963981438dfb8a123df1b3c023bd5fcc27f888f
Signed-off-by: Dave Barach <dbarach@cisco.com>
5 years agoRevert "ipsec: VPP-1316 calculate IP/TCP/UDP inner checksums" 93/13193/1
Ole Troan [Fri, 22 Jun 2018 20:36:46 +0000 (22:36 +0200)]
Revert "ipsec: VPP-1316 calculate IP/TCP/UDP inner checksums"

This reverts commit a98346f664aae148d26a8e158008b773d73db96f.

Change-Id: Iee5b3a5ddff0e8fd3a30fe5973cee24de434fe12
Signed-off-by: Ole Troan <ot@cisco.com>
5 years agoRevert "make test: fix broken interfaces" 92/13192/1
Ole Troan [Fri, 22 Jun 2018 20:33:41 +0000 (22:33 +0200)]
Revert "make test: fix broken interfaces"

This reverts commit d5c60b96a3fd93916fc4af5c8d6d25625c28242e.

Change-Id: I3632b9c3f76c615aee897f28f76d094e7031e689
Signed-off-by: Ole Troan <ot@cisco.com>
5 years agomake test: fix broken interfaces 88/13188/3
Klement Sekera [Fri, 22 Jun 2018 11:54:07 +0000 (13:54 +0200)]
make test: fix broken interfaces

Change-Id: I2e092774f81503e04b53cc6c6b5d357fe3fc52ab
Signed-off-by: Klement Sekera <ksekera@cisco.com>
5 years agojvpp: add support for enums (VPP-1153) 54/13154/3
Marek Gradzki [Wed, 20 Jun 2018 12:49:39 +0000 (14:49 +0200)]
jvpp: add support for enums (VPP-1153)

Change-Id: I2a1b946a71419e1fb3c5d70567c54a6a7d841f10
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
5 years agosession: improve session lookup speeds 80/13180/4
Florin Coras [Thu, 21 Jun 2018 15:14:34 +0000 (08:14 -0700)]
session: improve session lookup speeds

It would seem that this avoids using the stack for computing the
subsequent crc32 by storing the 2 x u64 ip4 5-tuple key into two
registers. Probably the cast to the "convenience" data structure "masks"
the fact that the key is 16B. Probably ... :-)

"sh run" on an ip4 tcp sender reports that the number of clocks spent in
tcp_input, where a session lookup is performed, drops ~25% (from ~100
clocks/packet to ~75 clocks/packet)

Change-Id: I50d647115ac72f8407bff7e3b73328ba42f0ddb5
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agojvpp: cleanup JNI generation code (VPP-1153) 53/13153/2
Marek Gradzki [Wed, 20 Jun 2018 11:15:08 +0000 (13:15 +0200)]
jvpp: cleanup JNI generation code (VPP-1153)

Minor cleanup that includes unifying
common Java to C and C to Java translation code.

Change-Id: I14d63dbe06334c3bbfbde75043de04d2c08f3dfd
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
5 years agoPython API: Add enum and union support. 51/13151/5
Ole Troan [Tue, 12 Jun 2018 19:06:44 +0000 (21:06 +0200)]
Python API: Add enum and union support.

As well as a rewrite of the encoders/decoders to make it more readable and extensible.
(Re-commit after fix to verify build.)

Change-Id: Ic244d3cebe070bb2570491f8a24f4a1e203f889a
Signed-off-by: Ole Troan <ot@cisco.com>
5 years agoUpdate tapv2 documentation 05/13105/3
Ian Wells [Mon, 18 Jun 2018 20:53:17 +0000 (13:53 -0700)]
Update tapv2 documentation

The documentation in the API file says that 0xffff == 'no interface
ID specified' but the code tests against ~(u32)0.

Change-Id: I5cd83d876c3ad4f53a5b01463299d4fcb806ea98
Signed-off-by: Ian Wells <iawells@cisco.com>
5 years agotest:vxlan over ipv6 tests 37/13137/4
Eyal Bari [Mon, 18 Jun 2018 10:01:59 +0000 (13:01 +0300)]
test:vxlan over ipv6 tests

Change-Id: Id910db0e3a07ecc6f469e2f0d1e97f39ba48cc60
Signed-off-by: Eyal Bari <ebari@cisco.com>
5 years agoVPP-1042: Fix the DPDK no-hugetbl flags 78/12678/4
Jessica Tallon [Mon, 21 May 2018 12:27:05 +0000 (12:27 +0000)]
VPP-1042: Fix the DPDK no-hugetbl flags

Change-Id: I7c611d3fa7fabe82294fc22a61d5a3927a2da39d
Signed-off-by: Jessica Tallon <tsyesika@igalia.com>
5 years agoconfigurable per-dispatch-cycle sleep 62/13062/5
Dave Barach [Thu, 14 Jun 2018 22:52:46 +0000 (18:52 -0400)]
configurable per-dispatch-cycle sleep

Workaround for lack of driver interrupt support. Also quite handy for
home gateway, laptop/vagrant, other use-cases not requiring maximum
vectors/second for proper operation.

Change-Id: Ifc4b98112450664beef67b89ab8a6940a3bf24b5
Signed-off-by: Dave Barach <dave@barachs.net>
5 years agoFastLinQ QL41000 Series PCI vendor and device ids 01/13101/3
Igor Mikhailov (imichail) [Mon, 18 Jun 2018 17:19:10 +0000 (10:19 -0700)]
FastLinQ QL41000 Series PCI vendor and device ids

Change-Id: I23caebf602e3e6ff45fdec106a0da88f6de7a284
Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
5 years agoipsec: VPP-1316 calculate IP/TCP/UDP inner checksums 48/13048/4
Klement Sekera [Wed, 16 May 2018 08:52:45 +0000 (10:52 +0200)]
ipsec: VPP-1316 calculate IP/TCP/UDP inner checksums

Calculate IP/TCP/UDP checksums in software before adding authentication.

Change-Id: I3e121cb00aeba667764f39ade8d62170f18f8b6b
Signed-off-by: Klement Sekera <ksekera@cisco.com>
5 years agoNull terminate name string 76/13176/2
Dave Barach [Thu, 21 Jun 2018 11:33:12 +0000 (07:33 -0400)]
Null terminate name string

Change-Id: If7bcc6ae3358b5e39bf76481ee58f4dbaa53d895
Signed-off-by: Dave Barach <dave@barachs.net>
5 years agotcp: move tracing out of established loop 68/13168/2
Florin Coras [Wed, 20 Jun 2018 19:44:16 +0000 (12:44 -0700)]
tcp: move tracing out of established loop

Change-Id: I4a7e4f616ed4a4df82be3112ac4702f7e4e2025c
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agoImplement DHCPv6 IA NA client (VPP-1094) 99/12599/11
Juraj Sloboda [Fri, 4 May 2018 12:20:06 +0000 (14:20 +0200)]
Implement DHCPv6 IA NA client (VPP-1094)

Change-Id: I682a47d6cf9975aca6136188d28ee93eaadf4fe3
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
5 years agojvpp: do not fail on type parsing error 48/13148/2
Marek Gradzki [Wed, 20 Jun 2018 11:53:10 +0000 (13:53 +0200)]
jvpp: do not fail on type parsing error

skip the type instead.

Change-Id: I533c8e13c1b2d05c1ddc6dc36427bac010d7c19a
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
5 years agoBIER neighbor stats 63/13063/4
Neale Ranns [Thu, 7 Jun 2018 09:08:07 +0000 (02:08 -0700)]
BIER neighbor stats

Change-Id: I2f638f1932b4aeddf2408c06d1b8393551675b72
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
5 years agodpdk/ipsec: add support for UDP encap/decap 37/13037/6
Radu Nicolau [Wed, 13 Jun 2018 15:39:05 +0000 (16:39 +0100)]
dpdk/ipsec: add support for UDP encap/decap

Change-Id: I024c1d398fcb51e5a20f9049d16a87b3b1ba0c20
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
5 years agoAdd .pydevproject to .gitignore 63/13163/2
Marek Gradzki [Wed, 20 Jun 2018 18:59:00 +0000 (20:59 +0200)]
Add .pydevproject to .gitignore

the file is used by PyDev - a Python IDE for Eclipse.

Change-Id: Id47287451fc8773332c65afa40c6f0464067cf81
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
5 years agoacl-plugin: fallback to linear ACL search for fragments 60/13160/2
Andrew Yourtchenko [Mon, 18 Jun 2018 10:15:09 +0000 (12:15 +0200)]
acl-plugin: fallback to linear ACL search for fragments

Trying to accomodate fragments as first class citizens
has shown to be more trouble than it's worth. So
fallback to linear ACL search in case it is a fragment
packet. Delete the corresponding code from the hash
matching.

Change-Id: Ic9ecc7c800d575615addb33dcaa89621462e9c7b
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
5 years agoNested-loop index typo. Oops. 59/13159/2
Dave Barach [Wed, 20 Jun 2018 14:53:51 +0000 (10:53 -0400)]
Nested-loop index typo. Oops.

Change-Id: I73b5a4adcfce0d7cd1dd4cf6d9d6a5fb25256bcf
Signed-off-by: Dave Barach <dave@barachs.net>
5 years agotcp: add per worker ctx structure 33/13133/3
Florin Coras [Tue, 19 Jun 2018 16:58:04 +0000 (09:58 -0700)]
tcp: add per worker ctx structure

Change-Id: I28d3c31bdc4255a4ca223d80bcf44709fb39f4ed
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agoipsec: VPP-1308 fix sorting of SPD entries 53/12953/8
Klement Sekera [Thu, 7 Jun 2018 17:36:07 +0000 (19:36 +0200)]
ipsec: VPP-1308 fix sorting of SPD entries

Change-Id: I761aced55b7cef51a9b47048283b2cb9430bcde2
Signed-off-by: Klement Sekera <ksekera@cisco.com>
5 years agoacl-plugin: acl-as-a-service: VPP-1248: fix the error if exports.h included in more... 69/11969/9
Andrew Yourtchenko [Tue, 15 May 2018 15:25:50 +0000 (17:25 +0200)]
acl-plugin: acl-as-a-service: VPP-1248: fix the error if exports.h included in more than one C file

Including the exports.h from multiple .c files belonging to a single plugin results in an error.

Rework the approach to require the table of function pointers to be filled in by
the initialization function.

Since the inline functions are compiled in the "caller" context,
there is no knowledge about the acl_main structure used by the ACL
plugin. To help with that, the signature of inline functions is slightly
different, taking the p_acl_main pointer as the first parameter.

That pointer is filled into the .p_acl_main field of the method
table during the initialization - since the calling of non-inline variants
would have required filling the method table, this should give
minimal headaches during the use and switch between the two methods.

Change-Id: Icb70695efa23579c46c716944838766cebc8573e
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
5 years agoFix sw-if-index display error. 22/13022/10
Brant Lin [Wed, 13 Jun 2018 10:01:58 +0000 (06:01 -0400)]
Fix sw-if-index display error.

If the sw-if-index is set to -1, it will send out all interfaces' arp enties. In this case, the sw-if-index is always set to -1. It is not correct.

Change-Id: I21e9ee078c757ac7efa70a2a1f1a7a4eb73d66a1
Signed-off-by: Brant Lin <brant.lin@ericsson.com>
5 years agoVCL: Fix session peer and local addresses 29/13129/3
Dave Wallace [Tue, 19 Jun 2018 17:37:30 +0000 (13:37 -0400)]
VCL: Fix session peer and local addresses

VPP-1302: VCL does not provide local and peer addresses

Change-Id: I7ff12e57799796dfeb030b181b4c24da07dc12eb
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
5 years agoDriver level time-based src mac filter 00/13100/7
Dave Barach [Mon, 18 Jun 2018 17:16:39 +0000 (13:16 -0400)]
Driver level time-based src mac filter

Change-Id: I062d7653e00d77e73a61d8841e01ab4a159b6404
Signed-off-by: Dave Barach <dbarach@cisco.com>
5 years agotcp: optimize tcp output 66/13066/10
Florin Coras [Thu, 14 Jun 2018 21:55:50 +0000 (14:55 -0700)]
tcp: optimize tcp output

Change-Id: Idf17a0633a1618b12c22b1119e40c2e9d3192df9
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agotcp: optimize tcp input 68/13068/7
Florin Coras [Fri, 15 Jun 2018 00:11:56 +0000 (17:11 -0700)]
tcp: optimize tcp input

Change-Id: Ib98cfc93f6c574de5250f251925f7ed4e86f5f6f
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agoCheck get packet template allocation failure (VPP-1321) 31/13131/3
John Lo [Tue, 19 Jun 2018 19:27:48 +0000 (15:27 -0400)]
Check get packet template allocation failure (VPP-1321)

After calling vlib_packet_template_get_packet(), make sure
packet buffer is allocated before using it.

Change-Id: Idb5199f4e2c9596137b2101e502d611f474a6ffe
Signed-off-by: John Lo <loj@cisco.com>
5 years agoVCL: refactor async & spinlocks 06/13106/5
Dave Wallace [Mon, 18 Jun 2018 22:41:32 +0000 (18:41 -0400)]
VCL: refactor async & spinlocks

- Consolidate async code.
- Add macros for spinlocks to improve readability.

Change-Id: I2e0fd2b82ea76987aaf298a183d816c7d2ee0867
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
5 years agoip checksum multiarch support, cleanup 61/13061/10
Dave Barach [Thu, 14 Jun 2018 22:05:30 +0000 (18:05 -0400)]
ip checksum multiarch support, cleanup

When computing tcp/udp checksums across large amounts of data -
e.g. when NIC h/w checksum offload is not available - it's worth
providing arch-dependent code; if only to compile the code w/ -O3.

Fix calculation when data is fully unaligned / on an odd byte
boundary.

Add a buffer alignment test vector.

Change-Id: I7644e2276ac6cbc3f575bf61746a6ffedbbb6150
Signed-off-by: Dave Barach <dave@barachs.net>
5 years agoFixed bugs in SRv6 API 32/11132/21
Pablo Camarillo [Tue, 19 Jun 2018 13:49:02 +0000 (15:49 +0200)]
Fixed bugs in SRv6 API

Jira ticket VPP-1196
Jira ticket VPP-1081
Jira ticket VPP-1078
Jira ticket VPP-1217

Change-Id: Id7e85229cae1017acb0aa4ca63ced334e6dafb8d
Signed-off-by: pcamaril <pcamaril@cisco.com>
Signed-off-by: Pablo Camarillo <pcamaril@cisco.com>
Signed-off-by: pcamaril <pcamaril@cisco.com>
Signed-off-by: Michal Cmarada <michal.cmarada@pantheon.tech>
5 years agoflow:free lookup entries after packets are handled 94/12994/3
eyal bari [Mon, 11 Jun 2018 16:50:40 +0000 (19:50 +0300)]
flow:free lookup entries after packets are handled

Change-Id: I737dad64bf6dd0743d36500d5cfa1cb1a6594b98
Signed-off-by: Eyal Bari <ebari@cisco.com>
5 years agoRevert "Python API: Add enum and union support." 04/13104/1
Ole Trøan [Mon, 18 Jun 2018 18:30:09 +0000 (18:30 +0000)]
Revert "Python API: Add enum and union support."

This reverts commit a5ee900fb75201bbfceaf13c8bc57a13ed094988.

Some of the unit tests breaks. Backing out until fixed.

Change-Id: I1846fb417db44a2a772f7b59cda8bcfe6d39f8c3
Signed-off-by: Ole Troan <ot@cisco.com>
5 years agoPython API: Add enum and union support. 13/13013/7
Ole Troan [Tue, 12 Jun 2018 19:06:44 +0000 (21:06 +0200)]
Python API: Add enum and union support.

As well as a rewrite of the encoders/decoders to make it more readable and extensible.

Change-Id: I253369ac76303922bf9c11377622c8974fa92f19
Signed-off-by: Ole Troan <ot@cisco.com>
5 years agoixgbe patch for link status updates 90/13090/3
Matthew Smith [Fri, 15 Jun 2018 21:42:57 +0000 (16:42 -0500)]
ixgbe patch for link status updates

An x550 with SFP+ interfaces attached to some switches can
have problems bringing the port up.

After configuring the link, there is a wait for 500 ms for
the link to come up. Some switches don't bring their ports up
that quickly. So the link is never observed to come up and is
reconfigured again the next time dpdk_update_link_state() is
called. Subsequent attempts time out also indefinitely.

Instead of waiting through 5 iterations of a 100 ms delay, wait
through 10 iterations. The i40e PMD does this when updating
link status.

This issue & patch will be reported to Intel so this or
some better solution can be applied upstream in the future.

Change-Id: I16d706a2790e51d695edc43c0ca17f1eff1dcf5e
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
5 years agoacl-plugin: fix the high cpu usage caused by the connection cleaner 59/13059/3
Andrew Yourtchenko [Thu, 14 Jun 2018 16:36:41 +0000 (18:36 +0200)]
acl-plugin: fix the high cpu usage caused by the connection cleaner

The commit 4bc1796b346efd10f3fb19b176ff089179263a24 had incorrect
calculation of the session lists minimal timeout, resulting
in returned value of 0 which resulted in existing sessions
constantly requeued, taking up the CPU. Fix this calculation.

Change-Id: I9a789739f96a1f01522c68f91b0a02db2417837f
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
5 years agoacl-plugin: split (L3) and (L4/pkt) logic of creation of 5tuple structure, optimize... 88/13088/2
Andrew Yourtchenko [Sun, 27 May 2018 15:41:27 +0000 (17:41 +0200)]
acl-plugin: split (L3) and (L4/pkt) logic of creation of 5tuple structure, optimize stores in the (l4/pkt)

Having two pieces of code - one for now much simpler to recreate L3 info,
one for a more difficult do build L4/pkt metadata allows more
degrees of freedom for optimizations.

Also, construct the metadata in local variables first before
saving it into the memory structure, this fewer memory stores
and they are better aligned, allowing to coalesce with
subsequent reads if needed.

Change-Id: Icb35d933834b14294f875362c9b58db3feb38d99
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
5 years agoNAT44: fix coverity 75/13075/2
Matus Fabian [Fri, 15 Jun 2018 10:59:12 +0000 (03:59 -0700)]
NAT44: fix coverity

Change-Id: Ib1e4563dbc027571c77497e5c190201713adc72b
Signed-off-by: Matus Fabian <matfabia@cisco.com>
5 years agoSTATS: Separate socket for fd exchange. 53/13053/3
Ole Troan [Thu, 14 Jun 2018 12:42:14 +0000 (14:42 +0200)]
STATS: Separate socket for fd exchange.

stats { interval <no> socket-name <name> | default }
Where the default socket is in /run/vpp/stats.sock

Change-Id: Idd501b328c662804d4ccd58034b0ea6b8aa1f89a
Signed-off-by: Ole Troan <ot@cisco.com>
5 years agoSTATS: Add more hierarchy to counters. 44/13044/3
Ole Troan [Thu, 14 Jun 2018 07:28:27 +0000 (09:28 +0200)]
STATS: Add more hierarchy to counters.

Put error counters under node_index.
/err/<node-name>/<error-name>

E.g:
/err/ip4-lookup/Hash table collisions
/err/ip6-rewrite/Buffer allocation error

Error names are not globally unique, and this allows
for walking all errors for a particular node.

Put interface counters under the directory /if.
E.g. /if/rx

Put system counters under the directory /sys.
E.g. /sys/vector_rate

Change-Id: I5b794d16698f61bcb2063a8cd77a7c4ae36419b8
Signed-off-by: Ole Troan <ot@cisco.com>
5 years agoavf: tx node fixes 60/13060/2
Damjan Marion [Thu, 14 Jun 2018 20:56:34 +0000 (22:56 +0200)]
avf: tx node fixes

- missing RSV bit set in descriptor
- wrong buffer offset

Change-Id: I8b138266652a30a50e4541c6344e4fe3dec4d1ca
Signed-off-by: Damjan Marion <damarion@cisco.com>
5 years agoUpdate DHCPv6 DUID code and fix coverity warnings 49/13049/2
Juraj Sloboda [Tue, 12 Jun 2018 08:21:05 +0000 (10:21 +0200)]
Update DHCPv6 DUID code and fix coverity warnings

- Generate client DUID only when DHCPv6 PD feature is enabled
- Change client DUID type from DUID-LLT to DUID-LL
- Fix coverity warnings

Change-Id: I20e518fc9a1c5f3f7ea9add7e7e03a487c99e978
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
5 years agoNAT44: endpoint dependent mode (VPP-1273) 30/13030/4
Matus Fabian [Wed, 13 Jun 2018 12:39:07 +0000 (05:39 -0700)]
NAT44: endpoint dependent mode (VPP-1273)

To enable NAT plugin endpoint dependent mode add following to statrup config:
nat { endpoint-dependent }

Enable endpoint dependent filtering and mapping for all sessions.
Move some existing functionality such as service load balancing, twice nat,
out2in-only static mappings and unknown protocol dynamic translations, which
use endpoint dependent lookup hash tables before. Basically split to vanilla
NAT44 and extra features NAT44.

Change-Id: I3925eb5ddcc8f1ec4cf6af4e2a618a7ec7aa9735
Signed-off-by: Matus Fabian <matfabia@cisco.com>
5 years agoTLS async support 12/12812/10
Ping Yu [Wed, 30 May 2018 22:16:08 +0000 (18:16 -0400)]
TLS async support

Change-Id: I26194e00dfb85e5cd1c65ff4e6ffd665be2d719b
Signed-off-by: Ping Yu <ping.yu@intel.com>
5 years agoFix SEGV in generic event sub reaper 58/13058/2
Matthew Smith [Thu, 14 Jun 2018 16:40:49 +0000 (11:40 -0500)]
Fix SEGV in generic event sub reaper

When a client subscribed to receive events disconnects
from the API, while deleting their subscription, a hash
lookup was being performed against a pointer that did
not refer to a hash, resulting in a SEGV.

Perform the hash lookup against the correct hash.

Change-Id: I011d7479e2c3b9ee50721cf7499385c3ff7f704a
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
5 years agoUse __attribute__((weak)) references where necessary 57/13057/2
Dave Barach [Thu, 14 Jun 2018 13:18:21 +0000 (09:18 -0400)]
Use __attribute__((weak)) references where necessary

It should be possible to use vlib without the vlibmemory library, etc.

Change-Id: Ic2316b93d7dbb728fb4ff42a3ca8b0d747c9425e
Signed-off-by: Dave Barach <dave@barachs.net>
5 years agoAdd clib_bihash_search_inline_2_with_hash to bihash template 54/13054/2
Andrew Yourtchenko [Sun, 27 May 2018 18:56:26 +0000 (20:56 +0200)]
Add clib_bihash_search_inline_2_with_hash to bihash template

Use similar approach as in the clib_bihash_search_inline_with_hash to
be able to do the hash calculation and lookup separately.

Change-Id: Ief79aa0f9f1e42b0af88be4807ca01fac30a80d7
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
5 years agoUse unicast DMAC for IP neighbor pool refresh probes 95/12995/2
John Lo [Tue, 12 Jun 2018 00:14:49 +0000 (20:14 -0400)]
Use unicast DMAC for IP neighbor pool refresh probes

Change-Id: I12fbebd1d24c37dc77c147773ea522c8a4b7b99d
Signed-off-by: John Lo <loj@cisco.com>
5 years agoacl-plugin: VAT: add an option to load entire ACL from a ClassBench ruleset file... 50/13050/2
Andrew Yourtchenko [Fri, 18 May 2018 16:10:16 +0000 (18:10 +0200)]
acl-plugin: VAT: add an option to load entire ACL from a ClassBench ruleset file for testing

Add a command "acl_add_replace_from_file" to VAT which can load a ruleset and
add an ACL with it. There are a few options which augment the ACL being created:

"permit+reflect" or "permit" alter the default action from deny on the ACEs
created.

"append-default-permit" adds an entry in the end with the "permit+reflect"
if the default action has been changed to permit+reflect, or with a simple
permit otherwise.

This command is IPv4-only because the available datasets were IPv4-only.

Change-Id: I26b9f33ecb6b59e051d1d9cbafedbc47e8203392
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
5 years agovxlan:use VLIB_NODE_FN for multiarch selection 42/13042/1
Eyal Bari [Thu, 14 Jun 2018 05:57:39 +0000 (08:57 +0300)]
vxlan:use VLIB_NODE_FN for multiarch selection

Change-Id: Ic98945fa1ffcc73e0b239ff5cc11d45e7318613e
Signed-off-by: Eyal Bari <ebari@cisco.com>
5 years agoMTU: IP fragmentation added to ip4-rewrite and ip6-rewrite 91/11691/8
Ole Troan [Tue, 10 Apr 2018 14:02:51 +0000 (16:02 +0200)]
MTU: IP fragmentation added to ip4-rewrite and ip6-rewrite

Change-Id: Ibae260273f25a319153be37470aed49ff73e957a
Signed-off-by: Ole Troan <ot@cisco.com>
5 years agoacl-plugin: use 16_8 bihash for IPv4 sessions and 40_8 bihash for IPv6 sessions 32/13032/3
Andrew Yourtchenko [Wed, 13 Jun 2018 14:10:35 +0000 (16:10 +0200)]
acl-plugin: use 16_8 bihash for IPv4 sessions and 40_8 bihash for IPv6 sessions

Add a new kv_16_8 field into 5tuple union, rename
the existing kv into kv_40_8 for clarity, and
add the compile-time alignment constraints.

Change-Id: I9bfca91f34850a5c89cba590fbfe9b865e63ef94
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
5 years agoDisable bihash bucket-level caching 39/13039/1
Dave Barach [Thu, 14 Jun 2018 00:48:09 +0000 (20:48 -0400)]
Disable bihash bucket-level caching

It'll be interesting to see what the perf trend job
says about this change.

Change-Id: I66307a19a865011ac9660108098874fa1481c895
Signed-off-by: Dave Barach <dave@barachs.net>
5 years agoStat segment / client: show run" works now 29/13029/1
Dave Barach [Wed, 13 Jun 2018 13:26:05 +0000 (09:26 -0400)]
Stat segment / client: show run" works now

Seems to have minimal-to-zero performance consequences. Data appears
accurate: result match the debug CLI output. Checked at low rates, 27
MPPS sprayed across two worker threads.

Change-Id: I09ede5150b88a91547feeee448a2854997613004
Signed-off-by: Dave Barach <dave@barachs.net>
5 years agoacl-plugin: change the src/dst L3 info in 5tuple struct to be always contiguous with... 08/13008/2
Andrew Yourtchenko [Tue, 12 Jun 2018 13:15:49 +0000 (15:15 +0200)]
acl-plugin: change the src/dst L3 info in 5tuple struct to be always contiguous with L4 data

Using ip46_address_t was convenient from operational point of view but created
some difficulties dealing with IPv4 addresses - the extra 3x of u32 padding
are costly, and the "holes" mean we can not use the smaller key-value
data structures for the lookup.

This commit changes the 5tuple layout for the IPv4 case, such that
the src/dst addresses directly precede the L4 information.
That will allow to treat the same data within 40x8 key-value
structure as a 16x8 key-value structure starting with 24 byte offset.

Change-Id: Ifea8d266ca0b9c931d44440bf6dc62446c1a83ec
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
5 years agoadd end of string for format name in unix_physmem_region_alloc 21/13021/2
lollita liu [Wed, 13 Jun 2018 09:14:02 +0000 (05:14 -0400)]
add end of string for format name in unix_physmem_region_alloc

Change-Id: I8cb4d5d90fb321de6e5037a3d0440507db79ec75
Signed-off-by: lollita liu <lollita.liu@ericsson.com>
5 years agocli: 'restart' should close open files (VPP-1068) 17/13017/2
Chris Luke [Wed, 13 Jun 2018 02:45:06 +0000 (22:45 -0400)]
cli: 'restart' should close open files (VPP-1068)

- On 'restart' close all registered files (except stdio) so that the
  new process has a clean start; in particular, CLI sockets, API
  sockets, tun/af_packet etc descriptors all need to close so they're
  not left open but unused by the new VPP process. To do this we iterate
  all the files registered for the polling mechanism and close() them.[1]
- While we're here, retain the original environment on 'restart';
  several things make use of it.

[1] An alternative mechanism would be to mark all files with CLOEXEC
  on opening; I think that is a little fragile for this fairly esoteric
  use case.

Change-Id: I81b4e261c4d3c4e2948981231be899824dd4e69f
Signed-off-by: Chris Luke <chrisy@flirble.org>
5 years agoFix clang compilation on aarch64: extraneous parentheses 60/12860/7
Sirshak Das [Mon, 11 Jun 2018 16:40:17 +0000 (11:40 -0500)]
Fix clang compilation on aarch64: extraneous parentheses

Fixes clang error: equality comparison with extraneous parentheses
Changing all the #defines to inlines.

Change-Id: I30a931679ac3325b23b249b1ae28c7c8cf54b012
Signed-off-by: Sirshak Das<sirshak.das@arm.com>
5 years agovxlan:offload RX flow 53/12553/16
eyal bari [Tue, 17 Apr 2018 08:20:27 +0000 (11:20 +0300)]
vxlan:offload RX flow

ip4 vxlan cli/api (using flow infra) to create flows and enable them on
different hardware (currently tested with i40e)

to offload a vxlan tunnel onto hw:
set flow-offload vxlan hw TwentyFiveGigabitEthernet3/0/0 rx vxlan_tunnel1

to remove offload:
set flow-offload vxlan hw TwentyFiveGigabitEthernet3/0/0 rx vxlan_tunnel1 del

TODO:ipv6 handling

Change-Id: I70e61f792ef8e3f007d03d7df70e97ea4725b101
Signed-off-by: Eyal Bari <ebari@cisco.com>
5 years agoavf: fix crash if device is busy 87/12987/4
Jakub Grajciar [Mon, 11 Jun 2018 10:22:46 +0000 (12:22 +0200)]
avf: fix crash if device is busy

Change-Id: I170d78c8e5f7e16a264c9f226a09693109aece5e
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
5 years agotcp: add close-wait state flags 96/12996/2
Florin Coras [Mon, 11 Jun 2018 20:15:11 +0000 (13:15 -0700)]
tcp: add close-wait state flags

Change-Id: I35508d5251633396393f52842d1b58bc1c1463f6
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agoMTU assigning to itself (Coverity) 00/13000/1
Ole Troan [Tue, 12 Jun 2018 09:39:15 +0000 (11:39 +0200)]
MTU assigning to itself (Coverity)

Change-Id: Iee8de25ab3c68ae3698c79852195dc336050914c
Signed-off-by: Ole Troan <ot@cisco.com>
5 years agovom: Add support for af-packet dump 65/12965/3
Mohsin Kazmi [Fri, 8 Jun 2018 14:57:33 +0000 (16:57 +0200)]
vom: Add support for af-packet dump

Change-Id: I0a1fc36ac29f6da70334ea3b5a5cf0e841faef76
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
5 years agotcp: cleanup connection/session fixes 31/12931/11
Florin Coras [Thu, 7 Jun 2018 00:55:02 +0000 (17:55 -0700)]
tcp: cleanup connection/session fixes

- Cleanup session state after last ack and avoid using a cleanup timer.
- Change session cleanup to free the session as opposed to waiting for
delete notify.
- When in close-wait, postpone sending the fin on close until all
outstanding data has been sent.
- Don't flush rx fifo unless in closed state

Change-Id: Ic2a4f0d5568b65c83f4b55b6c469a7b24b947f39
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agoudp: fix for multiple workers and add test 80/12980/4
Florin Coras [Sun, 10 Jun 2018 21:41:23 +0000 (14:41 -0700)]
udp: fix for multiple workers and add test

Since the main thread is not used for session polling anymore, when vpp
is started with multiple wokers, allocate connections on the first. Also
add a simple udp make test.

Change-Id: Id869f5d89e0fced51048f0384fa86a5022258b7c
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agoMTU: Software interface / Per-protocol MTU support 30/12930/6
Ole Troan [Thu, 7 Jun 2018 08:17:57 +0000 (10:17 +0200)]
MTU: Software interface / Per-protocol MTU support

This patch separates setting of hardware interfaec and software
interface MTU. Software MTU is L2 payload MTU (i.e. not including L2
header). Per-protocol MTU for IPv4, IPv6 and MPLS can also be set.
Currently only IP4, IP6 are enabled in adjacency / rewrite code.

Documentation in src/vnet/MTU.md

Change-Id: Iee2fd6f0bbc8210748dd8e073ab9fab87d323690
Signed-off-by: Ole Troan <ot@cisco.com>
5 years agoFix multiple NAT translation with interface address as external 64/12964/2
Alexander Chernavin [Fri, 8 Jun 2018 15:28:27 +0000 (11:28 -0400)]
Fix multiple NAT translation with interface address as external

Change-Id: Idd65c6d0489bf83984a2c34d22d3f94000fc7018
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
5 years agoIGMP: use simple u32 bit hash key 79/12979/1
Neale Ranns [Mon, 11 Jun 2018 01:01:49 +0000 (18:01 -0700)]
IGMP: use simple u32 bit hash key

some IGMP hashse use only a u32 key, which is not stored in the object, so don't use memory based hash

Change-Id: Iaa4eddf568ea0164bc2a812da4cc502f1811b93c
Signed-off-by: Neale Ranns <nranns@cisco.com>
5 years agocli: Disable XON/XOFF in the tty 77/12977/3
Chris Luke [Sun, 10 Jun 2018 17:42:45 +0000 (13:42 -0400)]
cli: Disable XON/XOFF in the tty

- CLI history forward-search is bound to ^S which is common, but
  that is also the tty's default control byte to pause output.
  So we disable XON/XOFF in the tty so that we can use ^S.

Change-Id: I61717c77a11733d64eed7f8119677e7cd2e20029
Signed-off-by: Chris Luke <chrisy@flirble.org>
5 years agocli: Fix reverse-line-wrap in terminals (VPP-1295) 69/12969/3
Chris Luke [Wed, 6 Jun 2018 03:50:19 +0000 (23:50 -0400)]
cli: Fix reverse-line-wrap in terminals (VPP-1295)

- Terminals do not reverse-line-wrap when the cursor is at the left
  edge and \b tries to make it go left.
- Instead, we have to track the cursor position if we need to emit \b's
  and if we are at the left edge emit an ANSI sequence to relocate
  the cursor. Previously we usually simply calculated the new cursor
  position after a bunch of output had completed.
- Further trickiness is required since most xterm-like terminals also
  defer moving the cursor to the next line when at the right edge[1], and
  then if they receive a \b move the cursor back one character too many.
- This requires intricate reworking of everywhere that \b is emitted
  by the CLI code during command line editing.

[1] Bash counters this issue by tracking the cursor position as output
  is generated and forcing the cursor to the next line (by emitting
  a space followed by \r) if it gets to this phantom cursor position);
  here we effectively do that but only if the user tries to go left
  when in this state.

Change-Id: I7c1d7c0e24c53111a5810cebb504ccfdac743086
Signed-off-by: Chris Luke <chrisy@flirble.org>
5 years agotcp: fix timer based recovery exit condition 75/12975/3
Florin Coras [Sat, 9 Jun 2018 13:49:59 +0000 (06:49 -0700)]
tcp: fix timer based recovery exit condition

Change-Id: I3f36e5760fd2935cc29d22601d4c0a1d2a22ba84
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agocli: Fix off-by-one in the pager 76/12976/2
Chris Luke [Sun, 10 Jun 2018 14:47:50 +0000 (10:47 -0400)]
cli: Fix off-by-one in the pager

- The last line in the pager buffer was sometimes missed when
  using space/pg-dn; simple off-by-one error.

Change-Id: Id4e5f7cf0e5db4f719f87b9069d75427bc66d3f7
Signed-off-by: Chris Luke <chrisy@flirble.org>
5 years agoDon't use foreach_vlib_main macro w/out barrier sync 74/12974/2
Dave Barach [Sat, 9 Jun 2018 18:49:00 +0000 (14:49 -0400)]
Don't use foreach_vlib_main macro w/out barrier sync

It should be OK to scrape dispatch stats without forcing a barrier
sync. Scrape the stats manually. We'll see what happens.

Change-Id: Ia20b51ea12ed81cce76e1801401bad0edd0645bb
Signed-off-by: Dave Barach <dave@barachs.net>
5 years agoadd script for virtual function create/show/remove 72/12972/3
Damjan Marion [Sat, 9 Jun 2018 13:11:52 +0000 (15:11 +0200)]
add script for virtual function create/show/remove

Change-Id: I151bc4269cb4d7e8572a6a676da20f69206d6c3f
Signed-off-by: Damjan Marion <damarion@cisco.com>
5 years agoFix bug in vlib_buffer_free_from_ring_no_next 73/12973/2
Damjan Marion [Sat, 9 Jun 2018 17:29:16 +0000 (19:29 +0200)]
Fix bug in vlib_buffer_free_from_ring_no_next

Change-Id: I332bb4578d1a3c79770985bf1f315d2ed823a3e5
Signed-off-by: Damjan Marion <damarion@cisco.com>
5 years agosession: cleanup queue node tracing 68/12968/3
Florin Coras [Fri, 8 Jun 2018 16:17:39 +0000 (09:17 -0700)]
session: cleanup queue node tracing

Change-Id: Ib8e332174d96bf9cfa4bbaaa5b8d8bc9958424b1
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agoavf: properly cofigure RSS LUT 70/12970/3
Damjan Marion [Sat, 9 Jun 2018 08:36:11 +0000 (10:36 +0200)]
avf: properly cofigure RSS LUT

Change-Id: I85cfab692ae0a72277ae561cdba7dcbc1f60aca3
Signed-off-by: Damjan Marion <damarion@cisco.com>
5 years agoavf: add support for intel X722 NICs 71/12971/1
Damjan Marion [Sat, 9 Jun 2018 13:10:09 +0000 (15:10 +0200)]
avf: add support for intel X722 NICs

Change-Id: I3e07070eed4948e813ad1490963c7f8ef7f4262e
Signed-off-by: Damjan Marion <damarion@cisco.com>
5 years agoTime range support for vppinfra 22/12922/6
Dave Barach [Wed, 6 Jun 2018 14:52:08 +0000 (10:52 -0400)]
Time range support for vppinfra

Change-Id: I2356b1e05fd868b46b4d26ade760900a5739ca4d
Signed-off-by: Dave Barach <dave@barachs.net>
5 years agoAdd reaper functions to want events APIs (VPP-1304) 82/12882/8
Neale Ranns [Tue, 5 Jun 2018 01:41:24 +0000 (18:41 -0700)]
Add reaper functions to want events APIs (VPP-1304)

Change-Id: Iaeb52d94cb6da63ee93af7c1cf2dade6046cba1d
Signed-off-by: Neale Ranns <nranns@cisco.com>
5 years agoImplement DHCPv6 PD client (VPP-718, VPP-1050) 38/12738/11
Juraj Sloboda [Fri, 25 May 2018 12:02:20 +0000 (14:02 +0200)]
Implement DHCPv6 PD client (VPP-718, VPP-1050)

Change-Id: I72a1ccdfdd5573335ef78fc01d5268934c73bd31
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
5 years agohttp server: do not close connections after reply 66/12966/2
Florin Coras [Fri, 8 Jun 2018 09:02:13 +0000 (02:02 -0700)]
http server: do not close connections after reply

Change-Id: I7add46258fe44bc4d23d805ffc7eae75e37cab82
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agoexport counters in a memfd segment 92/12892/3
Dave Barach [Fri, 1 Jun 2018 22:52:25 +0000 (18:52 -0400)]
export counters in a memfd segment

also export per-node error counters

directory entries implement object types

Change-Id: I8ce8e0a754e1be9de895c44ed9be6533b4ecef0f
Signed-off-by: Dave Barach <dave@barachs.net>
5 years agoGratuitous ARP packet handling 56/12956/3
Neale Ranns [Fri, 8 Jun 2018 01:09:49 +0000 (18:09 -0700)]
Gratuitous ARP packet handling

only learn from a GARP packet if it is an update to an existing entry.

Change-Id: I4c1b59cfedb911466e5e4c9756cf53a6676e1909
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
5 years agoAdding pad for reasm vnet_buffer reasm struct sothat adj_index is retained 54/12954/4
Vijayabhaskar Katamreddy [Thu, 7 Jun 2018 18:49:01 +0000 (11:49 -0700)]
Adding pad for reasm vnet_buffer reasm struct sothat adj_index is retained

Change-Id: Ib756c4f3e8caba1f77ef48b62a2a5d7283fe5016
Signed-off-by: Vijayabhaskar Katamreddy <vkatamre@cisco.com>
5 years agoLB: reply message id and table length are wrong. 33/12933/4
Hongjun Ni [Thu, 7 Jun 2018 18:20:31 +0000 (02:20 +0800)]
LB: reply message id and table length are wrong.

Change-Id: Iea2c661cb3e0728bb2d10b06791ed84fed00f6a7
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
5 years agoFix IP scan neighbor API/CLI handling of interval and stale 45/12945/2
John Lo [Thu, 7 Jun 2018 16:00:43 +0000 (12:00 -0400)]
Fix IP scan neighbor API/CLI handling of interval and stale

Change-Id: I77264c4398e6fad461bb4dc10867a1f9c3accec0
Signed-off-by: John Lo <loj@cisco.com>
5 years agodpdk: fix interface naming issue 46/12946/3
Damjan Marion [Thu, 7 Jun 2018 16:16:35 +0000 (18:16 +0200)]
dpdk: fix interface naming issue

... introduced with dpdk 18.05 support patch

Change-Id: Idf2283888f81d7652599651c0d65476e451f9343
Signed-off-by: Damjan Marion <damarion@cisco.com>
5 years agoRevert "Allow arp-input node to learn IPv4 neighbors from GARP packets" 52/12952/2
John Lo [Thu, 7 Jun 2018 16:46:24 +0000 (16:46 +0000)]
Revert "Allow arp-input node to learn IPv4 neighbors from GARP packets"

This reverts commit d018870d1b02109fc8b328446f15312fdd2fcd11.

Change-Id: I700ade7a25ae5ed72cfed586e50b02492a4f11de
Signed-off-by: John Lo <loj@cisco.com>
5 years agodpdk: failsafe PMD initialization code 49/12549/4
Rui Cai [Fri, 11 May 2018 23:38:41 +0000 (23:38 +0000)]
dpdk: failsafe PMD initialization code

Added code to initialize failsafe PMD

This is part of initial effort to enable vpp running over
dpdk on failsafe PMD in Microsoft Azure(4/4).

Change-Id: Ia2469c7087ca4b5c7881dfb11ec5c4fcebaa1d04
Signed-off-by: Rui Cai <rucai@microsoft.com>