Commit Graph

10100 Commits

Author SHA1 Message Date
Jakub Grajciar 47e68de222 libmemif: set next free buffer
Adds memif_set_next_free_buffer - set internal pointer
to next free descriptor for any tx queue.

Type: feature

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: Ia24345a886a52c25c1723c6dbce023f2aed4a42c
2021-02-05 16:20:37 +00:00
Ole Troan 18327be5d4 nat: 1:1 policy NAT
A NAT sub-plugin doing statically configured match/rewrite on IP4 input or output.
It's stateless (no connection tracking).
Currently it supports rewriting of SA, DA and TCP/UDP ports.
It should be simple to add new rewrites if required.

API:
pnat_binding_add, pnat_binding_del, pnat_bindings_get, pnat_interfaces_get

CLI:
set pnat translation interface <name> match <5-tuple> rewrite <5-tuple> {in|out} [del]
show pnat translations
show pnat interfaces

Trying a new C based unit testing scheme. Where the graph node is tested
in isolation. See pnat/pnat_test.c.
Also added new cmake targets to generate coverage directly.
E.g.:
make test_pnat-ccov-report

File '/vpp/sdnat/src/plugins/nat/pnat/pnat.c':
Name                               Regions    Miss   Cover     Lines    Miss   Cover
------------------------------------------------------------------------------------
pnat_interface_by_sw_if_index           39       8  79.49%        13       0 100.00%
pnat_instructions_from_mask              9       0 100.00%        13       0 100.00%
pnat_binding_add                        64       8  87.50%        31       2  93.55%
pnat_flow_lookup                         4       4   0.00%        10      10   0.00%
pnat_binding_attach                    104      75  27.88%        33       6  81.82%
pnat_binding_detach                     30       5  83.33%        23       2  91.30%
pnat_binding_del                        97      33  65.98%        17       3  82.35%
pnat.c:pnat_calc_key_from_5tuple         9       1  88.89%        14       1  92.86%
pnat.c:pnat_interface_check_mask        10       2  80.00%        11       2  81.82%
pnat.c:pnat_enable                       5       0 100.00%        11       0 100.00%
pnat.c:pnat_enable_interface           107      26  75.70%        60      15  75.00%
pnat.c:pnat_disable_interface           91      30  67.03%        32       7  78.12%
pnat.c:pnat_disable                      7       2  71.43%        13       7  46.15%
------------------------------------------------------------------------------------
TOTAL                                  576     194  66.32%       281      55  80.43%

File '/vpp/sdnat/src/plugins/nat/pnat/pnat_node.h':
Name                               Regions    Miss   Cover     Lines    Miss   Cover
------------------------------------------------------------------------------------
pnat_test.c:pnat_node_inline            67      11  83.58%       115       1  99.13%
pnat_test.c:pnat_calc_key                9       2  77.78%        14       2  85.71%
pnat_test.c:pnat_rewrite_ip4            55      11  80.00%        60      12  80.00%
pnat_test.c:format_pnat_trace            1       1   0.00%        12      12   0.00%
pnat_node.c:pnat_node_inline            63      63   0.00%       115     115   0.00%
pnat_node.c:pnat_calc_key                9       9   0.00%        14      14   0.00%
pnat_node.c:pnat_rewrite_ip4            55      55   0.00%        60      60   0.00%
pnat_node.c:format_pnat_trace            5       5   0.00%        12      12   0.00%
------------------------------------------------------------------------------------
TOTAL                                  264     157  40.53%       402     228  43.28%

Type: feature
Change-Id: I9c897f833603054a8303e7369ebff6512517c9e0
Signed-off-by: Ole Troan <ot@cisco.com>
2021-02-05 13:27:48 +00:00
Benoît Ganne 490b92738f ipsec: add support for AES CTR
Type: feature

Change-Id: I9f7742cb12ce30592b0b022c314b71c81fa7223a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-02-05 12:52:07 +00:00
Filip Tehlar b8ce5b784c ikev2: fix bad ip in logs
Type: fix

