vpp.git
3 years agoip: Path MTU 35/30535/25
Neale Ranns [Mon, 21 Dec 2020 08:29:34 +0000 (08:29 +0000)]
ip: Path MTU

Type: feature

Support setting the MTU for a peer on an interface. The minimum value of
the path and interface MTU is used at forwarding time.

the path MTU is specified for a given peer, by address and table-ID.
In the forwarding plane the MTU is enfored either:
 1 - if the peer is attached, then the MTU is set on the peer's
adjacency
 2 - if the peer is not attached, it is remote, then a DPO is added to
the peer's FIB entry to perform the necessary fragmentation.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I8b9ea6a07868b50e97e2561f18d9335407dea7ae

3 years agopolicer: improve policer struct 85/31285/3
Brian Russell [Mon, 15 Feb 2021 11:49:42 +0000 (11:49 +0000)]
policer: improve policer struct

Ensure policer struct is cache aligned and fits in one cache line.
Give it a simpler name to reflect its job as the representation of
a policer.

Type: improvement
Signed-off-by: Brian Russell <brian@graphiant.com>
Change-Id: If1ae4931c818b86eee20306e503f4e5d6b84bd0d

3 years agovppinfra: fix memcpy undefined behaviour 40/31240/4
Benoît Ganne [Thu, 11 Feb 2021 18:46:43 +0000 (19:46 +0100)]
vppinfra: fix memcpy undefined behaviour

Calling mem{cpy,move} with NULL pointers results in undefined behaviour.
This in turns is exploited by GCC. For example, the sequence:
    memcpy (dst, src, n);
    if (!src)
      return;
    src[0] = 0xcafe;
will be optimized as
    memcpy (dst, src, n);
    src[0] = 0xcafe;
IOW the test for NULL is gone.

vec_*() functions sometime call memcpy with NULL pointers and 0 length,
triggering this optimization. For example, the sequence:
    vec_append(v1, v2);
    len = vec_len(v2);
will crash if v2 is NULL, because the test for NULL pointer in vec_len()
has been optimized out.

This commit fixes occurrences of such undefined behaviour, and also
introduces a memcpy wrapper to catch those in debug mode.

Type: fix

Change-Id: I175e2dd726a883f97cf7de3b15f66d4b237ddefd
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agoquic: Coverity fix 79/31279/2
Nathan Skrzypczak [Mon, 15 Feb 2021 08:35:59 +0000 (09:35 +0100)]
quic: Coverity fix

Type: fix

Change-Id: I744cedb9c1b57945af5e83057e4759964fd2e104
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
3 years agoikev2: fix rekey against strongSwan 26/31226/5
Filip Tehlar [Mon, 8 Feb 2021 07:06:34 +0000 (07:06 +0000)]
ikev2: fix rekey against strongSwan

When strongSwan rekeys it sends create child sa request first and then
delete request for the old child sa (or vice versa depending on
configuration) as opposed to sending just a single create child sa with
rekey notify message.

Type: fix

Change-Id: I1fa55a607ca623cd3a6d887436207153c6f6bbf6
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
3 years agotests: test punt policer bound to worker thread 22/31222/4
Brian Russell [Wed, 10 Feb 2021 13:56:06 +0000 (13:56 +0000)]
tests: test punt policer bound to worker thread

Add to the IP[46] punt policer handoff tests by binding the policer to
a particular worker and checking all packets are policed on that thread.

Type: test
Signed-off-by: Brian Russell <brian@graphiant.com>
Change-Id: I7fab28659ccb65f13f841cec65a3f808281b3f90

3 years agopolicer: add api to bind policer to worker 21/31221/3
Brian Russell [Wed, 10 Feb 2021 13:53:42 +0000 (13:53 +0000)]
policer: add api to bind policer to worker

Add a new api to allow a policer to be bound to
a specific worker thread for thread handoff.

Type: improvement
Signed-off-by: Brian Russell <brian@graphiant.com>
Change-Id: I2623a6827843c3d93c0d7b4ad7c2e13611ec1696

3 years agointerface: Add promisc on/off in api 18/31118/3
Nathan Skrzypczak [Thu, 4 Feb 2021 15:11:18 +0000 (16:11 +0100)]
interface: Add promisc on/off in api

Type: feature

Change-Id: Ib777a5201f1c728438c7a5f2b1aa2246f1344b9b
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
3 years agofib: Always honour flow hash flag 66/31166/4
Neale Ranns [Mon, 8 Feb 2021 15:24:56 +0000 (15:24 +0000)]
fib: Always honour flow hash flag

Type: fix

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Id7b27edf3712aaa3c277e752b9ca78bb91d184a1

3 years agovppapigen: py2 cleanup - remove subclassing of object 86/30286/4
Paul Vinciguerra [Fri, 4 Dec 2020 20:01:53 +0000 (15:01 -0500)]
vppapigen: py2 cleanup - remove subclassing of object

Type: refactor

Change-Id: I7136cb8ba101ea3917dacc31ceb3a76a31328301
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
3 years agotests: explicitly close subprocess files 53/30453/3
Paul Vinciguerra [Thu, 17 Dec 2020 02:03:16 +0000 (21:03 -0500)]
tests: explicitly close subprocess files

Resolve the following error:
/vpp/test/framework.py:657: ResourceWarning: unclosed file <_io.BufferedReader name=6>
  del cls.vpp
Object allocated at (most recent call last):
  File "/usr/lib/python3.8/subprocess.py", lineno 844
    self.stdout = io.open(c2pread, 'rb', bufsize)

Type: test

Change-Id: Ia2974da594f0582dcff1f4bdf40d25475769c46c
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
3 years agordma: rdma_log__ argument dev is a pointer 43/31243/5
Vratko Polak [Fri, 12 Feb 2021 16:55:38 +0000 (17:55 +0100)]
rdma: rdma_log__ argument dev is a pointer

Also apply style edits as proprosed by checkstyle.

Ticket: VPP-1971
Type: fix

Change-Id: I4332a4e32220f3076b4a373da01cc0022cde32f5
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
3 years agonat: pnat only use save_rewrite_length on output path 15/31215/2
Ole Troan [Wed, 10 Feb 2021 15:20:26 +0000 (16:20 +0100)]
nat: pnat only use save_rewrite_length on output path

Don't expect save_rewrite_length to be set correctly on RX path.

Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Ieee40d119213f617c3d836181e5879f084b74548
Signed-off-by: Ole Troan <ot@cisco.com>
3 years agoipsec: Store thread-index in buffer meta-data during SA handoff 07/31207/5
Neale Ranns [Wed, 10 Feb 2021 08:42:49 +0000 (08:42 +0000)]
ipsec: Store thread-index in buffer meta-data during SA handoff

Type: improvement

negates the need to load the SA in the handoff node.
don't prefetch the packet data, it's not needed.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I340472dc437f050cc1c3c11dfeb47ab09c609624

3 years agodpdk: use whole vmbus address as hash key for devconf 96/30996/5
Vladimir Ratnikov [Thu, 28 Jan 2021 16:08:35 +0000 (11:08 -0500)]
dpdk: use whole vmbus address as hash key for devconf

u32[0] is not enough unique for some platforms like azure
where several devices(not only network) can have almost
the same addresses and this can cause collisions.

Change hash to mhash type for vmbus devices with key
of whole 16 bytes of vmbus address.

Type: improvement

Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com>
Change-Id: Ic6c6a657ae29f45beddd0c69d8e785e702349460

3 years agopolicer: tidy up 47/31247/3
Brian Russell [Wed, 10 Feb 2021 18:34:48 +0000 (18:34 +0000)]
policer: tidy up

Convert old logging style to new and remove unused tracepoints.
Remove code always conditionally not compiled.
Make comment style consistent.

Type: improvement
Change-Id: I13339f28539cf190fb92be2d5c8020b6249319c8
Signed-off-by: Brian Russell <brian@graphiant.com>
3 years agopolicer: use enum types 20/31220/8
Brian Russell [Tue, 9 Feb 2021 11:36:31 +0000 (11:36 +0000)]
policer: use enum types

Make the policer action enum packed and use it in the policer code.
Use other policer enums where applicable.

Type: improvement
Signed-off-by: Brian Russell <brian@graphiant.com>
Change-Id: I32f9735942af8bca3160b9ef8a75f605d9aba5fa

3 years agodocs: fixing VPP tutorial 32/31232/3
Arthur de Kerhor [Thu, 11 Feb 2021 11:02:44 +0000 (03:02 -0800)]
docs: fixing VPP tutorial

Updating ARP table command.

Type: fix

Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com>
Change-Id: I02d6ac86aed4c83430f9d07bdeaa3e0f5c3ae73f

3 years agopolicer: remove SSE2 prefix 19/31219/3
Brian Russell [Tue, 9 Feb 2021 10:16:58 +0000 (10:16 +0000)]
policer: remove SSE2 prefix

The policer code uses a naming convention of prefixing a lot of
its definitions with "SSE2" when in fact there is nothing SSE2
specific about them. This is confusing so remove the prefix.

Unfortunately it has to stay in the API definitions for backward
compatibility.

Type: improvement
Signed-off-by: Brian Russell <brian@graphiant.com>
Change-Id: I59a7df9fd5ded2575f2e587b2768a025a213b07c

3 years agovppapigen: coverity issues in autogenerated code pass 3. 45/31245/2
Ole Troan [Fri, 12 Feb 2021 10:48:12 +0000 (11:48 +0100)]
vppapigen: coverity issues in autogenerated code pass 3.

Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I5ee2e8aba3ee7281bbca11825dece79983e52f06

3 years agobuild: add missing virtualenv dependencies for debian-10 44/31244/1
Andrew Yourtchenko [Fri, 12 Feb 2021 11:06:30 +0000 (11:06 +0000)]
build: add missing virtualenv dependencies for debian-10

Type: make
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I57a1f90d7fe9e1262f210d0c091bafda5d496c69

3 years agovppapigen: fix fromjson coverity errors in generation 30/31230/3
Ole Troan [Thu, 11 Feb 2021 10:13:46 +0000 (11:13 +0100)]
vppapigen: fix fromjson coverity errors in generation