Change-Id: Icd01491043e9fd1bb8f51f4f55e1252fd78512de
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2021-02-05 12:17:03 +00:00
Neale Ranns 6a999d67d6 interface: RX/TX direction type in API
Type: feature

Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Change-Id: I982205b48615395f19cbb36c73854fb5c3db45e8
2021-02-05 12:00:56 +00:00
Paul Vinciguerra adcc0b3596 papi: remove unused name from __all__
missed in https://gerrit.fd.io/r/c/vpp/+/30238

Type: fix

Change-Id: I342868a77d7ca87896d97847ca6525ad1abcd1b6
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2021-02-05 11:59:06 +00:00
Elias Rudberg e345ee5cb9 nat: configurable handoff frame queue size
Make number of worker handoff frame queue elements configurable as
a set nat frame-queue-nelts command. The default value is 64 which
is the same value that was previously hard-coded. The idea is that
allowing larger values can be useful in some cases, to avoid
congestion drops. Also add nat_set_fq_options API support and a
corresponding test case.

Type: improvement

Change-Id: I5c321eb2d7997f76fac2703d9c4a5b2516375db3
Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
2021-02-05 11:54:14 +00:00
Artem Glazychev 839dcc0fb7 vxlan: add udp-port configuration support
Type: improvement

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: Ie30d51ab4df5599b52f7335f863b930cd69dbdc1
2021-02-05 11:53:38 +00:00
Tetsuya Murakami 6b354914c2 sr: Fix the issue that L3VPN SRv6 encapsulated packets could not be forwarded.
Type: fix

Signed-off-by: Tetsuya Murakami <tetsuya.mrk@gmail.com>
Change-Id: Ia12feee9e46d4951519d5c6f9d1a21d89701dc0f
Signed-off-by: Tetsuya Murakami <tetsuya.mrk@gmail.com>
2021-02-05 11:50:44 +00:00
Filip Tehlar d28196f007 tests: ikev2: non-default table id test
Test whether responder sends info requests using correct ip table

Type: test

Change-Id: I9e97576f9d80686961f92de3cbc3e6f8d6341587
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2021-02-05 08:43:58 +00:00
Neale Ranns 066212702b mpls: MPLS Hash fixes
Type: fix

MPLS hash includes the IP hash at the bottom of the stack. Default this
to the IP default and use the value passed in to the compute function.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I3f8cb0f7c4fe98ea903a752c2b5fd3d7e26d449a
2021-02-04 19:35:05 +00:00
Filip Tehlar bdd14fc2a3 ikev2: add hint to the log when IDs do not match
Type: improvement
Ticket: VPP-1908

Change-Id: I1d86ea18fcb6174b86c449d5d9403fd0e5715318
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2021-02-04 18:12:13 +00:00
Filip Tehlar a0951d4b3b ikev2: fix msgid
Type: fix

In responder initialize msgid in requests to 1 as the previous value (0) was
causing retransmision on the initiator.

Change-Id: I8f5b84331ecac5943129f4c9a377076768fec455
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2021-02-04 18:05:47 +00:00
Benoît Ganne fe7ff320b6 crypto-ipsecmb: add support for AES CTR
Type: feature

Change-Id: Ide2901f5d2111a518b2c8212aa84468cef1d72ca
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-02-04 16:03:53 +00:00
Florin Coras b4d9c5dedb vppinfra: fix mem map mt issue due to snprintf
Type: fix

Apparently snprintf is not thread safe!?

Thread 6 "vpp_wk_3" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffeed1a3700 (LWP 819375)]
0x00007ffff58fc2b4 in __GI__IO_default_xsputn (n=<optimized out>,
data=<optimized out>, f=<optimized out>) at genops.c:394
394     genops.c: No such file or directory.
(gdb) bt
0  0x00007ffff58fc2b4 in __GI__IO_default_xsputn (n=<optimized out>,
data=<optimized out>, f=<optimized out>) at genops.c:394
1  __GI__IO_default_xsputn (f=0x7ffeec35e050, data=<optimized out>,
n=9) at genops.c:370
2  0x00007ffff58e127c in __vfprintf_internal (s=s@entry=0x7ffeec35e050,
format=format@entry=0x7ffff5f833ce "%s",
    ap=ap@entry=0x7ffeec35e1d0, mode_flags=mode_flags@entry=2) at