Fix memory leak coverity errors where free was not called
on error conditions. Or called twice.

Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I21cffa8b01e4f72f10501f202f6a762ae300a941
Signed-off-by: Ole Troan <ot@cisco.com>
3 years agovppinfra: fix membulk coverity warnings 02/31202/4
Florin Coras [Tue, 9 Feb 2021 18:03:50 +0000 (10:03 -0800)]
vppinfra: fix membulk coverity warnings

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4830656ad852de62211e31574a0e0afb62d00f37

3 years agotests: tag the tests that do not work with multi-worker configuration 23/31023/20
Andrew Yourtchenko [Fri, 29 Jan 2021 13:17:19 +0000 (13:17 +0000)]
tests: tag the tests that do not work with multi-worker configuration

If the multi-worker default VPP configuration is triggered by
setting VPP_WORKER_CONFIG="workers 2", some of the tests fail
for various reasons.

It's a substantial number, so this change marks all of the
testsets that have this issue, such that they can be addressed
later independently.

Type: test
Change-Id: I4f77196499edef3300afe7eabef9cbff91f794d3
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
3 years agowireguard: testing alternative timer dispatch 95/30695/3
Mohammed Hawari [Tue, 12 Jan 2021 16:00:21 +0000 (17:00 +0100)]
wireguard: testing alternative timer dispatch

Change-Id: I645bb0a31b333a6160c74987dddb3fb50ff154d8
Type: improvement
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
3 years agopolicer: use ip dscp 18/31218/2
Brian Russell [Mon, 8 Feb 2021 15:33:18 +0000 (15:33 +0000)]
policer: use ip dscp

Use the common IP definitions of DSCP rather than duplicating in the
policer code.

Type: improvement
Signed-off-by: Brian Russell <brian@graphiant.com>
Change-Id: Iff4bc789356edc290b9c31eca33e93cf5b6211bf

3 years agovcl: validate seg handle on migrate only if needed 25/31225/2
Florin Coras [Wed, 10 Feb 2021 23:26:37 +0000 (15:26 -0800)]
vcl: validate seg handle on migrate only if needed

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3c15a465f84f2ceb6bd5f1c459899824d4bc1c90

3 years agotests: add policer tests 96/31196/2
Brian Russell [Thu, 4 Feb 2021 17:53:23 +0000 (17:53 +0000)]
tests: add policer tests

Add some tests which configure policer params, use the policer
test helper CLI to police pretend packets and then check the
policer stats.

Type: test
Signed-off-by: Brian Russell <brian@graphiant.com>
Change-Id: Ib2688b6f77d84a4bfd3c8185e44c59fa2300716a

3 years agotests: add policer test helper 75/31175/2
Brian Russell [Thu, 4 Feb 2021 17:23:44 +0000 (17:23 +0000)]
tests: add policer test helper

Add a helper CLI to exercise a policer pre-configured by the test
harness. The test harness will check the stats afterwards.

Type: test
Signed-off-by: Brian Russell <brian@graphiant.com>
Change-Id: I913dda4a9f8179c1c6b3061a68164bf1e698a392

3 years agovppinfra: fix bihash test-debug aarch64 sporadic failure 12/31212/2
Dave Barach [Wed, 10 Feb 2021 12:40:05 +0000 (07:40 -0500)]
vppinfra: fix bihash test-debug aarch64 sporadic failure

Turns out that both the multi-core and single-core add / del tests run
for just under 5 seconds (aarch64, debug image). Increase the vapi =>
debug CLI timeout to avoid spurious failures.

Type: test

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ia64bffa82a908172a21c34f3ae4402ad774af28a

3 years agoipsec: Use the new tunnel API types to add flow label and TTL copy 97/31197/4
Neale Ranns [Tue, 9 Feb 2021 14:04:02 +0000 (14:04 +0000)]
ipsec: Use the new tunnel API types to add flow label and TTL copy
support

Type: feature

attmpet 2. this includes changes in ah_encrypt that don't use
uninitialised memory when doing tunnel mode fixups.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ie3cb776f5c415c93b8a5ee22f22586fd0181110d

3 years agonat: fix EI hairpinning thread safety 74/31174/4
Klement Sekera [Tue, 2 Feb 2021 12:25:40 +0000 (13:25 +0100)]
nat: fix EI hairpinning thread safety

Avoid doing inter-thread reads without locks by doing a handoff before
destination address rewrite. Destination address is read from a session
which is possibly owned by a different thread. By splitting the work in
two parts with a handoff in the middle, we can do both in a thread safe
way.

Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I1c50d188393a610f5564fa230c75771a8065f273

3 years agomisc: updating maintainers file 10/31210/1
Ole Troan [Wed, 10 Feb 2021 11:03:25 +0000 (12:03 +0100)]
misc: updating maintainers file

Adding maintainers for stn, ioam, cdp.

Type: improvement
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I0f75bb0044b340ee17a1720a7eea1c840625276b

3 years agol2: crash on l2_input_is_xconnect 72/31172/5
Steven Luong [Tue, 9 Feb 2021 07:48:30 +0000 (23:48 -0800)]
l2: crash on l2_input_is_xconnect

Running vpp without any interface configured and then invoking the
binary-api l2_xconnect_dump causes vpp to crash in l2_input_is_xconnect due
to l2input_main.configs has no memory allocated to it, not even for the local
interface which exists all the times.

The reason that l2input_main.configs has no memory allocated to it was due to
gerrit patch 29232 which took out a line in l2input_init

  /* Create the config vector */
  vec_validate (mp->configs, 100);