../libio/libioP.h:948
3  0x00007ffff58f611a in __vsnprintf_internal (string=0x7ffed57ed018
"", maxlen=<optimized out>, format=0x7ffff5f833ce "%s",
    args=args@entry=0x7ffeec35e1d0, mode_flags=2) at vsnprintf.c:114
4  0x00007ffff5997fd1 in ___snprintf_chk (s=<optimized out>,
maxlen=<optimized out>, flag=<optimized out>, slen=<optimized out>,
    format=<optimized out>) at snprintf_chk.c:38
5  0x00007ffff5f7fd74 in clib_mem_vm_map_internal (base=<optimized
out>, log2_page_sz=<optimized out>, size=<optimized out>,
    fd=<optimized out>, offset=<optimized out>, name=0x0) at
/scratch/fcoras/vpp/src/vppinfra/linux/mem.c:502

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I8ff7cfed422273dbdc55068772e11f5e550a9b60
2021-02-04 15:10:01 +00:00
Damjan Marion 34c6c309d5 vlib: "revert startup multi-arch variant configuration fix for interfaces"
Type: fix

This reverts commit 5a48b3b9d8.

Change-Id: Ifa91b18bdbbc32bb729abc09d95637d9cdf42c3b
Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2021-02-04 14:46:55 +00:00
Klement Sekera 6b3f1c0a9c nat: reduce number of hash tables for EI NAT
Making code more simple and storing thread index along with session
index as a preparation step for fixing thread safety patches.

Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Ib0c531e9f1f64b1f1ee912d4a83279200638e931
2021-02-04 14:35:43 +00:00
Neale Ranns 92e9caea3b api: Fold the empty pool check into the main macro
Type: improvement

the empty pool chekc is always required, so make it alwayd happen.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I3879e752036a7dd49fff7e16dc6d9ea02563aa7a
2021-02-04 14:25:52 +00:00
Neale Ranns 44db1caefb linux-cp: Linux Interface Mirroring for Control Plane Integration
Type: feature

please see FEATURE.yaml for details.

Signed-off-by: Neale Ranns <nranns@cisco.com>
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Signed-off-by: Jon Loeliger <jdl@netgate.com>
Signed-off-by: Pim van Pelt <pim@ipng.nl>
Change-Id: I04a45c15c0838906aa787e06660fa29f39f755fa
2021-02-04 14:16:34 +00:00
Neale Ranns 1a52d37fc5 ipsec: one thread index per-SA
Type: improvement

AN SA is uni-drectional therefore it can be used only for encrypt or
decrypt, not both. So it only needs one thread ID. free up some space on
the 1st cacheline.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I21cb7cff70a763cbe2bffead860b574bc80b3136
2021-02-04 11:33:32 +00:00
Miklos Tirpak 38fae31084 vlib: increase the stats epoch only when necessary
When the counter vectors are validated and they are already long enough
to fit the given index in memory, there is no need to increase the stats
segment epoch. In this case, the counter vectors do not change as a
result of the validation.

This optimization is necessary for the case when the configuration is
changed at multiple thousands per second rate. The counter vectors grow
at the beginning and their size stabilizes after a while. Without this
improvement, it can still take several seconds for a stats reader to
succeed.

Type: improvement
Signed-off-by: Miklos Tirpak <miklos.tirpak@gmail.com>
Change-Id: I5a6c30255832716a1460018d0bd0f63031de102b
2021-02-04 09:56:54 +00:00
Ray Kinsella 15cb3dac87 vxlan: fix interface naming
Previous commit broke naming of vxlan interfaces.

Type:fix
Fixes:a4b0541f6

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I5e304821be73547b4e47c35ad9632283f153830f
2021-02-03 17:28:52 +00:00
Neale Ranns 9302cfea9d vppapigen: Support an 'autoendian' keyword for message definitions in
.api files

Type: feature

Make the auto-endian nature explicit, rather than hidden in the x_api.c
file.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ibe647117ceeaf6f99a38a96576a5a41a3cbb1615
2021-02-03 15:09:50 +00:00
Paul Vinciguerra 6d467b3ad5 vppapigen: fix enum types
enums can return signed or unsigned integers
enumflags are unsigned integers