The fix is to iterate through l2input_main.configs for each interface in
l2 to call l2_input_is_xconnect when dumping l2_xconnect interfaces.

Type: fix
Fixes: gerrit 29232

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I8d9cba4b7eba4c2e0c60887c4fd57d5ec3b06d3b

3 years agotls: dtls initial implementation 36/30036/54
Florin Coras [Thu, 19 Nov 2020 21:38:26 +0000 (13:38 -0800)]
tls: dtls initial implementation

Type: feature

Basic dtls transport protocol implementation that relies on openssl
wire protocol implementation. Retries/timeouts not yet supported.

To test using vcl test apps, first ensure all arp entries are properly
resolved and subsequently:

server: vcl_server -p dtls 1234
client: vcl_client -p dtls <server-ip> 1234 -U -N 2000000 -T 1460 -X

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I04b4516a8fe9ce85ba230bcdd891f33a900046ed

3 years agosession: coverity fixes 01/31201/2
Florin Coras [Tue, 9 Feb 2021 17:46:22 +0000 (09:46 -0800)]
session: coverity fixes

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I2828287c58115aa08c0a4297c01cea60f41f4749

3 years agocrypto: fix bad-hmac in sw scheduler if async mode 50/30550/3
Alexander Chernavin [Mon, 28 Dec 2020 09:29:13 +0000 (04:29 -0500)]
crypto: fix bad-hmac in sw scheduler if async mode

When IPsec async mode is enabled, packets don't pass through the tunnel
if ciphers other than AES GCM are used for child SAs. An error that
arises is "bad-hmac" in the "crypto-dispatch" node.

On the encryption stage, the VNET_CRYPTO_OP_FLAG_HMAC_CHECK flag is set
for the integrity crypto operation when it's not supposed to. It seems
that the flag remains from the previous operation.

With this change, zero flags of crypto operations in the SW scheduler
during operation filling.

Type: fix
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: Iabac253474e95cb01f9ec0933f3c4860f8a5289c

3 years agogbp: fix typo in macro 47/30547/2
Paul Vinciguerra [Mon, 28 Dec 2020 02:34:30 +0000 (02:34 +0000)]
gbp: fix typo in macro

Type: fix

Change-Id: I1f8245e8cccacb5bbb511aef39e31d0a76bba95f
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
3 years agopapi: expose vpp_papi version to client 90/30490/8
Paul Vinciguerra [Fri, 18 Dec 2020 23:47:27 +0000 (18:47 -0500)]
papi: expose vpp_papi version to client

root@ae2a2e85c5d4:/vpp/src/vpp-api/python# python3
Python 3.6.9 (default, Oct  8 2020, 12:12:24)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import vpp_papi
>>> vpp_papi.__version__
'1.6.2'

Type: feature

Change-Id: I73025427a58214a842245fceaa77daa7acd3e6f8
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
3 years agopapi: remove python2 vpp-api-python.deb 55/30555/3
Paul Vinciguerra [Wed, 30 Dec 2020 00:41:15 +0000 (00:41 +0000)]
papi: remove python2 vpp-api-python.deb

Type: fix

Change-Id: I4901f7eb9d739afd4d45a25306434e9d122a4068
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
3 years agomisc: Now that VOM is deprecated remove the build dependency on boost 99/31199/1
Neale Ranns [Tue, 9 Feb 2021 16:53:37 +0000 (16:53 +0000)]
misc: Now that VOM is deprecated remove the build dependency on boost

Type: make

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Icbbae3ab222e7d97e6c496c13ec9229e94cf5ede

3 years agonat: bump default max translations to 63K 40/30840/2
Klement Sekera [Tue, 19 Jan 2021 16:55:46 +0000 (17:55 +0100)]
nat: bump default max translations to 63K

Type: improvement

Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Ibea7ec844d1d910e8a3235e11154b1ecea8302ac

3 years agonat: deny adding intf addr if static-mapping-only 82/30382/4
Alexander Chernavin [Fri, 11 Dec 2020 08:36:45 +0000 (03:36 -0500)]
nat: deny adding intf addr if static-mapping-only

If static-mapping-only is enabled, NAT pool cannot be configured, only
static mappings. There're two ways to add addresses to the NAT pool:
by address range, or by first found address from an interface.
NAT44_ADD_DEL_ADDRESS_RANGE already tests if dynamic mappings are
available but NAT44_ADD_DEL_INTERFACE_ADDR doesn't. If
static-mapping-only is enabled, adding addresses by range is rejected
but by interface not.

With this change, if static-mapping-only is enabled, do not allow to
add addresses to the NAT pool both ways.

Type: fix
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: Ifc055ea9a71a5e579388833a2990aef21bf7ed29

3 years agonat: fix coverity errors 34/31134/4
Ole Troan [Sat, 6 Feb 2021 12:02:41 +0000 (13:02 +0100)]
nat: fix coverity errors

Including a general missing free in fromjson autogenerated code.

Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I9ab2b0193135e2fb3d62d51b3c114df56969e341
Signed-off-by: Ole Troan <ot@cisco.com>
3 years agonat: improve type safety and remove unused param 91/31091/6
Klement Sekera [Tue, 2 Feb 2021 19:15:59 +0000 (20:15 +0100)]
nat: improve type safety and remove unused param

Type: improvement
Change-Id: I456f9b14e6a4eb46c9c49f6e09acccae530e4ebc
Signed-off-by: Klement Sekera <ksekera@cisco.com>
3 years agoRevert "ipsec: Use the new tunnel API types to add flow label and TTL copy" 78/31178/2
Matthew Smith [Mon, 8 Feb 2021 22:13:59 +0000 (22:13 +0000)]
Revert "ipsec: Use the new tunnel API types to add flow label and TTL copy"

This reverts commit c7eaa711f3e25580687df0618e9ca80d3dc85e5f.

Reason for revert: The jenkins job named 'vpp-merge-master-ubuntu1804-x86_64' had 2 IPv6 AH tests fail after the change was merged. Those 2 tests also failed the next time that job ran after an unrelated change was merged.

Change-Id: I0e2c3ee895114029066c82624e79807af575b6c0
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
3 years agovlib: ASSERT vm == vlib_get_main() 63/31163/5
Dave Barach [Mon, 8 Feb 2021 12:56:22 +0000 (07:56 -0500)]
vlib: ASSERT vm == vlib_get_main()

To catch coding mistakes: calling vlib_get_frame_to_node() from a
worker thread with vm = &vlib_global_main instead of
vm = vlib_mains[worker_thread_index]

Type: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I5a8f01fdf9f35daeeada2d6eaa7180a60c4ca529

3 years agoipsec: Use the new tunnel API types to add flow label and TTL copy 62/31162/2
Neale Ranns [Thu, 4 Feb 2021 11:09:33 +0000 (11:09 +0000)]
ipsec: Use the new tunnel API types to add flow label and TTL copy
support

Type: feature

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I6d4a9b187daa725d4b2cbb66e11616802d44d2d3

3 years agointerface: automask interrupts to polling rxqs 17/31017/2
Mohammed Hawari [Fri, 29 Jan 2021 09:12:53 +0000 (10:12 +0100)]
interface: automask interrupts to polling rxqs

Sometimes, vnet_hw_if_rx_queue_set_int_pending is called on rxqs which
are not in interrupt mode. Currently, it segfaults due to a too small
clib_interrupt_t structure. This change prevents that and makes the
framework slightly more robust to driver bugs (that might be subtle
to track in some cases involving concurrency...)

Change-Id: I9643b9b1aa37e6852754b93f10cd2f96ed9e6118
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: fix

3 years agovirtio: use vpp clib_memset instead glibc memset 71/30371/3
Mohsin Kazmi [Thu, 10 Dec 2020 10:22:34 +0000 (10:22 +0000)]
virtio: use vpp clib_memset instead glibc memset

Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ib3cefe5d27286c4853eb0c0e1803a94787a62c97

3 years agovirtio: add atomic call for kicking 70/30370/5
Mohsin Kazmi [Thu, 10 Dec 2020 09:49:21 +0000 (09:49 +0000)]
virtio: add atomic call for kicking

Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I41faa2ca249ff75e564a732af896e6b5d76bf665

3 years agoipsec: Checking wrong DB for initialistation 58/31158/3
Neale Ranns [Mon, 8 Feb 2021 09:53:10 +0000 (09:53 +0000)]
ipsec: Checking wrong DB for initialistation

Type: fix

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I2325d311a6fd7343c7041dc516777f4db0029823

3 years agotests: allow for externally supplied VPP workers config for tests 65/30865/15
Andrew Yourtchenko [Wed, 20 Jan 2021 20:30:36 +0000 (20:30 +0000)]
tests: allow for externally supplied VPP workers config for tests

Allow to supply the external VPP worker config for tests which
do not specify the workers config explicitly, and use
the tags infra to flag those that need attention in this configuration.
This commit shows one example use of such a tag, there will be
a separate commit with the rest of the places needing it,
since that change is rather mechanical.

Thus, the assumption is that the test should by default be agnostic
of the VPP configuration, unless it explicitly specifies so.

Type: test
Change-Id: I3c0077e4e22a75cb9561fb98d3b783b93486b2be
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
3 years agoping: fix aborting on keypress 35/31035/4
Ivan Shvedunov [Mon, 1 Feb 2021 11:11:10 +0000 (14:11 +0300)]
ping: fix aborting on keypress

Type: fix

Currently ping stops on events like SOCKET_READ_EVENT,
which makes it hard to use over e.g. govpp as it aborts
immediately most of the time. With this patch, ping only
stops upon real CLI read / quit events.

Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com>
Change-Id: Id7a8d0b0fdeb7bbc7b85240e398d27bd5199345b

3 years agotunnel: support copying TTL and flow label from inner to outer 11/31111/3
Neale Ranns [Thu, 4 Feb 2021 11:02:52 +0000 (11:02 +0000)]
tunnel: support copying TTL and flow label from inner to outer

Type: feature

The added functionality is to support copying TTL and flow label from
inner to outer. The .api was extened to support expressing this and also
adding a common tunnel endpoint type. i find it best to make API changes
in one patch so there are less versions of the API.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I755c1e3f4c475058792af39c1abeda92129efb76