Type: fix

Change-Id: Iafc8f8f09c96679c5983d2cb807699fcf90ca0d7
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2021-02-03 07:43:35 +00:00
Brian Russell e988726cbf tests: verify policer stats in punt tests
Add verification of policer stats in the IP[46] punt paths.

Type: test
Signed-off-by: Brian Russell <brian@graphiant.com>
Change-Id: I8b1035afc2d3abe4e98bdb3a76e87a0dd131ef4b
2021-02-02 15:05:44 +00:00
Brian Russell a71ed7869f policer: add counters
Add counters to the policer against each of the 3 possible results:
conform, exceed and violate.

Type: improvement
Signed-off-by: Brian Russell <brian@graphiant.com>
Change-Id: Ia98a2f5655df6873259197d6bbf0ff2709b7d60e
2021-02-02 14:58:07 +00:00
Florin Coras bad1d35d7d vcl: remove verbose output from vcl iperf tests
For high throughput tests the amount of debug output can be
considerable.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Icc9f2092918ebca432502af960da11b154818a02
2021-02-01 19:57:49 +00:00
Mathias Raoul 33a4649733 quic: clean setup_cipher function
Type: fix

Change-Id: I02e473440a8732ddfb1a13ad6552779adaa67f60
Signed-off-by: Mathias Raoul <mathias.raoul@gmail.com>
2021-02-01 19:40:06 +00:00
Vratko Polak fc116e9ff7 misc: remove duplicated gbp entry in maintainers
Type: style

Change-Id: Iba79915b78daf6eec6affa4efce66d3670d3f3c0
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2021-02-01 18:58:53 +00:00
Vratko Polak f79908d817 misc: mark vnet and plugin in maintainers
Type: style

Change-Id: Ibbc33d92e3663aea0b33a2f961a9ceebc975b51c
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2021-02-01 18:38:25 +00:00
Vratko Polak 4199df2b7d misc: use tab as separator in maintainers file
Type: style

Change-Id: I9bf61b0b9fd35941fda52c0eef99c7c95db9cba8
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2021-02-01 18:38:25 +00:00
Paul Atkins 2ac41357bc vppinfra: add defines for bihash add and delete
When calling the bihash_add_del... functions some callers add a comment
beside the value to indicate this is the is_add param. Make the code
easier to read by adding defines for add and delete that the callers
can use instead of having to use 0 or 1.

Type: improvement
Signed-off-by: Paul Atkins <patkins@graphiant.com>
Change-Id: Iab5f7c8e8df12ac62fc7e726ca1798622dcdb42c
2021-02-01 17:20:32 +00:00
Neale Ranns 21ed5e8ade misc: Volunteer as maintainer for the policer
Type: improvement

I volunteer myself as maintainer of the policer code.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ia843f031372cf2ca834e884ed2ba4774bf7fcd21
2021-02-01 16:37:06 +00:00
Neale Ranns 31687f73c8 misc: Remove duplicate "classify" entry in MAINTAINER list
Type: fix

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I5466838353f3286941333f752f9ef6d336db0de4
2021-02-01 16:35:15 +00:00
Andrew Yourtchenko 3e72083b45 docs: fix up the markdown
Type: docs
Change-Id: Ia541839e1f1ceddfae4579dece43b9cc820702e2
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit de569048a5)
2021-02-01 15:34:39 +00:00
Andrew Yourtchenko a98d99ab3f misc: 21.01 Release Notes
Change-Id: I8fa48e631b9405f2882ea975927c42dbbd32cf1f
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Type: docs
(cherry picked from commit 3d2d96e554)
2021-02-01 15:34:02 +00:00
Neale Ranns 5f837b7592 misc: Update my email address in MAINTAINERS
Type: fix

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I87cc517535f8d8dd5bf786bb8e00863b004df808
2021-02-01 12:30:27 +00:00
Neale Ranns 1c59df770b fib: Changes to interpose source
Type: improvement

1) stack the interpose on any path-extensions (e.g. labels) from the
next best source
2) allow more than 1 source to contribute a DPO for a given prefix

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Idc2fbb36cfbd2387081765d8af0f1fbe61612160
2021-02-01 11:59:42 +00:00
Mohsin Kazmi 4b56340aac tap: fix the interrupt handling
Type: fix

Interrupt are suppressed from kernel on tx path.

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I9f39f343b7e16bad09910766adf0b09654721f67
2021-02-01 11:05:41 +00:00
Benoît Ganne 64177a3ed8 interface: fix interface name overflow in logs
hi->name is a non-NULL-terminated vector.

Type: fix

Change-Id: I1a9f128f24f137b43cb47169677cc4288043fbd7
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-01-29 16:33:35 +00:00
Steven Luong 150bf5ac6b misc: fix a trunccation on vhost dump
feature is u64. We need to print it with %llx and enough precision to
avoid truncation

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I9f5dd523400473b4881b01b8e6cecf439a8060d9
2021-01-29 14:22:38 +00:00
Kommula Shiva Shankar ced43e28ed vlib: acquire barrier before exit call
Type: fix

A plugin exit callback function registered via
VLIB_MAIN_LOOP_EXIT_FUNCTION() is called without stopping worker cores
doing data path processing. Following error is observed while exiting
vpp.

error log:
vppctl# q
0: /vpp_master/src/vnet/interface.c:1058 (vnet_delete_hw_interface) assertion `ii == 0 || this_vlib_main->parked_at_barrier == 1' fails

This patch calls all exit() functions after acquiring barrier

Signed-off-by: Kommula Shiva Shankar <kshankar@marvell.com>
Reviewed-by: Nitin Saxena <nsaxena@marvell.com>
Change-Id: I2fd565f0afaa62cb0fb0389922f49e4d382f028c
2021-01-29 12:51:10 +00:00
Florin Coras 6a6555ac34 vcl: support set/get vrf attribute
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I011faa52939d44bdc90de69ad381dc1eea8c8eb3
2021-01-28 11:39:57 -08:00
Florin Coras 096a1d599c vcl: fix select want deq ntf for ct sessions
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I2d008a12da6c6e68ad8955a638b44d09e4febd8d
2021-01-28 15:57:45 +00:00
Florin Coras 80b742592b svm vcl: add helper fn that discovers mqs in segment
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I1b083ee793a7cf91b1001bfe88353fa5e6515c42
2021-01-28 15:57:33 +00:00
Florin Coras b13ba133fb vcl: honor time wait in eventfd epoll wait
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4bfdeb4bfbdcf333cfd4047a80edd04e35a371fc
2021-01-28 15:57:21 +00:00
Nathan Skrzypczak 0c1792e983 cnat: Fix session with deleted tr
Type: fix

When a translation gets deleted, hiting a
session pointing to it sefaults. We're better
off directly storing the next node index.

Change-Id: I4f0716d775202b4ecf54d6cdb827bbeebd23056c
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-01-28 13:35:49 +00:00
Nathan Skrzypczak 208891c093 cnat: Fix throttle hash & cleanup
Type: fix

This fixes two issues :
- We used a hash to throttle RPC for adding fib entries,
but as we rely on a refcount, we cannot accept loosing an
entry, which could happen in case of a collision.
- On client cleanup we weren't freeing the fib entry correctly
which resulted in crashes when recreating an entry.
Added a test that ensures proper cleanup

Change-Id: Ie6660b0b02241f75092737410ae2299f8710d6b9
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-01-28 13:34:15 +00:00
Brian Russell 5214f3a2c8 tests: add ip6 punt policer handoff test
Add a test for ip6 punt policer thread handoff. A child class is
created that uses common punt test setup but is configured to have 2
worker threads.

Type: test
Signed-off-by: Brian Russell <brian@graphiant.com>
Change-Id: I65c44f5d79455129accd7cf405c15920a5a9b678
2021-01-28 10:28:00 +00:00
Brian Russell a1f360647f tests: move ip6 punt setup to its own class
Move interface and packet setup for the ip6 punt test to its own
class so that child classes can be created that use it.

Type: test
Signed-off-by: Brian Russell <brian@graphiant.com>
Change-Id: I14acedc1bcd12cb320835a36833cd32303c5f793
2021-01-28 10:27:52 +00:00