3 years agomisc: support api generated dependency for multiarch source 30/30230/15
Ole Troan [Wed, 2 Dec 2020 13:19:49 +0000 (14:19 +0100)]
misc: support api generated dependency for multiarch source

Fix dependency issues where multi-arch file is using API generated file.

Type: improvement
Change-Id: I5d4af7a630529bc138c35841723e38938f36d963
Signed-off-by: Ole Troan <ot@cisco.com>
3 years agolibmemif: fix insecure uses of strncpy 24/31024/9
Andrew Yourtchenko [Fri, 29 Jan 2021 14:18:12 +0000 (14:18 +0000)]
libmemif: fix insecure uses of strncpy

A calling patterm of "strncpy(dst, src, strlen(src))" invites a lot of troubles.

However, even using the target size may result in a problem if the string is
longer, since then the termination is not done.

Use strlcpy(dst, src, sizeof(dst)), which will always null-terminate
the string.

Change-Id: I8ddaf3dc8380a78af08914e81849279dae7ab24a
Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
3 years agolibmemif: set data offset for memif buffer 65/30765/8
Jakub Grajciar [Thu, 14 Jan 2021 12:23:48 +0000 (13:23 +0100)]
libmemif: set data offset for memif buffer

Update descriptor offset based on data pointer
in memif_buffer_t.
Slave only, master will not modify the descriptor.

Type: feature

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: Ice1e94cec366face650c58df81795f4dea727010

3 years agovppinfra: do not crash if format string is null 35/31135/3
Andrew Yourtchenko [Sat, 6 Feb 2021 12:28:52 +0000 (12:28 +0000)]
vppinfra: do not crash if format string is null

Sending 128 bytes of zeroes via API shared memory interface (or putting any other message ID that results in
null message name - e.g. 2,4,5) results in this crash:

Program received signal SIGSEGV, Segmentation fault.
va_format (s=0x7fffb5643a60 "memclnt_create", fmt=0x0, va=0x7fffa739ccf0) at /home/ubuntu/vpp/src/vppinfra/format.c:395
395       c = *f;
(gdb) bt
0  va_format (s=0x7fffb5643a60 "memclnt_create", fmt=0x0, va=0x7fffa739ccf0) at /home/ubuntu/vpp/src/vppinfra/format.c:395
1  0x00007ffff50e7259 in elog_string (em=0x7ffff5f2fbc8 <vlib_global_main+968>, fmt=0x0) at /home/ubuntu/vpp/src/vppinfra/elog.c:592
2  0x00007ffff7bc4cec in vl_msg_api_handler_with_vm_node (am=0x7ffff7dd1c90 <api_global_main>, vlib_rp=0x130023000, the_msg=0x130086d50, vm=0x7ffff5f2f800 <vlib_global_main>,
   node=0x7fffb5edd4c0, is_private=0 '\000') at /home/ubuntu/vpp/src/vlibapi/api_shared.c:585
3  0x00007ffff7ba6c86 in void_mem_api_handle_msg_i (am=0x7ffff7dd1c90 <api_global_main>, vlib_rp=0x130023000, vm=<optimized out>, node=<optimized out>, is_private=0 '\000')
   at /home/ubuntu/vpp/src/vlibmemory/memory_api.c:696
4  vl_mem_api_handle_msg_main (vm=0x7ffff5f2f800 <vlib_global_main>, node=0x7fffb5edd4c0) at /home/ubuntu/vpp/src/vlibmemory/memory_api.c:707
5  0x00007ffff7bb573e in vl_api_clnt_process (vm=0x7ffff5f2f800 <vlib_global_main>, node=0x7fffb5edd4c0, f=<optimized out>) at /home/ubuntu/vpp/src/vlibmemory/vlib_api.c:338
6  0x00007ffff5cb3bb7 in vlib_process_bootstrap (_a=<optimized out>) at /home/ubuntu/vpp/src/vlib/main.c:1477
7  0x00007ffff514088c in clib_calljmp () from /home/ubuntu/vpp/build-root/install-vpp-native/vpp/lib/libvppinfra.so.21.01
8  0x00007fffa95b0550 in ?? ()
9  0x00007ffff5ca93e2 in vlib_process_startup (vm=0x7ffff5f2f800 <vlib_global_main>, p=0x7fffb5edd4c0, f=0x0) at /home/ubuntu/vpp/src/vlib/main.c:1502
10 dispatch_process (vm=0x7ffff5f2f800 <vlib_global_main>, p=0x7fffb5edd4c0, f=0x0, last_time_stamp=<optimized out>) at /home/ubuntu/vpp/src/vlib/main.c:1558
11 0x0000000000000000 in ?? ()
(gdb)

I am not sure if this place is better to fix it or the 4-5 places in vl_msg_api_handler_with_vm_node that it gets called from,
but submitting this one since it is the shortest

Type: fix
Change-Id: I659d2bea7405d8763181336f35ef468682f64cf2
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
3 years agoflowprobe: set collector port for data from setting 38/28938/5
jan_cavojsky [Fri, 18 Sep 2020 10:17:42 +0000 (12:17 +0200)]
flowprobe: set collector port for data from setting

Type: fix
Ticket: VPP-1859

Signed-off-by: jan_cavojsky <Jan.Cavojsky@pantheon.tech>
Change-Id: Iaa5045001621ec99dc8579e8e989adf81dc60525

3 years agoipsec: CLI improvement for udp port encap 32/31132/2
Mohammed Hawari [Fri, 5 Feb 2021 18:04:42 +0000 (19:04 +0100)]
ipsec: CLI improvement for udp port encap

Change-Id: I59f55db7209549ad43a1205470a2f5ea9ea8a1c7
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: feature

3 years agotcp: fix port reuse with multiple listeners 54/30554/8
Florin Coras [Tue, 29 Dec 2020 17:42:58 +0000 (09:42 -0800)]
tcp: fix port reuse with multiple listeners

The check in listen state that the listener is not valid is not enough
if the time wait session's index overlaps an actual listener's index.
Thanks wanghanlin@corp.netease.com for the report!

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3dff0cb134940a8265ff908faa607c67dba5e56b

3 years agodevices: af-packet gso mtu 78/31078/4
Nathan Skrzypczak [Mon, 1 Feb 2021 16:13:59 +0000 (17:13 +0100)]
devices: af-packet gso mtu

Type: fix

Set the GSO flag when buffer length exceeds the
linux mtu. Don't listen for mtu changes on linux
side for now.

This also fixes a TX issue, as we only search for
valid frames on tx to the extent of n_left, we might
stay stuck.

Change-Id: Idf0bdd88990254a614962c2f7bc3e0292ccfd61a
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
3 years agosession svm: non blocking mq 27/30927/27
Florin Coras [Tue, 26 Jan 2021 04:31:27 +0000 (20:31 -0800)]
session svm: non blocking mq

Avoid synchronizing producers and the consumer. Instead, only use mutex
or spinlock (if eventfds are configured) to synchronize producers.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie2aafbdc2e07fced5d5e46ee2df6b30a186faa2f

3 years agoip: Remove unused include file 27/31127/2
Neale Ranns [Fri, 5 Feb 2021 14:34:11 +0000 (14:34 +0000)]
ip: Remove unused include file

Type: refactor

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Iae135cbca372def29b1dd5e9f29b7db546ef1a3e

3 years agolibmemif: fix memif_refill_queue 28/30928/2
Jakub Grajciar [Tue, 26 Jan 2021 06:38:30 +0000 (07:38 +0100)]
libmemif: fix memif_refill_queue

Fix arithmetic error in memif_refill_queue., where
some of the buffers didn't get properly refilled.

Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: I9815a8ac9b899216581452c352e75e2a0454cbce

3 years agolibmemif: set next free buffer 70/30670/9
Jakub Grajciar [Fri, 8 Jan 2021 14:32:43 +0000 (15:32 +0100)]
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

3 years agonat: 1:1 policy NAT 18/30718/23
Ole Troan [Tue, 12 Jan 2021 20:49:38 +0000 (21:49 +0100)]
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>
3 years agoipsec: add support for AES CTR 95/30895/5
Benoît Ganne [Fri, 22 Jan 2021 17:03:09 +0000 (18:03 +0100)]
ipsec: add support for AES CTR

Type: feature

Change-Id: I9f7742cb12ce30592b0b022c314b71c81fa7223a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agoikev2: fix bad ip in logs 23/31123/2
Filip Tehlar [Thu, 4 Feb 2021 17:07:30 +0000 (17:07 +0000)]
ikev2: fix bad ip in logs

Type: fix

Change-Id: Icd01491043e9fd1bb8f51f4f55e1252fd78512de
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
3 years agointerface: RX/TX direction type in API 15/30415/4
Neale Ranns [Mon, 14 Dec 2020 16:50:33 +0000 (16:50 +0000)]
interface: RX/TX direction type in API

Type: feature

Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Change-Id: I982205b48615395f19cbb36c73854fb5c3db45e8

3 years agopapi: remove unused name from __all__ 49/30449/3
Paul Vinciguerra [Wed, 16 Dec 2020 17:37:57 +0000 (17:37 +0000)]
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>
3 years agonat: configurable handoff frame queue size 33/30933/4
Elias Rudberg [Tue, 26 Jan 2021 12:56:45 +0000 (13:56 +0100)]
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>
3 years agovxlan: add udp-port configuration support 04/30204/10
Artem Glazychev [Mon, 30 Nov 2020 19:39:21 +0000 (02:39 +0700)]
vxlan: add udp-port configuration support

Type: improvement

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: Ie30d51ab4df5599b52f7335f863b930cd69dbdc1

3 years agosr: Fix the issue that L3VPN SRv6 encapsulated packets could not be forwarded. 28/31028/12
Tetsuya Murakami [Mon, 1 Feb 2021 00:38:56 +0000 (16:38 -0800)]
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>
3 years agotests: ikev2: non-default table id test 77/31077/3
Filip Tehlar [Wed, 27 Jan 2021 18:08:21 +0000 (18:08 +0000)]
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>
3 years agompls: MPLS Hash fixes 10/31110/2
Neale Ranns [Thu, 4 Feb 2021 10:54:22 +0000 (10:54 +0000)]
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

3 years agoikev2: add hint to the log when IDs do not match 47/30947/5
Filip Tehlar [Tue, 26 Jan 2021 22:06:48 +0000 (22:06 +0000)]
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>
3 years agoikev2: fix msgid 36/30936/2
Filip Tehlar [Tue, 26 Jan 2021 15:08:25 +0000 (15:08 +0000)]
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>
3 years agocrypto-ipsecmb: add support for AES CTR 56/30956/2
Benoît Ganne [Fri, 22 Jan 2021 17:41:06 +0000 (18:41 +0100)]
crypto-ipsecmb: add support for AES CTR

Type: feature

Change-Id: Ide2901f5d2111a518b2c8212aa84468cef1d72ca
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agovppinfra: fix mem map mt issue due to snprintf 96/31096/7
Florin Coras [Tue, 2 Feb 2021 23:40:35 +0000 (15:40 -0800)]
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

3 years agovlib: "revert startup multi-arch variant configuration fix for interfaces" 11/30911/3
Damjan Marion [Wed, 27 Jan 2021 14:21:36 +0000 (14:21 +0000)]
vlib: "revert startup multi-arch variant configuration fix for interfaces"

Type: fix

This reverts commit 5a48b3b9d88fa2793793e2bf3db8bf156fe2951f.

Change-Id: Ifa91b18bdbbc32bb729abc09d95637d9cdf42c3b
Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
3 years agonat: reduce number of hash tables for EI NAT 90/31090/4
Klement Sekera [Tue, 26 Jan 2021 11:18:53 +0000 (12:18 +0100)]
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

3 years agoapi: Fold the empty pool check into the main macro 70/30970/2
Neale Ranns [Thu, 28 Jan 2021 11:38:16 +0000 (11:38 +0000)]
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

3 years agolinux-cp: Linux Interface Mirroring for Control Plane Integration 59/30759/11
Neale Ranns [Thu, 24 Dec 2020 09:16:09 +0000 (09:16 +0000)]
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

3 years agoipsec: one thread index per-SA 13/31113/1
Neale Ranns [Thu, 4 Feb 2021 11:33:32 +0000 (11:33 +0000)]
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

3 years agovlib: increase the stats epoch only when necessary 93/30693/7
Miklos Tirpak [Tue, 12 Jan 2021 14:14:02 +0000 (15:14 +0100)]
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

3 years agovxlan: fix interface naming 97/30997/5
Ray Kinsella [Thu, 28 Jan 2021 17:09:45 +0000 (17:09 +0000)]
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

3 years agovppapigen: Support an 'autoendian' keyword for message definitions in 85/31085/3
Neale Ranns [Tue, 2 Feb 2021 09:21:52 +0000 (09:21 +0000)]
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

3 years agovppapigen: fix enum types 94/30394/6
Paul Vinciguerra [Sun, 13 Dec 2020 04:12:55 +0000 (04:12 +0000)]
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>
3 years agotests: verify policer stats in punt tests 73/30973/2
Brian Russell [Wed, 27 Jan 2021 14:45:22 +0000 (14:45 +0000)]
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

3 years agopolicer: add counters 72/30972/2
Brian Russell [Wed, 27 Jan 2021 11:34:33 +0000 (11:34 +0000)]
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

3 years agovcl: remove verbose output from vcl iperf tests 82/31082/2
Florin Coras [Mon, 1 Feb 2021 19:59:49 +0000 (11:59 -0800)]
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

3 years agoquic: clean setup_cipher function 75/30975/2
Mathias Raoul [Wed, 27 Jan 2021 15:35:54 +0000 (15:35 +0000)]
quic: clean setup_cipher function

Type: fix

Change-Id: I02e473440a8732ddfb1a13ad6552779adaa67f60
Signed-off-by: Mathias Raoul <mathias.raoul@gmail.com>
3 years agomisc: remove duplicated gbp entry in maintainers 81/31081/2
Vratko Polak [Mon, 1 Feb 2021 17:42:04 +0000 (18:42 +0100)]
misc: remove duplicated gbp entry in maintainers

Type: style

Change-Id: Iba79915b78daf6eec6affa4efce66d3670d3f3c0
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
3 years agomisc: mark vnet and plugin in maintainers 80/31080/2
Vratko Polak [Mon, 1 Feb 2021 17:25:59 +0000 (18:25 +0100)]
misc: mark vnet and plugin in maintainers

Type: style

Change-Id: Ibbc33d92e3663aea0b33a2f961a9ceebc975b51c
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
3 years agomisc: use tab as separator in maintainers file 79/31079/2
Vratko Polak [Mon, 1 Feb 2021 17:20:06 +0000 (18:20 +0100)]
misc: use tab as separator in maintainers file

Type: style

Change-Id: I9bf61b0b9fd35941fda52c0eef99c7c95db9cba8
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
3 years agovppinfra: add defines for bihash add and delete 71/30971/2
Paul Atkins [Tue, 19 Jan 2021 15:22:23 +0000 (15:22 +0000)]
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

3 years agomisc: Volunteer as maintainer for the policer 33/31033/2
Neale Ranns [Mon, 1 Feb 2021 10:19:15 +0000 (10:19 +0000)]
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

3 years agomisc: Remove duplicate "classify" entry in MAINTAINER list 31/31031/2
Neale Ranns [Mon, 1 Feb 2021 10:15:01 +0000 (10:15 +0000)]
misc: Remove duplicate "classify" entry in MAINTAINER list

Type: fix

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I5466838353f3286941333f752f9ef6d336db0de4