Compare commits

...

536 Commits

Author SHA1 Message Date
Benoît Ganne b6e090c493 ipsec: fix AES CBC IV generation (CVE-2022-46397)
For AES-CBC, the IV must be unpredictable (see NIST SP800-38a Appendix
C). Chaining IVs like is done by ipsecmb and native backends for the
VNET_CRYPTO_OP_FLAG_INIT_IV is fully predictable.
Encrypt a counter as part of the message, making the (predictable)
counter-generated IV unpredictable.

Fixes: VPP-2037
Type: fix

Change-Id: If4f192d62bf97dda553e7573331c75efa11822ae
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-02-07 17:21:43 +01:00
Juraj Linkeš 4f7b92f0a0 dpdk: disable i40evf in favor of iavf patch
Fix an issue where multiple VPP instances with DPDK starting at the
same time would not initialize VFs properly. This is done by using the
iavf PMD (where the issue can't be reproduced) instead of the i40evf
PMD.

Type: fix
Ticket: VPP-1943
Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Change-Id: Idcc48088c7d66a76da2b4675c02c7c115706c8b3
2021-05-27 12:41:37 +02:00
Filip Tehlar 8b4bd27d60 ikev2: test responder behind NAT
Type: test
Ticket: VPP-1903

Change-Id: I7fab6931833d6e253b7b921172825387302d8f70
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit 027d813a50)
2021-04-21 19:37:29 +00:00
Dave Barach 4f88004bc3 docs: vpp stateless traffic generator
Add a use-case writeup.

Type: docs

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ib6e79e80455edbdeedcc96943dd98f16c57c559e
(cherry picked from commit b8f6122b4f)
2021-01-22 14:02:48 +00:00
Dave Wallace 14bfb66d39 build: add missing openssl-devel package for centos-8 vpp-ext-deps
- In a new centos-8 installation, vpp-ext-deps fails on missing
  ssl.h header file after 'make install-deps'.

Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I521d817dd1f1e21aff427d98b9832ea7c7b89339
2021-01-14 21:50:53 +00:00
Paul Vinciguerra d1598d4274 docs: update list of plugins
The list of plugins is outdated.

This change introduces a dynamically
generated list of the plugins along with their descriptions,
extracted directly from the sources.

Type: docs

Change-Id: Icb7b65e6b45289e257d71a1c18d10f62ced59cbe
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
(cherry picked from commit 630ca994e0)
2020-12-21 23:23:53 +00:00
Paul Vinciguerra 1e44cf53b5 docs: fix missing quotes in ubuntu install instructions
type: docs

Change-Id: Ifa09b63924f4b7bf2719bba6ada0e1122407641c
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
(cherry picked from commit ac9a585c62)
2020-12-18 23:37:48 +00:00
Elias Rudberg 3b82d3e393 nat: avoid hairpinning infinite loop problem
Fix in nat44 hairpinning code to check if anything was actually
changed in the snat_hairpinning() routine, and return 0 if nothing
changed. This helps avoid an infinite loop repeating the three
nodes nat44-hairpinning-->ip4-lookup-->ip4-local in case there
was no change. Also add a corresponding test case.

This is essentially a cherry-pick of change 30284 but the
automatic cherry-picking did not work because of some filename
changes.

Type: fix

Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Change-Id: I21a59ae7423f40abeff9fc0411330da58b3011f0
2020-12-10 09:30:46 +00:00
Dave Wallace a23dd5dbb5 build: fix centos-8 'make install-deps' enable PowerTools repo
- The name of the powertools repo was changed [0]
  in centos-8 from 'PowerTools' to 'powertools'.
  Retrieve the correct name from 'dnf repolist all'
  instead of hard coding it.

[0] https://git.centos.org/rpms/centos-repos/c/b759b17557b9577e8ea156740af0249ab1a22d70

Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: Ic1402e671eb1d70dec429bab82ad18d8251f4eef
(cherry picked from commit 1affb31ef5)
2020-12-08 21:05:31 +00:00
Filip Tehlar 7847f172a3 ikev2: fix nat traversal
Type: fix

Change-Id: Ie723cf680745ec2292a15e2df05c1821436dba19
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit 18107c974c)
2020-12-02 09:04:22 +00:00
Ole Troan 007bd2f1fe stats: missing dimension in stat_set_simple_counter
A simple counter is a two dimensional array by threads and
counter index. 28017 introduced an error missing the first
dimension.

If a vector is updated at the same time as a client reads,
an invalid pointer my result. This will be caught by the
optimistic locking after copying out the data, but if
following a pointer outside of the stat segment then
the stat client would crash. Add suitable boundary checks
for access to stat memory segment.

Fixes: 7d29e320fb
Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I94f124ec71d98218c4eda5d124ac5594743d93d6
(cherry picked from commit 65c56c83ce)
Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
2020-11-30 20:43:08 +01:00
Mohammed Hawari e7a1006e86 rdma: fixed UAR writing at tx
Change-Id: Id81b4d27845c4e91cef90a4b8649662942d3cba1
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: fix
(cherry picked from commit 3ef653aa88)
2020-11-26 15:04:05 +00:00
Neale Ranns b72fb31d69 ip-neighbor: Send API event when neighbor is removed
Type: fix

Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Change-Id: I9952497a108bac26445af95c28d4eed46099c2fc
2020-11-26 15:03:50 +00:00
Filip Tehlar 0e68a7cb5b ikev2: better handling when no IKE DH configured
Type: improvement

Change-Id: I4289d20adaa3f2872889d5dbaafd9c025df8aca8
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit e1ab06c14d)
2020-11-26 15:02:41 +00:00
Filip Tehlar 6e13acc42e ikev2: fix issue when sending multiple requests at once
Type: fix

Change-Id: I8ed556de4370a03d10c56cce101cd5ea0d0aaf8b
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit 38340fa32c)
2020-11-26 15:02:41 +00:00
Benoît Ganne 186f018f68 ikev2: respect punting only for ipv4
IPSec punting to IKEv2 is valid only for NAT-T in IPv4.
Fix coverity CID 214915.

Type: fix

Change-Id: I6f2db38abf179565316f50c5d47c78acce3a0d01
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit d9ed0b6786)
2020-11-26 15:02:41 +00:00
Filip Tehlar 49de3282a3 ikev2: fix memleak when tunnel protect fails
Type: fix

Change-Id: I1d278fc2b03b948c054ff1686315635ac0278ae8
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 727082016f)
2020-11-26 15:02:41 +00:00
Filip Tehlar 29ad98844b ikev2: add tests for DPD
Type: test

Change-Id: I9c1129a8596344551f3f8f2e029846d22511482e
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit 2008e31453)
2020-11-26 15:02:41 +00:00
Filip Tehlar 6d878f3e61 ikev2: fix msg IDs generation
Type: fix

Change-Id: Id922895c269f0d2450e55fcb6871b6857f443462
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit f6b02e0d0b)
2020-11-26 15:02:41 +00:00
Filip Tehlar cbc3dc0b30 ikev2: fix udp encap
Type: fix

Change-Id: I8c66f79f2d8cfff7c6d45e1fc5b529ffb3941491
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit 67b8a7fa76)
2020-11-26 15:02:41 +00:00
Filip Tehlar 8035ffe8dc ikev2: add option to disable NAT traversal
Type: feature
Ticket: VPP-1935

Change-Id: I705f84047b112279377590157a1c7b4a34f693d2
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit d7fc12f073)
2020-11-26 15:02:41 +00:00
Filip Tehlar f6deabd4fc ikev2: fix reply during rekey
Type: fix

Change-Id: If87f4b8ae92508215fe91178958fe2ddb91e5a35
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit 68ad625837)
2020-11-26 15:02:41 +00:00
Filip Tehlar 31b44a7a13 ikev2: increase tick interval in process node
This helps to resolve sporadic failures in unit tests.

Type: fix

Change-Id: I3abd77ed74310f9729a841e8569eafe6d7758dcb
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit 761f8f0eaa)
2020-11-26 15:02:41 +00:00
Filip Tehlar 56d712533b ikev2: cli for disabling dead peer detection
Type: feature

Change-Id: I0db0a9b2f872753fa64d27335838cb34645a9ee8
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit af4a414eb7)
2020-11-26 15:02:41 +00:00
Filip Tehlar f7fd0e749b ikev2: fix memory leak
Type: fix

Change-Id: I33c38c791cc9a28898de402ae831c4862073eb2d
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit b8bc2f1ef3)
2020-11-26 15:02:41 +00:00
Filip Tehlar a81bcf3945 ikev2: support sending requests from responder
Type: improvement
Ticket: VPP-1894

Change-Id: I5a24a48416bca2ffbd346cdaa813fb25801e6c9b
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit edf2900ac6)
2020-11-26 15:02:41 +00:00
Filip Tehlar 233b12d11d ikev2: fix setting responder/initiator addresses
Type: fix

Change-Id: Ic406aa914d92e802a5fb0f27c2ffa1b98db012b0
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit ec112e5a9e)
2020-11-26 15:02:41 +00:00
Filip Tehlar 83c70b7a5a ikev2: prevent crash after no IP address
Type: fix
Ticket: VPP-1900

This fixes a crash when initiating IKE connection using interface
without any IP address.
It also ensures that the IKE connection is automatically retried once the
interface obtains an address.

Signed-off-by: jan_cavojsky <Jan.Cavojsky@pantheon.tech>
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Ia1919c349e64b3a0a4198365e075e177e3ba3de5
(cherry picked from commit 6960da5284)
2020-11-26 15:02:41 +00:00
Filip Tehlar 8b69f7546e ikev2: fix initial contact cleanup
When looking for existing SA connection to clean up search all per
thread data, not only current one.

Type: fix

Change-Id: I59312e08a07ca1f474b6389999e59320c5128e7d
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit e7c8396982)
2020-11-26 15:02:41 +00:00
Filip Tehlar 3ff88076d3 ikev2: fix coverity warning
Type: fix

Change-Id: Iee96b3ea3e71ec248c3c3c98d153a08372b5faf0
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit dc6378f71b)
2020-11-26 15:02:41 +00:00
Filip Tehlar ae0d24f1be ikev2: fix memory leak in auth routine
Type: fix

Change-Id: I93529b069925fcef32cdb22e27975b802b4c3b97
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit 623d87fd39)
2020-11-26 15:02:41 +00:00
Filip Tehlar 469181845b ikev2: support ipv6 traffic selectors & overlay
Ticket: VPP-1917
Type: feature

Change-Id: Ie9f22e7336aa7807b1967c48de9843df10fb575c
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit 84962d19ba)
2020-11-26 15:02:41 +00:00
Filip Tehlar 0b685565c1 ikev2: refactor ikev2 node
Type: refactor

Change-Id: I65acbd5d9724c500a24699de973df08016d9d8d6
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit 3434cb8fe3)
2020-11-26 15:02:41 +00:00
Filip Tehlar df61e60815 ikev2: better packet parsing functions
Ticket: VPP-1918
Type: improvement

Change-Id: I2bc3e30121697404dcd54f1c2127bd85ccc1029e
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit 558607dc3a)
2020-11-26 15:02:41 +00:00
Filip Tehlar 447f673e75 ikev2: show IKE SA command improvements
Ticket: VPP-1898
Type: improvement

Change-Id: I1c56df331965c733a2d0eae63a12d5a4ee5a2e41
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit 90690f1e8f)
2020-11-26 15:02:41 +00:00
Benoît Ganne 7d304405ed dns: use correct per-thread vlib_main
Using vlib_main of another thread is prohibited.

Type: fix

Change-Id: I7ae294dfaf2526738e91408c9b4865ef9f801b8a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 7483a7272d)
2020-11-26 14:56:28 +00:00
Benoît Ganne 7946c61c55 syslog: use per-thread vlib_main
We should not use main thread vlib_main in workers.

Type: fix

Change-Id: I58c0a8cadf2dc7f768b20ac90e7ec7921e2e8ca4
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 0a2fde105a)
2020-11-26 13:10:42 +00:00
Benoît Ganne c646d54b46 dns: fix double-unlock
dns cache should no longer be unlocked by caller.

Type: fix
Fixes: 84a563ae40

Change-Id: I3708718ae8f00e4e4f4e04381caa0095c8494b82
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 2113c7f28b)
2020-11-25 17:55:06 +00:00
Ray Kinsella a6a5031e78 crypto-native: fix multi-arch variant initialization
crypto_native/main.h is being built as default,
and crypto_native_main is initialized with a size of 64 bytes.

crypto_native/aes_gcm.c and crypto_native/aes_cbc.c are march
variants, their ICL variants are expecting crypto_native_main
to be 256 bytes.

Type: fix

Signed-off-by: Georgii Tkachuk <georgii.tkachuk@intel.com>
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I4cddb75b712ea83c9cfca621887605d7bae104ec
2020-11-13 10:26:48 +00:00
Benoît Ganne 1e0e3d55a8 ipsec: add support for tx-table-id in cli + example
Type: improvement

Change-Id: I840741dfe040718b682935cdbcb0ba958d45a591
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 40aa27ef7c)
2020-11-12 12:33:34 +00:00
Benoît Ganne e36b854a72 feature: reset interface feature arc on interface deletion
When removing an interface we must reset all per-interface per-feature
arc data to ensure we do not get wrong feature arc config data when the
sw_if_index is recycled.

Type: fix

Change-Id: I8c9d850d7c62b7b77193da4258ab5fb9bdda85a6
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 6178bdafa6)
2020-11-12 12:33:31 +00:00
Benoît Ganne 087d81dafa af_xdp: fix NUMA node parsing
Non-NUMA systems might report -1 as NUMA node.

Type: fix

Change-Id: I092c817ea670009d6f530cc70ad13d45e15fd363
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 4317b8efb1)
2020-11-12 12:33:28 +00:00
Benoît Ganne 73a3476602 wireguard: reset secret data before freeing it
Type: fix

Change-Id: I880bdd55ae5da0b9775a3fb548d44512348a7bc6
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 2531d50101)
2020-11-12 12:33:25 +00:00
Benoît Ganne 07aeedd242 vpp: fix main heap init
NUMA node parsing with vlib_get_thread_core_numa() can failed on single
socket systems. Use clib_get_current_numa_node() instead as we already
pinned the main thread to the requested core.

Type: fix

Change-Id: I22339516d0305689a58584c92ded7c96eb53be39
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 33ce5e568f)
2020-11-12 12:33:22 +00:00
Benoît Ganne 020f02cf3d ipsec: fix unformat types
ipsec_{crypto,integ}_alg_t are packed and smaller than u32. Callers are
using those enums so unformat functions should too instead of u32 to
not overflow the stack.

Type: fix

Change-Id: Ifc86366f1928ca6352f06f390a88ac64668289d5
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit f6422ffbc8)
2020-11-12 12:33:18 +00:00
Benoît Ganne b2a92ff3b9 svm: fix fifo unit test
- fix fifo initialization overflowing chunk size
 - stick to the default base virtual address to initialize fifo. ASAN
   can be picky about address space

Type: fix

Change-Id: If9a29138d2c207859d72845e928290c808c4a982
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 07b9455808)
2020-11-12 12:33:15 +00:00
Benoît Ganne 19b477f977 ikev2: fix cli memory leak
Type: fix

Change-Id: Ibdd83fa336427ec0c66224ecebb1b6bd36d1d1ba
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 1f6a6b8b2b)
2020-11-12 12:33:12 +00:00
Benoît Ganne 32c2b2ae60 rdma: add RSS support for IPv6 and TCP
Type: feature

Change-Id: I8b0d918e6f13325954b29bf34e4ef224c1315c51
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 91603958d1)
2020-11-12 12:33:09 +00:00
Benoît Ganne 9c73329588 build: better detection of libbpf dependencies
Type: fix

Change-Id: Ib496e6eb0a76e6268aea09d5f4495f3ecd921ec2
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 24b5107edd)
2020-11-12 12:33:05 +00:00
Benoît Ganne dcb9fcfc64 af_xdp: add option to claim all available rx queues
Type: feature

Change-Id: I97176c2c90ea664a68078b3a7b7d44eb237a7f13
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit d4e1091382)
2020-11-12 12:33:02 +00:00
Benoît Ganne 52bbd86836 ipsec: fix outer table id lookup in ipsec tun script
Type: fix

Change-Id: I195949b610dca1b860baca18a059d39949627961
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 27632cae3d)
2020-11-12 12:32:58 +00:00
Benoît Ganne 019ce71c2d ip: fix doxygen doc for address add/del command
Type: docs

Change-Id: I96d5cdb41bd938f06d2d72f2625bf1b3d2c5b1b4
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 7bed48cb79)
2020-11-12 11:25:16 +00:00
Benoît Ganne 071328283e svm: fix ASAN annotations for external chunks
Chunks can be allocated from another process. We need to manually
mark them as accessible for ASAN.

Type: fix

Change-Id: Ifbeef3346e9cee2c1231f80cbcf7f9673b5b54be
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit df601ae2d1)
2020-11-09 19:13:25 +01:00
Mohammed Hawari 8cfcbaa726 rdma: various fixes for chained buffers tx
Type: fix
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Change-Id: I428c87e581db335362fef30e274db8947a896416
(cherry picked from commit a210433d53)
2020-11-05 08:31:41 +00:00
Mohammed Hawari 7ed6a731ad pci: set PCI memory enable before mapping PCI BAR
This change mitigates software faults issued by some versions of the
linux kernel vfio-pci driver when VF PCI BARs are used without setting
the memory enable bit in the PCI configuration. This problem is
mentionned in https://lkml.org/lkml/2020/6/25/628

Change-Id: Idc177be4a5adb6ee467b4dd8f055f133ff267fe1
Type: improvement
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
(cherry picked from commit 70fc36f268)
2020-10-28 16:27:23 +00:00
Steven Luong 11166453a5 virtio: checksum error reported for ip6 traffic with GSO enable
When GSO is enabled, vhost clears the checksum field prior to transmitting
the packet. Some newer kernel version does not like that and complains
about checksum error. This was seen with ip6 traffic.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I7c6f2a6148f4a30107bfa8b078f5990e64300cf1
(cherry picked from commit ac0f536388)
2020-10-23 21:13:59 +00:00
Dave Wallace ee3ea11496 build: fix typo in dpdk-20.08 patch #0003
Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: Id0b3264e723f1df161a606e4dbdcd70c36d448a4
2020-10-23 09:35:12 -04:00
Dave Wallace 312e441a8e build: fix external patch application to not create .orig files
- Generation of patched original files (eg. dpdk-devbind.py.orig)
  causes build breakage of 'make install-ext-deps' on CentOS-8.
  Note: this only occurs on builds using 'make' for dpdk instead
  of 'meson'.  Thus only applies to stable/2009.

Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I3f1f70781b7a5564cd38e8876644d817e2eb4aad
2020-10-21 19:27:05 -04:00
Dave Wallace 9ef7eae699 build: fix broken debian dependencies on ubuntu-18.04 & debian-9
- Installation vpp-plugin-core from packagecloud.io/master
  & packagecloud.io/2009 breaks due to invalid dependencies
  on newer versions of libmbedtls & libmbedcrypto

Type: fix
Fixes: 641467406

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: If736dabcc4a91a04b46515620dd87662b7b14260
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2020-10-21 16:29:55 +00:00
Dave Wallace 4b50a90aad build: backport dpdk usertools support python3 only patch
- On Centos-8, 'make install-ext-deps' fails due to the
  bpr-mangle-shebangs script failing the dpdk usertools
  python scripts containing '#!/usr/bin/env python'.
  Backport usertools section of the DPDK patch which
  fixes this issue:
  http://git.dpdk.org/dpdk/commit/?id=3f6f83626cf4967a99382a6518a614a1bf3d2c20

- Also fix README to reflect name change of dpdk master
  branch to 'main'.

- On stable/2009, the dpdk build using make fails due to rpmbuild
  defaulting to using /usr/bin/python (version 2.7) which
  fails to build.  The build on master uses meson which somehow
  resolves this issue.  For this cherry-pick, fix the build by
  fixing the rpm vpp-ext-deps spec to force the use of python3.

Type: fix

Change-Id: I487b1ff2da786a4a3fd8fb0f859436b0e1885f1b
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2020-10-19 23:38:00 +00:00
Chuan Han d5f8a9b0ad build: Add missing debian dependencies
Otherwise, vpp install will fail.

Type: improvement

Signed-off-by: Chuan Han <chuan.han.comm@gmail.com>
Change-Id: Ifb4d7b8f6fb7b333b8205ba6b424176f8554cfdc
2020-10-16 08:05:03 -07:00
Dave Wallace 53604e5c83 build: add missing dnf-plugins-core package on centos-8
Type: fix

Change-Id: I1a4d9a7a8089cbf488dcd6f09eec6b4e0d0d72fe
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
(cherry picked from commit 858856df16)
2020-10-14 16:34:34 +00:00
Filip Tehlar 4a232f88d0 ikev2: fix leaking pending INIT requests
.. when associated profile is deleted.

Type: fix

Change-Id: Ib05831d79b3b58664ee0a930960513fd465373bf
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit 6614df5350)
2020-10-14 16:08:59 +00:00
Filip Tehlar 94f5335efb ikev2: fix issue when decrypting packet with no keys
Type: fix

Change-Id: I0e615d5089587992012a0f280ee902b2906f21c2
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-10-14 15:13:40 +00:00
Chuan Han 93a786b4d7 build: fix build for debian testing
1. add libelf-dev to default deb deps
2. Also use libffi7 instead of libffi6 for debian-testing

Type: fix

Signed-off-by: Chuan Han <chuan.han.comm@gmail.com>
Change-Id: I9f13955812877422ecb8aac3dd34c5828b9c4607
2020-10-02 10:38:39 -07:00
Andrew Yourtchenko 072def4738 build: fix the version in 'show version' for RPM
The RPM build ends up with "vXX.YY" to vstring,
which is not what we'd expect - so fix it up.

Change-Id: I0af68e69b1e40fc49ade759bb2f0ed9f47614217
Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-09-30 23:58:50 +00:00
Andrew Yourtchenko 3c5414029b misc: 20.09 Release Notes
Type: docs
Change-Id: I1b12f1d14a1a68504767c01ceac0eed115fb7ba6
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
2020-09-30 16:50:44 +00:00
Mohsin Kazmi 8eb1e6d1f0 virtio: fix modern device queue notify
QUEUE_SELECT and QUEUE_NOTIFY_OFF registers are shared between all
workers operating on the same device and operations are not atomic

Type: fix

Change-Id: Ie017b1bfc7e3b6b4e59029f45db78eeffd9f3aeb
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 162a296756)
2020-09-30 11:31:26 +00:00
Benoît Ganne 47e0bd7303 virtio: fix txq locking
Initialize txq lock only if some txq are shared and check if another
worker is already operating on the txq before processing gro timeouts
in input node.

Type: fix

Change-Id: I89dab6c0e6eb6a7aa621fa1548b0a2c76e6c7581
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit b6b484d01a)
2020-09-30 11:31:13 +00:00
Vladimir Isaev ddb070e8b1 tap: do not use strlen on vector
sanitizer complains about strlen on hi->name in tap_dump_ifs.
hi->name is a vector which is not null-terminated, so use vec_len.

Type: fix
Signed-off-by: Vladimir Isaev <visaev@netgate.com>
Change-Id: Icdd5f65369bb51b0c4a9cd86c24899e6febd837c
(cherry picked from commit 84f3d9fba4)
2020-09-30 11:30:55 +00:00
Mohsin Kazmi 36e657032c virtio: fix the gro enable/disable on tx-vrings
Type: fix

Change-Id: I96c30baaf34fe7b0cd899966a507501e58cde934
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 1017a1d360)
2020-09-30 11:30:25 +00:00
Filip Tehlar c6f50a3e3e ikev2: fix false positive NAT detection
Type: fix

Change-Id: Id7f865f537c55d00a784eec51624ba28e903a083
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-09-30 11:30:08 +00:00
Benoît Ganne db17fa2fb8 ikev2: fix memory leaks
Type: fix

Change-Id: I5be19a4923b37e2636621d36155178ac348ee41c
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit a8af7cf253)
2020-09-29 17:23:26 +00:00
Dave Wallace 6cb106314b build: remove OS distros which are EOL
Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: If80ff6bfbd42779a663af1e7dcfff80d75f47f1e
2020-09-28 23:06:27 +00:00
Andrew Yourtchenko 29fd163e1c dpdk: Revert "call the meson-based build instead of Makefiles"
This reverts commit 73903d7e8a.

After discussion with Damjan, the change is more risky than it seemed,
so revert.

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Idee82806cd4a12a92540f904397d259b531770d1
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-09-28 12:18:58 +00:00
Andrew Yourtchenko a0b1329aa6 dpdk: Revert "prevent linking dpdk against libbsd"
This reverts commit 7a76017951.

After discussion with Damjan, the change is more risky than it seemed,
so revert.

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I67defb01a0bebb8ff4231c27690b694f608fcb8e
2020-09-28 12:16:52 +00:00
Andrew Yourtchenko c7b359ff53 misc: documentation fixes
Change-Id: Id7ae7bbc53e89777892b973008baa93f1a083aac
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-09-25 17:41:29 +00:00
Klement Sekera a26b40af90 bfd: add missing unlock
Thanks to Martin Sustrik for spotting the bug introduced by a316744
and submitting the fix.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I4984fc32503b0c7b6db3543834dfbbfed2a1f23c
2020-09-25 13:31:26 +00:00
Florin Coras df143bf705 wireguard: fix uninitialized peer index in handoff
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I41513b9aa6ca0db1fb9392a15e5ac329a635ebfa
2020-09-24 17:19:12 -07:00
Artem Glazychev 48d81b58df wireguard: add handoff node
All timer and control plane functions happen from main thread

Type: fix

Change-Id: I4fc333c644485cd17e6f426493feef91688d9b24
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
(cherry picked from commit 8eb69407c8)
2020-09-24 18:54:26 +00:00
Dave Wallace c359dfa186 build: fix missing openssl package on debian-10
- libssl-dev missing on debian-10 breaks
  'make install-ext-deps'

Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: Ib6a6f120147e8ae0dcfead6fae9f0a7a3434d687
(cherry picked from commit 17569cbeb2)
2020-09-24 14:27:09 +00:00
Damjan Marion dccf863d79 vppinfra: allow handoff to main thread
Type: improvement
Change-Id: If2e907967c9b75997b581ff0c058bd5c15e823f5
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit f6e6c78807)
2020-09-24 12:15:52 +00:00
Steven Luong cc4f3d9102 avf: wrong argument passed to avf_log_err
Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ica4601c9d17e182cbc348989a9f75ab1cb18b78a
(cherry picked from commit ba3a20082d)
2020-09-23 20:52:16 +00:00
Dave Wallace ef73a0725d build: fix fts.py to run on debian-9/python3.5
Type: fix

Change-Id: I1404e73dd2ee62b51746e9f4760c7c3ca3b5989e
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
(cherry picked from commit a079844cf0)
2020-09-23 18:05:23 +00:00
Mohammed Hawari 7a76017951 dpdk: prevent linking dpdk against libbsd
If libbsd is detected by the DPDK build system, DPDK does not provide
implementations for strlcpy and dynamically link against the one
provided by libbsd. When the DPDK plugin is loaded by VPP, a crash
occurs because libbsd is not loaded by VPP.

Type: fix
Change-Id: Ib691bbe27edcf0f6f0a3d39952e439027cef72cb
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
(cherry picked from commit 1f799bc3cb)
2020-09-23 18:04:41 +00:00
Andrew Yourtchenko 226e8e65bc vppapigen: crcchecker: harmonize the in_progress marking
The format for deprecation is "option deprecated" now,
so harmonize the in-progress marking to logically be
"option in_progress"

At the same time recognize the legacy/erroneous
types of marking, print the warning.

Change-Id: If418dfadd69ffb112550164d63d13420e51cefd7
Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit 6a3d4cc9a1)
2020-09-23 15:21:58 +00:00
Andrew Yourtchenko 1aa63b83f9 build: allow for rc3/rc4 style tags
Historically, there was only rc1/rc2 tags, fix in case we tag
rc3/rc4 during longer release windows.

Type: fix
Change-Id: I4243a1c03663a877f96a06d647e89adb74abd977
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit bc31247c92)
2020-09-23 15:20:53 +00:00
Mohammed Hawari 73903d7e8a dpdk: call the meson-based build instead of Makefiles
Type: feature
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Change-Id: I576d92605da6d43e9b9f12238b18a518a0d69385
(cherry picked from commit 4c4633cad1)
2020-09-23 13:57:07 +00:00
Neale Ranns f72b1aff7d vxlan-gbp: Mark APIs as in-progress
Type: fix

The GBP plugin that uses this module is also in-ptogress, hence so is
this module.

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: I3cb5dd124afac05da013d92d67b2abf6cdf9b769
(cherry picked from commit b468773aa4)
2020-09-23 12:54:48 +00:00
Yulong Pei d69b12a7bf crypto: revert crypto set handler all API
This reverts commit 8c91b2ae2b,
but keep a comment fix.

Type: fix

Signed-off-by: Yulong Pei <yulong.pei@intel.com>
Change-Id: Ia66941bf18d3efac96f41bdf905d877cfb3ab211
(cherry picked from commit 6816c3b3df)
2020-09-22 13:33:56 +00:00
Dave Wallace d88c9a13e8 build: remove opensuse build infra
- VPP on opensuse has not been supported
  for several releases.

Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I2b5316ad5c20a843b8936f4ceb473f932a5338d9
(cherry picked from commit bc35f469c8)
2020-09-22 11:35:12 +00:00
Dave Wallace dd49451845 build: missing deb pkg on ubuntu-20.04
- The vpp build on the ubuntu-20.04 executor failed
  due to the package 'dh-python' not getting
  installed by 'make install-dep'

Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: Id9307ad1b4e34c413d90258c6bde2aa5afafec63
(cherry picked from commit 5cc11b1210)
2020-09-22 11:34:54 +00:00
Dave Wallace ef51f3696e build: touch files when extracting rpm tarballs
Type: fix

- Long story short, intermittently centos jobs have been
  failing with clock skew issues. When someone commits a
  patch on a machine with the date ahead of UTC, then clock
  skew will be encountered when extracting the RPM source
  tarball. See [0] and [1] for details.

- Replace 'make bootstrap' with 'make install-dep' in
  RPM package build specfile.

[0] https://unix.stackexchange.com/questions/164807/does-git-archive-use-the-wrong-file-timestamp
[1] https://git.fd.io/vpp/tree/Makefile#n380

Change-Id: Iebfb9eb2e26c1f2e4488e871da86d0c60b9f4048
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
(cherry picked from commit 27b50fea14)
2020-09-22 11:33:28 +00:00
Steven Luong 56eed87058 vmxnet3: gso fixes
outbound:
wrong header len computation
gso size and header length need to be set in the first segment of the
chain

inbound:
EOP may have zero length descriptor to terminate the chain
missing endian conversion for ethertype

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Iaa003c0e9af3ead4df6c6c0d5772a179d2ff15c4
(cherry picked from commit 007abe751f)
2020-09-16 17:03:13 +00:00
Andrew Yourtchenko a87deb77da vppapigen: crcchecker: report in-progress messages
in-progress messages do not give any API stability guarantees,
by design, to allow easy iteration. Provide an easy way
to know which messages are in-progress.

If as a user you see "in-progress" message that you want
to use in production, please contact the feature owner
and discuss the path to removing the "in-progress" status
before that.

Change-Id: I27729995e26a70af373e642b871dbb5cc5526959
Type: improvement
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit 8b0cd69d31)
2020-09-16 15:53:00 +00:00
Yulong Pei 4035daffd5 crypto: Crypto set handler API to support set all as CLI
Type: improvement

Signed-off-by: Yulong Pei <yulong.pei@intel.com>
Change-Id: I43556f8c76c7aae64d9c927e1fda3c1774d7e49d
(cherry picked from commit 8c91b2ae2b)
2020-09-16 15:13:56 +00:00
Damjan Marion fb66fcf3fb avf: change promisc mode from the avf process node
Avoid situations where promisc mode is chaged while avf process
is suspended in the middle of adminq operation.

Type: fix
Change-Id: Ia1fc6551e83218b5938630ad3a15d4f3f0ceceff
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 160a2a9a8c)
2020-09-16 12:45:49 +00:00
Damjan Marion 4b952f85bd avf: fix race between avf and cli/api process
device pool my grow during suspemd which will cause crash in avf process
after it exits from suspend.

Type: fix

Change-Id: I51fec90088c909cfbaaca6c245272a28c0827ca0
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 171d6aceb0)
2020-09-16 12:45:16 +00:00
Ole Troan 00f21fb2fe api: clean up use of deprecated flag
The syntax of the deprecated flag has evolved.
Clean up usage to be "option deprecated;".

Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: If2b639f275eb8db58b36c457f9245fe35a4d8cb1
(cherry picked from commit f916414b38)
2020-09-16 12:22:27 +00:00
Andrew Yourtchenko ec7e8d8598 vppapigen: crcchecker: report deprecated messages
Report if the messages were marked as deprecated,
but not yet deleted.

Useful for building the release notes and comparing
between the releases.

Also, put the dict_compare() call into the report(),
since latter always consumes the output of the former.

Change-Id: Iceab3e94ff66da931a4669b612026bd162dd5d1a
Type: improvement
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit 62bd50de97)
2020-09-16 11:24:38 +00:00
Damjan Marion 97109b1ad8 avf: add assert to ensure that adminq is used only from avf process
Type: improvement
Change-Id: Ib64c9b8207776986656e5a26c13a221edc6cc950
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 698eeb126d)
2020-09-16 11:14:42 +00:00
Neale Ranns 6efd393965 wireguard: Fix for tunnel encap
Type: fix

add UT for sneding handshale init and transport packets

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Iab1ed8864c666d5a0ae0b2364a9ca4de3c8770dc
(cherry picked from commit d75a2d12c4)
2020-09-16 11:03:59 +00:00
Onong Tayeng 21cbdc75f2 lisp: fix vat crash with one_add_del_local_eid api
VAT crashes when the one_add_del_local_eid api is invoked with mac
address as eid.

Type: fix

Signed-off-by: Onong Tayeng <otayeng@cisco.com>
Change-Id: I29e246f6cad4b350fec52d54e94dbed586d488c4
(cherry picked from commit 5f473c0efc)
2020-09-16 10:33:48 +00:00
Onong Tayeng a14f367e27 lisp: fix help msg of show eid-table command
The lisp|one show eid-table command's help msg does not display the
available options. This patch fixes that.

  show lisp eid-table [local|remote|eid <eid>]
  show one eid-table [local|remote|eid <eid>]

Type: fix

Signed-off-by: Onong Tayeng <otayeng@cisco.com>
Change-Id: Id39148db2ff291a7fe859830c1488b69ccd15c05
(cherry picked from commit b418c397dc)
2020-09-16 10:32:48 +00:00
Onong Tayeng c669272949 lisp: fix spelling mistake in option name
In the vat help msg for one_add_del_l2_arp_entry the IP address option
is misspelled as "ip4 <ip4>" when it should have been "ip <ip4>".

Type: fix
Signed-off-by: Onong Tayeng <otayeng@cisco.com>
Change-Id: Id4058a3ddfdb78b840d7e5a3c330e67b393f5d3b
(cherry picked from commit 8c6ba2957c)
2020-09-16 10:32:37 +00:00
Onong Tayeng d5f713ce60 lisp: fix lisp|one_eid_table_dump's local|remote options in vat
The local|remote options to vat's lisp|one_eid_table_dump api command
does not print the eid details instead it produces the following error
messages:

    Filter error, unknown filter: 1
    Filter error, unknown filter: 2

Type: fix
Signed-off-by: Onong Tayeng <otayeng@cisco.com>
Change-Id: I000c290b400dbf39bd883d57115923167092c9bd
(cherry picked from commit 2237cc8ce1)
2020-09-16 10:32:29 +00:00
Damjan Marion 2ee0098dee avf: fix race between avf process node and avf_delete_if(...)
It may happen that process node is suspended while it waits for response
from adminq and during that time CLI or API process can call
avf_delete_if. When avf process node resumes, it may happen that device
is not there anymeore.

This patch delegates interface deletion to process node, so CLI/API
process just sends signal instead of deleting device instance itself.

Type: fix

Change-Id: I7f12e12df3071650f6e60ad7eb5af23b7acfe335
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 66bb7dd64e)
2020-09-16 10:15:52 +00:00
Vladimir Isaev 95a77a2360 nat: Fix next feature for ED with multiple workers
Multiple (> 1) workers leads to handoff node being enabled.
This node pops next feature index to nat.arc_next to make sure
that packet will be pushed to the next feature in the arc.

But node nat44-ed-in2out-output also pops next feature and changes
arc_next. So actual next feature will be skipped in that case.

It leads to all nat44-ed-in2out packets being dropped if we have
multiple workers (handoff node enabled).

To resolve this a new node was added (nat-pre-in2out-output) to fill
arc_next in single worker case and multiple worker case is already
handled by handoff node.

Type: fix
Signed-off-by: Vladimir Isaev <visaev@netgate.com>
Change-Id: I9dfba68f00164d2d5ab867224871811bef4411ed
(cherry picked from commit 8fb4d10dc2)
2020-09-16 10:15:24 +00:00
Filip Varga 1f18c50174 nat: endian mismatch
Type: fix

Change-Id: Icf6ce0ddb5fe9d078503e9d9ff7e7b26423f53f8
Signed-off-by: Filip Varga <fivarga@cisco.com>
(cherry picked from commit 2fe25370ba)
2020-09-16 10:15:15 +00:00
Nathan Skrzypczak 6c25154e95 quic: Clean quic_crypto_setup_cipher
Type: fix

Change-Id: I4c19636c2be8a577c6cba272708cb04bcc24785b
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
(cherry picked from commit 8847749269)
2020-09-16 10:14:37 +00:00
Onong Tayeng 7bae4911bf lisp: fix crash with arp and packet trace on
With packet trace on, VPP crashes when an arp packet arrives. This patch
fixes the crash and also ensures that the packet trace displays the eid
info.

Type: fix
Signed-off-by: Onong Tayeng <otayeng@cisco.com>
Change-Id: Iaad09a5e2b33e931ab9bd7bc3d4573b5ed5e4bfd
(cherry picked from commit a3960a8b74)
2020-09-16 10:14:22 +00:00
Artem Glazychev 911d7563cb wireguard: fix handshake procedure
Type: fix

Change-Id: I96e8c5c9c792b1d9aefd39ce3e240d220827b7d1
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
(cherry picked from commit cf527882e2)
2020-09-16 09:45:13 +00:00
Neale Ranns 58db34c2ca wireguard: increase FIB source priority
Type: fix

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Icc1c458474d357c7d9b3b4df1897500de0c314a1
(cherry picked from commit a26b0d11e9)
2020-09-16 09:43:21 +00:00
Neale Ranns c71dad4a2d crypto: Crypto SW Scheduler Coverity Warnings
Type: fix

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: I7f98d0c7847ecc40b90b78e5ae83f320575be310
(cherry picked from commit 69f77a3a3c)
2020-09-15 14:40:10 +00:00
Damjan Marion ddd8c0fe59 crypto-native: fix issues detected by coiverity
Type: fix
Change-Id: Id61aa407eeeb4d44cf47ed39283a0c79ed3abbee
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 139a6ae0dd)
2020-09-15 11:25:25 +00:00
Yichen Wang 748bf82a50 build: fix the the build on centos/rhel 8
1. Remove uncessary runtime dependency;
2. Add missing build dependency;
3. Fix runtime dependency for api-python3 RPM;

Type: make

Change-Id: I2700f1a15112effba8d1527aca6467158f81f486
Signed-off-by: Yichen Wang <yicwang@cisco.com>
(cherry picked from commit 466872f089)
2020-09-15 10:08:53 +00:00
Filip Tehlar 57b16c694c ikev2: fix copy-paste error when freeing memory
Type: fix

Change-Id: If44c807d188b3e88d819f4132d73e6a34402a525
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit 999395cd66)
2020-09-15 10:07:50 +00:00
Benoît Ganne 047eebfa97 build: fix build for Debian 9 and Debian 10
Type: fix

Change-Id: Ic07d0ae313b32e420ba93693cb75960a86f752a9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 3f0ae664fa)
2020-09-15 08:40:06 +00:00
Florin Coras 89bdb836f9 vcl: always fill buffer or drain rx fifo
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ibbe438aa6f2fe6d9f55c56ca6d3aec1a29b32cad
(cherry picked from commit 4a2c794c43)
2020-09-15 08:39:26 +00:00
Neale Ranns ec8a577ed9 wireguard: coverity fixes
Type: fix

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Ib1eabbc87a573c660ac251602d631f167928259b
(cherry picked from commit 76770fd659)
2020-09-15 08:39:03 +00:00
Benoît Ganne a238082a8a vlib: fix call to vlib_get_node_by_name
Type: fix

Change-Id: I1b4f52e186165b04db5bd5f11058dc77b647bc94
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 268e3b6477)
2020-09-15 08:38:32 +00:00
Matthew Smith 649ba152cb l2: fix null deref in l2_to_bvi()
Type: fix

Static analysis identified a possible null pointer dereference. It
was introduced by a recent patch which expanded the DMAC comparison
on inbound packets on a BVI interface to include any secondary MAC
addresses which were added to an interface.

Check if the pointer is null before dereferencing.

Change-Id: Ic2afe2b062eda32977e05bf3f98d82c1fe64620c
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit 78681def21)
2020-09-15 08:38:11 +00:00
Benoît Ganne c13aab8ca1 ikev2: fix memory leaks
- make sure everything is freed on cleanup
 - reuse already allocated vectors where possible

Type: fix

Change-Id: Ibd8da1edb37126522dc2d525596521d32dceb73a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 730cec8c06)
2020-09-15 08:35:37 +00:00
Martin Millnert cb94290d5f misc: selinux fixes (packet_socket r/w)
vpp-20.05 on up-to-date Centos 7.8 host with enforcing SELinux fails to
create a host-interface due to two missing SELinux-permissions:

vpp_t self:packet_socket { read write }

This simple patch adds these two permissions. Tested successfully on
local installation.

The steps to reproduce:

$ ip link add vpeer-host type veth peer name vpeer-vpp
vpp# create host-interface name vpeer-vpp
create host-interface: Permission denied (errno 13)
[...]
$ semodule -i vpp-packet-socket.pp
vpp# create host-interface name vpeer-vpp
host-vpeer-vpp

Type: fix
Ticket: VPP-1931
Change-Id: I2b3d92b27b9a9f26aa1c85af2946b15e83e27944
Signed-off-by: Martin Millnert <martin@millnert.se>
(cherry picked from commit 68849350c5)
2020-09-15 08:35:15 +00:00
Aloys Augustin 6f1a86f187 quic: fix coverity warning
Change-Id: Ic31cde8564a0705710d91e0a7b90dcc6cf2f8db6
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2020-09-15 08:34:37 +00:00
Mohammed Hawari 758e6776a8 af_xdp: documents incompatibility with 1GB hugepages and high buffers-per-numa.
Type: docs
Change-Id: If8602d4b73cc1f04e42d19b8df60a05f67aa90c9
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
(cherry picked from commit 5d2091da2a)
2020-09-15 08:34:05 +00:00
Chenmin Sun f1b7953449 dpdk: fix coverity defect #214232, #182930
Type: fix

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: Ie328834159687cdb4314c37d36697f2fb9081fbd
(cherry picked from commit 504bcb7c29)
2020-09-12 21:54:43 +00:00
Andrew Yourtchenko f96ce156b5 misc: edit the MAINTAINERS entries for crypto plugins for common style
Change-Id: Ic40bf11210cf1c36420578281f5a42668bad9801
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit f8b319359c)
2020-09-11 18:07:25 +00:00
Andrew Yourtchenko fb6d768419 misc: Initial changes for stable/2009 branch
Change-Id: Ibb982c877427c8382a30ee561c23d878adc9c28d
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-09-09 21:54:44 +00:00
Nathan Skrzypczak c4781a32df docs: Improve new plugin doc & add govpp API doc
Type: docs

Change-Id: I5f20ac0232c5cdc3cf64015185b0d0fc5c4a3100
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-09-09 20:44:08 +00:00
Nathan Skrzypczak f681e9f736 docs: Update and improve indent install
Type: docs

Change-Id: I1a37450261e0bcedf90685243b14027f3cf23704
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-09-09 20:44:00 +00:00
Matthew Smith adf2fe0def l2: check secondary macs on BVI interface
Type: fix

VRRP cannot be used on a BVI interface currently because packets sent
to the virtual mac address of the VR fail the destination mac check in
l2_to_bvi().

Apparently people want to use VRRP on BVI interfaces, so update the
check in l2_to_bvi() so that it will check any secondary mac addresses
which have been added to the ethernet interface if the destination mac
address does not match the primary mac address for the interface.

An equivalent check is already done in ethernet_input_inline() for L3
interfaces which are in promiscuous mode.

Change-Id: I7c5bf624dafda8744fea236c704e8e17e5f53b35
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-09-09 19:45:26 +00:00
Nathan Skrzypczak 97158289bc docs: Fix create memif cli
Type: docs

Change-Id: I91a954abf77335e1ddcbd1468633d9d7980bbac2
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-09-09 16:56:28 +00:00
Benoît Ganne da5b4efbab svm: fix non-null-terminated string
Type: fix

Change-Id: Ia9cd71ce12584cd8ef90bfe357cf762dd7653f71
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-09-09 14:49:59 +00:00
Andrew Yourtchenko d78a5bc03e misc: Merge 20.05.1, 19.08.3 RELEASE.md sections
also, remove a duplicate 17.01.1 section and wrong page tag for 20.09

Change-Id: Ia2cc77faa75cccab38972ad46517762cb7456466
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-09-09 13:36:01 +00:00
Artem Glazychev edca1325cf wireguard: initial implementation of wireguard protocol
Type: feature

The main information about plugin you can see in README.md

vpp# wireguard ?
  wireguard create                         wireguard create listen-port <port> private-key <key> src <IP> [generate-key]
  wireguard delete                         wireguard delete <interface>
  wireguard peer add                       wireguard peer add <wg_int> public-key <pub_key_other>endpoint <ip4_dst> allowed-ip <prefix>dst-port [port_dst] persistent-keepalive [keepalive_interval]
  wireguard peer remove                    wireguard peer remove <index>

Change-Id: I85eb0bfc033ccfb2045696398d8a108b1c64b8d9
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Jim Thompson <jim@netgate.com>
Signed-off-by: Neale Ranns <nranns@cisco.com>
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-09 11:57:48 +00:00
Fan Zhang ef80ad6bff crypto: change cryptodev with new cryptodev API
Type: feature

This patch updateds cryptodev engine uses new DPDK Cryptodev
API planned to be upstreamed in DPDK 20.11.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Signed-off-by: Piotr Bronowski <piotrX.bronowski@intel.com>
Change-Id: I8dd1a8ac643f1e952deb787e466b76ea7aa5f420
2020-09-09 10:19:21 +00:00
Chenmin Sun c4665093cd interface: support configuring RSS steering queues
This patch adds the RSS steering queues set interface, and it's
implementation in DPDK device:

/* Interface to set rss queues of the interface */
typedef clib_error_t *(vnet_interface_rss_queues_set_t)
  (struct vnet_main_t * vnm, struct vnet_hw_interface_t * hi,
   clib_bitmap_t *bitmap);

This patch also introduces a command line to set the RSS queues:
  set interface rss queues <interface> <list <queue-list>>
To display the rss queues, use "show hardware-interfaces"

Below is the example to configure rss queues for interface Gig0:
vpp# set interface rss queues Gig0 list 0,2,4-7
vpp# show hardware-interfaces brief
              Name                Idx   Link  Hardware
VirtualFunctionEthernet18/1/0      1    down  VirtualFunctionEthernet18/1/0
  Link speed: unknown
  RSS queues: 0 2 4 5 6 7
local0                             0    down  local0
  Link speed: unknown
vpp#

Users can also configure the rss queues on a dpdk interface in
startup.conf:
dpdk {
    dev 0000:18:01.0 {
        rss-queues 0,2,5-7
    }
}

Type: feature

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: I1835595a1c54016a84eabee9fd62ce137935385d
2020-09-09 10:12:06 +00:00
Rajesh Goel 765008670b stats: Fix stat_segment to set timeout directly
Type: fix

Signed-off-by: Rajesh Goel <rajegoel@cisco.com>
Change-Id: Ib37802f4270fe894a31e871c7fbb12b5a1cdf058
2020-09-09 06:47:15 +00:00
Ryujiro Shibuya ddfd56265e tcp: fix the tcp unittest to work
Type: fix

Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com>
Change-Id: If5a8313262da828616db8b1d9ef831d42b11d952
2020-09-09 04:14:11 +00:00
Christian Hopps f6cb044604 dpdk-ipsec: don't leak buffers on crypto alloc failure
Type: fix
Signed-off-by: Christian Hopps <chopps@labn.net>
Change-Id: I4dee2ea723631e1bd95b33a74b9431d984565aef
2020-09-08 17:12:22 +00:00
Christian Hopps cd64f73951 dpdk: fix extended stat strings
- These were displaying blank, apparently dpdk extended stat strings
must be within the heap so they are identified as vectors by
format_c_identifier even though they are not.

Type: fix
Change-Id: I2b153b100203b9856ce3af6d5ecb2daae410fb5b
Signed-off-by: Christian Hopps <chopps@labn.net>
2020-09-08 16:58:29 +00:00
Christian Hopps 527746ff06 dpdk: fix interface counters to never go backward
Was seeing imissed counter become negative. Reuse the RX_ERROR code for all
three error counters to avoid the problem.

Type: fix
Change-Id: I99a69c8816326682745785ecd30e18a131ac2969
Signed-off-by: Christian Hopps <chopps@labn.net>
2020-09-08 16:55:52 +00:00
Florin Coras 97d39e3e05 svm session: document unsupported fifo deq combinations
Type: fix

- Document that ooo dequeues with ooo lookups cannot be done in
combination with in order dequeues.
- Added assert to capture this scenario and de-initialized rbtrees for
cut-through tx fifo

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic40d020b3f0391fcf022ea3c906b86121744144f
2020-09-08 16:14:08 +00:00
Christian Hopps fb7e7ed2cd ipsec: fix padding/alignment for native IPsec encryption
Not all ESP crypto algorithms require padding/alignment to be the same
as AES block/IV size. CCM, CTR and GCM all have no padding/alignment
requirements, and the RFCs indicate that no padding (beyond ESPs 4 octet
alignment requirement) should be used unless TFC (traffic flow
confidentiality) has been requested.

  CTR: https://tools.ietf.org/html/rfc3686#section-3.2
  GCM: https://tools.ietf.org/html/rfc4106#section-3.2
  CCM: https://tools.ietf.org/html/rfc4309#section-3.2

- VPP is incorrectly using the IV/AES block size to pad CTR and GCM.
These modes do not require padding (beyond ESPs 4 octet requirement), as
a result packets will have unnecessary padding, which will waste
bandwidth at least and possibly fail certain network configurations that
have finely tuned MTU configurations at worst.

Fix this as well as changing the field names from ".*block_size" to
".*block_align" to better represent their actual (and only) use. Rename
"block_sz" in esp_encrypt to "esp_align" and set it correctly as well.

test: ipsec: Add unit-test to test for RFC correct padding/alignment

test: patch scapy to not incorrectly pad ccm, ctr, gcm modes as well

- Scapy is also incorrectly using the AES block size of 16 to pad CCM,
CTR, and GCM cipher modes. A bug report has been opened with the
and acknowledged with the upstream scapy project as well:

  https://github.com/secdev/scapy/issues/2322

Ticket: VPP-1928
Type: fix
Signed-off-by: Christian Hopps <chopps@labn.net>
Change-Id: Iaa4d6a325a2e99fdcb2c375a3395bcfe7947770e
2020-09-07 09:43:27 +00:00
Christian E. Hopps dce44e4e23 marvell: add cli options to configure rxq and txq sizes
Add the ability to configure the pp2 rx and tx queue sizes in the CLI.

Type: improvement
Signed-off-by: Christian E. Hopps <chopps@chopps.org>
Change-Id: I6a824f92e22fa47fec3d84525cc2d82524ddf639
2020-09-06 08:50:38 -04:00
Nathan Skrzypczak 4b2946a884 vlib: vlib_get_node_by_name fails via API
Type: fix

Calling vlib_get_node_by_name via the VPE api
doesn't work due to hash weirdness. Haven't
gotten around the real cause of this. But this
fixes it.

Change-Id: I89f95dba2bcd9573b8f1f435e063e9dd57f9ca93
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-09-05 08:43:44 +00:00
Nathan Skrzypczak 24179ee1a4 docs: Improve & link cnat doc
Type: docs

Change-Id: Ib985ed6a644ae3f4c330bf6a27dc69c49a489a2f
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-09-05 08:37:51 +00:00
Dave Barach e697caf9f8 cnat: fix cnat_set_snat() debug CLI
Otherwise, the debug CLI command is unusable in a script because it
will eat (and complain about) subsequent lines in the script. Missing
this guitar lick, etc:

/* Get a line of input. */
 if (!unformat_user (input, unformat_line_input, line_input))
   return 0;

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Id328e6f1cc4d2e1672c3946db3865ab5a1a3af8d
2020-09-04 16:33:25 -04:00
MathiasRaoul 5c721baeb1 cnat: fix snat ip v6 tests
Type: fix

Change-Id: I9e102e0028274cc084e59c106d1cd4be174b1205
Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com>
2020-09-04 16:57:22 +00:00
Mohsin Kazmi a7a2281732 virtio: remove kernel virtio header dependencies
Type: refactor

tap, virtio and vhost use virtio/vhost header files from linux
kernel. Different features are supported on different kernel
versions, making it difficult to use those in VPP. This patch
removes virtio/vhost based header dependencies to local header
files.

Change-Id: I064a8adb5cd9753c986b6f224bb075200b3856af
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-09-04 13:34:20 +00:00
Matthew Smith f1cd3da20f vrrp: improve RFC compliance for ARP/ND
Type: fix

The ARP/ND feature nodes reply to requests for a VR virtual IP address
when a VR is in the master state. If the VR is in the backup state, the
request is passed to the next node on the feature arc.

This can cause an incorrect response to be sent. If some other feature
(e.g. NAT) causes a virtual IP address to be configured as a "local"
address on the system, a later node on the feature arc may respond to
an ARP/ND request with the real MAC address of the interface.

RFC 5798 says that a router must respond to ARP/ND requests for VR
virtual IP addresses with the VR virtual MAC address. And it says a
router must not respond to ARP/ND requests for VR virtual IP addresses
when the VR is in the backup state. Ensure that ARP/ND requests for
VR virtual IP addresses are dropped when in the backup state rather
than allowing them to continue on the feature arc where another node
may end up responding.

In order to do this, enable/disable the feature nodes when leaving
or entering the init state instead of the master state.

Change-Id: I416f83e125cbf91deb90c3b6eb00ba3207de24ad
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-09-04 12:55:42 +00:00
Damjan Marion 0be1b764a3 buffers: improve cache occupancy
Adjust buffer allocation so it always have odd number of cache lines.
That should result in better distribution of cachelines among cache sets.

Type: improvement
Change-Id: I0d39d4cf01cff36ad6f70a700730823a96448c22
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-04 12:45:46 +00:00
Christian Hopps 93a7f63943 dpdk-ipsec: use init function instead of one-time process
Use VLIB_MAIN_LOOP_ENTER_FUNCTION to do post init initialization for
dpdk crypto rather than create a one-time process to do the same.

Type: fix
Signed-off-by: Christian Hopps <chopps@labn.net>
Change-Id: I06e480b028c8e1fc1b0024a66b2338eb21a797ca
2020-09-04 12:40:54 +00:00
Nathan Skrzypczak 5cd626eb1e vpp: Fix node APIs
Type: fix

Change-Id: Ic6e2b7e05b50945a8e2222019c2942a6ee52e465
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-09-04 12:14:51 +00:00
Christian Hopps 942b9803f8 dpdk-ipsec: fix show output
Fix the shown crypto inflight counts which were reversed. Also improve a
couple error descriptions to tell them apart when viewed.

Type: fix
Signed-off-by: Christian Hopps <chopps@labn.net>
Change-Id: I6d4054c64aa842658cfcde8969c7aa48f6d21207
2020-09-04 12:12:57 +00:00
Christian Hopps d570e53c74 ipsec: fix trace of GRE_teb packets
The issue is not easily hit. When GRE_teb packets are received the post
crypto processing adjusts the l2.l2_len value in the vnet_buffer opaque
data. This is overwriting the ipsec opaque data. Later the trace code
fetches the sa_index from the ipsec opaque data. It's just an accident
that this currently works, if the ipsec data is changed so that the
sa_index moves around it will be overwritten by the l2_len modification.
Indeed, this was found b/c local development changes had moved the
sa_index so it was over-lapping with the l2_len memory space, and the UT
failed.

Type: fix
Change-Id: Iaecfa750cf0b36653fd9e75b4d799f323a14d932
Signed-off-by: Christian Hopps <chopps@labn.net>
2020-09-04 11:56:06 +00:00
Christian Hopps 99975388a2 ipsec: cli: add missing flags for SA add
Add missing cli options for setting IPsec SA flags, inbound,
use-anti-replay, and use-esn.

Type: fix
Change-Id: Ia7a91b4b0a12be9e4dd0e684be3e04d8ccafb9d4
Signed-off-by: Christian Hopps <chopps@labn.net>
2020-09-04 11:40:45 +00:00
Zhiyong Yang 5e52417a2a ip: enhance vtep4_check of tunnel by vector way
This patch aims to improve decap performance by reducing expensive
hash_get callings as less as possible using AVX512 on XEON.
e.g. vxlan, vxlan_gpe, geneve, gtpu.

For the existing code, if vtep4 of the current packet match the last
vtep4_key_t well, expensive hash computation can be avoided and the
code returns directly.

This patch improves tunnel decap multiple flows case greatly by
leveraging 512bit vector register on XEON accommodating 8 vtep4_keys.
It enhances the possiblity of avoiding unnecessary hash computing
once hash key of the current packet hits any one of 8 in the 512bit
cache.

The oldest element in vtep4_cache_t is updated in round-robin order.

vlib_get_buffers is also leveraged in the meanwhile.

Type: improvement

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Signed-off-by: Junfeng Wang <drenfong.wang@intel.com>
Change-Id: I313103202bd76f2dd638cd942554721b37ddad60
2020-09-04 02:34:03 +00:00
Christian Hopps 4a433f4608 api: fix ipsec custom_dump function
The protocol value was changed to 50 and 51 (rather than 0 and 1), but
the custom_dump function wasn't updated to reflect this. Also the is_add
value wasn't being shown. Fix both these issues.

Type: fix
Change-Id: I429b4616d6c7937f73308b644154370fab32eaae
Signed-off-by: Christian Hopps <chopps@labn.net>
2020-09-03 22:53:34 +00:00
Christian Hopps 4d56b18ce5 misc: l2tp: cli: fix overly generic CLI commands
"clear counters" is not appropriate for a protocol to own. Change
to "clear l2tp counters" (and "test l2tp counter").

Type: fix
Signed-off-by: Christian Hopps <chopps@labn.net>
Change-Id: I3faac3907c4697c1c95df34ac7d31e48063869a8
2020-09-03 22:51:24 +00:00
Christian Hopps 1da08197eb vlib: exit 0 (nocore) on SIGHUP
Scenarios where SIGHUP is sent would include the user closing an xterm
while in interactive/nodaemon mode, or similarly when running vpp in the
same mode during testing (e.g., using ssh to run VPP on a DUT). VPP
should exit in these cases; however, generating a core is unwanted.

Type: fix
Signed-off-by: Christian Hopps <chopps@labn.net>
Change-Id: Ibccfe5e676547e913c8a205ff16ab56d9abb1c82
2020-09-03 22:50:13 +00:00
Nathan Skrzypczak 0c936b147f crypto: Add async crypto APIs
Type: feature

This adds api calls for the following CLIs:
* set sw_scheuduler worker <N> crypto on|off
* set crypto async dispatch polling|interrupt
* set crypto handler
* set crypto async handler

Change-Id: Ic701d149c440e42ea4575da42b9f69e4c8759602
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-09-03 16:49:19 +02:00
PiotrX Kleski 2284817eae crypto: SW scheduler async crypto engine
Type: feature

This patch adds new sw_scheduler async crypto engine.
The engine transforms async frames info sync crypto ops and
delegates them to active sync engines. With the patch it
is possible to increase the single worker crypto throughput
by offloading the crypto workload to multiple workers.

By default all workers in the system will attend the crypto
workload processing. However a worker's available cycles
are limited. To avail more cycles to one worker to process
other workload (e.g. the worker core that handles the RX/TX
and IPSec stack processing), a useful cli command is added
to remove itself (or add it back later) from the heavy
crypto workload but only let other workers to process the
crypto. The command is:

 - set sw_scheduler worker <idx> crypto <on|off>

It also adds new interrupt mode to async crypto dispatch node.
This mode signals the node when new frames are enqueued
as opposed to polling mode that continuously calls dispatch node.

New cli commands:
 - set crypto async dispatch [polling|interrupt]
 - show crypto async status (displays mode and nodes' states)

Signed-off-by: PiotrX Kleski <piotrx.kleski@intel.com>
Signed-off-by: DariuszX Kazimierski <dariuszx.kazimierski@intel.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
Change-Id: I332655f347bb9e3bc9c64166e86e393e911bdb39
2020-09-03 14:23:51 +00:00
Florin Coras 56230097e2 vcl: handle svm fifo write failure
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4b132cad8ff906ef24846cc43935ccfd6aa7b4ec
2020-09-02 20:52:58 -07:00
Florin Coras 67fe778546 tcp: fix connection refused error
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I436741e061f11685980a71fb3989befc7af1e081
2020-09-02 17:54:31 +00:00
Filip Varga 6484f4b9cb nat: twice-nat static mapping pool address
Let twice-nat static mapping pick specific
address from the twice-nat pool.

Type: improvement

Change-Id: Iadaa036af2fa3b0e6e9a68ff6e68b4bbe1650eb1
Signed-off-by: Filip Varga <fivarga@cisco.com>
2020-09-02 16:42:41 +00:00
Neale Ranns 42845dd56e fib: IPv6 lookup data structure MP safe when prefixes change
Type: fix

adding routes should be MP safe. When new prefixes with differrent
prefix lengths are added, adjust the sorted list in an MP safe way.

Change-Id: Ib73a3c84d01eb86d17f8e79ea2bd2505dd9afb3d
Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-09-02 16:09:42 +00:00
yedg f6698d2674 fib: fix ADJ_NBR_ITF_OK param error
Type: fix
Signed-off-by: yedonggang <yedg@wangsu.com>
Change-Id: I3bf67070ed01df40626f3b90f2762158b6c3ce05
2020-09-02 16:07:24 +00:00
Steven Luong ea7178631e bonding: add bond_create2 API to include gso option
gso option is available for the debug CLI version of bond create.
This patch is to create a new API to have the corresponding option in
the binary API. The old binary API bond_create is marked deprecated.

Type: improvement

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Id9501b8e6d267ae09e2b411957f181343da459c0
2020-09-02 14:47:28 +00:00
Florin Coras 8ccea00339 session: fix non-blocking msg enqueue to vpp mq
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I7228a01d38e61cc00358419b2512ca0da4f76ff5
2020-09-02 14:28:19 +00:00
Yulong Pei 2e84d66554 ipsec: add ipsec set async mode api
Type: improvement

Signed-off-by: Yulong Pei <yulong.pei@intel.com>
Change-Id: I841f4407ed8c1a448e5102059fc79ae1f7d461de
2020-09-02 13:09:10 +00:00
Benoît Ganne 7d4a997ea1 misc: fix pcap [rx|tx|drop] filename stem overflow
Type: fix

Change-Id: I2b6b7b6f28cbf7accf883743e390b0031dd13bbb
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-09-02 13:02:02 +00:00
Mohsin Kazmi a1a2246eab tap: add the static assert for api flags
Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ia1276d00dded36ee28b4b2e93b4cc7c1df6b1eef
2020-09-02 12:00:31 +00:00
Mohsin Kazmi 518251bc8a virtio: add virtio 1.1 api flags
Type: feature

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I95d7fc1cc8db5199570c66535f45e867a7cae676
2020-09-02 11:50:00 +00:00
jiangxiaoming 9f1dbd20b3 build: Fix 'make build VPP_EXTRA_CMAKE_ARGS=-DVPP_ENABLE_SANITIZE_ADDR=ON' error on Centos 7
Type: fix

Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com>
Change-Id: Ic47f5e8627923c951333c70004850b53ed4cab06
2020-09-02 10:02:50 +00:00
Mohsin Kazmi 50bd165599 tap: add virtio 1.1 API flag
Type: feature

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I3e00deb94943c545d1649865b2efdf7d51b90f4d
2020-09-02 08:48:58 +00:00
Artem Glazychev 1b6ed022e7 crypto-openssl: add chacha20-poly1305 to crypto-openssl
Type: feature

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: Iec28fb11b6edff1bee23117f56aa3a3e5729541a
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-01 19:12:22 +00:00
Mohsin Kazmi 0a507d7cd5 virtio: fix the bar starting index
Type: fix

Change-Id: Ia28161b583ea26ab820a494332a79b64add7004d
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-09-01 18:18:48 +02:00
Mohsin Kazmi c79d735362 virtio: fix the NULL deference
Type: fix

Change-Id: I8d55c2bfdd3c4607044370ebabf40cbac78b4996
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-09-01 17:47:36 +02:00
Mohsin Kazmi c96e64b617 virtio: fix the error return
Type: fix

Change-Id: I12b08333f3f69aaa882e8801f4f69bca2d7bd558
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-09-01 17:47:29 +02:00
Aloys Augustin b6e211ad3b misc: fix uninitialized use warnings with gcc-{8,9}
Change-Id: I4930c3c2a8025ec9ceb17e994137be67d88d455f
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2020-09-01 15:22:32 +00:00
Ole Troan 6006ca8571 vppapigen: supports backwards compatible marking of enums
enum bar_enum {
  BAR1 = 0,
  BAR2,
  BAR3 [backwards_compatible],
  BAR4 = 9 [backwards_compatible],
};

This allows adding backwards compatible (as guaranteed by the developer) enums.
The enums marked backwards compatible are not considered in the CRC calculation.

Type: improvement
Change-Id: I6fc0c21b19e1a02cff7f5d279a0f3a32d2f8b630
Signed-off-by: Ole Troan <ot@cisco.com>
2020-09-01 15:10:09 +00:00
Artem Glazychev 61f49aa38e crypto: add chacha20-poly1305 algo
Type: feature

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: I3697cf7fab7abb7c3d2f61ef326c9116bc1eed66
2020-09-01 14:07:39 +02:00
Benoît Ganne 6e334e3e77 ip: fix ip zero checksum verification
In one's complement, there are two representations of zero: the all
zero and the all one bit values, often referred to as +0 and -0. See
RFC 1624 section 3 for more details.
This used to be taken care of in ip4_header_checksum(), but it is no
longer the case. The check ip->checksum == ip4_header_checksum (ip) is
no longer correct in the -0 case.
Always use ip4_header_checksum_is_valid() instead (which behaves
correctly since 9a79a1ab93).

Type: fix
Fixes: e5f0050c7a

Change-Id: Iacc6b60645a834287b085aecb9e3fdb4554cf0cf
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-09-01 12:03:27 +00:00
jiangxiaoming 1d104c5ecd dpdk: fix mac address length was wrong
Type: fix

Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com>
Change-Id: I87c6f423ea8fdd9fb764693055eb1509f994d6f1
2020-09-01 12:01:56 +00:00
Benoît Ganne faec38f3e1 fib: detect wrong adj neighbour bugs
Type: improvement

Change-Id: Ie063ee0a0c59a9ad632200ce2b23703bc0d936e6
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-09-01 11:43:13 +00:00
Benoît Ganne 4069f41c6e mpls: fix adjacencies walk in case of restack
Adjacencies are only defined for IPv4 and IPv6.

Type: fix
Fixes: 20aec3db44

Change-Id: I19b2b7f6958da49f41c6eabc9f248840769acbbb
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-09-01 11:42:37 +00:00
Nathan Skrzypczak 7be474635d vppinfra: Fix bihash coverity warning
Type: fix

Hitting a code not reachable when setting
BIHASH_KVP_AT_BUCKET_LEVEL = 1

Change-Id: I24d539df67ae7650a3b1969f5709a6f7366d786b
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-09-01 11:19:34 +00:00
Nathan Skrzypczak 369e4e56e2 cnat: Fix typo in ts handling
Type: fix

Change-Id: I5287f6326726780c09e515eede0992bafb413bb2
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-09-01 11:18:23 +00:00
Damjan Marion 9a79a1ab93 ip: improve ip4_header_checksum_is_valid
It is cheaper to include checksum field in calculation and simply
compare result with zero.

Type: improvement

Change-Id: I6f77632c0a4d2f2c632d044d3a5d2fcf2b5bac62
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-01 06:56:26 +00:00
Klement Sekera edc816355a nat: fix type in api message
Translation memory size is internally a uword, but in api it was u32,
resulting in the returned value being 0 all the time.

Fix the "incorrect" API reply to return a u32 capped to 0xffffffff if
the u64 is larger than that, introduce the message with
the correct type, deprecate the message with the incorrect type.

Also, while we are updating the message definition,
add the max translations / max users per worker thread
into the new message.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I92e38a6a2bcb70fc8d1b129bbe416bf7f9e54280
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-08-31 21:52:42 +00:00
Vladimir Isaev b59095f830 vlib: extend telnet protocol guard
There is a number of TERMs with big length, such as
'screen.konsole-256color' (23). These TERMs can not
be processed properly by vpp because maximum telnet
byte stream supported is 24 and we need 6 more service
bytes to send TTYPE.

So I extended maximum depth guard to 32.

Type: fix
Signed-off-by: Vladimir Isaev <visaev@netgate.com>
Change-Id: I9ca506996a97e9567d06483c5f020d6cc394329c
2020-08-31 20:43:34 +00:00
Damjan Marion 90d05bc7fb vppinfra: convert A_extend_to_B to B_from_A format of vector inlines
Make it shorter and same format when converting to biggor or smaller
types.

Type: refactor

Change-Id: I443d67e18ae65d779b4d9a0dce5406f7d9f0e4ac
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-08-31 18:46:21 +00:00
Ray Kinsella f9c8fe4128 vpp_config: update node variants to skx and icl
Node variant names have changed to skx and icl.

Type: fix

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I5be832aa59e4e440df53869077d801c011e3defa
2020-08-31 18:17:20 +00:00
Jieqiang Wang c8833b2191 ip: fix compiling error with gcc-10
Building VPP using gcc-10 fails because of the array bounds check
error for function ip4_header_checksum(), with option field in IPv4
header exceeding the ip4_header_t bound. Fix this error by turning
off the array bounds check option for function ip4_header_checksum().

Change-Id: I68cc241ae9e403d35ac2e320549506dc6565a0b6
Type: fix
Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
2020-08-31 18:15:51 +00:00
Benoît Ganne 4a76d6f6da af_xdp: AF_XDP input plugin
Type: feature

Change-Id: I85aa4ad6b68c1aa0e51938002dc691a4b11c545c
Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-08-31 17:16:56 +00:00
Mohammed Hawari bfed7c047d rdma: bugfix in the descriptor refill logic. In case of a partial allocation, the remainder modulo 8 must be returned to the pool so that the number of kept buffers is a multiple of 8.
Type: fix
Change-Id: Ifd97b03ea220300e7e6fe81a8ff4a25060fea6c1
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2020-08-31 17:16:38 +00:00
jiangxiaoming dfb30d9d30 session: format app_ns_name with %v rather than %s
Type: fix

Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com>
Change-Id: Ie29dec803aa4ee02755190b09573c23f9b5f0ada
2020-08-31 16:35:49 +00:00
Chenmin Sun 34bfa50b61 flow: code refactor
This is the code refactor for vnet/flow infra and the dpdk_plugin flow
implementation. The main works of the refactor are:
1. Added two base flow type: VNET_FLOW_TYPE_IP4 and VNET_FLOW_TYPE_IP6
   as the base the flow type
2. All the other flows are derived from the base flow types
3. Removed some flow types that are not currently supported by
   the hardware, and VPP won't leverage them either:
   IP4_GTPU_IP4, IP4_GTPU_IP6, IP6_GTPC, IP6_GTPU,
   IP6_GTPU_IP4, IP6_GTPU_IP6
4. Re-implemented the vnet/flow cli as well as the dpdk_plugin
   implementation
5. refine cli prompt
6. refine display info in command "show flow entry"

Type: refactor

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: Ica5e61c5881adc73b28335fd83e36ec1cb420c96
2020-08-31 12:14:03 +00:00
Neale Ranns 29f3c7d2ec cnat: Destination based NAT
Type: feature

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: I64a99a4fbc674212944247793fd5c1fb701408cb
2020-08-31 09:23:32 +00:00
Mohsin Kazmi 133c91c1c0 virtio: fix the coverity warning
Type: fix

Change-Id: I6c6d66ad8aa158be8d2b9d111de7d46473b9dc02
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-08-31 09:05:02 +00:00
Dave Barach 2b79341dca vppinfra: add clib_mem_destroy_mspace(void *ms)
Also clib_mem_destroy() to destroy the current mspace.

Handy when an application wants to make a memory allocation arena
disappear.

Type: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I020db902fbe2473545506fecbc230c2b048992f8
2020-08-28 15:31:07 +00:00
Neale Ranns e6df80de41 ipsec: Deprecate old interface API
Type: feature

Change-Id: Ib5d7b7e4735a5dec6c3ed74068206a86782588ca
Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-08-27 15:55:28 +00:00
Florin Coras bcdc50d900 session: limit max number of ct sessions per dispatch
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia67662a5b988b3b5351cea21d6d92fb3a86629b5
2020-08-27 10:35:48 +00:00
Nitin Saxena e2f5236dc5 vppinfra: Multiarch support for OCTEONTX2 SoC
Type: feature

- Added multiarch support for Marvell OCTEONTX2
- Corrected Marvell THUNDERX2 spelling

Signed-off-by: Nitin Saxena <nsaxena@marvell.com>
Change-Id: I42d3654aeda89759a2db9d695592ee3227b26c2b
2020-08-27 09:57:02 +00:00
Vladimir Ratnikov ed04407829 dpdk: fix blacklists
When we have both format blacklisted devices like:
blacklist 1234:5678
blacklist 1234:56:78.0

unformat with fmt=%x:%x matches for both strings
 and the rest 78.0 substring is kept in input
 and it can't be parsed for init args

This patch checks first if device format matches PCI address and
 just then if it matches Vendor and Product

Type: fix
Change-Id: If111762c0e0a424b052e4f6dc0f67731bf89dc2a
Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com>
2020-08-27 08:25:56 +00:00
Andrew Yourtchenko a3b7c554c6 tests: "force solo" testcase support
Some of the tests are time-sensitive, and at present require a non-trivial
modification in order to run at high concurrency.

Without these modifications, they intermittently fail, and require
the test retries.

Rather than setting them to the extended tests and forgetting
about them, put them into a "solo" set, which gets run in a
single-threaded mode after the rest of the tests are done.

Mark a few of the tests that showed errors during TEST_JOBS=48
as forced-solo.

Also, give a better diagnostic if the testcase misses a docstring
needed to represent it in the diagnostic outputs.

Type: fix

Change-Id: I33fe62eb17edc1885bd2c3523892051d52da6546
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-08-27 08:03:38 +00:00
Dave Barach d135487aff vppinfra: elog multi-track g2 test pattern
Type: test

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ia4504629cb5e87067a337d16f43e044399b87cac
2020-08-26 21:57:09 +00:00
Damjan Marion 3373a55f91 dpdk: bump to DPDK 20.08
Type: improvement

Change-Id: Id864c80ac0c9e6f3514a99e516fed82a998effff
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-08-26 11:42:33 +00:00
hanlin f8e1363c4f vcl: fix duplicated key of session_index_to_vlsh_table in multiple
threads vcl workers scenario

Type: fix

In multiple threads vcl workers scenario, multiple vcl workes can create
sessions with same index. Because only one vls worker created, key of
session_index_to_vlsh_table is duplicated.

Signed-off-by: hanlin <hanlin_wang@163.com>
Change-Id: I7e1f5bc471adc5378194452aef85e611f5d0df1d
2020-08-26 01:04:50 +00:00
Benoît Ganne cd631b5ba0 rdma: bump rdma-core version to v31.0
Type: improvement

Change-Id: If02deabea1fe47bbe82c53182e24a97cff68f8ec
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-08-25 20:34:51 +00:00
Florin Coras a5ea8211b1 vcl: cleanup non-blocking connect
Make sure session is in non-closed state after non-blocking connect to
ensure cleanup is performed, if needed.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic1533b9864828f875c840dfdfeed08bf32d10651
2020-08-25 13:39:29 +00:00
Chenmin Sun d0236f725d flow: add vnet/flow formal API
This patch adds the API for vnet/flow infra.
Currently this API supports the below flow types:
    VNET_FLOW_TYPE_IP4_N_TUPLE
    VNET_FLOW_TYPE_IP6_N_TUPLE
    VNET_FLOW_TYPE_IP4_N_TUPLE_TAGGED
    VNET_FLOW_TYPE_IP6_N_TUPLE_TAGGED
    VNET_FLOW_TYPE_IP4_L2TPV3OIP
    VNET_FLOW_TYPE_IP4_IPSEC_ESP
    VNET_FLOW_TYPE_IP4_IPSEC_AH
    VNET_FLOW_TYPE_IP4_GTPU

All the above flows are tested with Intel E810/X710 NIC

Type: feature

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: Icb8ae20cab9bdad6b120dddc3bd4fb1d85634f3f
2020-08-25 12:13:43 +00:00
Matthew Smith 4fa3aad33f ip-neighbor: skip probe for disabled interfaces
Type: fix

In ip6_neighbor_probe(), if the interface is not enabled for ip6,
return NULL and skip trying to build a packet.

If the interface is not enabled, its mcast adjacency will be set to
~0 and a seg fault will ensue.

Change-Id: I825c9f40a0d5b2a77f788ac8dbd618138706383d
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-08-25 07:45:40 +00:00
Ole Troan bad679291a api: register endian handlers for reply messages
Endian handlers was not registered for reply messages.
Causing endian-neutral handlers to crash.

Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Id14173300ee1ab2601e92d58c70d2fa260814b69
2020-08-25 07:35:49 +00:00
Steven Luong 3f54d96dac bonding: enhance binary api handling
- check input sw_if_index to make sure it is sane. Coverity actually
complains about it.
- return rv. Some of the APIs handlers were not passing back the rv.

Type: improvement

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I8378ea948af561ba2bd9b02fb10bf4f9df2a2cd2
2020-08-24 10:44:31 +00:00
Steven Luong 067ef751d3 vmxnet3: enhance debug CLI error handling
- Display the interface name upon successfully creating the interface.
- Don't go silent when error occurs. Be explicit about it.

Type: improvement

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ie4fdaf323f8b3833ad4a7af3872290141204aba8
2020-08-24 10:43:52 +00:00
jiangxiaoming 34a72c61ea hsa: set connected mode for udp server
Type: fix

Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com>
Change-Id: I32a28a944fcee11657c4dd0ba34ad6d73de89263
2020-08-22 11:29:54 +00:00
Dave Barach b08fe6617b vppinfra: add format_one_elog_event
To avoid ridiculous pointer gymnastics in golang

Type: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ic5a641c18281970e2b9bc3013a54cfc3ae92e372
2020-08-21 14:21:55 +00:00
Nathan Skrzypczak 9ff0cd7171 vppapigen: Fix missing api dir
Type: fix

pci_types.api lives in vlib/pci which wasn't included
in the generate_json.py script

Change-Id: I15649786282584b7aefb9ace83c5154eb697b50b
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-08-21 11:16:54 +02:00
Florin Coras cc4d6d022f tcp: track reorder with sacks
Type: feature

Change-Id: I041bff2e8d589c171661de286fa1503531dff891
Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-08-20 16:58:33 +00:00
Mohsin Kazmi ad1e455f4d tap: fix flags in custom-dump
Type: fix

Change-Id: I4cd0b1855eab05344897686dc17b7df44de6c786
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-08-20 16:26:29 +02:00
Mohsin Kazmi 379aac395a virtio: add modern device support
Type: feature

Change-Id: I205f7c146a213d603d9d1e46fcf5195a876608dc
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-08-20 14:12:40 +00:00
Milan Lenco 7885c740ae ipsec: fix esp padding
Type: fix

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Change-Id: Ic8db52b41d7e5af3425099f008984e50afb3da74
2020-08-20 14:00:40 +02:00
Mohsin Kazmi a0a68339b7 virtio: refactor pci device code
Type: refactor

Change-Id: I7342178f9ab9adb99b91a4f984bc22bef2ce8021
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-08-20 09:33:23 +00:00
Elias Rudberg 224735bf09 ip: vnet_ip_mroute_cmd payload_proto fix
Make sure payload_proto variable is set properly in vnet_ip_mroute_cmd()
function. This avoids using an uninitialized payload_proto value which
could lead to assertion failure when using e.g. the ip mroute add
command.

Type: fix

Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Change-Id: I8b1d1df02e80150836b7b0448814d8f99747eeed
2020-08-20 08:56:37 +00:00
Filip Varga 9f57c72e27 nat: fixed cli nat summary and nat limit
Type: fix

Change-Id: I78017b02015116f93b579c7381119f618351c98d
Signed-off-by: Filip Varga <fivarga@cisco.com>
2020-08-20 07:17:49 +00:00
Florin Coras dd7d24bdfb session: ct init error handling
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie70348406a2bfc156302687d2f5f98bc1a50c88f
2020-08-19 16:27:47 +00:00
Dave Barach e09ae01f67 vppinfra: minor tweaks for cgo interoperation
'type' is a keyword in golang, so s/type/event_type/ in elog.h and
elsewhere.

Add vec_len_not_inline(...), elog_write_file_not_inline(...) and
elog_read_file_not_inline(...) since the inline forms aren't usable.

More such tweaks may follow.

Type: improvement
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I9a80a6afa635f5cdedee554ee9abe400fafc1cb6
2020-08-19 07:04:36 -04:00
Filip Varga 5c1cba5401 nat: session cli command fix
Type: fix

Change-Id: I57ae649d1b26d5bea2df89c209f257372e565b49
Signed-off-by: Filip Varga <fivarga@cisco.com>
2020-08-19 08:01:31 +00:00
Florin Coras 587ea45ad8 api: retry sending fd on EAGAIN
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I04117636ad95b706e3dd9331f00bd80e57d26d7f
2020-08-18 14:34:01 +00:00
Andrew Yourtchenko 1060332e62 build: add explicit commit to rc1, rc2 builds, and add ".0" to post-non-dot-release per-patch builds
This addresses problem with incorrect sorting of artifacts in the per-patch packagecloud repositories
for throttle branches, by slightly changing the version string for the non-released (per-build) artifacts:

1) the rc1 and rc2 artifacts now will have the count of
   commits since tag (0) and the explicit commit hash

2) the builds after version XX.YY but before XX.YY.1
are named as if the version was "XX.YY.0"

Type: fix
Change-Id: Ib69a59ee98aa296c5cb24b183bba807b6cb3c05c
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-08-18 10:40:15 +00:00
Nathan Skrzypczak 42b29ba3d4 vppinfra: fix RC in bihash instantiation
There can be a race condition in the case
a thread tries to do a bihash_search while
another instantiates the bihash.

Type: fix

Change-Id: Ic61b590763beb409e112957c43a5a66cd10afb28
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-08-17 16:33:50 +02:00
Klement Sekera ec9bf61fcb nat: det: replace speculative buffer enqueue model
Replace speculative buffer enqueue coding model with
vlib_get_buffers(...)/vlib_buffer_enqueue_to_next(...).

Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Ib5a32d60592fb17ed0ba1ac074047e39780f74be
2020-08-17 10:36:16 +00:00
Vratko Polak 9a412bcec4 stats: Move misplaced comment block
Type: fix
Fixes: fdc678081c

Change-Id: I64d15b050cfd3d88923bf996cb68b13504dbf6af
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2020-08-17 10:35:48 +00:00
Ole Troan f92bfb1bde vppapigen: generate define for module_semver
Generate a semver define for API modules in the VPP side C generator.

E.g in map.api_types.h
\#define VL_API_MAP_API_VERSION_MAJOR 4
\#define VL_API_MAP_API_VERSION_MINOR 2
\#define VL_API_MAP_API_VERSION_PATCH 1

Type: improvement
Change-Id: I2ab86154e85e26fb075c4e91a01ff3692640654b
Signed-off-by: Ole Troan <ot@cisco.com>
2020-08-17 10:33:32 +00:00
Mohsin Kazmi 9e2a78564f tap: add gro support
Type: feature

Change-Id: I5868dd267aa26aa97aec5fd70e70c5956ac52277
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-08-17 08:46:53 +00:00
Filip Varga 00dd39044e nat: sessions get expired when fib table removed
fib table removal would leave lingering sessions in vpp
this patch is aimed at solving this issue by grouping
sessions by source and destionation fib. if one of the
fibs gets removed this grouping is tagged as expired
and session won't be passed to non existing fib table

Ticket: VPPSUPP-93
Type: improvement

Change-Id: I45b1205a8b58d91f174e6feb862554ec2f6cffad
Signed-off-by: Filip Varga <fivarga@cisco.com>
2020-08-17 07:53:18 +00:00
Florin Coras 17ec577f7b vcl: rx dequeue notifications with epoll
Add deq request on ct fifo if present and clear event when session is
removed from epoll group.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I8a20342879b3aac2f8fe8171556baaf9c992363b
2020-08-14 20:23:06 +00:00
Florin Coras c34118b591 vcl: minimize vpp to vcl rx events
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I2015162bd315927e45b9fe583324b1458fe69d8f
2020-08-14 20:22:47 +00:00
Mohsin Kazmi f382b06feb gso: packet coalesce library
Type: feature

Change-Id: Ia19d3611e596d9ec47509889b34e8fe793a0ccc3
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-08-14 09:38:58 +00:00
Steven Luong c3ed1c9913 ip: add VNET_IP_TABLE_ADD_DEL_FUNCTION
vrf table may be dynamically added or deleted. When the table is deleted,
clients who use the corresponding vrf table may need a callback to
do the clean up. The mechanism added here is cloned from
VNET_SW_INTERFACE_ADD_DEL_FUNCTION.

Type: improvement

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I08635c715cd7361a6c359b90890dd3545b0da94c
2020-08-14 08:15:31 +00:00
Florin Coras 2f630188b9 vcl: clear ct rx event on right fifo
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I70bab0d86287c108c6dffda5c5b2f29277c15de1
2020-08-13 14:21:43 +00:00
Christian Hopps 047f67eedd docs: correct fib tunnel diagram reference
The included image was pulling in figure 2, change to the correct
figure 11.

Type: docs
Signed-off-by: Christian Hopps <chopps@labn.net>
Change-Id: I3679916364753fc682d1d1713fce952de398e626
2020-08-13 12:29:10 +00:00
Filip Varga 603e754658 nat: move deterministic nat to det44 sub feature
Type: refactor

Change-Id: I0bb203102a0e13dd7448e2125925ab356bbd7937
Signed-off-by: Filip Varga <fivarga@cisco.com>
2020-08-13 10:06:33 +00:00
Klement Sekera de118da58e nat: remove non-error error counters
Some statistics counters were implemented as error counters. Move them
to stat segment, where they belong.

Type: improvement
Change-Id: I5600bec1b4e0496282297374ec1e79d909cdaf8a
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2020-08-13 08:34:33 +00:00
Andrew Yourtchenko fbecd936bd acl: use the global heap when allocating the lookup context
The "ACL as a service" lookup infra is shared, so a global heap must
be used.

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I86894254b737392c1968b6a581b5a37590376428
2020-08-13 08:19:17 +00:00
Ole Troan 920acd47bc vppapigen: remove unreachable code
Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Ifd81acaa020f6ebff20ec4eff4370d8a18323860
2020-08-13 07:33:08 +00:00
Ole Troan 7d29e320fb stats: remove offsets on vpp side
Represent pointers directly in shared memory and require clients to adjust for
shared memory segment being mapped at different base address.
Deprecated: stat_segment_pointer() / stat_segment_offset()
Added: stat_segment_adjust()

Bumped the stat segment version to 2.

Type: refactor
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I33e756187b8903b45dcd353e6c1a101b7a4acb79
2020-08-13 07:28:13 +00:00
Florin Coras ff40d8f1b2 vcl: mt detection and cleanup
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I521c110fd4d7445bd585c96d4c768f16a0a7d3b8
2020-08-12 07:52:17 -07:00
hanlin a3a489691d vcl: support multi-threads with session migration
Currently, mutlti-threads only support one dispatch thread and multiple
worker threads, eventually only dispatch thread is a vcl worker and can
interact with epoll.
This patch will register all threads as vcl worker, and then each
thread can interact with epoll now. Moreover, session migration also
supported, such as socket created in thread A and used (bind, connect
and etc.) in thread B.

Type: feature

Signed-off-by: hanlin <hanlin_wang@163.com>
Change-Id: Iab0b43a33466968c1423d7d20faf1460c8589d91
2020-08-12 01:57:18 +00:00
Florin Coras 40c07ce7a7 vcl: support inter worker rpc
Type: feature

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I664cd14c84fc5cf2ffe61efce99c95219b44fad7
2020-08-11 18:05:06 +00:00
Ole Troan 68ebcd50bf vppapigen: add support for empty options
Type: improvement
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I59323447bee7bb4f0563251a5df80cbefb9bd89e
Signed-off-by: Ole Troan <ot@cisco.com>
2020-08-11 14:55:41 +00:00
Ole Troan 710fe10462 papi: allow unknown address family
In unions all representations of the union are decoded.
Which means trying to decode something that isn't an address
might have invalid address family types.

Type: fix
Ticket: VPP-1884
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Id3381ef8cc885952c1eb488ebc70e276eaceb366
2020-08-11 13:51:59 +00:00
Ole Troan fdc678081c stats: add timeout for in_progress access to stat segment
add new api stat_segment_set_timeout_nsec to limit time waiting for vpp
in_progress state.

Change-Id: Ic78a97bc5013d67d7e4bbcc4a6f0ef918f9f9b33
Type: improvement
Signed-off-by: Ole Troan <ot@cisco.com>
2020-08-11 09:48:13 +02:00
Ole Troan 3c70c05e1f stats: name and error index client memory leak
Type: fix
Change-Id: I6c9999b93d4f4ad4b8540a21e793c9a90e7c8ecf
Signed-off-by: Ole Troan <ot@cisco.com>
2020-08-10 17:29:09 +02:00
Simon Zhang 53ec96777c vcl: fix getting wrong non-blocking flags issue in VPPCOM_ATTR_GET_FLAGS action
Type: fix

Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
Change-Id: If4c700b59b8936a43d6a73ed75cc6fdaf6cf141d
2020-08-09 01:37:07 +00:00
Matthew Smith 6042d28155 vrrp: change init of vrrp key in VR lookup
Type: fix

A struct that is used as a hash key was being initialized in its
declaration. On CentOS 8 this caused some hash lookups to fail.
This seems to be caused by uninitialized padding.

Use clib_memset() to initialize the key with 0's to avoid the issue.

Change-Id: I00555c201a1ab34133971313ba14f20f4e867a30
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-08-07 17:06:21 +00:00
Steven Luong 35050289e6 memif: wrong interface counter is incremented
vlib_increment_combined_counter takes sw_if_index, not hw_if_index.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Iecde2697ed490940f0eff796d28d15381405b895
2020-08-06 12:25:21 -07:00
Dave Wallace 49c9feaa73 bash: fix pip install issue with jjb-sandbox-env function
- In a new system (e.g. ubuntu 18.04 docker image), the pip3
  installation of jenkins-job-builder fails unless pip3 wheel
  is completed on a previous pip3 install command.

Type: fix

Change-Id: I4354c851161b9c470d44951dc8b722ffc87f56f7
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2020-08-06 18:54:30 +00:00
Dave Barach d4a639bbd2 vppinfra: harmonize function names
Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Icce7eab4510785e15bdcf97e4d1881b0f46f6899
2020-08-06 17:09:49 +00:00
Dave Barach 11fb09e38f misc: harmonize names
Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ibad744788e200ce012ad88ff59c2c34920742454
2020-08-06 12:10:50 -04:00
Dave Barach 586462fabc interface: add pcap trace data preallocation
Type: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I2e53fa85a0b4082666f57a3a58a09c04ae2001b5
2020-08-05 22:08:42 +00:00
Florin Coras 0edfb1a06e vcl: fix epoll timeout
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I917158a62e5881b97917c3339527d3c34c37565a
2020-08-04 22:45:45 -07:00
Florin Coras eedc74b804 tcp: improve timestamp rtt accuracy
- switch to using vlib_time as reference for timestamps
- use us precision ticks for tcp but keep using ms precision for
timestamps. As a result, srtt, rttvar and rto are now measured in us
instead of ms. MRTT samples from timestamps are converted from ms to
us (not accurate under ms) while high precision samples are used with us
precision, i.e., they're no longer converted to ms precision samples.

Type: improvement

Change-Id: Ibda559575d9b4fdc85b0985264f7c865ff367e34
Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-08-03 15:36:32 +00:00
Benoît Ganne f3ae9e3266 unittest: add clib_count_equal_u8/16/32/64 tests
Type: test

Change-Id: I490c1b1a2fa49badda038e6be014c77b9bee6c56
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-08-03 11:59:00 +00:00
Benoît Ganne 2a0bd4a7d1 vppinfra: fix clib_count_equal_u8/16/32/64 overflow
Type: fix

Change-Id: Id5ca868cd7a2abc9320206f0336aa3348f5906e3
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-08-03 11:59:00 +00:00
Florin Coras 9811007f5f nsim: limit tx burst size and refactor input node
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic93a598051d437a5801d794b678edf6e73d42a47
2020-07-31 13:57:24 -07:00
Florin Coras e6c3e8f0ee nsim: basic reorder support
Reorder delayed packets, i.e., flush instead of delay, with a configured
rate.

Type: feature

Change-Id: Ib1294f5f1c9b6e98a12b1bb0be655e54facfed3a
Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-07-31 19:34:20 +00:00
Vladimir Isaev b2f44bd8e7 ip-neighbor: Allow to replace dynamic entry
Before this patch it was not allowed to replace
a dynamic ARP entry with a static one with the
same mac-address.

Type: fix

Signed-off-by: Vladimir Isaev <visaev@netgate.com>
Change-Id: I6cfc0e510ffdf141c61874288f11a60395182374
2020-07-31 16:02:49 +00:00
Andrew Yourtchenko 5d27037d16 docs: Add link to 20.05 test framework docs
Change-Id: I429a29a5cb1f311bec4361c758b14b51b0afc8aa
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit 765ef37670)
2020-07-30 12:58:32 +00:00
Florin Coras f9512bff1c tcp: process syn in fin-wait-2
Type: improvement

Change-Id: I379ba4270dad56fb0a06427a43e97bed36bdaa13
Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-07-30 11:15:18 +00:00
Dave Barach caebbcf3cd feature: add vnet_feature_is_enabled
A predicate function which says whether a given sw_if_index has a
certain feature enabled.

int vnet_feature_is_enabled (const char *arc_name,
                             const char *feature_node_name,
                             u32 sw_if_index)

returns 1 if the feature is enabled
returns 0 if the feature is not enabled
returns VNET_API_ERROR_INVALID_VALUE if the arc name is not found
returns VNET_API_ERROR_INVALID_VALUE_2 if the feature node name is not found
returns VNET_API_ERROR_INVALID_SW_IF_INDEX if the sw_if_index is not found

Type: improvement
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Id9ed53e2ae9252efc750ae80fd610456b95cefa4
2020-07-29 18:08:01 -04:00
Ivan Shvedunov 4c5343600d hsa: fix handling active connection failures in the proxy
Type: fix

Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com>
Change-Id: I9c62bb6524247e2cd25de198263c16f3d9db0da9
2020-07-29 19:29:40 +03:00
Ivan Shvedunov e52eafd047 tcp: fix skipping RSTs in SYN_SENT state
Type: fix

Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com>
Change-Id: Ieddf8f03fdd14e71efaf4c78fe5b7f0d15c5cf5a
2020-07-29 19:29:04 +03:00
Jieqiang Wang 81b95c1fe2 build: Fix 'make install-deps' errors on aarch64 CentOS 7
On CentOS-7 aarch64, command of 'debuginfo-install -y glibc openssl-libs mbedtls-devel zlib' in 'make install-deps' fails because it tries to install the corresponding *debuginfo* packages from some inaccessible/unmaintained repos on aarch64, e.g., centos-sclo-rh-debuginfo. The error message shows as below.

Using 'debuginfo-install --enablerepo=xxx' also fails because it will still enable all the repos including the broken repos on aarch64. Using 'debuginfo-install --disablerepo=xxx' (xxx is the broken repo) works fine but we are not centain about that if VPP user will install additional broken repos on aarch64 or not. So to fix this error, we install all the *debuginfo* packages for 'glibc openssl-libs mbedtls-devel zlib' packages using 'yum install' instead.

[root@ ~]# debuginfo-install -y glibc openssl-libs mbedtls-devel zlib
Loaded plugins: auto-update-debuginfo, fastestmirror, ovl
enabling epel-debuginfo
enabling base-debuginfo
enabling centos-sclo-rh-debuginfo
Loading mirror speeds from cached hostfile
epel/aarch64/metalink                                                                                                                                                                       | 8.2 kB  00:00:00
epel-debuginfo/aarch64/metalink                                                                                                                                                             | 8.5 kB  00:00:00
 * base: mirror.aktkn.sg
 * centos-sclo-rh: mirror.aktkn.sg
 * epel: mirrors.yun-idc.com
 * epel-debuginfo: mirrors.yun-idc.com
 * extras: mirror.aktkn.sg
 * updates: mirror.xtom.com.hk
http://debuginfo.centos.org/centos/7/sclo/aarch64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below wiki article

https://wiki.centos.org/yum-errors

If above article doesn't help to resolve this issue please use https://bugs.centos.org/.

failure: repodata/repomd.xml from centos-sclo-rh-debuginfo: [Errno 256] No more mirrors to try.
http://debuginfo.centos.org/centos/7/sclo/aarch64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found

Type: fix

Change-Id: I017c3b20a167d8035c3ae617b9ad5ae479e52f57
Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
2020-07-29 14:37:11 +00:00
Benoît Ganne bdd8b5736d ipsec: fix cli uninitialized parameters
Type: fix

Change-Id: Ia5c1f928f6752314b278127d2446e973f03a5da8
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-07-29 02:34:11 +00:00
Florin Coras d75213fe87 tcp: process syn in close-wait
Type: improvement

Change-Id: I0cafe08d21e02094dda203c5eb60601b5953425d
Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-07-29 02:24:14 +00:00
Steven Luong dc2abbe5cc bonding: toggle bond admin state may cause hw link state to down
For bond interface, we set hardware link state to up initially when
admin state is set to up. Thereafter, if we toggle the admin state to
down and up, we require at least one active member in the bond prior
to bringing up the hardware state which is inconsistent. The fix is to
remove the unnecessary condition.

This is a rework of the original proposed patch which is more complex
and could be tricky to get it right
https://gerrit.fd.io/r/c/vpp/+/27141

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I65f4fee55299b5b4d5645f6e05e1be15b46b73cd
2020-07-28 20:55:36 +00:00
John DeNisco b046487622 docs: Update the VPP tutorial
Update the documents for the VPP tutorial.

Type: fix

Signed-off-by: John DeNisco <jdenisco@cisco.com>
Change-Id: I62d0641ff0af7b07a26b4379f19cbdaf285537d7
2020-07-28 16:30:53 +00:00
Klement Sekera 18c6cd9aa8 ip: svr: improve performance for non-fragments
Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Ia77ce41a8f1a032c5e027c4bb47347752cfda0a9
2020-07-28 12:55:19 +00:00
Benoît Ganne 9ae3c6a40f ip: fix punt cli to only consumes a line of input
Type: fix

Change-Id: Idb6f82e08b29e3805ed2133acb5fd7226148f672
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-07-28 12:18:38 +00:00
Florin Coras 0f4e3c22ed http_static: fix session cleanup
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ibb380eecca76ed9c00ed14c167dfcf576f943db0
2020-07-28 12:18:03 +00:00
Florin Coras 7d941d45bc hsa: fix http server session cleanup
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6832e3f24a56e043415a32eb4072d0bfb7697251
2020-07-28 12:17:44 +00:00
Florin Coras 39771adc1d lisp: fix cli locator-set name null termination
Type: fix

Change-Id: I5f550bd6a03f47b829ef99803cb6b9ac86329450
Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-07-28 12:17:04 +00:00
Florin Coras 508dc51bd0 lisp: fix lisp/one enable/disable
Type: fix

Change-Id: Iefe6b3a1a0a999d89ef9812fc14d31159043e60c
Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-07-28 12:17:04 +00:00
Benoît Ganne 2a10ee3a99 sr: fix prefix_len type parsing
prefix_len is parsed using '%u' format requiring an integer.

Type: fix

Change-Id: I9f31fa60e80d4f45fe456f3fd6c94f123cfc99ea
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-07-28 12:14:54 +00:00
Steven Luong 4c4223edfd bonding lacp: replace slave string with member
- Replace textual string slave with member except APIs.
- For APIs, mark the existing APIs as deprecated and introduce new APIs
- While introducing sw_bond_interface_dump, add the optional filter by
  sw_if_index and enhance the testcases to make use of it.

Type: improvement

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ib6626c514e45350308aeeda0decb70f3aba2f63e
2020-07-28 12:13:49 +00:00
Filip Tehlar 4d1423c5ac ikev2: fix session re-initiate after SA expires
Type: fix

Change-Id: Ie3d24b3df02d08fbb74d97f4e5ab0d79c35b0c0d
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-07-28 07:25:08 +00:00
Klement Sekera 6977ed6cff nat: limit resource consumption when out of ports
Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I83f44711264376389989152666f3c71216146bdd
2020-07-28 06:31:56 +00:00
Ivan Shvedunov 9fefa89169 tcp: fix tcp_connection_cleanup() with uninitialized elog
This fixes TCP connection cleanup crash when TCP debugging is enabled.
It could happen if session_stream_accept() returned an error.

Type: fix

Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com>
Change-Id: I0df08969d82bb0f44def81b9e47195bd15502831
2020-07-27 20:16:46 +03:00
Benoît Ganne c72995dd79 lacp: fix vector overflow
Type: fix

Change-Id: I8f776ce10ee8c29689db5ceef70df42dfb6b747c
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-07-24 21:23:31 +00:00
Benoît Ganne 17814d74db interface: fix show/clear hardware-interfaces string overflow
Type: fix

Change-Id: Iab99bc1f6c309fae6eaa714b484274fe7072a4cb
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-07-24 21:15:43 +00:00
Benoît Ganne e3a24300d0 pci: fix non NULL-terminated vector used as C string overflow
Type: fix

Change-Id: Iab512ba8c72c9e20aeba2d4265276bcabf095d46
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-07-24 21:13:05 +00:00
Florin Coras c7fd24e30b session: cleanup lookup table for rejected session
Type: fix

Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id20f693a5acdee74ab534e9964418973537b977f
2020-07-24 21:11:43 +00:00
Florin Coras d2f5174dd0 tcp: fix synack elog crash
The elog track, if enabled, must be initalized before synack is sent.

Type: fix

Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I0c585f466c9a5cbc13af971ae4951b93f9913c5f
2020-07-24 17:12:56 +00:00
jan_cavojsky a340fe1ac6 ikev2: add SA dump API
Type: feature
Ticket: VPP-1897

Change-Id: I0245aceeb344efd29b1f9217c35889a8bbe1f744
Signed-off-by: jan_cavojsky <Jan.Cavojsky@pantheon.tech>
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-07-24 11:44:23 +00:00
Ole Troan 7fc88cf3a1 geneve: support geneve interface acting as a bvi
create geneve tunnel local 10.10.10.10 remote 10.10.10.9 vni 48 decap-next node ethernet-input l3-mode
set interface ip address geneve_tunnel0 11.11.11.12/24

Type: feature
Change-Id: I579ce879553d72a2e8048e33d0c0122674996b81
Signed-off-by: Ole Troan <ot@cisco.com>
2020-07-24 09:28:04 +00:00
Vladimir Ratnikov 5a849e3b35 dpdk: device_id sorted order for cryptodev
By default, VPP automatically assignes for each tunnel
next available QAT device by order dev_id-que-pair.
In most cases we have more than one device and it can
greatly increase ipsec perfomance without any actions
with configuration from user  if we use all the
devices first and first que-pairs

Type: feature

Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com>
Change-Id: Iac9fe74768775459e22f69bb3706b542090a9375
2020-07-23 22:24:48 +00:00
Benoît Ganne c79a14f13a feature: fix feature config data initialization overflow
Copy only exactly the data provided by the user even when it is not a
4-bytes multiple.

Type: fix

Change-Id: I2ef987c37e58523a38b46b09227529db2c26aa55
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-07-23 22:21:25 +00:00
Lijian.Zhang 24ee40a5cb acl: correct acl vat help message
"ipv4"/"ipv6" option is not supported in acl_add_replace and
macip_acl_add_replace vat api.
Update its help message per actual api usage.

Type: fix

Change-Id: I8d34fac5f98bd78a46a5e98df05cd35182988dd8
Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
Reviewed-by: Jieqiang Wang <Jieqiang.Wang@arm.com>
Reviewed-by: Govindarajan Mohandoss <Govindarajan.Mohandoss@arm.com>
2020-07-23 20:52:41 +00:00
Florin Coras c703a0b9ad hsa: proxy session cleanup fixes
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I96673c984077876e69b18b4126b55e70dc07b50f
2020-07-23 19:44:37 +00:00
Damjan Marion 5c00ec26ec vppinfra: add *_zero() vector inlines
Type: improvement
Change-Id: Ia63d1d7de273967ab7725d83634c0b6dd481c6c0
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-07-23 17:20:01 +00:00
Florin Coras 1caf7f11c0 tcp: track pending timers
Also removes delack timer and reuses the u32 for the pending timers
list.

Type: fix
Ticket: VPP-1923

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4edbb72d5b2aa5e14f87659f49e675af1e834aca
2020-07-23 16:39:48 +00:00
Elias Rudberg bf9a0c8097 nat: fix port number selection
Change the port number selection for new NAT sessions so that it
matches how the thread index is calculated from the port number for
out2in packets. Before this change there was a problem when the
largest port number in the range was used, that resulted in the wrong
thread index being selected when out2in packets arrive for that
session.

Type: fix

Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Change-Id: I936c389eb0d5df6168e18e5e44754de1cdad6ad1
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2020-07-23 12:50:57 +00:00
Benoît Ganne 7c8644c368 ikev2: add global message length check
Type: fix

Change-Id: I3eb51ea4f6c29005b0315cf488fcabb8543dfcd1
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-07-23 12:10:17 +00:00
Ole Troan 9f84e70c6d vppapigen: missing crcs in user-defined types
make the change backwards compatible

Change-Id: I379691aa5972f99b2144deda4b7ef9e6ba4af67d
Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
2020-07-23 11:33:30 +00:00
Mohsin Kazmi 543ed86441 virtio: add the buffer allocation error
Type: improvement

Change-Id: I991e32d531719693c387db4ef93d04d4b562789d
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-07-22 17:15:10 +02:00
Neale Ranns dd4ccf2623 ipsec: Dedicated IPSec interface type
Type: feature

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Ie8bd50df163aea2798e9f9d35a13dcadc4a4a4b2
2020-07-21 18:42:25 +00:00
Benoît Ganne 0c65f52bb9 crypto: bails out early for unsupported key type
Do not access data structures based on uninitialized key->alg.

Type: fix
Fixes: f539578bac

Change-Id: I6bfb7e7a51af2c131b8bdf3bca6a38fcf1094760
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-07-21 17:27:47 +00:00
Steven Luong e29fb5bf1b stats: memory leak in stat_validate_counter_vector
Free the existing vectors prior to losing them.

Type: fix
Ticket: VPPSUPP-94

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ic15f1fbc7a0c6c348065fc9759ee5d5c43013b91
Signed-off-by: Ole Troan <ot@cisco.com>
2020-07-21 06:20:08 +00:00
Filip Tehlar 459d17bb7d ikev2: refactor and test profile dump API
Type: refactor

Change-Id: I6b8dc68e5d4a452776fbaf5a69fbd7f53a8abb75
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-07-20 13:47:42 +00:00
Chinmaya Agarwal 30fa97dc67 sr: new messages created to return sl index for segment lists in a sr policy
Type: fix
Signed-off-by: Chinmaya Agarwal <chinmaya.agarwal@hsc.com>
Change-Id: Id43ab583f444e4487085fc686d5faed4858b2e97
2020-07-19 14:03:13 +00:00
Dave Barach 38ca6e62d7 api: call api reaper callbacks for socket clients
Add a callback to clear the per-client packet trace buffer cache.

Save the packet trace dump pg setup script.

Type: improvement
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I252be911b5f937ece0da5dca152263ece3d52963
2020-07-19 13:06:06 +00:00
Benoît Ganne 2e64b5a934 unittest: keep ASAN happy for non-terminated string tests
Type: fix

Change-Id: Iae9e84d4297acd54c909d3a8a39adafcd86b0a91
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-07-19 11:31:36 +00:00
Andrew Yourtchenko df494dafa0 abf: mark API as in-progress
As requested by Neale, mark the ABF API as in-progress

Change-Id: I109a32fa54b1f2a882695d9fd71b235fa46bc6f3
Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-07-17 12:09:49 +00:00
Andrew Yourtchenko d2f8fb9c7e gbp: mark APIs as in-progress
As per request from Neale, mark the GBP plugin APIs as in-progress.

Type: fix
Change-Id: I679943edcfff0742ee32c45cd8f97f482c353b9f
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-07-17 12:09:21 +00:00
Andrew Yourtchenko f733e7ade0 l2e: mark API as in-progress
As requested by Neale, mark the API as in-progress.

Change-Id: Id92cad65c66435e179583507f077816e09e4205b
Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-07-17 12:09:05 +00:00
TimotheeChauvin 2887159a1a pppoe: fix uninitialized memory bug
In pppoe_cp_node.c, node->errors[error0] was accessed without
node->errors being initialized.

Found with AFL + ASAN.

Type: fix
Signed-off-by: TimotheeChauvin <timchauv@cisco.com>
Change-Id: Ide8a60021b2d47b5e2fce7062d8f12c7f4d225f7
2020-07-17 07:09:45 +00:00
Tom Seidenberg 6c81f5a249 misc: add callback hooks and refactor pmc
Callbacks for monitoring and performance measurement:
- Add new callback list type, with context
- Add callbacks for API, CLI, and barrier sync
- Modify node dispatch callback to pass plugin-specific context
- Modify perfmon plugin to keep PMC samples local to the plugin
- Include process nodes in dispatch callback
- Pass dispatch function return value to callback

Type: refactor

Signed-off-by: Tom Seidenberg <tseidenb@cisco.com>
Change-Id: I28b06c58490611e08d76ff5b01b2347ba2109b22
2020-07-16 21:44:42 +00:00
Chenmin Sun bab02f0b18 dpdk: fix coverity warning in the flow code
CID 211153

Type: fix

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: Ic4d518d047c3ff36d9a7b72477c3efcb554d05bb
2020-07-16 21:44:19 +00:00
Benoît Ganne 01a103bec1 vlib: fix asan compilation with gcc
clang tends to force alignment of all sections when compiling for
address sanitizer, confusing VPP plugin infra.
On the contrary, GCC does not support this attribute on sections.
Selectively enable it depending upon the compiler.

Type: fix
Fixes: cea46522e7

Change-Id: I2dd6e52e70e6b4d89c101171cafc813e175ec472
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-07-16 21:42:40 +00:00
Fan Zhang 4933849439 crypto: fix coverity issue for cryptodev
- Fixes coverity issue #210160.
- Fixes the possible issue in cryptodev when input node does
  not update mbuf, such as avf-input.
- Fixes GCM ESN packet incorrect tag.
- Code clean up to reduce binary size.

Type: fix

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Signed-off-by: Dariusz Kazimierski <dariuszx.kazimierski@intel.com>
Signed-off-by: Piotr Kleski <piotrx.kleski@intel.com>
Change-Id: Ic05ae29855ac1f7a62e4af5831a4ed9faa8f561a
2020-07-16 21:42:00 +00:00
Benoît Ganne 1bd6f61820 vppinfra: fix format_c_identifier vector overflow
In case of vector, we must check length before trying to access element.
Also fix wrong DPDK plugin workaround.

Type: fix

Change-Id: I2ecef1c88ebef2362f48cab0d462699aa43cd4b9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-07-16 21:41:12 +00:00
Dave Barach 65b65a4692 misc: add tracedump API plugin
Type: feature

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I586547508003b95eaa74e18e4a5ac6f72986822c
2020-07-16 21:39:50 +00:00
Dave Barach ac0326fc5a adl: move allow/deny list function to plugin
Provide binary API compatibility support for the "cop" APIs until vpp
21.01.

Change the deprecation date in map.api to vpp 21.01.

Type: refactor
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I0e60d96de4ae9ae4448f134cf257934126f3b760
2020-07-16 21:39:23 +00:00
Damjan Marion 9a0f2a5e7f ip: optimize ip4_header_checksum, take 2
- add 64-bit version
- remove byte swaps, as they are actually not needed

Type: improvement
Change-Id: Ia1efe54ee80b4ae7633b9ab36b3154c3357006d7
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-07-16 17:52:36 +02:00
Benoît Ganne 284e658dbf ikev2: fix race condition in child_sa update
Type: fix

Change-Id: I864d49a641b45337c0a45a0af7d996cad75f6629
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-07-16 13:21:55 +00:00
Benoît Ganne 5e60c17f49 vppinfra: enable STATIC_ASSERT with clang
For some reason clang does not support &((struct foo*)0)->field in
static assertion contrary to gcc.
Use offsetof() macro implementation provided by both compilers instead.

Type: fix

Change-Id: I3311cdd29c5861e45dc0ef92f2bbd66242ca73b8
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-07-16 13:21:27 +00:00
Damjan Marion e5f0050c7a ip: optimize ip4_header_checksum
Type: improvement
Change-Id: I67bacb90a3dd8a9bd7beb4975ad0fe344675b65f
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-07-16 12:07:20 +00:00
Aloys Augustin cf86740a11 gre: fix outer ip6 length
This updates the computation of the outer ip6 header payload_length
field in order to take into account the GRE header length.

Change-Id: Ie9f982521aeaef7279a9e329a33272d6fae0a428
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2020-07-16 11:25:08 +00:00
Damjan Marion 94dbf95220 vppinfra: more vector inlines
Type: improvement
Change-Id: Ie0de374b89ec3a17befecf3f08e94951597609ec
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-07-15 20:26:42 +02:00
Klement Sekera 4d119a6f15 nat: add prefetching to in2out_ed/out2in_ed
This saves about 20 clocks/packet in both code paths.

Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Ib559c74bf8168e3ddd764d51b7e5bcd2a557f591
2020-07-15 16:27:29 +00:00
Filip Tehlar a7b963df27 ikev2: add support for AES-GCM cipher in IKE
Type: feature
Ticket: VPP-1920

Change-Id: I6e30f3594cb30553f3ca5a35e0a4f679325aacec
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-07-15 16:12:16 +00:00
Mohsin Kazmi 8046fdc10b virtio: fix the msix for multiqueue
Type: fix

Change-Id: Ie0cff37b474f8d85a3ae376e0f547a347fb1ad8a
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-07-15 15:57:40 +00:00
Filip Tehlar ac46e3b1db ikev2: API downgrade due to lack of ikev2 tests
Type: refactor

Change-Id: Ic7ddad20088e069887f81721cceb21f4902e8907
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-07-14 19:26:33 +00:00
Chenmin Sun e30f9c5c63 ip: fix format_ip6_address_and_mask() bug
Previously there's a format_ip4_address in format_ip6...
This patch fixes this typo

Type: fix

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: Ice124db6594720ed35a992d069341f399c331e1d
2020-07-14 14:34:57 +00:00
jiangxiaoming 3999a4bdb7 hsa: set connected mode for echo_server app in udp mode.
Type: fix

Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com>
Change-Id: I85a53ee049a9af371d929364400fe166cf71d53f
2020-07-13 21:41:32 +00:00
jiangxiaoming b495e9fd6d session: fix application_lookup_name fail due to app_by_name default hash type wrong
Type: fix

Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com>
Change-Id: I539c431d991234c6cebc0961588f5dfbc9caa3c2
2020-07-13 17:07:17 +00:00
Florin Coras 47cb248424 session: reduce verbosity on fifo alloc failure
Also fix session test app name registrations

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I7d365154ab9af83b17b026762ab4f0aea85ce486
2020-07-13 08:57:35 -07:00
Benoît Ganne 52e9aaf0b5 dpdk: add txq struct and fix dpdk tx lock
This introduces a txq structure mirroring the rxq structure.
This fixes the case when #txq > #rxq, because lock must be per txq.

Type: fix
Fixes: dfb19cabe2

Change-Id: Ic1bce64d2b08b9a98c8242a1ba1bfcdbda322bec
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-07-09 15:32:51 +00:00
Florin Coras ea7e7087d2 session: fix ct listener cleanup
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I749f36a7062bf9b073c1b6753436c23ba326a5db
2020-07-07 17:57:59 -07:00
Florin Coras c78d47b141 tcp: round down rcv wnd even if avoiding retraction
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I7fb3a4a2ffc4c5f42aa043e3a317b52d7767fb81
2020-07-07 14:56:02 +00:00
Mohsin Kazmi 4834a66b7b tap: fix the tun sndbuf value for kernel 4.20 and later
Type: fix

From kernel 4.20, xdp support has been added in tun_sendmsg.
If sndbuf == INT_MAX, kernel executes xdp data path
for tun driver which assumes packets are ethernet frames.
This patch is avoiding the xdp data path in kernel by setting
the sendbuf value < INT_MAX.

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ia4aa54b177b96d56a2d513d18d26ca01d5b88929
2020-07-07 14:44:53 +00:00
Filip Tehlar 190983de61 ikev2: per thread usage of openssl context
Type: refactor

Change-Id: I04af90b4d86c00092ce1732aeb3c0517af1808e0
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-07-07 08:18:57 +00:00
John DeNisco 742000af20 docs: Reflect the fact that the DPDK is now a plugin
Type: Improvement

Signed-off-by: John DeNisco <jdenisco@cisco.com>
Change-Id: Ic1253f601ee515392902a21b92e1dfd3962cc0a4
2020-07-06 12:30:31 -04:00
Jan Cavojsky 6a9bd81886 ikev2: add profile dump API
Type: feature
Signed-off-by: Jan Cavojsky <Jan.Cavojsky@pantheon.tech>
Change-Id: I84776a50b520134e8a3ca6ae41b4cc29009e6319
2020-07-06 14:25:11 +00:00
Filip Tehlar 4f42a71779 ikev2: add more ikev2 tests
Tests for AES-GCM and AES-CBC with different key lengths

Type: test

Change-Id: Ie7eeebb0f7e8331a717866475cb4ee00042857ce
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-07-06 13:34:10 +00:00
jiangxiaoming 9268b5823f ip: set ip4 mask for ip_copy and ip_set when dealing with ip4 type
Type: fix

Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com>
Change-Id: I3ace7dfe3ddacb4f7fa7a974a2ffe2b3cf902ff9
2020-07-06 08:42:14 +00:00
Matthew Smith ee167e524c fib: fix debug preprocessor directives
Type: fix

Some debugging declarations were wrapped in an 'ifdef CLIB_DEBUG'.
This seems to always evaluate true because clib.h defines CLIB_DEBUG
to 0 if its not defined.

The result is that if a route table is added and a route is added to
it and then the table is deleted, VPP exits because the debug function
fib_table_assert_empty() gets called whether VPP was started using a
debug build or a release build.

Change the ifdef to 'if CLIB_DEBUG > 0'.

Change-Id: I357dc2c299e81b95244f2f7efaadb8e0de27627a
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-07-06 08:35:59 +00:00
Florin Coras fbb846cfa1 tcp: fix coverity warning
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I60828bc084b9adbb925c306d26060412c410c516
2020-07-02 14:52:34 -07:00
Florin Coras 3e9ff291da tcp: cli to dump half-open connections
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Idf7e483de0afc95a7579145fb16689e1853b10f9
2020-07-02 19:13:32 +00:00
Matthew Smith 39008ca19e vrrp: fix feature declaration for v6 accept-mode
Type: fix

The v6 accept mode input feature was being declared with
the node added to ip4-multicast instead of ip6-multicast. Add to
the correct arc.

Change-Id: I08f6e5e7dde84a37687fa0af750a7a16fe537ea6
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-07-02 17:03:11 +00:00
Filip Tehlar da8e4fe3fc ikev2: use remote proposals when installing tunnel
Change-Id: Ib9c5dff6c825f495400a73869d429b9c2df670fc
Type: fix
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-07-02 16:58:48 +00:00
Mohsin Kazmi 86f281a841 tap: fix dump for TUN interfaces
Type: fix

Change-Id: I3bcc8ff1cf0a828ce3ba112694d38e3287d38d8d
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-07-02 14:48:14 +00:00
Andrew Yourtchenko 319a135515 misc: 20.05 Release Notes
Change-Id: If68e419b00f8961c814727713f989fd0d72f6f1b
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit ab572152d9)
2020-07-02 14:32:30 +00:00
Ole Troan 96068d6b94 nat: nat66 to plugin
Type: refactor
Change-Id: I8c1f0c02a4522c1f9e461ddadd59938579ec00c6
Signed-off-by: Ole Troan <ot@cisco.com>
2020-07-02 13:13:27 +00:00
Mohsin Kazmi c6eae9c079 ip: fix the order in ip4 punt redirect
Type: fix
Fixes: a84cb715f5

Change-Id: Id448d6ae9cfdd3122e8187121c509412835117c5
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-07-02 11:00:39 +02:00
Benoît Ganne d25147d581 vlib: wake up workers if interrupts are posted
Type: fix

Change-Id: If8dbbcb46193fd057fe8d704058609a3a8787d6c
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-07-01 20:39:01 +00:00
Dave Barach 126c885441 classify: fix debug CLI
unformat_ip6_mask wasn't accounting for customized field names
when deciding if it managed to parse at least one field.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I26cab4c6828b510e277079628af5115ac43af3ff
2020-06-30 08:28:29 -04:00
Filip Tehlar bfeae8c57e tests: ikev2: add nat traversal & cert based auth test
Type: test

Change-Id: I3e8e451c5deaf04f519a471369370c383d9cda3b
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-06-30 08:15:01 +00:00
Ryujiro Shibuya cc1085647b tcp: avoid rcv wnd more than RX fifo can enqueue
Type: fix

Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie358b731f8ecb1fcaebd6e79f5ce5c10802c2814
2020-06-30 04:25:41 +00:00
Mohsin Kazmi ec1d61efe6 gso: fix the l2 path
Type: fix

Change-Id: I4f91175444dec9800d651aa5a5e0472359de63d1
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-06-29 08:55:57 +00:00
Vadym Martsynovskyy 42386fc974 udp: align udp_encap_t_ to 2 cachelines
Based on the comments in the struct, udp_encap_t_ is meant to span 2
cachelines. Due to the 64 bit alignment of dpo_id_t, the struct spanned
3 cachelines. This caused fetching ue_ip_proto to trigger an additional
cache miss. This patch rearranges the ordering of the struct fields
so that udp_encap_t_ only spans 2 cachelines as intended.

before:
(gdb) print (int)&((struct udp_encap_t_*)0)->cacheline1
$8 = 128

after:
(gdb) print (int)&((struct udp_encap_t_*)0)->cacheline1
$1 = 64

Type: fix
Signed-off-by: Vadym Martsynovskyy <vmartsyn@fb.com>
Change-Id: I066c08654d4a8ef3e2d3954e957d4c5d382b209f
2020-06-27 10:27:55 +00:00
Chinmaya Agarwal edc2ea435b sr: fix for SID index across segment lists within a sr policy
Type: fix
Signed-off-by: Chinmaya Agarwal <chinmaya.agarwal@hsc.com>
Change-Id: I9aa5456bf94356e8702fbfd39b14db4c2e74d3e6
2020-06-27 10:26:35 +00:00
Zhiyong Yang 975a3cbb13 l2: performance enhancement in l2input
Short Load/Stores combined with prefetching in the beginning of the loop
place too much pressure on AGUs and memory accesses.
The patch interleaves load/store operations with computational operations
to alleviate the pain point.

vlib_get_buffers is also leveraged.

Redefine u8 dst_and_src[12] instead of dst[6] and src[6] in struct
l2input_trace_t in order to merge two copys into one.

Type: improvement

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Change-Id: I7d3df7732c476069235e3019c68f0f53bca9637e
2020-06-27 10:26:13 +00:00
Matthew Smith d352bf8276 vrrp: backup processes priority 255 advertisement
Type: fix

When accept mode is enabled, a backup VR will configure the VR virtual
addresses locally and respond to packets sent to those addresses. This
did not work when the primary VR is the address owner and sends
advertisements using the virtual address as the source address. It
also did not work when NAT was configured on the interface with the
virtual address as the NAT pool address. In both cases, advertisements
from other VRs would arrive and be dropped because they appeared to
be spoofed - the source address would be an address that is
configured as an interface address on the instance receiving it.

When accept mode is enabled for a VR and the VR enters the master state,
add an input feature on ip[46]-multicast for the interface which looks
for VRRP advertisements, figures out whether they are for a VR which
is configured with accept mode and is in the master state  and kicks
them straight to the VRRP nodes to avoid dropping them.

Change-Id: I240ba1ee0b3fd6d693de729698c1181dc71bb08b
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-06-27 10:23:04 +00:00
Steven Luong a4611b85b5 lacp: add unit test
add test_lacp.py to cover basic lacp unit test

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I6f7f3d801956e54106f3c55cedaca186d81dad25
2020-06-27 10:22:40 +00:00
Klement Sekera 9466e4fed6 nat: replace speculative buffer enqueue model
Replace speculative buffer enqueue coding model with
vlib_get_buffers(...)/vlib_buffer_enqueue_to_next(...).

Type: improvement
Change-Id: I7dbfac2234a7bd754c599857eb1d5b601da5bc7c
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2020-06-27 10:19:46 +00:00
Benoît Ganne 78c61c33f3 ikev2: add FEATURE.yaml
Type: docs

Change-Id: Ie7836543e52bee08d12c565fbb6238d3e82ea3ce
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-06-27 10:18:43 +00:00
Chenmin Sun d4c3666b9a flow: add IPSec ESP/AH flow
This patch adds the IPSec ESP/AH type flow support
Have tested on E810 with Intel iAVF driver

Type: feature

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: I6ab8e69f67c423cc4e33f3c363881a97cdb98c30
2020-06-27 10:18:05 +00:00
Mohsin Kazmi b5ca55962d virtio: add tx trace
Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I0b1a1ce085ceb75fe139092e40878566682a7986
2020-06-27 10:16:43 +00:00
Mohsin Kazmi add4a412d1 tap: remove the bridge configurations for TUN interface
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ifeae641ec0aa7de74e33e582234505bf6e28ca87
2020-06-27 10:16:09 +00:00
Filip Tehlar b9d5a6c3da ikev2: remove unused field
Type: improvement

Change-Id: I0893d7cd8b8ab9958f585ac564bd0638bc60e78a
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-06-27 10:15:11 +00:00
Mohsin Kazmi a84cb715f5 ip: fix the punt redirect for ip4
Type: fix

Change-Id: I39341f201209931392f315ead5adfddd8b567caf
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-06-26 17:19:12 +00:00
Dave Barach 17c4531bf1 misc: add gdb macros
These gdb macros should prove very helpul when poking around in core files.

Pifi (pool_is_free_index) is not straighforward. Best to work it out
once.

Others:
 bitmap_get = clib_bitmap_get
 vl = vec_len
 pe = pool_elts
 node_name_from_index, as described
 vnet_buffer_opaque, prints the primary buffer opaque
 vnet_buffer_opaque2, prints the secondary buffer opaque

Fix vppinfra unit-test compile error

Type: improvement
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Id2a2391a47e5a07cf3757f473e3805cc04784161
2020-06-25 15:10:07 +00:00
Klement Sekera fe77bdc190 nat: avoid division by zero
Return error instead of dividing by zero.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I9f6a942e87ab87e8f1921e744ec1add45884e74a
2020-06-25 08:58:26 +00:00
Aloys Augustin 8eca60df74 tests: fix deps pinning / patching
This ensures we don't recompute the requirements-{2,3}.txt on each make
test run, and skips patching scapy if it is already patched instead of
failing.

Change-Id: I3da57182ae49f3dd04db139d96734a5d145fedff
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2020-06-24 20:09:22 +00:00
Mohsin Kazmi 8975dbdf89 virtio: fix the vlib buffer flags
Type: fix

Change-Id: I92e8e30e4175229e24dd92471016e9095b5cc83e
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-06-24 16:20:36 +02:00
Klement Sekera f3d7bd9d4d nat: deterministic: disallow invalid config
Prevent overflow if input network prefix is too small and crash on
packet #1 due to vector not being allocated/initialized.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I3494cc62ce889df48cc59cc9340b5dd70338c3a8
2020-06-24 07:20:50 +00:00
Florin Coras 9c8142a43c udp: jump over ip4 options
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4f57a776302e11815fcea433ba8cf6724799ff65
2020-06-23 22:21:50 +00:00
Damjan Marion 97b9e008b9 vppinfra: fix u32x4_gather definition
Type: fix
Change-Id: I3df8d3f277bfadee95bfc329e8ce8b929a986af6
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-06-23 19:01:56 +02:00
Dave Barach b30b9549ac vlib: debug CLI macro expander, part deux
Deal with circular macro definitions instead of crashing due to stack
overflow.

Separate macro tables, per CLI session

Add documentation to the Sphinx docs

Type: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I55fc9152bd37ad0c15fa3959f38b07b63100e634
2020-06-23 15:35:14 +00:00
Klement Sekera cc72094696 nat: fix broken test
Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I04952865b7e2b447763d0b67d120c3d933177646
2020-06-23 07:13:05 +00:00
Alexander Chernavin 86d6df69e0 ip6-nd: punt neighbor advertisements
With this change, punt received neighbor advertisements instead of drop
in order to give other elements of the system an opportunity to handle
them.

Type: improvement
Change-Id: Ie6cde9eebc83e42029967141cb32ebc459fd3680
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2020-06-23 02:23:06 +00:00
Klement Sekera 1523c347d8 nat: set buf error if can't create user
Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I747d78966a7296dcbae54d54b0c165d407c8863d
2020-06-22 12:58:00 +00:00
Filip Tehlar 4128c7b463 ikev2: use both local and remote ID for profile lookup
Type: fix
Ticket: VPP-1890

Change-Id: I9441d5afc38df7dabf6cccaead69dd32646d2a9e
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-06-18 11:03:54 +00:00
John DeNisco df35a20f9b vpp_config: Updates for 20.05
Added external dependancies package. Updated the startup.conf template.

Fix extras/scripts/check_commit_msg so it accepts '_' characters in
feature names.

Type: fix

Signed-off-by: John DeNisco <jdenisco@cisco.com>
Change-Id: I69c33a24b30d31e5b8081021030bff88cbaeace9
Signed-off-by: Dave Barach <dave@barachs.net>
2020-06-21 12:07:36 +00:00
Dave Barach 3a49130c75 tests: improve lcov stats for memory_api.c
Cover vl_mem_api_dead_client_scan(...), which is not so simple.  Spin
up vpp_api_test using pexpect.spawn, make it bootstrap a private
memory segment, kill vpp_api_test, and wait for the dead client
scanner to run a few times so that it declares the client dead.

The test only runs if GCOV_TESTS=yes is set in the environment.

Type: test

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I3c712fa011df2e23761a2e73c1aba0c7e50123a6
2020-06-20 01:58:34 +00:00
Filip Tehlar 12b517b3ff tests: add ikev2 test framework with basic test case
Ticket: VPP-1905
Type: test

Change-Id: Ie66fbd8e37eb5e69bd61b701ed3449366bee8c84
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-06-18 05:02:04 +00:00
Tom Seidenberg 99151bde6e build: add cmake dependency from test plugin to api
Type: fix

Signed-off-by: Tom Seidenberg <tseidenb@cisco.com>
Change-Id: I00fa22733bd293e56eb6b81346fdf2d75ad9d88f
2020-06-19 07:04:08 +00:00
Dave Barach 961e3c8428 vlib: add recursive macro expander to debug cli
All of the pieces have been sitting around for years.

Added several debug CLI commands:

"define <variable-name> <value>"
"undefine <variable-name>"
"show macro [noeval]"
"echo <whatever>"

Macros may refer to other macros. To defer evaluation:
"define foo \$(bar)" or some such.

The macro evaluator is not smart about "define foo \$(foo)" or more
complicated circular definitions, so don't do that.

Environment variables are available, simply use $<name-of-environment-vbl>

The macro expander has a table of (overrideable) builtin names, which
are evaluated by calling functions.

Simple example:

echo $USER
define ip1 192.168.1.1/24
define ip2 192.168.2.1/24

loop create
loop create
set int ip address loop0 $ip1
set int ip address loop1 $ip2
show int addr
show macro
undefine ip1
undefine ip2

Type: feature

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I08a800647bac573d8ae3cfd75c40061d41c5f976
2020-06-19 07:03:34 +00:00
Klement Sekera fb4df27fae nat: remove unused code
Type: refactor
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Icc55276c8a4c256049718610cb131a34dc8d0a80
2020-06-19 06:59:42 +00:00
Dave Barach 70a9f442f5 docs: add more FEATURE.yaml documentation
For src/tools/g2, src/vlibapi, and src/vlibmemory

Type: docs

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I800c3e3a1ecb011d5e692d78a015e78342706786
2020-06-17 17:02:48 -04:00
Dave Barach 994a44c411 docs: add more FEATURE.yaml documentation
This patch documents the DNS plugin, vlib packet tracing, vnet feature
arcs, and the vppinfra library.

Type: docs

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Idb16ec0593d428ce78fe8404374a823a56b4b420
2020-06-17 20:06:35 +00:00
Klement Sekera f6a9b1442a nat: print hash table parameters in CLI
Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Id6ab7e2ca965e860ea3f96145a888e0f3ccf9778
2020-06-17 15:27:18 +00:00
Dave Barach 35ccd26a5d build: multiple yaml file support
Change the yaml file matching pattern from FEATURE.yaml to
FEATURE*.yaml, so we can document multiple features in one directory.

Type: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ic62f9fb4c73330c698724244cd8b362364fce5f9
2020-06-17 08:06:35 -04:00
Klement Sekera 212bcfefcc nat: add more trex test scripts
Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Ia824d663c86d6a7c9bafe0206e9a93f93884739d
2020-06-17 09:56:12 +00:00
Damjan Marion 5857daf432 build: cmake cross-compilation fixes
Type: fix
Change-Id: I40337c208375b74b4dc3c35102c5e66a6e4568e8
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-06-17 00:46:35 +00:00
Benoît Ganne ae45d47899 ip-neighbor: fix MLD hash key using stack pointer
Use pointed value (ipv6 address) as hash key instead of pointer value
(pointer to ipv6 address on the stack).

Type: fix

Change-Id: I74a8b6d4bb552b5b344bcb50c8e830700c4ce739
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-06-17 00:44:54 +00:00
Dave Barach 1af730d0df misc: fix sonarclound warnings
Type: fix
Ticket: VPP-1888
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I9c2fb926a5e010658088a74051c8c3462ff61734
2020-06-16 17:32:17 +00:00
Damjan Marion cea46522e7 vlib: address sanitizer support for stack switch, enable clang
Type: improvement
Change-Id: I81df4b61d1f0b8c1df77c1ee9bebcb491e155b69
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-06-16 16:05:01 +00:00
Benoît Ganne 173484fe3a build: fix address sanitizer default args
Type: fix
Fixes: ec3a3f16e4

Change-Id: Iea3acd93a96b4bfc9f335e37ec04c00e8fa5ff27
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-06-16 15:30:38 +00:00
Dave Barach 4330c46abb interface: add minimal vpp pkt trace for error-drop
Provide a minimal trace [ip4/ip6 src/dst address] for dropped pkts
when the user specifies "trace add error-drop XXXX", but does not
trace pkts from the original input node.

This is a wireshark dissector problem. Packets thrown at error-drop
may be well-formed, or not. VPP must not crash, no matter what.

The minimal trace capture and decode could be enhanced. Anyone
interested in doing that must consider all of the corner-cases
involved. This version should be at least somewhat useful.

Note that "pcap trace drop ..." - and the packet generator - seem like
the right tools to use when researching more complex issues.

Type: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I961ca133980ffa2a1e5707879a443b21442ed894
2020-06-16 11:50:17 +00:00
Klement Sekera cf9bb22a94 nat: improve outside port selection & perf
Prefer using source port form packet as outside port if possible.

Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I5c25f6a42386f38c9a6cc95bd7dda9f090b49817
2020-06-16 09:05:15 +00:00
John Lo 9ebbb5c416 gtpu: support separate rx-decap and encap-tx teid values
Support separate local and remote TEIDs, with local (or RX) one used
for GTPU tunnel RX/decap and remote (or TX) one used encap/TX.
Updated current gtpu API to support seperate RX/TX TEIDs and added new
gtpu_tunnel_update_tteid API to allow changing TX-TEID of an existing
GTPU tunnel.  The current tunnel field "teid" is used for RX-TEID and
a new field "tteid" is used for TX-TEID.

Type: improvement

Signed-off-by: John Lo <loj@cisco.com>
Change-Id: I549d79750a34bb965036da298c0ca894d15c2c20
2020-06-16 07:25:30 +00:00
Steven Luong a0e8d9669e virtio: add vhost sw_if_index filter for sw_interface_vhost_user_dump
The filter sw_if_index was in the API sw_interface_vhost_user_dump. But
it was never implemented in the backend. This patch is to add the backend,
vat, and custom dump support for the filter.

Type: feature

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Iaa41a7e11bfbcbb4c60092375e4b0dcf0950077b
2020-06-16 01:37:56 +00:00
Mohsin Kazmi 0cf528233a gso: fix the udp checksum in test
Type: fix

Change-Id: I7005e4763e73f3679c40f94bdab26d439cd23188
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-06-16 01:35:05 +00:00
Benoît Ganne ff13e46215 api: check id is valid for bounce checking
If the id is invalid we cannot check whether we must free the message or
not, free it anyway.

Type: fix

Change-Id: Ie4426f601390d1e5e14c739f670e8c1e6e3aaf1e
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-06-15 19:04:25 +00:00
Simon Chatterjee 810ad343de build: remove un-needed script
The move to cmake obviates the need for this build script (and its terminology).

Type: make

Signed-off-by: Simon Chatterjee <code@chatts.net>
Change-Id: Ie17429bfdf5a4b02ce2b70ba3568a7445c162d38
2020-06-15 18:46:38 +00:00
Florin Coras 66ec467cda vcl: move helper functions out of header file
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3889fd80b145cf80f76f6054d63247e76bdf20ff
2020-06-15 17:36:36 +00:00
Yichen Wang 81355d74a4 build: fix the build on centos8
Add missing dependencies and correct the building to support CentOS8

Type: make

Change-Id: Ie15b9b1174fa9b6d5ae02bace36ebc77e17d770c
Signed-off-by: Yichen Wang <yicwang@cisco.com>
2020-06-15 16:12:48 +00:00
Zhiyong Yang 47ea4c35fe vxlan: remove judgement with always true
if ((A | B) == false)  it means both A and B are false, so for
the following code

if (PREDICT_FALSE (!good_udp1))
      {
        if ((flags1 & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED) == 0)
          {
              ...
          }
      }
if ((flags1 & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED) == 0) is always
true if the code run it. Remove it.

Type: improvement

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Change-Id: I6bd1e9340c7a00089fc1c9ae49773add832d309e
2020-06-15 16:09:58 +00:00
Benoît Ganne c16fe46890 buffers: fix non-default sized buffers initialization
Type: fix

Change-Id: I4a93e1d9936414c514cb237a22624986b3ef5b3d
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-06-15 14:52:04 +00:00
Benoît Ganne b43677fe2d dpdk: cryptodev: fix non-null terminated strings
Type: fix

Change-Id: Ib6f423e24f1a8d8439cd7e8893e4605e10984d48
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-06-15 14:51:09 +00:00
Filip Tehlar fbd47cf835 ikev2: announce both 'ESN' and 'No ESN'
Type: fix

Change-Id: If73b88b9478b9314df6d9163c3a13724d4253c80
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-06-15 07:01:31 +00:00
Steven Luong 1eae8ecb7a vlib: node recyling and node deletion missing triggering graph node sync
When recycling a graph node vnet_register_interface, it is missing an
explicit call to vlib_worker_thread_node_runtime_update(). However,
there is an implicit call to vlib_worker_thread_node_runtime_update()
via vnet_sw_interface_set_flags_helper() if it enables a new feature on
the interface for the first time. But that implicit call is not
guaranteed. For example, if an interface is created, deleted, and
created, then it may skip the implicit call to
vlib_worker_thread_node_runtime_update(). When that happens, the graph
nodes on thread 0 are not sync'ed to the worker threads. So the worker
thread's graph nodes are out of sync momentarily with the main thread's
graph nodes until some other event happens which calls for a sync is
needed. During this window, the worker thread's graph node is
vulnerable and may experience a crash.

When deleting a graph node, we never trigger a sync to the worker
thread. A patch was committed 3 years ago via
https://gerrit.fd.io/r/c/vpp/+/7523 to fix a show run crash. In
hindsight, the approach taken by 7523 is not orthogonal. While at it,
let's fix it right for both issues with a call to
vlib_worker_thread_node_runtime_update() in the appropriate place and
remove 7523.

Type: fix
Ticket: VPPSUPP-86
Fixes: gerrit 7523 / 19e9d954bd

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ic9472bd2d3a212dbfeceb526506ed0400983a142
2020-06-12 19:07:01 +00:00
Mohsin Kazmi 38b09681a0 virtio: interface type based improvements
Type: improvement

Change-Id: I220ea6ab609e3c1628f5210be441d0d5e825a32c
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-06-12 15:43:32 +00:00
Dave Barach 01a2a10715 ip: allocate ip4 mtrie pages in htlb memory
No change in default behavior. To use htlb pages for the ip4 mtrie,
use the "ip" command-line option "mtrie-hugetlb".

Type: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I5497e426a47200edff2c7e15563ed6a42af12e7f
2020-06-12 12:06:29 +00:00
Filip Tehlar 4cb21c8e5d ikev2: don't add DH group in ESP transform proposals
Type: fix

Anouncing DH group in esp transform proposals will enable PFS which is
not suppored now. This fixes issue during rekey when using strongswan as
responder.

Change-Id: Ib9f586113ae0ab9dc67e6ceadff43f8aac463820
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-06-11 16:50:55 +00:00
Klement Sekera cd35ed48d4 nat: properly scale out2in-ed hash on init
Type: fix
Fixes: a1018c166a
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I86592f73a60fd146d3764e474f975881e940c244
2020-06-11 10:37:11 +00:00
Klement Sekera a1018c166a nat: simplify bihash buckets/mem config
Derive reasonable values from max translations/max users.

Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I41a96ab63ab138b4160cd60bd6df24fc73791c86
2020-06-11 08:02:16 +00:00
Klement Sekera 35418ba491 vapi: memset allocated messages to zero
This avoids using dirty data from shared memory by client.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I96eecf655bf344ec29609cedbd8dc891b572e207
2020-06-10 11:11:07 +00:00
zhengdelun ce53363d20 ip: reassembly: LRU algorithm should eliminate the longest unused nodes
Type: fix

Signed-off-by: zhengdelun <xszhengdelun@gmail.com>
Change-Id: I3f6240b4c0798f85960acc55a193a0cbf0c67ea4
2020-06-10 11:09:59 +00:00
Klement Sekera d6ba3ca251 nat: optimize prefetching
Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Iea1748e8e39d213fcb3f3b52379bd37a6dd6aa3d
2020-06-10 09:48:47 +00:00
Mohsin Kazmi b660a0e5b2 tap: enable gso/csum offload for tun
Type: improvement

Change-Id: I5b9d5ea192776f14a45bf909acc4bef7793521e8
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-06-09 15:18:12 +02:00
Mohsin Kazmi dbd5fb3db5 vxlan: fix the inner packet checksum calculation
Type: fix

Change-Id: I1da4ace9f3e548af4b5b3373d695e4214c5df2ff
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-06-09 15:18:03 +02:00
Mohsin Kazmi 21a1de42b0 misc: add code styling for vxlan encap and vxlan_packet files
Type: style

Change-Id: Id363ccd0e51c61388fb45ef10685929f629cccbd
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-06-09 15:17:58 +02:00
Florin Coras 8ddd19bf7b tcp: improve rtt estimation with rate sampling
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I25043da84b2f2b3f37024ecfedac535df3004ea5
2020-06-08 18:44:34 +00:00
Dave Barach 0a67b48f1d vlib: stop inlining vlib_add_trace(...)
Packet tracing performance doesn't justify inlining
vlib_add_trace(...) over 500 times.

It makes a 15% text-segment size difference in a representative use-case:

Inline:
$ size .../vnet_skx.dir/ipsec/ipsec_input.c.o
   text    data     bss     dec     hex filename
   6831      80       0    6911    1aff .../vnet_skx.dir/ipsec/ipsec_input.c.o

Not inline:
$ size .../vnet_skx.dir/ipsec/ipsec_input.c.o
   text    data     bss     dec     hex filename
   5776      80       0    5856    16e0 .../vnet_skx.dir/ipsec/ipsec_input.c.o

Retain the original code as vlib_add_trace_inline, instantiate once as
vlib_add_trace.

Type: refactor
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Iaf431dbf00c4aad03663d86f9dd1322e84d03962
2020-06-08 16:03:36 +00:00
Dave Barach 6a3195f166 vlib: Coverity fix
Fix a nit warning: we're not likely to create a vlib process with more
than 4gb of stack.

Type: fix
Ticket: VPP-1888

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I8bc7f64287c2802b0c286ce3d04443ac723a9a33
2020-06-08 15:54:56 +00:00
Vladimir Isaev 698eb87a8e vxlan: Fixed checksum caclculation offset
VXLAN uses csum_offload for IPv6 packets.

But without gso node we have csum calculated only for inner
packet.
This patch adds support for outer header csum calculation.
Checksum for inner packet should be calculated before
interface-output node (for example in vxlan node).

Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Signed-off-by: Vladimir Isaev <visaev@netgate.com>
Change-Id: Ica68429ede4426293769207cd83c791ebe72fe56
2020-06-08 14:17:59 +00:00
Klement Sekera e362151804 nat: more long read after short write optimization
Replace whitespread (mis)use of snat_session_key_t by proper function
arguments where applicable and inline functions to calculate hash keys
instead of using structs for that. Make all hash tables use same network
byte order port so that there is no longer a discrepancy between static
mappings using host byte order while in2out/out2in tables using network
byte order.

Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I80786d2f947c67824c101a13bb608f1fe1080f34
2020-06-08 13:46:35 +00:00
Dave Barach c1f0d9c105 mactime: print error if feature not enabled
Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I8fbc4baefecf512573126c5085ed7a6e2e360fbe
2020-06-07 09:18:57 -04:00
Dave Barach 26d890eb4b fib: fix multiple dpo pool expand cases
Add dpo_pool_barrier_sync/release, use them to clean up
thread-unsafe pool expansion cases.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I09299124a25f8d541e3bb4b75375568990e9b911
2020-06-07 09:11:48 +00:00
Dave Barach c2d2228e92 fib: fix adj pool expand cases
adj_alloc (...) is not thread safe when the adj pool or combined
counter vectors expand.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I55710de6ecc083b7434e11798659cca9250c9131
2020-06-05 07:07:42 -04:00
Jieqiang Wang a5cf6e077d build: add libssl-dev library for ubuntu 20.04
Add the libssl-dev library for ubuntu 20.04 in Makefile.

Type: fix

Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
Change-Id: I4187cb041997e7457734ffdb18bdbec98a051669
2020-06-04 15:35:44 +00:00
Dave Barach 8341f76fd1 fib: add barrier sync, pool/vector expand cases
load_balance_alloc_i(...) is not thread safe when the
load_balance_pool or combined counter vectors expand.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I7f295ed77350d1df0434d5ff461eedafe79131de
2020-06-04 14:42:26 +00:00
Klement Sekera c39c79c5aa nat: fix coverity warning
Type: fix

Change-Id: I0e87021b11009a955f5839bdb68af897145816c1
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2020-06-04 14:01:06 +00:00
Filip Tehlar 0b3648fd1f ikev2: session cleanup after profile is deleted
Type: fix

Change-Id: I3198461f3dfc13cd3cedf2b8611dc80bb6f959c8
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-06-04 12:10:43 +00:00
Damjan Marion dfb19cabe2 dpdk: cleanup, add rx queue struct
Type: improvement
Change-Id: I3defde103ab245404de42d2be7abcb2c43d49a60
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-06-04 12:08:09 +00:00
Filip Varga 4496243cc9 nat: fixed input validation
Ticket: VPP-1887
Type: fix

Change-Id: I341ac7b455926a106d736f4de6771aae655db82e
Signed-off-by: Filip Varga <fivarga@cisco.com>
2020-06-04 10:10:51 +00:00
Klement Sekera 17a8ab6857 nat: add tracing for nat44-hairpinning
Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Ife437f959e29d3de88bd7ee77221ada86fb03e80
2020-06-04 08:37:28 +00:00
Dave Barach ce412fd7d6 docs: improve handoff queue writeup
Type: docs
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I4d63a0fbbdb3cc00eac9116f122e5b831d059e33
2020-06-03 20:17:45 +00:00
Damjan Marion 1033b4997e vlib: improve node interrupt handling
- add ability to pass data together with interrupt
 - avoid locking for local interrupts (same thread)

Type: improvement

Change-Id: I73a2ab2e716bb887a1f02c87788ae83e329f9b40
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-06-03 13:21:57 +00:00
Ole Troan ec62d0a436 nat: refactor mss_clamping to not depend on snat_main_t
Type: refactor
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I1110e425859a4f1f07952c91b50f263cb7323836
2020-06-03 11:48:50 +02:00
Andrew Yourtchenko be360ee4d7 bash: functions to set up csit and sandbox env
Type: test

Change-Id: Iceaebfe2faf29a893b9571069212e951273c3d2b
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Signed-off-by: John DeNisco <jdenisco@cisco.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2020-06-02 19:21:17 +00:00
Filip Tehlar 96dabc69ab ikev2: remove unused hash computation
Type: improvement

Change-Id: I99c2383dd0d30efd1837f3d10ff2e4cf3a784283
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-06-02 12:17:04 +00:00
Andreas Schultz 3b519b38b0 ip: fix IPv6 mask to prefix length conversion
make sure we don't pass a 0 (zero) to log2.

Type: fix

Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
Change-Id: Ib3386ad4686835d3836f48294cee4058e897847a
2020-06-01 15:41:08 +00:00
Dave Barach 63c672c440 nat: update ip4-udp src port for checksum == 0 pkts
Otherwise, the out2in path will discard return-path traffic with
probability 1.0.

Type: fix
Fixes: gerrit 23963 / f126e746fc

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I621ed99329c04ef358035747dde599c0016b58f5
2020-06-01 13:01:10 +00:00
Paul Vinciguerra 353535bb48 lisp: fix api_format reference
Type: fix
Ticket: VPP-1885

Change-Id: I474fffd4d36f439a19d475a8cb20171ca88274ec
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2020-05-29 19:01:18 -04:00
Matthew Smith 7285103a74 bonding: Revert adjust link state
This reverts commit 9121c415a9.

Reason for revert: causes deadlock with multiple worker threads

Type: fix

Change-Id: Icf3d6d343d99d887abacbaa03acbf04d4628514e
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-05-29 21:59:32 +00:00
Florin Coras f3c1e4b612 lisp: fix api_format
Type: fix
Ticket: VPP-1885
Fixes: 58db6e1

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6431e49b315e09490fed8fd70ac53872836c6a09
2020-05-29 20:50:25 +00:00
Florin Coras 9b72b153d8 lisp: fix custom dump
Type: fix
Ticket: VPP-1886
Fixes: 58db6e1

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic40018a756e57bfec05ffbc5e30d18f4feb315db
2020-05-29 20:50:02 +00:00
Neale Ranns 22391fa92b fib: Safe adj walk
Type: fix

the hash walk does not give the same guarantees as the bihash so
walk in a safe manner.

Change-Id: Idfe48c3a84ab3a341d887f7d196bc81ba34ae8b0
Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-05-29 20:27:06 +00:00
Mohsin Kazmi adf6209cbe gso: add checksum and payload size testing
Type: test

Change-Id: I9e4f7cf44d465712aa26e5dd6a0ff38588964a39
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-05-29 17:03:50 +00:00
Mohsin Kazmi be03b5c155 gso: fix flag for inner header
Type: fix

Change-Id: Ic3fc488521636f7f7c9402a20db45fdb599adaae
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-05-29 17:03:19 +00:00
John DeNisco 5bb3e81e7f docs: Minor updates to feature.yaml files
Type: docs

Signed-off-by: John DeNisco <jdenisco@cisco.com>
Change-Id: Iba106d33d34766b91e46980e7237fbdfc3710b8b
2020-05-29 13:14:01 +00:00
John DeNisco d52820d264 docs: Minor fixes in publish_docs.sh and sanitizer.rst
Fix a warning in sanitizer.rst and publish_docs.sh

Type: fix

Signed-off-by: John DeNisco <jdenisco@cisco.com>
Change-Id: I66d724f52a7b724a97a894e1cd35c1239aeedcdf
2020-05-29 13:12:40 +00:00
Elias Rudberg 2dca180db9 misc: ipfix-export unformat u16 collector_port fix
Use %U and unformat_udp_port instead of %u for unformat() call for
u16 collector_port number in set_ipfix_exporter_command_fn() to
avoid corruption of other variables which can happen if unformat()
with %u is used with a 16-bit variable. This avoids crash due to
corrupted fib_index value.

Type: fix

Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Change-Id: Id54273fcc458a7f9c5aa4025aa91711f160c1c1a
2020-05-29 12:57:20 +00:00
Mohsin Kazmi aeb18d37b4 misc: fix the pretty print for api trace
Type: style

Change-Id: I4ef8ba30be2696e8f63d5305027d2aa629cbdb88
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-05-29 10:43:29 +00:00
Andrew Yourtchenko e7df8cbb6d misc: Avoid sample.md from in the VPP docs, clean up the extraneous copy
I had cleaned up the sample.md previously for 20.01, but when later
that was merged to master, the file was renamed. So, fix this issue.


Change-Id: I6347685af216901fbfdd445606735b9bf79f8fe5
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit e2e3c38be6)
2020-05-28 17:06:27 +00:00
Mohsin Kazmi 04f4d91c9f tap: fix rx queue index
Type: fix

Change-Id: I5601bdeb47d08118476ff7bd29435d2c1dba34b9
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-05-28 14:37:50 +00:00
Benoît Ganne dcd4aa2110 dhcp: use per-thread vlib main instead of global one
Type: fix

Change-Id: I8890aa5cc3c576fc9fb68735549dfab721714310
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-05-28 11:09:45 +00:00
Dave Barach 7f475bf4b7 dhcp: vat support for the dhcp_client_dump API
Also: permanently solve ordering issues with the vpp builtin vat
plugin loader, by explicitly loading vat plugins once we're sure that
all data plane plugins have registered their APIs / API message
handlers.

Fix compilation / link errors when the vpp builtin vat plugin loader
is disbled by cmake configuration.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Id553c63ae860ebfc196c5ad4b55c19e08fec2c9e
Signed-off-by: Ole Troan <ot@cisco.com>
2020-05-27 20:53:57 +00:00
Damjan Marion ec3a3f16e4 build: make address sanitizer options configurable with cmake
Type: improvement
Change-Id: I9ee0407e0634f773862dd65ff5d5594814294c2c
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-05-27 18:46:27 +00:00
Neale Ranns 5500d1d650 ipsec: Add/Del IPSec SA is not MP safe
Type: fix

we can probably do better, but for now this is needed

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: I07161f5ac07a70a0e6db6608ba31659d9bc2c9ed
2020-05-27 17:33:19 +00:00
John Lo 4a302ee7c7 ethernet: fix DMAC check and skip unnecessary ones (VPP-1868)
Fix and optimize DMAC check in ethernet-input node to utilize NIC or
driver which support L3 DMAC-filtering mode so that DMAC check can be
bypassed safely for interfaces/sub-interfaces in L3 mode.
Checking of interface in L3-DMAC-filtering state to avoid DMAC check
require the following:
a) Fix interface driver init sequence for devices which supports L3
   DMAC-filtering to indicate its capability and initialize interface
   to L3 DMAC-filtering state.
b) Fix ethernet_set_flags() function and its associated callback
   flags_change() functions registered by various drivers in interface
   infra to provide proper L3 DMAC filtering status.
Maintain interface/sub-interface L3 config count so DMAC checks can be
bypassed if L3 forwarding is not setup on any main/sub-interfaces.

Type: fix
Ticket: VPP-1868

Signed-off-by: John Lo <loj@cisco.com>
Change-Id: I204d90459c13e9e486cfcba4e64e3d479bc9f2ae
2020-05-27 17:27:27 +00:00
Damjan Marion 94f3295d38 dpdk: bump to DPDK v20.05
Type: improvement
Change-Id: I5f89fc3d994bd85d2c5138069ea2c58661814228
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-05-27 16:09:06 +00:00
Damjan Marion 6183cf4fb9 vppinfra: fix SIGBUS in bihash init when running unpriviledged, take two
Looks like MAP_LOCK is not enough, so call mlock(...) instead....

Type: fix
Change-Id: I1bc668a2bf3c861ca1c2d376c0fb6bfea87d4f48
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-05-27 16:43:35 +02:00
Klement Sekera 11492291e6 ip: reassembly: use correct IP header offset
Type: fix
Ticket: VPP-1883
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Icf50a645e114fa3b7bd974f8c82f5ceebfcedcd7
2020-05-27 14:29:21 +00:00
Matthew Smith 9121c415a9 bonding: adjust link state based on active slaves
Type: improvement

Bond link state is being maintained inconsistently. It is initially set to
up.  If the bond interface admin state is set to down, the link state is
set to down. If the bond interface admin state is set to up, the link
state is only set to up if there are active slave interfaces at that point.
If slaves become active at some later time, it does not get updated. Its
next chance to be updated is the next time the bond interface is set to
admin up.

To address this, do not set the link state to up after creating a bond.
Adjust the link state as slave interfaces are attached or detached
based on whether the bond is getting its first active slave or losing
its last one.

Unit test added to verify correct maintenance of link state.

Change-Id: I31f17321f7f0e727e1ab1e01713423af6566dad9
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-05-27 12:58:33 +00:00
Elias Rudberg 5556813fb6 nat: fix regarding vm arg for vlib_time_now call
Change in snat_ipfix_header_create() to use thread-specific
vlib_main_t *vm pointer to avoid problems with different threads
accessing the same vlib_main_t data structure. This avoids
assertion failure when vlib_time_now() is called with a vm
corresponding to a different thread.

Type: fix

Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Change-Id: I2096c1debb5688d3b97e5ed9a0ea78d94053d8b7
2020-05-27 11:48:44 +00:00
Ole Troan e796a18734 api: make vpp api handlers endian independent
Add a new boolean to signal that the API infrastructure should performan any required
endian conversions for the API handler.

  am->is_autoendian[mm->msg_id_base + VL_API_MAP_ADD_DOMAIN] = 1;

Similarly add new REPLY_ macros that perform endian conversion.

These changes do not change the on-the-wire encoding of the API messages, and therefore the API CRC is not changed.

Type: feature
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I7588f8ccb38b2d1e8d85ea17be99bac43f756267
Signed-off-by: Ole Troan <ot@cisco.com>
2020-05-27 08:30:38 +00:00
Florin Coras 0ab36f5575 vcl: fix ldp fcntl64
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I342d8f928fcc7de74f9bd288c1a5d63ea1f90020
2020-05-26 20:35:19 +00:00
Neale Ranns 1bf6df4ff9 fib: Fix interpose source reactivate
Type: fix

when the interpose is on an adj-fib and the cover is removed the adj
source will not install. this lead to no path list being found for the
interpose source and a crash. pick a drop path list in this case.

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Ied217da043926c913657080f5ffb151201225d23
2020-05-26 14:56:25 +00:00
Neale Ranns 20aec3db44 fib: Use basic hash for adjacency neighbour table
Type: improvement

a bihash per-interface used too much memory.

Change-Id: I447bb66c0907e1632fa5d886a3600e518663c39e
Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-05-26 14:54:23 +00:00
Florin Coras 080aa503b2 vcl: do not propagate epoll events if session closed
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I1e9652b476bbc07852b4e701a948c36a0d8c67fa
2020-05-26 14:16:35 +00:00
Damjan Marion 0792bb451c pci: improve vfio logging
Type: improvement
Change-Id: Ic49a43651b80b79fa278e29964da5cb2ead2a818
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-05-26 12:36:26 +00:00
Rajesh Goel d1d90f5951 ipsec: DES/3DES fixing the iv_len for openssl crypto
Type: fix

Signed-off-by: Rajesh Goel <rajegoel@cisco.com>
Change-Id: I8d128598b4c872f19b64c779c19b5908ba2f2c08
2020-05-26 07:44:27 +00:00
Florin Coras a4dac8af0e vcl: fix udp connected check
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I83dafe10cdc78fbb9a751f32155cd84d281b12d9
2020-05-25 21:03:41 +00:00
Aloys Augustin ef29fa43ce tests: update pip and pip-tools
This fixes an issue where the pinned requirements file can be modified
when running the tests.

Change-Id: Ic89d1844d1fd8d00f62211a9b051a26ac34ee316
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2020-05-25 20:27:29 +00:00
Florin Coras 3b9540966f tcp: fix sack block validation on wrap
Type: fix
Fixes: 487507f

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia9813ae09d14111dc8edac0fa6ab082e13ab6e2e
2020-05-25 19:36:59 +00:00
Ole Troan f5db3711b2 api: add new stream message convention
Instead of having to wrap dump/detail calls in control ping, send details messages in between a normal
reply / request pair. As expressed in the below service statement.

Example:

service {
  rpc map_domains_gets returns map_domains_get_reply
    stream map_domain_details;
};

define map_domains_get
{
  u32 client_index;
  u32 context;
  u32 cursor;
};

define map_domains_get_reply
{
  u32 context;
  i32 retval;
  u32 cursor;
};

To avoid blocking the main thread for too long, the replies are now sent in client message queue size
chunks. The reply message returns VNET_API_ERROR_EAGAIN when there is more to read.
The API handler must also include a "cursor" that is used to the next call to the get function.

API handler example:
  REPLY_AND_DETAILS_MACRO (VL_API_MAP_DOMAINS_GET_REPLY, mm->domains,
  ({
    send_domain_details (cursor, rp, mp->context);
  }));

The macro starts from cursor and iterates through the pool
until vl_api_process_may_suspend() returns true or the iteration
reaches the end of the list.

Client Example:

cursor = 0
d = []
while True:
    rv, details = map_domains_get(cursor=cursor)
    d += details
    if rv.retval == 0 or rv.retval != -165:
        break
    cursor = rv.cursor

or the convenience iterator:
for x in vpp.details_iter(vpp.api.map_domains_get):
  pass

or

list(details_iter(map_domains_get))

Change-Id: Iad9f6b41b0ef886adb584c97708dd91cf552749e
Type: feature
Signed-off-by: Ole Troan <ot@cisco.com>
2020-05-25 11:22:34 +00:00
Alexander Chernavin afc233aa93 dpdk: del warnings that duplicate counters in esp
Type: improvement

Change-Id: I51cbe5c76a88d7fa65fa24dc1528e4f991eba534
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2020-05-24 23:32:07 +00:00
Damjan Marion e6db7752df vppinfra: fix SIGBUS in bihash init when running unpriviledged
Obserbed when VPP is running in k8s container.

Type: fix
Change-Id: Ibbff9c3921bd7f4f97d47cb6f10eed8ed5efe269
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-05-24 20:45:15 +02:00
Florin Coras ce17f46b81 vcl: add sendmsg/recvmsg for vlsh in ldp
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: If61eec3f5723e6b36e6f4a21c05d8d0dd3547fc7
2020-05-24 17:34:49 +00:00
Florin Coras d4712a8933 tcp: track buffer alloc failures
Reported as part of "show tcp stats"

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I499ab4e41d13aaf1a0d060e37f09087e63d09567
2020-05-24 17:34:32 +00:00
PiotrX Kleski fdca4dd1a1 ipsec: fixed chaining ops after add footer and icv
In case there is no free space in first buffer for ICV and footer,
additional buffer will be added, but esp_encrypt will stay in single
buffer mode.
The issue happens for the following payload sizes:
 - TCP packets with payload 1992
 - ICMP packets with payload 2004

This fix moves the single/chained buffer ops selection to after
esp_add_footer_and_icv call.

Type: fix

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Signed-off-by: PiotrX Kleski <piotrx.kleski@intel.com>
Change-Id: Ic5ceba418f738933f96edb3e489ca2d149033b79
2020-05-24 07:31:49 +00:00
Damjan Marion cbe053e14f vppinfra: remove include
Type: refactor
Change-Id: Iea83e0ea8a6e13f3c9ece1a13f891c1fa0956711
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-05-22 21:11:01 +00:00
Damjan Marion d4d2e59d0d avf: interrupt mode, support for WB_ON_ITR
Type: improvement
Change-Id: I5c944c3f82e0f278b64f28e09a74f24514c029f0
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-05-22 17:53:49 +02:00
Damjan Marion 5a47b43a39 avf: improve link speed handling
Support VIRTCHNL_VF_CAP_ADV_LINK_SPEED.

Type: improvement
Change-Id: Ie45c9d557d0369464cbb6881ee1259ef3807d7d5
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-05-22 17:22:41 +02:00
Vladimir Ratnikov f3b327673c nat: fix dslite session port allocation
Fix allocation of port per dslite session.
After each session is created per protocol,
when new one should be created with new port,
instead it's trying to create with the same port
and while(1) loop is executed forever and VPP does
not response

Type: fix

Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com>
Change-Id: Ic91b8b07253498ef9846ca60bcd4c4c76a5fac91
2020-05-22 08:02:12 +00:00
Filip Varga b8749ff775 nat: output fib index fix
Type: fix

Change-Id: I7cb7e3716aee865b12235865009e39ed6ad16680
Signed-off-by: Filip Varga <fivarga@cisco.com>
2020-05-22 07:44:48 +00:00
Damjan Marion a2185120d5 vlib: enforce buffer alloc return value check
Type: improvement
Change-Id: I33cd702f9c4d995520509fdb16e3b8f8fd50e535
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-05-21 17:33:37 +00:00
Florin Coras 1e96617d95 vcl: support connected udp listens
Request connected udp listener behavior by setting
VPPCOM_ATTR_SET_CONNECTED attribute with vppcom_session_attr

Type: feature

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iba95155c0f41cea8c6e1a4263946270d49c213ac
2020-05-21 16:54:58 +00:00
Neale Ranns fc74697ed3 ip: Dual loop error in midchain chksum
Type: fix

Change-Id: Idf7c80b7d81f796bd0512bca4276bcfcf2af241a
Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-05-21 07:09:34 +00:00
Damjan Marion ef58758286 vlib: mmap process stacks
Instead of allocating stack from the main heap, this patch mmaps stack
memory together with guard page.

This aproach reduces main heap usage, and stack memory is prefaulted
on demand, so bigger process stacks will have zero impact on memory
usage as long as stack memory is not needed for real.

In addition, it fixes issue with systems which have bigger default page
size (observed with 65536).

Type: improvement
Change-Id: I593365c603d4702e428967d80fd425fdee2c4a21
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-05-20 22:01:44 +02:00
Benoît Ganne ca86c95a34 docs: asan: update doc to match current status
Type: docs

Change-Id: I45265876c9c778f6b91d39f30eb6035f14d166ec
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-05-20 16:01:30 +00:00
hanlin 4266d4d5ff vcl: nest vcl_mq_epfd to support epoll_wait without high CPU usage
Now, libc epfd and vls epfd are independent and can only epoll_wait independently without timeout, then app calling epoll_wait will occupy high CPU. So we nest vcl_mq_epfd into libc epfd when using eventfd with VPP, and then we can only epoll_wait libc epfd with specified timeout.

Type: feature
Signed-off-by: hanlin <hanlin_wang@163.com>
Change-Id: I6b6e0f501c769e186714bfbc187cfaed2533b4c2
Signed-off-by: hanlin <hanlin_wang@163.com>
2020-05-20 15:30:28 +00:00
Satoru Matsushima cf75544267 srv6-mobile: Update the doc for gtp4.dt and gtp6.dt funcitons.
Document update to reflect merged SRv6 functions of lookup and forwarding for inner IP packet encapsulated with outer IP and GTP-U headers.

Type: docs

Signed-off-by: Satoru Matsushima <satoru.matsushima@gmail.com>
Change-Id: I85c9ddf6bf9fa63f2b8b6e03eff3ecec1e7615ab
2020-05-20 11:09:19 +00:00
Dave Barach 2a41919e39 vppinfra: refactor mpcap.h
vppinfra source files MUST NOT #include <vlib/vlib.h>, <vnet/vnet.h>
or similar. Move mpcap_add_packet(...), mpcap_add_buffer(...) to a new
file: src/vnet/mpcap.h.

Type: refactor
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Id517aef6fe49b618f853ce32940b91ba45a1e60d
2020-05-19 20:50:41 +00:00
Matthew Smith 827b929301 dpdk: change netvsc device port type
Netvsc devices have the port type determined from their link speed.
The link speed between reboots of an Azure VM does not always end
up at the same value, so an interface that was FortyGigabitEthernet0
earlier may be FiftyGigabitEthernet0 now. That makes it difficult
to maintain a persistent store of configurations and apply those at
startup.

Change the port type to be VF so the name will always be generated
as VirtualFunctionEthernetX.

Type: improvement

Change-Id: I58cab852b87c0bcd9f73afe239803f38dab5c159
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-05-19 18:54:59 +00:00
Benoît Ganne c32a84c70e dpdk: fix pktmbuf pool private data init
Type: fix

Change-Id: I7349840af48eec209532dab43a8ad0bd68993268
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-05-19 17:15:21 +00:00
Ole Troan deecc93bd9 vppapigen: handle new api file for crcchekcer
Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I1b3ae8b348eb3cba628a55ea3e72e85b9a4288d5
2020-05-19 13:32:47 +02:00
Jakub Grajciar e30f1e92eb interface: fix interface rx mode config API
Swap byte order for fields of type vl_api_rx_mode_t.

Ticket: VPP-1871
Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: Ia1745257b57209d41661d38067e0dd7618f9a9b9
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
(cherry picked from commit aefcd1a357)
2020-05-19 07:23:31 +00:00
Damjan Marion 53b8dc8bea vppinfra: OpenPOWER ELF V2 ABI version of clib_{longjmp,setjmp,calljmp}
Type: improvement
Change-Id: Iea8e08dc18b72334f69af77c2753e900be6b97fb
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-05-18 21:28:31 +00:00
Paul Vinciguerra f4fbfd692f libmemif: cleanup typos
cleaned up typos in documetation while doing a read through.

Type: style

Change-Id: Id8abbd8d6297ee10490c12a8e62097224f7ec1e1
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2020-05-18 18:21:53 +00:00
Ignas Bacius 59a78e966c ip6-nd: correct set-ip6-nd-proxy CLI short_help
Type: fix
Signed-off-by: Ignas Bacius <ignas@noia.network>
Change-Id: Id99a15272f6f12a724a4cfd9de461f1aa6a6a634
2020-05-17 13:44:21 +00:00
Damjan Marion 97086e18a4 vppinfra: use byte swap builtins
Type: improvement
Change-Id: I438206513b3cc3dedc0241b43c4ce037afa83e2b
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-05-16 02:59:52 +00:00
Ole Troan 14a6c0e601 vppapigen: add assert for python version
The recent introduction of f-strings require  >=Python3.6
Fix a couple of pycodestyle warnings.

Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Id9e375bb8febb157d7f9d7fa21808724770df6f8
2020-05-16 02:54:37 +00:00
John Lo f415a3b53a l2: L2/L3 mode swicth cleanup and l2-patch fix
Cleanup L2/L3 mode switch to not redirect to/from ethernet-input node
as it is no longer necessary.
L2 patch should use sw_if_index for device feature enable/disable.

Type: fix

Signed-off-by: John Lo <loj@cisco.com>
Change-Id: I0f24161d027b07c188fd1e05276146f94c075710
2020-05-16 02:52:13 +00:00
Ignas Bacius f3a522fb3f misc: fix typo in set-ipfix-exporter CLI short_help
Type: fix
Change-Id: Id6687780b9a740323bd2eef58447864e70dc0235
Signed-off-by: Ignas Bacius <ignas@noia.network>
2020-05-16 02:35:33 +00:00
Damjan Marion a416493d3b misc: fix ubuntu 20.04 python deps
Type: fix
Change-Id: I9cdfbffd6333d090f970422bf047aaa90c1e4c65
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-05-15 23:42:40 +00:00
Damjan Marion d466c0cafc vppinfra: remove trailing whitespace in longjmp.S
Type: refactor

Change-Id: I2acbd864186c1d7694701c047ba72f58750a8558
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-05-15 23:41:58 +00:00
Benoît Ganne 10a22a6294 vlib: restore commands for non-interactive sessions
'quit' and 'show terminal' are valid for non-interactive sessions too.

Type: fix
Fixes: a58be82dda

Change-Id: Ib63244c7b64ad2e30c257ed19e982295f59bfffa
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-05-15 23:35:06 +00:00
Florin Coras 3ca663e743 vcl: remove udpc transport
Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I145ff3301f168973c4f7f32c337bbcac47900705
2020-05-15 21:36:33 +00:00
Ray Kinsella 8bf80a3dda misc: removed executable bits from source files
Identified and removed executable bit from source files in the tree.
find . -perm 755 -name *.[ch] -exec chmod a-x {} \;

Type: improvement

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I00710d59fcc46ce5be5233109af4c8077daff74b
2020-05-15 19:26:42 +00:00
Florin Coras c8e812f6fb session: track detached listener segment managers
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iae734a526d2e7befd9738054d028df0062b67000
2020-05-15 16:14:12 +00:00
Dave Barach 18a86c6e60 g2: fix the g2 build for Ubuntu 20.04
Shut off deprecated declaration warnings

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I65ea4bbc4d5ee5a11d4e8f554f414f57944c7e1c
2020-05-15 15:23:00 +00:00
Filip Tehlar 4362baa33c ikev2: add support for NAT traversal
Type: feature

* initiator behind NAT supported
* tested with static NAT mappings
* works only with pre-configured tunnels

The pre-configured tunnel has to be defined as follows:

initiator (i) side: src=ip(i) dst=ip(r)
responder (r) side: src=ip(r) dst=ip(nat)

Change-Id: Ia9f79ddbbcc3f7dc8fde6bbeca2a433e3b784e94
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-05-15 11:41:14 +00:00
Florin Coras 17b5c3d6ab tcp: fix bogus time update due to missing cast
Type: fix

Seems clang needs explicit casting to u64 of u64 and f64 multiplication
before truncating to u32

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ib0d7a33d4c5e68577e401e854fc3e55e0723da93
2020-05-14 18:09:05 +00:00
Klement Sekera 1ce60463a8 nat: unhide tests
Parallel merges introduced two test clasess with a same name. Rename
latter, so that former is seen (and run) by test runner again.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I47772b41bb940bfdda4536cdd1f9b5e3768ca18b
2020-05-14 15:16:37 +00:00
hanlin d0e646f689 vcl svm: fix rx event loss
When vcl_epoll_wait_handle_mq handles rx events exceeding maxevents, VPP will not signal because cursize > 0, and the remaining rx events cannot be triggered because the eventfd event has been read. Therefore, we should dequeue all events until cursize = 0. And then handle msg up to maxevents with vcl_epoll_wait_handle_mq_event and those beyond with vcl_handle_mq_event.

Type: fix
Signed-off-by: hanlin <hanlin_wang@163.com>
Change-Id: I8a0c87cb41c837deb8284b40f668cc3c7d9d6e56
Signed-off-by: hanlin <hanlin_wang@163.com>
2020-05-14 14:36:51 +00:00
Klement Sekera 219fbb228f nat: "users" dump for ED-NAT
Since the removal of "users" concept in ED-NAT nat44_user_dump API
returns empty array. This brings back previous behaviour at
a considerable runtime cost until a better API is introduced.

Type: improvement
Change-Id: I5a45923cfeb6b8ebe6fc906601264d6567386991
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2020-05-14 12:47:12 +00:00
Onong Tayeng 4ab5190eb4 lisp: API cleanup
Removing the comments around eid_type which seem to have been overlooked
by the original patch https://gerrit.fd.io/r/c/vpp/+/24663.

Type: refactor

Signed-off-by: Onong Tayeng <otayeng@cisco.com>
Change-Id: I48e1993cf8869cb32e159d1956f3ec1e5943e33f
2020-05-14 12:46:51 +00:00
Benoît Ganne a58be82dda vlib: fix unix cli commands crash without session
If a cli command is run while there are no cli session, then
cm->cli_file_pool will not be initialized and we should not try to
operate on it.

Type: fix

Change-Id: Iaea15a23f7efd5b17fab13e6c1cbb3a9a34080e0
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-05-14 12:27:39 +00:00
Filip Tehlar 0ef9153989 ikev2: use u32 in unformat
Type: fix

Change-Id: If240bd8b3579678c0a6b5ea723946a35b53e5c31
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-05-14 12:25:55 +00:00
Benoît Ganne 31eb471d0c dpdk: fix crash with chelsio pmd
cxgbe PMD initializes its control channel as part of dev_configure(),
and trying to get link status prior to it will lead to a crash.

DPDK documentation loosely hints that we should not call any device
function before dev_start(), call link_state() only for the relevant
PMDs.

From DPDK API documentation:
The functions exported by the application Ethernet API to setup a device
designated by its port identifier must be invoked in the following
order:
    rte_eth_dev_configure()
    rte_eth_tx_queue_setup()
    rte_eth_rx_queue_setup()
    rte_eth_dev_start()
Then, the network application can invoke, in any order, the functions
exported by the Ethernet API to get the MAC address of a given device,
to get the speed and the status of a device physical link, to
receive/transmit [burst of] packets, and so on.

Type: fix

Change-Id: I12d2ab4d84e6bd72a9f695447e86f3222929c804
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-05-14 12:25:27 +00:00
Mrityunjay Kumar 3f0579e8df memif: 14 bytes extra overhead issue fixed.
Type: fix

Signed-off-by: Mrityunjay Kumar <kumarnitp@gmail.com>
Change-Id: I31cc5e853b57e285064647503231b251e5152d3f
2020-05-14 12:24:31 +00:00
Klement Sekera 85be5d75da nat: remove unused code
Type: improvement

Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I95286d6723fd1860bf6bb0e81c474d732ab25121
2020-05-14 12:13:35 +00:00
Klement Sekera 2a595da121 nat: ED: store both thread&session idx in hash
By storing thread and session index in hash table we are able to skip
multiple hash lookups in multi-worker scenario, which were used for
handoff before. Also, by storing sesion index in vnet_buffer2, we can
avoid repeating the lookup after handoff.

Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I406fb12f4e2dd8f4a5ca5d83d59dbc37e1af9abf
2020-05-14 12:12:45 +00:00
Alexander Chernavin 88120824ac nat: fix segv if out of ports in ed mode
Type: fix

Change-Id: Ife726d2f6baaa3516c209011183f39670cf6a55d
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2020-05-14 12:08:43 +00:00
yedg dbd366b239 ip: fix interface ip address del sw_if_index check
Type: fix

Signed-off-by: Ye donggang <yedg@wangsu.com>
Change-Id: Ia9f72ff2be455ecd4ff3d16e884c5a50f9df69fe
2020-05-14 07:39:25 +00:00
Andrew Yourtchenko b163bbb748 misc: Initial 20.09-rc0 commit
Change-Id: Ib9ff4e2e3bea2085834294fd2a0beb3c559c459f
Type:docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-05-13 19:03:15 +00:00
792 changed files with 63505 additions and 20513 deletions
+1
View File
@@ -81,6 +81,7 @@ GTAGS
/build-root/.doxygen-bootstrap.ok
/build-root/.doxygen-siphon.dep
/docs/_build
/docs/dynamic_includes
/sphinx_venv
!/docs/Makefile
+1
View File
@@ -2,3 +2,4 @@
host=gerrit.fd.io
port=29418
project=vpp
defaultbranch=stable/2009
+37 -8
View File
@@ -60,6 +60,9 @@ M: Dave Barach <dave@barachs.net>
M: Damjan Marion <damarion@cisco.com>
F: src/vlib/
E: src/vlib/buffer*.[ch]
E: src/vlib/pci/
E: src/vlib/linux/pci.[ch]
E: src/vlib/linux/vfio.[ch]
Vector Library - Buffer Management
I: buffers
@@ -67,6 +70,13 @@ M: Damjan Marion <damarion@cisco.com>
M: Dave Barach <dave@barachs.net>
F: src/vlib/buffer*.[ch]
Vector Library - PCI
I: pci
M: Damjan Marion <damarion@cisco.com>
F: src/vlib/pci/
F: src/vlib/linux/pci.[ch]
F: src/vlib/linux/vfio.[ch]
Binary API Libraries
I: api
M: Dave Barach <dave@barachs.net>
@@ -180,11 +190,6 @@ M: Damjan Marion <damarion@cisco.com>
M: Neale Ranns <nranns@cisco.com>
F: src/vnet/crypto/
VNET COP
I: cop
M: Dave Barach <dave@barachs.net>
F: src/vnet/cop/
VNET TEIB
I: teib
M: Neale Ranns <nranns@cisco.com>
@@ -195,17 +200,17 @@ I: span
M: N/A
F: src/vnet/span
Crypto native Plugin
Plugin - Crypto - native
I: crypto-native
M: Damjan Marion <damarion@cisco.com>
F: src/plugins/crypto_native/
Crypto openssl Plugin
Plugin - Crypto - OpenSSL
I: crypto-openssl
M: Damjan Marion <damarion@cisco.com>
F: src/plugins/crypto_openssl/
Crypto ipsecmb Plugin
Plugin - Crypto - ipsecmb
I: crypto-ipsecmb
M: Neale Ranns <nranns@cisco.com>
F: src/plugins/crypto_ipsecmb/
@@ -353,6 +358,11 @@ I: abf
M: Neale Ranns <nranns@cisco.com>
F: src/plugins/abf/
Plugin - Allow / Deny List
I: adl
M: Dave Barach <dave@barachs.net>
F: src/plugins/adl/
Plugin - Simple DNS name resolver
I: dns
M: Dave Barach <dave@barachs.net>
@@ -419,6 +429,8 @@ Plugin - Internet Key Exchange (IKEv2) Protocol
I: ikev2
M: Damjan Marion <damarion@cisco.com>
M: Neale Ranns <nranns@cisco.com>
M: Filip Tehlar <ftehlar@cisco.com>
M: Benoît Ganne <bganne@cisco.com>
F: src/plugins/ikev2/
Plugin - Internet Group Management Protocol (IGMP)
@@ -670,6 +682,17 @@ I: urpf
M: Neale Ranns <nranns@cisco.com>
F: src/plugins/urpf
Plugin - CNat
I: cnat
M: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
M: Neale Ranns <nranns@cisco.com>
F: src/plugins/cnat
Plugin - Wireguard
I: wireguard
M: Artem Glazychev <artem.glazychev@xored.com>
F: src/plugins/wireguard
VPP Config Tooling
I: vpp_config
M: John DeNisco <jdenisco@cisco.com>
@@ -680,6 +703,12 @@ I: bash
M: Dave Wallace <dwallacelf@gmail.com>
F: extras/bash/
Plugin - AF_XDP driver
I: af_xdp
M: Benoît Ganne <bganne@cisco.com>
M: Damjan Marion <damarion@cisco.com>
F: src/plugins/af_xdp/
THE REST
I: misc
C: Contact vpp-dev Mailing List <vpp-dev@fd.io>
+32 -70
View File
@@ -55,42 +55,45 @@ endif
ifeq ($(filter ubuntu debian,$(OS_ID)),$(OS_ID))
PKG=deb
else ifeq ($(filter rhel centos fedora opensuse opensuse-leap opensuse-tumbleweed,$(OS_ID)),$(OS_ID))
else ifeq ($(filter rhel centos fedora,$(OS_ID)),$(OS_ID))
PKG=rpm
endif
# +libganglia1-dev if building the gmond plugin
DEB_DEPENDS = curl build-essential autoconf automake ccache
DEB_DEPENDS += debhelper dkms git libtool libapr1-dev dh-systemd
DEB_DEPENDS += debhelper dkms git libtool libapr1-dev dh-systemd dh-python
DEB_DEPENDS += libconfuse-dev git-review exuberant-ctags cscope pkg-config
DEB_DEPENDS += lcov chrpath autoconf indent clang-format libnuma-dev
DEB_DEPENDS += python-all python3-all python3-setuptools
DEB_DEPENDS += python-virtualenv python-pip check
DEB_DEPENDS += python3-all python3-setuptools check
DEB_DEPENDS += libboost-all-dev libffi-dev python3-ply libmbedtls-dev
DEB_DEPENDS += cmake ninja-build uuid-dev python3-jsonschema python3-yaml
DEB_DEPENDS += python3-venv # ensurepip
DEB_DEPENDS += python3-dev # needed for python3 -m pip install psutil
# python3.6 on 16.04 requires python36-dev
LIBFFI=libffi6 # works on all but 20.04
LIBFFI=libffi6 # works on all but 20.04 and debian-testing
ifeq ($(OS_VERSION_ID),16.04)
DEB_DEPENDS += python-dev
DEB_DEPENDS += libssl-dev
else ifeq ($(OS_VERSION_ID),18.04)
DEB_DEPENDS += python-dev
ifeq ($(OS_VERSION_ID),18.04)
DEB_DEPENDS += python-dev python-all python-pip python-virtualenv
DEB_DEPENDS += libssl-dev
DEB_DEPENDS += clang-9
else ifeq ($(OS_VERSION_ID),20.04)
LIBFFI=libffi7
else ifeq ($(OS_ID)-$(OS_VERSION_ID),debian-8)
DEB_DEPENDS += python3-virtualenv
DEB_DEPENDS += libssl-dev
APT_ARGS = -t jessie-backports
DEB_DEPENDS += libelf-dev # for libbpf (af_xdp)
LIBFFI=libffi7
else ifeq ($(OS_ID)-$(OS_VERSION_ID),debian-9)
DEB_DEPENDS += libssl1.0-dev
DEB_DEPENDS += python-all python-pip
DEB_DEPENDS += python-dev python-all python-pip python-virtualenv
else ifeq ($(OS_ID)-$(OS_VERSION_ID),debian-10)
DEB_DEPENDS += libssl-dev
DEB_DEPENDS += libelf-dev # for libbpf (af_xdp)
else
DEB_DEPENDS += libssl-dev
DEB_DEPENDS += libelf-dev # for libbpf (af_xdp)
LIBFFI=libffi7
endif
DEB_DEPENDS += $(LIBFFI)
@@ -104,6 +107,9 @@ RPM_DEPENDS += selinux-policy selinux-policy-devel
RPM_DEPENDS += ninja-build
RPM_DEPENDS += libuuid-devel
RPM_DEPENDS += mbedtls-devel
RPM_DEPENDS += ccache
RPM_DEPENDS += xmlto
RPM_DEPENDS += elfutils-libelf-devel
ifeq ($(OS_ID),fedora)
RPM_DEPENDS += dnf-utils
@@ -116,8 +122,8 @@ ifeq ($(OS_ID),fedora)
RPM_DEPENDS_GROUPS = 'C Development Tools and Libraries'
else ifeq ($(OS_ID)-$(OS_VERSION_ID),centos-8)
RPM_DEPENDS += yum-utils
RPM_DEPENDS += compat-openssl10
RPM_DEPENDS += python36-devel python3-ply
RPM_DEPENDS += compat-openssl10 openssl-devel
RPM_DEPENDS += python2-devel python36-devel python3-ply
RPM_DEPENDS += python3-virtualenv python3-jsonschema
RPM_DEPENDS += cmake
RPM_DEPENDS_GROUPS = 'Development Tools'
@@ -127,7 +133,7 @@ else
RPM_DEPENDS += python36-ply # for vppapigen
RPM_DEPENDS += python3-devel python3-pip
RPM_DEPENDS += python-virtualenv python36-jsonschema
RPM_DEPENDS += devtoolset-9
RPM_DEPENDS += devtoolset-9 devtoolset-9-libasan-devel
RPM_DEPENDS += cmake3
RPM_DEPENDS_GROUPS = 'Development Tools'
endif
@@ -135,42 +141,11 @@ endif
# +ganglia-devel if building the ganglia plugin
RPM_DEPENDS += chrpath libffi-devel rpm-build
# lowercase- replace spaces with dashes.
SUSE_NAME= $(shell grep '^NAME=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g' | sed -e 's/ /-/' | awk '{print tolower($$0)}')
SUSE_ID= $(shell grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g' | cut -d' ' -f2)
RPM_SUSE_BUILDTOOLS_DEPS = autoconf automake ccache check-devel chrpath
RPM_SUSE_BUILDTOOLS_DEPS += clang cmake indent libtool make ninja python3-ply
RPM_SUSE_DEVEL_DEPS = glibc-devel-static libnuma-devel
RPM_SUSE_DEVEL_DEPS += libopenssl-devel openssl-devel mbedtls-devel libuuid-devel
RPM_SUSE_PYTHON_DEPS = python-devel python3-devel python-pip python3-pip
RPM_SUSE_PYTHON_DEPS += python-rpm-macros python3-rpm-macros
RPM_SUSE_PLATFORM_DEPS = distribution-release shadow rpm-build
ifeq ($(OS_ID),opensuse)
ifeq ($(SUSE_NAME),tumbleweed)
RPM_SUSE_DEVEL_DEPS = libboost_headers1_68_0-devel-1.68.0 libboost_thread1_68_0-devel-1.68.0 gcc
RPM_SUSE_PYTHON_DEPS += python3-ply python2-virtualenv
endif
ifeq ($(SUSE_ID),15.0)
RPM_SUSE_DEVEL_DEPS += libboost_headers-devel libboost_thread-devel gcc
RPM_SUSE_PYTHON_DEPS += python3-ply python2-virtualenv
else
RPM_SUSE_DEVEL_DEPS += libboost_headers1_68_0-devel-1.68.0 gcc6
RPM_SUSE_PYTHON_DEPS += python-virtualenv
endif
endif
ifeq ($(OS_ID),opensuse-leap)
ifeq ($(SUSE_ID),15.0)
RPM_SUSE_DEVEL_DEPS += libboost_headers-devel libboost_thread-devel gcc git curl
RPM_SUSE_PYTHON_DEPS += python3-ply python2-virtualenv
endif
endif
RPM_SUSE_DEPENDS += $(RPM_SUSE_BUILDTOOLS_DEPS) $(RPM_SUSE_DEVEL_DEPS) $(RPM_SUSE_PYTHON_DEPS) $(RPM_SUSE_PLATFORM_DEPS)
RPM_DEPENDS_DEBUG = glibc-debuginfo e2fsprogs-debuginfo
RPM_DEPENDS_DEBUG += krb5-debuginfo openssl-debuginfo
RPM_DEPENDS_DEBUG += zlib-debuginfo nss-softokn-debuginfo
RPM_DEPENDS_DEBUG += yum-plugin-auto-update-debug-info
ifneq ($(wildcard $(STARTUP_DIR)/startup.conf),)
STARTUP_CONF ?= $(STARTUP_DIR)/startup.conf
@@ -282,7 +257,7 @@ ifeq ($(filter ubuntu debian,$(OS_ID)),$(OS_ID))
exit 0
else ifneq ("$(wildcard /etc/redhat-release)","")
@for i in $(RPM_DEPENDS) ; do \
RPM=$$(basename -s .rpm "$${i##*/}" | cut -d- -f1,2,3) ; \
RPM=$$(basename -s .rpm "$${i##*/}" | cut -d- -f1,2,3,4) ; \
MISSING+=$$(rpm -q $$RPM | grep "^package") ; \
done ; \
if [ -n "$$MISSING" ] ; then \
@@ -301,13 +276,6 @@ bootstrap:
.PHONY: install-dep
install-dep:
ifeq ($(filter ubuntu debian,$(OS_ID)),$(OS_ID))
ifeq ($(OS_VERSION_ID),14.04)
@sudo -E apt-get $(CONFIRM) $(FORCE) install software-properties-common
endif
ifeq ($(OS_ID)-$(OS_VERSION_ID),debian-8)
@grep -q jessie-backports /etc/apt/sources.list /etc/apt/sources.list.d/* 2> /dev/null \
|| ( echo "Please install jessie-backports" ; exit 1 )
endif
@sudo -E apt-get update
@sudo -E apt-get $(APT_ARGS) $(CONFIRM) $(FORCE) install $(DEB_DEPENDS)
else ifneq ("$(wildcard /etc/redhat-release)","")
@@ -317,29 +285,23 @@ ifeq ($(OS_ID),rhel)
@sudo -E yum install $(CONFIRM) $(RPM_DEPENDS)
@sudo -E debuginfo-install $(CONFIRM) glibc openssl-libs mbedtls-devel zlib
else ifeq ($(OS_ID)-$(OS_VERSION_ID),centos-8)
@sudo -E dnf install $(CONFIRM) dnf-plugins-core epel-release
@sudo -E dnf config-manager --set-enabled \
$(shell dnf repolist all 2>/dev/null|grep -i powertools|cut -d' ' -f1)
@sudo -E dnf groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
@sudo -E dnf install $(CONFIRM) $(RPM_DEPENDS)
else ifeq ($(OS_ID),centos)
@sudo -E yum install $(CONFIRM) centos-release-scl-rh epel-release
@sudo -E yum groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
@sudo -E yum install $(CONFIRM) $(RPM_DEPENDS)
@sudo -E debuginfo-install $(CONFIRM) glibc openssl-libs mbedtls-devel zlib
@sudo -E yum install $(CONFIRM) --enablerepo=base-debuginfo $(RPM_DEPENDS_DEBUG)
else ifeq ($(OS_ID),fedora)
@sudo -E dnf groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
@sudo -E dnf install $(CONFIRM) $(RPM_DEPENDS)
@sudo -E debuginfo-install $(CONFIRM) glibc openssl-libs mbedtls-devel zlib
endif
else ifeq ($(filter opensuse-tumbleweed,$(OS_ID)),$(OS_ID))
@sudo -E zypper refresh
@sudo -E zypper install -y $(RPM_SUSE_DEPENDS)
else ifeq ($(filter opensuse-leap,$(OS_ID)),$(OS_ID))
@sudo -E zypper refresh
@sudo -E zypper install -y $(RPM_SUSE_DEPENDS)
else ifeq ($(filter opensuse,$(OS_ID)),$(OS_ID))
@sudo -E zypper refresh
@sudo -E zypper install -y $(RPM_SUSE_DEPENDS)
else
$(error "This option currently works only on Ubuntu, Debian, RHEL, CentOS or openSUSE systems")
$(error "This option currently works only on Ubuntu, Debian, RHEL, or CentOS systems")
endif
git config commit.template .git_commit_template.txt
+1417 -10
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -765,7 +765,7 @@ find_source_for_package = \
exit 1; \
fi ; \
$(call build_msg_fn,Fix file dates in $${g}/$(PACKAGE_SOURCE)) ; \
(cd $${s} ; $(MU_BUILD_ROOT_DIR)/autowank --touch) ; \
: the timestamp-adjustment script used to be invoked at this point ; \
fi ; \
s=`cd $${s} && pwd` ; \
$(call build_msg_fn,Source found in $${s})
-307
View File
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -39,13 +39,14 @@ include packages/ipsec-mb.mk
include packages/quicly.mk
include packages/dpdk.mk
include packages/rdma-core.mk
include packages/libbpf.mk
.PHONY: clean
clean:
@rm -rf $(B) $(I)
.PHONY: install
install: dpdk-install rdma-core-install quicly-install
install: dpdk-install rdma-core-install quicly-install libbpf-install
.PHONY: config
config: dpdk-config rdma-core-config
+1 -1
View File
@@ -79,7 +79,7 @@ $(B)/.$1.patch.ok: $(B)/.$1.extract.ok
ifneq ($$(wildcard $$($1_patch_dir)/*.patch),)
@for f in $$($1_patch_dir)/*.patch ; do \
echo "Applying patch: $$$$(basename $$$$f)" ; \
patch -p1 -d $$($1_src_dir) < $$$$f ; \
patch -p1 -d $$($1_src_dir) --no-backup-if-mismatch < $$$$f ; \
done
endif
@touch $$@
+8 -3
View File
@@ -21,13 +21,13 @@ DPDK_MLX5_PMD ?= n
DPDK_TAP_PMD ?= n
DPDK_FAILSAFE_PMD ?= n
DPDK_VERSION ?= 20.02
DPDK_VERSION ?= 20.08
DPDK_BASE_URL ?= http://fast.dpdk.org/rel
DPDK_TARBALL := dpdk-$(DPDK_VERSION).tar.xz
DPDK_TAR_URL := $(DPDK_BASE_URL)/$(DPDK_TARBALL)
DPDK_18.11_TARBALL_MD5_CKSUM := 04b86f4a77f4f81a7fbd26467dd2ea9f
DPDK_19.08_TARBALL_MD5_CKSUM := 8a6f5bd844b7a06b34787063409298ed
DPDK_20.02_TARBALL_MD5_CKSUM := e20171462d6b2252dfbae1de8c45ba10
DPDK_20.05_TARBALL_MD5_CKSUM := 7c6f3e7f7de2422775c4cba116012c4d
DPDK_20.08_TARBALL_MD5_CKSUM := 64badd32cd6bc0761befc8f2402c2148
MACHINE=$(shell uname -m)
# replace dot with space, and if 3rd word exists we deal with stable dpdk rel
@@ -166,6 +166,7 @@ DPDK_MAKE_ARGS := -C $(DPDK_SOURCE) -j $(JOBS) \
EXTRA_LDFLAGS="$(DPDK_EXTRA_LDFLAGS)" \
CPU_CFLAGS="$(DPDK_CPU_CFLAGS)" \
DESTDIR=$(I) \
MAKE_PAUSE=n \
$(DPDK_MAKE_EXTRA_ARGS)
define set
@@ -228,6 +229,10 @@ $(B)/custom-config: $(B)/.dpdk-patch.ok Makefile
$(call set,RTE_LIBRTE_IFPGA_BUS,n)
$(call set,RTE_LIBRTE_BBDEV,n)
$(call set,RTE_LIBRTE_BBDEV_NULL,n)
$(call set,RTE_LIBRTE_GRAPH,n)
$(call set,RTE_LIBRTE_NODE,n)
$(call set,RTE_LIBRTE_FIB,n)
$(call set,RTE_LIBRTE_RIB,n)
$(call set,RTE_TEST_PMD,n)
$(call set,RTE_KNI_KMOD,n)
$(call set,RTE_EAL_IGB_UIO,n)
+57
View File
@@ -0,0 +1,57 @@
# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
LIBBPF_DEBUG?=n
libbpf_version := 0.1.0
libbpf_tarball := v$(libbpf_version).tar.gz
libbpf_tarball_md5sum_0.1.0 := 00b991a6e2d28d797a56ab1575ed40e1
libbpf_tarball_md5sum := $(libbpf_tarball_md5sum_$(libbpf_version))
libbpf_tarball_strip_dirs := 1
libbpf_url := https://github.com/libbpf/libbpf/archive/$(libbpf_tarball)
LIBBPF_CFLAGS:=-g -Werror -Wall -fPIC -fvisibility=hidden
ifeq ($(LIBBPF_DEBUG),y)
LIBBPF_CFLAGS+= -O0
else
LIBBPF_CFLAGS+= -O2
endif
# check for libelf, zlib and kernel if_xdp.h presence
LIBBPF_DEPS_CHECK:="\#include <linux/if_xdp.h>\\n\#include <gelf.h>\\n\#include <zlib.h>\\nint main(void){return 0;}"
LIBBPF_DEPS_CHECK:=$(shell echo -e $(LIBBPF_DEPS_CHECK) | $(CC) -xc -lelf -lz -o /dev/null - > /dev/null 2>&1)
LIBBPF_DEPS_CHECK:=$(.SHELLSTATUS)
define libbpf_config_cmds
@true
endef
define libbpf_build_cmds__
BUILD_STATIC_ONLY=y OBJDIR='$(libbpf_build_dir)' PREFIX='' DESTDIR='$(libbpf_install_dir)' CFLAGS='$(LIBBPF_CFLAGS)' make -C '$(libbpf_src_dir)/src' $(1) > $(2)
endef
define libbpf_build_cmds
$(call libbpf_build_cmds__,,$(libbpf_build_log))
endef
define libbpf_install_cmds
$(call libbpf_build_cmds__,install,$(libbpf_install_log))
endef
ifneq ($(LIBBPF_DEPS_CHECK),0)
$(warning "Missing libbpf dependencies. libbpf will be skipped.")
libbpf-install:
@true
else
$(eval $(call package,libbpf))
endif
+2 -3
View File
@@ -13,11 +13,10 @@
RDMA_CORE_DEBUG?=n
rdma-core_version := 28.0
rdma-core_version := 31.0
rdma-core_tarball := rdma-core-$(rdma-core_version).tar.gz
rdma-core_tarball_md5sum_25.0 := d8839edaae4cb6dacdacc4b5a824854c
rdma-core_tarball_md5sum_26.0 := e68ad88679f37a0285d4d5b820e6b689
rdma-core_tarball_md5sum_28.0 := 780125feed6c599f2f22228db1a5996e
rdma-core_tarball_md5sum_31.0 := 6076b2cfd5b0b22b88f1fb8dffd1aef7
rdma-core_tarball_md5sum := $(rdma-core_tarball_md5sum_$(rdma-core_version))
rdma-core_tarball_strip_dirs := 1
rdma-core_url := http://github.com/linux-rdma/rdma-core/releases/download/v$(rdma-core_version)/$(rdma-core_tarball)
+1 -1
View File
@@ -24,7 +24,7 @@ for release tag “v2.2.0” and will create a branch named “two_dot_two”.
5. Create the patch files with format-patch. This creates all the patch files
for your branch (two_dot_two), with your latest commits as the last ones.
# git format-patch master..two_dot_two
# git format-patch main..two_dot_two
6. Copy, add and commit the new patches into the patches directory.
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,232 @@
From bd048f56bc4b85fed31f34db676f1ad67c86bd16 Mon Sep 17 00:00:00 2001
From: Robin Zhang <robinx.zhang@intel.com>
Date: Mon, 19 Apr 2021 03:05:39 +0000
Subject: [PATCH] net/iavf: deprecate i40evf pmd
The i40evf PMD will be deprecated, iavf will be the only VF driver for
Intel 700 serial (i40e) NIC family. To reach this, there will be 2 steps:
Step 1: iavf will be the default VF driver, while i40evf still can be
selected by devarg: "driver=i40evf".
This is covered by this patch, which include:
1) add all 700 serial NIC VF device ID into iavf PMD
2) skip probe if devargs contain "driver=i40evf" in iavf
3) continue probe if devargs contain "driver=i40evf" in i40evf
Step 2: i40evf and related devarg are removed, this will happen at DPDK
21.11
Between step 1 and step 2, no new feature will be added into i40evf except
bug fix.
Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
---
doc/guides/nics/intel_vf.rst | 6 +++
doc/guides/rel_notes/deprecation.rst | 8 ++++
drivers/common/iavf/iavf_devids.h | 2 +
drivers/net/i40e/i40e_ethdev_vf.c | 45 ++++++++++++++++++++++
drivers/net/iavf/iavf_ethdev.c | 57 +++++++++++++++++++++++++++-
5 files changed, 116 insertions(+), 2 deletions(-)
diff --git a/doc/guides/nics/intel_vf.rst b/doc/guides/nics/intel_vf.rst
index ade5152595..b95200698d 100644
--- a/doc/guides/nics/intel_vf.rst
+++ b/doc/guides/nics/intel_vf.rst
@@ -88,6 +88,12 @@ For more detail on SR-IOV, please refer to the following documents:
assignment in hypervisor. Take qemu for example, the device assignment should carry the IAVF device id (0x1889) like
``-device vfio-pci,x-pci-device-id=0x1889,host=03:0a.0``.
+ Starting from DPDK 21.05, the default VF driver for Intel® 700 Series Ethernet Controller will be IAVF. No new feature
+ will be added into i40evf except bug fix until it's removed in DPDK 21.11. Between DPDK 21.05 and 21.11, by using the
+ ``devargs`` option ``driver=i40evf``, i40evf PMD still can be used on Intel® 700 Series Ethernet Controller, for example::
+
+ -a 81:02.0,driver=i40evf
+
The PCIE host-interface of Intel Ethernet Switch FM10000 Series VF infrastructure
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index c2770feeae..25caf4e52d 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -335,3 +335,11 @@ Deprecation Notices
``make``. Given environments are too much variables for such a simple script,
it will be removed in DPDK 20.11.
Some useful parts may be converted into specific scripts.
+
+* i40e: As there are both i40evf and iavf pmd, the functions of them are
+ duplicated. And now more and more advanced features are developed on iavf.
+ To keep consistent with kernel driver's name
+ (https://patchwork.ozlabs.org/patch/970154/), i40evf is no need to maintain.
+ Starting from 21.05, the default VF driver of i40e will be iavf, but i40evf
+ can still be used if users specify the devarg "driver=i40evf". I40evf will
+ be deleted in DPDK 21.11.
diff --git a/drivers/common/iavf/iavf_devids.h b/drivers/common/iavf/iavf_devids.h
index 2e63aac289..1c3acb586d 100644
--- a/drivers/common/iavf/iavf_devids.h
+++ b/drivers/common/iavf/iavf_devids.h
@@ -13,5 +13,7 @@
#define IAVF_DEV_ID_VF_HV 0x1571
#define IAVF_DEV_ID_ADAPTIVE_VF 0x1889
#define IAVF_DEV_ID_X722_VF 0x37CD
+#define IAVF_DEV_ID_X722_A0_VF 0x374D
+
#endif /* _IAVF_DEVIDS_H_ */
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 69cab8e739..3d61c092d8 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1592,9 +1592,53 @@ i40evf_dev_uninit(struct rte_eth_dev *eth_dev)
return 0;
}
+static int
+i40evf_check_driver_handler(__rte_unused const char *key,
+ const char *value, __rte_unused void *opaque)
+{
+ if (strcmp(value, "i40evf"))
+ return -1;
+
+ return 0;
+}
+
+static int
+i40evf_driver_selected(struct rte_devargs *devargs)
+{
+ struct rte_kvargs *kvlist;
+ const char *key = "driver";
+ int ret = 0;
+
+ if (devargs == NULL)
+ return 0;
+
+ kvlist = rte_kvargs_parse(devargs->args, NULL);
+ if (kvlist == NULL)
+ return 0;
+
+ if (!rte_kvargs_count(kvlist, key))
+ goto exit;
+
+ /* i40evf driver selected when there's a key-value pair:
+ * driver=i40evf
+ */
+ if (rte_kvargs_process(kvlist, key,
+ i40evf_check_driver_handler, NULL) < 0)
+ goto exit;
+
+ ret = 1;
+
+exit:
+ rte_kvargs_free(kvlist);
+ return ret;
+}
+
static int eth_i40evf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
struct rte_pci_device *pci_dev)
{
+ if (!i40evf_driver_selected(pci_dev->device.devargs))
+ return 1;
+
return rte_eth_dev_pci_generic_probe(pci_dev,
sizeof(struct i40e_adapter), i40evf_dev_init);
}
@@ -1617,6 +1661,7 @@ static struct rte_pci_driver rte_i40evf_pmd = {
RTE_PMD_REGISTER_PCI(net_i40e_vf, rte_i40evf_pmd);
RTE_PMD_REGISTER_PCI_TABLE(net_i40e_vf, pci_id_i40evf_map);
RTE_PMD_REGISTER_KMOD_DEP(net_i40e_vf, "* igb_uio | vfio-pci");
+RTE_PMD_REGISTER_PARAM_STRING(net_i40e_vf, "driver=i40evf");
static int
i40evf_dev_configure(struct rte_eth_dev *dev)
diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index c3aa4cd725..f22c3ccdb9 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -76,6 +76,10 @@ static int iavf_dev_filter_ctrl(struct rte_eth_dev *dev,
static const struct rte_pci_id pci_id_iavf_map[] = {
{ RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_ADAPTIVE_VF) },
+ { RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_VF) },
+ { RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_VF_HV) },
+ { RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_X722_VF) },
+ { RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_X722_A0_VF) },
{ .vendor_id = 0, /* sentinel */ },
};
@@ -1516,10 +1520,59 @@ iavf_dcf_cap_selected(struct rte_devargs *devargs)
return ret;
}
+static int
+iavf_drv_i40evf_check_handler(__rte_unused const char *key,
+ const char *value, __rte_unused void *opaque)
+{
+ if (strcmp(value, "i40evf"))
+ return -1;
+
+ return 0;
+}
+
+static int
+iavf_drv_i40evf_selected(struct rte_devargs *devargs, uint16_t device_id)
+{
+ struct rte_kvargs *kvlist;
+ const char *key = "driver";
+ int ret = 0;
+
+ if (device_id != IAVF_DEV_ID_VF &&
+ device_id != IAVF_DEV_ID_VF_HV &&
+ device_id != IAVF_DEV_ID_X722_VF &&
+ device_id != IAVF_DEV_ID_X722_A0_VF)
+ return 0;
+
+ if (devargs == NULL)
+ return 0;
+
+ kvlist = rte_kvargs_parse(devargs->args, NULL);
+ if (kvlist == NULL)
+ return 0;
+
+ if (!rte_kvargs_count(kvlist, key))
+ goto exit;
+
+ /* i40evf driver selected when there's a key-value pair:
+ * driver=i40evf
+ */
+ if (rte_kvargs_process(kvlist, key,
+ iavf_drv_i40evf_check_handler, NULL) < 0)
+ goto exit;
+
+ ret = 1;
+
+exit:
+ rte_kvargs_free(kvlist);
+ return ret;
+}
+
static int eth_iavf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
struct rte_pci_device *pci_dev)
{
- if (iavf_dcf_cap_selected(pci_dev->device.devargs))
+ if (iavf_dcf_cap_selected(pci_dev->device.devargs) ||
+ iavf_drv_i40evf_selected(pci_dev->device.devargs,
+ pci_dev->id.device_id))
return 1;
return rte_eth_dev_pci_generic_probe(pci_dev,
@@ -1542,7 +1595,7 @@ static struct rte_pci_driver rte_iavf_pmd = {
RTE_PMD_REGISTER_PCI(net_iavf, rte_iavf_pmd);
RTE_PMD_REGISTER_PCI_TABLE(net_iavf, pci_id_iavf_map);
RTE_PMD_REGISTER_KMOD_DEP(net_iavf, "* igb_uio | vfio-pci");
-RTE_PMD_REGISTER_PARAM_STRING(net_iavf, "cap=dcf");
+RTE_PMD_REGISTER_PARAM_STRING(net_iavf, "cap=dcf driver=i40evf");
RTE_LOG_REGISTER(iavf_logtype_init, pmd.net.iavf.init, NOTICE);
RTE_LOG_REGISTER(iavf_logtype_driver, pmd.net.iavf.driver, NOTICE);
#ifdef RTE_LIBRTE_IAVF_DEBUG_RX
--
2.20.1
@@ -0,0 +1,212 @@
From 858b4575513fe72dce95370944b0da237b755204 Mon Sep 17 00:00:00 2001
From: Dave Wallace <dwallacelf@gmail.com>
Date: Thu, 15 Oct 2020 15:22:22 -0400
Subject: [PATCH] backport dpdk usertools support python 3 only
Applicable usertools section of DPDK patch:
http://git.dpdk.org/dpdk/commit/?id=3f6f83626cf4967a99382a6518a614a1bf3d2c20
Required to avoid build failure of 'make install-ext-deps' on CentOS-8 due
to brp-mangle-shebangs failing on un-versioned python shebang (e.g.
'#! /usr/bin/env python'.
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
---
usertools/cpu_layout.py | 15 ++-------------
usertools/dpdk-devbind.py | 22 ++++------------------
usertools/dpdk-pmdinfo.py | 7 +------
usertools/dpdk-telemetry-client.py | 18 +++---------------
usertools/dpdk-telemetry.py | 2 +-
5 files changed, 11 insertions(+), 53 deletions(-)
diff --git a/usertools/cpu_layout.py b/usertools/cpu_layout.py
index 5423c7965..cc3963821 100755
--- a/usertools/cpu_layout.py
+++ b/usertools/cpu_layout.py
@@ -1,19 +1,8 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2010-2014 Intel Corporation
# Copyright(c) 2017 Cavium, Inc. All rights reserved.
-from __future__ import print_function
-import sys
-try:
- xrange # Python 2
-except NameError:
- xrange = range # Python 3
-
-if sys.version_info.major < 3:
- print("WARNING: Python 2 is deprecated for use in DPDK, and will not work in future releases.", file=sys.stderr)
- print("Please use Python 3 instead", file=sys.stderr)
-
sockets = []
cores = []
core_map = {}
@@ -21,7 +10,7 @@
fd = open("{}/kernel_max".format(base_path))
max_cpus = int(fd.read())
fd.close()
-for cpu in xrange(max_cpus + 1):
+for cpu in range(max_cpus + 1):
try:
fd = open("{}/cpu{}/topology/core_id".format(base_path, cpu))
except IOError:
diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
index 094c2ffc8..8278a748d 100755
--- a/usertools/dpdk-devbind.py
+++ b/usertools/dpdk-devbind.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2010-2014 Intel Corporation
#
-from __future__ import print_function
import sys
import os
import getopt
@@ -12,10 +11,6 @@
from os.path import exists, abspath, dirname, basename
from os.path import join as path_join
-if sys.version_info.major < 3:
- print("WARNING: Python 2 is deprecated for use in DPDK, and will not work in future releases.", file=sys.stderr)
- print("Please use Python 3 instead", file=sys.stderr)
-
# The PCI base class for all devices
network_class = {'Class': '02', 'Vendor': None, 'Device': None,
'SVendor': None, 'SDevice': None}
@@ -154,14 +149,6 @@ def usage():
""" % locals()) # replace items from local variables
-
-# This is roughly compatible with check_output function in subprocess module
-# which is only available in python 2.7.
-def check_output(args, stderr=None):
- '''Run a command and capture its output'''
- return subprocess.Popen(args, stdout=subprocess.PIPE,
- stderr=stderr).communicate()[0]
-
# check if a specific kernel module is loaded
def module_is_loaded(module):
global loaded_modules
@@ -218,8 +205,7 @@ def get_pci_device_details(dev_id, probe_lspci):
device = {}
if probe_lspci:
- extra_info = check_output(["lspci", "-vmmks", dev_id]).splitlines()
-
+ extra_info = subprocess.check_output(["lspci", "-vmmks", dev_id]).splitlines()
# parse lspci details
for line in extra_info:
if len(line) == 0:
@@ -255,7 +241,7 @@ def get_device_details(devices_type):
# first loop through and read details for all devices
# request machine readable format, with numeric IDs and String
dev = {}
- dev_lines = check_output(["lspci", "-Dvmmnnk"]).splitlines()
+ dev_lines = subprocess.check_output(["lspci", "-Dvmmnnk"]).splitlines()
for dev_line in dev_lines:
if len(dev_line) == 0:
if device_type_match(dev, devices_type):
@@ -283,7 +269,7 @@ def get_device_details(devices_type):
# check what is the interface if any for an ssh connection if
# any to this host, so we can mark it later.
ssh_if = []
- route = check_output(["ip", "-o", "route"])
+ route = subprocess.check_output(["ip", "-o", "route"])
# filter out all lines for 169.254 routes
route = "\n".join(filter(lambda ln: not ln.startswith("169.254"),
route.decode().splitlines()))
diff --git a/usertools/dpdk-pmdinfo.py b/usertools/dpdk-pmdinfo.py
index f9ed75517..166198279 100755
--- a/usertools/dpdk-pmdinfo.py
+++ b/usertools/dpdk-pmdinfo.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2016 Neil Horman <nhorman@tuxdriver.com>
@@ -7,8 +7,6 @@
# Utility to dump PMD_INFO_STRING support from an object file
#
# -------------------------------------------------------------------------
-from __future__ import print_function
-from __future__ import unicode_literals
import json
import io
import os
@@ -28,9 +26,6 @@
pcidb = None
# ===========================================
-if sys.version_info.major < 3:
- print("WARNING: Python 2 is deprecated for use in DPDK, and will not work in future releases.", file=sys.stderr)
- print("Please use Python 3 instead", file=sys.stderr)
class Vendor:
"""
diff --git a/usertools/dpdk-telemetry-client.py b/usertools/dpdk-telemetry-client.py
index 98d28fa89..d8e439027 100755
--- a/usertools/dpdk-telemetry-client.py
+++ b/usertools/dpdk-telemetry-client.py
@@ -1,10 +1,7 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2018 Intel Corporation
-from __future__ import print_function
-from __future__ import unicode_literals
-
import socket
import os
import sys
@@ -18,15 +15,6 @@
GLOBAL_METRICS_REQ = "{\"action\":0,\"command\":\"global_stat_values\",\"data\":null}"
DEFAULT_FP = "/var/run/dpdk/default_client"
-try:
- raw_input # Python 2
-except NameError:
- raw_input = input # Python 3
-
-if sys.version_info.major < 3:
- print("WARNING: Python 2 is deprecated for use in DPDK, and will not work in future releases.", file=sys.stderr)
- print("Please use Python 3 instead", file=sys.stderr)
-
class Socket:
def __init__(self):
@@ -86,7 +74,7 @@ def requestMetrics(self): # Requests metrics for given client
def repeatedlyRequestMetrics(self, sleep_time): # Recursively requests metrics for given client
print("\nPlease enter the number of times you'd like to continuously request Metrics:")
- n_requests = int(raw_input("\n:"))
+ n_requests = int(input("\n:"))
print("\033[F") #Removes the user input from screen, cleans it up
print("\033[K")
for i in range(n_requests):
@@ -107,7 +95,7 @@ def interactiveMenu(self, sleep_time): # Creates Interactive menu within the scr
print("[4] Unregister client")
try:
- self.choice = int(raw_input("\n:"))
+ self.choice = int(input("\n:"))
print("\033[F") #Removes the user input for screen, cleans it up
print("\033[K")
if self.choice == 1:
diff --git a/usertools/dpdk-telemetry.py b/usertools/dpdk-telemetry.py
index 8e4039d57..181859658 100755
--- a/usertools/dpdk-telemetry.py
+++ b/usertools/dpdk-telemetry.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python3
+#! /usr/bin/env python3
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2020 Intel Corporation
+4
View File
@@ -1,6 +1,10 @@
%define _install_dir /opt/vpp/external/%(uname -m)
%define _make_args -C ../.. BUILD_DIR=%{_topdir}/tmp INSTALL_DIR=%{buildroot}%{_install_dir}
%{!?__python3: %global __python3 /usr/bin/python3}
%global __python %{__python3}
%global _pylib /usr/lib/python3.6/site-packages
Name: vpp-ext-deps
Version: %{_version}
Release: %{_release}
+2
View File
@@ -27,6 +27,8 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
# Generate dynamic content
@python3 ./includes_renderer.py
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
spell:
+2 -2
View File
@@ -4,6 +4,6 @@
About
=====
**VPP Version:** 20.01-rc0~785-g1063f2ae8
**VPP Version:** 20.09-rc0~244-g9fefa8916
**Built on:** Tue Dec 10 19:22:28 GMT 2019
**Built on:** Tue Jul 28 14:58:41 GMT 2020
View File
+1
View File
@@ -0,0 +1 @@
../../../src/tools/vppapigen/VPPAPI.md
+56 -28
View File
@@ -7,7 +7,7 @@ Adding a plugin
Overview
________
This section shows how a VPP developer can create a new plugin, and
add it to VPP. We assume that we are starting from the VPP <top-of-workspace>.
@@ -21,7 +21,7 @@ Create your new plugin
Change directory to **./src/plugins**, and run the plugin generator:
.. code-block:: console
$ cd ./src/plugins
$ ../../extras/emacs/make-plugin.sh
<snip>
@@ -36,7 +36,7 @@ Change directory to **./src/plugins**, and run the plugin generator:
Plugin name: myplugin
Dispatch type [dual or qs]: dual
(Shell command succeeded with no output)
OK...
The plugin generator script asks two questions: the name of the
@@ -65,9 +65,8 @@ Here are the generated files. We'll go through them in a moment.
$ cd ./myplugin
$ ls
CMakeLists.txt myplugin.c myplugin_periodic.c setup.pg
myplugin_all_api_h.h myplugin.h myplugin_test.c
myplugin.api myplugin_msg_enum.h node.c
CMakeLists.txt myplugin.api myplugin.c myplugin.h
myplugin_periodic.c myplugin_test.c node.c setup.pg
Due to recent build system improvements, you **don't** need to touch
any other files to integrate your new plugin into the vpp build. Simply
@@ -92,7 +91,7 @@ As a quick sanity check, run vpp and make sure that
"myplugin_plugin.so" and "myplugin_test_plugin.so" are loaded:
.. code-block:: console
$ cd <top-of-workspace>
$ make run
<snip>
@@ -122,25 +121,21 @@ the copyright notice:
The rest of the build recipe is pretty simple:
.. code-block:: console
.. code-block:: CMake
add_vpp_plugin (myplugin
SOURCES
myplugin.c
node.c
myplugin.c
node.c
myplugin_periodic.c
myplugin.h
MULTIARCH_SOURCES
node.c
node.c
API_FILES
myplugin.api
INSTALL_HEADERS
myplugin_all_api_h.h
myplugin_msg_enum.h
API_TEST_SOURCES
myplugin_test.c
)
@@ -178,13 +173,13 @@ binary API message dispatcher, and to add its messages to vpp's global
Vpp itself uses dlsym(...) to track down the vlib_plugin_registration_t
generated by the VLIB_PLUGIN_REGISTER macro:
.. code-block:: console
.. code-block:: C
VLIB_PLUGIN_REGISTER () =
VLIB_PLUGIN_REGISTER () =
{
.version = VPP_BUILD_VER,
.description = "myplugin plugin description goes here",
};
};
Vpp only loads .so files from the plugin directory which contain an
instance of this data structure.
@@ -193,7 +188,7 @@ You can enable or disable specific vpp plugins from the command
line. By default, plugins are loaded. To change that behavior, set
default_disabled in the macro VLIB_PLUGIN_REGISTER:
.. code-block:: console
.. code-block:: C
VLIB_PLUGIN_REGISTER () =
{
@@ -205,14 +200,14 @@ default_disabled in the macro VLIB_PLUGIN_REGISTER:
The boilerplate generator places the graph node dispatch function
onto the "device-input" feature arc. This may or may not be useful.
.. code-block:: console
.. code-block:: C
VNET_FEATURE_INIT (myplugin, static) =
{
.arc_name = "device-input",
.node_name = "myplugin",
.runs_before = VNET_FEATURES ("ethernet-input"),
};
};
As given by the plugin generator, myplugin.c contains the binary API
message handler for a generic "please enable my feature on such and
@@ -243,20 +238,53 @@ node.c
This is the generated graph node dispatch function. You'll need to
rewrite it to solve the problem at hand. It will save considerable
time and aggravation to retain the **structure** of the node dispatch
function.
function.
Even for an expert, it's a waste of time to reinvent the *loop
structure*, enqueue patterns, and so forth. Simply tear out and
replace the specimen 1x, 2x, 4x packet processing code with code
relevant to the problem you're trying to solve.
myplugin.api
------------
This contains the API message definition. Here we only have defined
a single one named ``myplugin_enable_disable`` and an implicit
``myplugin_enable_disable_reply`` containing only a return value due
to the ``autoreply`` keyword.
The syntax reference for ``.api`` files can be found at VPP API Language
Addressing the binary API with this message will run the handler defined
in ``myplugin.c`` as ``vl_api_myplugin_enable_disable_t_handler``.
It will receive a message pointer ``*mp`` which is the struct defined
in ``myplugin.api`` and should return another message pointer ``*rmp``,
of the reply type. That's what ``REPLY_MACRO`` does.
To be noted, all API messages are in net-endian and vpp is host-endian,
so you will need to use :
* ``u32 value = ntohl(mp->value);``
* ``rmp->value = htonl(value);``
You can now use this API with :ref:`GoLang bindings <add_plugin_goapi>`
myplugin_periodic.c
-------------------
This defines a VPP process, a routine that will run indefinitely and
be woken up intermittently, here to process plugin events.
To be noted, vlib_processes aren't thread-safe, and data structures
should be locked when shared between workers.
Plugin "Friends with Benefits"
------------------------------
In vpp VLIB_INIT_FUNCTION functions, It's reasonably common to see a
specific init function invoke other init functions:
.. code-block:: console
.. code-block:: C
if ((error = vlib_call_init_function (vm, some_other_init_function))
return error;
@@ -264,7 +292,7 @@ specific init function invoke other init functions:
In the case where one plugin needs to call a init function in another
plugin, use the vlib_call_plugin_init_function macro:
.. code-block:: console
.. code-block:: C
if ((error = vlib_call_plugin_init_function (vm, "otherpluginname", some_init_function))
return error;
@@ -274,7 +302,7 @@ This allows sequencing between plugin init functions.
If you wish to obtain a pointer to a symbol in another plugin, use the
vlib_plugin_get_symbol(...) API:
.. code-block:: console
.. code-block:: C
void *p = vlib_get_plugin_symbol ("plugin_name", "symbol");
@@ -0,0 +1,83 @@
.. _add_plugin_goapi:
Add a plugin's GO API
=====================
In order to use your plugin's API with GO, you will need to use
a GO client and GO definitions of the API messages that you defined
in ``myplugin.api`` (go bindings).
These two things can be found in `govpp <https://github.com/FDio/govpp>`_
* The API client lives in `./core`
* The api-generator lives in `./binapigen`
* A sample of its output (the go bindings) for VPP's latest version lives in `./binapi`
To generate the go bindings for your plugin. Assuming :
* ``/home/vpp`` is a VPP clone with your plugin in it.
* ``/home/controlplane`` is a go controlplane repo
.. code-block:: console
$ mkdir /home/controlplane/vpp-go-bindings
$ git clone https://github.com/FDio/govpp>
$ cd govpp
$ BINAPI_DIR=/home/controlplane/vpp-go-bindings VPP_DIR=/home/vpp make gen-binapi-from-code
This will generate the go-bindings in ``/home/controlplane/vpp-go-bindings``
For example ``vpp-go-bindings/myplugin/myplugin.ba.go`` will contain :
.. code-block:: go
// MypluginEnableDisable defines message 'myplugin_enable_disable'.
type MypluginEnableDisable struct {
EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}
You can then use the generated go bindings in your go code like this :
.. code-block:: go
package main
import (
"fmt"
"git.fd.io/govpp.git"
"git.fd.io/govpp.git/binapi/interfaces"
"git.fd.io/govpp.git/binapi/vpe"
"myplugin.io/controlplane/vpp-go-bindings/myplugin/myplugin"
)
func main() {
// Connect to VPP
conn, _ := govpp.Connect("/run/vpp/api.sock")
defer conn.Disconnect()
// Open channel
ch, _ := conn.NewAPIChannel()
defer ch.Close()
request := &vpe.MypluginEnableDisable{
EnableDisable: true,
}
reply := &vpe.MypluginEnableDisableReply{}
err := ch.SendRequest(request).ReceiveReply(reply)
if err != nil {
fmt.Errorf("SendRequest: %w\n", err)
}
}
As you will need to import (or ``go get "git.fd.io/govpp.git"``) to leverage the API
client in your code, you might want to use the api-generator directly from the
clone ``go build`` fetches for you. You can do this with :
.. code-block:: console
$ export GOVPP_DIR=$(go list -f '{{.Dir}}' -m git.fd.io/govpp.git)
$ cd $GOVPP_DIR && go build -o /some/bin/dir ./cmd/binapi-generator
$ # instead of make gen-binapi-from-code you can rewrite the code to target
$ # your version ./binapi-generator
+1
View File
@@ -0,0 +1 @@
../../../src/plugins/cnat/cnat.rst
@@ -10,19 +10,19 @@ This is a first attempt to support Cross compilation of VPP on MacOS for develop
* You'll need to install the following packages
.. code-block:: bash
.. code-block:: console
pip3 install ply
brew install diffutils gnu-sed pkg-config ninja crosstool-ng
$ pip3 install ply pyyaml jsonschema
$ brew install diffutils gnu-sed pkg-config ninja crosstool-ng
* You'll also need to install ``gnu-ident 2.2.11`` to be able to ``make checkstyle``. You can get it from `GNU <https://www.gnu.org/prep/ftp.html>`_
* You'll also need to install ``gnu-ident 2.2.11`` to be able to ``make checkstyle``. This can be done with :ref:`this doc<install_indent_2_2_11>`
* You should link the binaries to make them available in your path with their original names e.g. :
.. code-block:: bash
.. code-block:: console
ln -s $(which gsed) /usr/local/bin/sed
ln -s $(which gindent) /usr/local/bin/indent
ln -s /usr/local/Cellar/diffutils/3.7/bin/diff /usr/local/bin/diff
$ ln -s $(which gsed) /usr/local/bin/sed
$ ln -s $(which gindent) /usr/local/bin/indent
$ ln -s /usr/local/Cellar/diffutils/3.7/bin/diff /usr/local/bin/diff
**Setup**
@@ -35,17 +35,17 @@ For now we don't support e-build so dpdk, rdma, quicly won't be compiled as part
To build with the toolchain do:
.. code-block:: bash
.. code-block:: console
$VPP_DIR/extras/scripts/cross_compile_macos.sh build
$ $VPP_DIR/extras/scripts/cross_compile_macos.sh build
To get the compile_commands.json do
.. code-block:: bash
.. code-block:: console
$VPP_DIR/extras/scripts/cross_compile_macos.sh cc
# >> ./build-root/build-vpp[_debug]-native/vpp/compile_commands.json
$ $VPP_DIR/extras/scripts/cross_compile_macos.sh cc
$ >> ./build-root/build-vpp[_debug]-native/vpp/compile_commands.json
@@ -54,4 +54,19 @@ This should build vpp on MacOS
Good luck :)
.. _install_indent_2_2_11 :
Installing indent 2.2.11
------------------------
In order to install indent on macos :
.. code-block:: bash
$ wget http://mirror.sergal.org/gnu/indent/indent-2.2.11.tar.gz
$ tar -xzvf indent-2.2.11.tar.gz
$ cd indent-2.2.11
$ ./configure --disable-dependency-tracking --disable-debug --program-prefix=g --prefix=/usr/local/Cellar/gnu-indent/2.2.11
Install will exit with an error code, but indent 2.2.11 will still be installed in ``/usr/local/bin/gindent``
Other mirrors can be found on the `GNU website <https://www.gnu.org/prep/ftp.html>`_
@@ -10,7 +10,7 @@ beforehand, so the recursive switch can be avoided if the packet can follow the
already constructed data-plane graph for the tunnel's destination. This process
of joining to DP graphs together is termed *stacking*.
.. figure:: /_images/fib20fig2.png
.. figure:: /_images/fib20fig11.png
Figure 11: Tunnel control plane object diagram
+16 -1
View File
@@ -83,7 +83,22 @@ For example for a document with only patches you should add the tag **docs:**.
.. code-block:: console
$ git add <filename>
$ git commit -s -m "<*TAG*>: <*COMMIT_MESSAGE*>"
$ git commit -s
The commit comment should have something like the following comment:
.. code-block:: console
docs: A brief description of the commit
Type: Improvement (The type of commit this could be: Improvement, Fix or Feature)
A detailed description of the commit could go here.
Push the patch for review.
.. code-block:: console
$ git review
If you are creating a draft, meaning you do not want your changes reviewed yet, do the following:
+3
View File
@@ -22,6 +22,7 @@ The Developers section covers the following areas:
running_vpp
gdb_examples
add_plugin
add_plugin_goapi
gitreview
softwarearchitecture
infrastructure
@@ -41,3 +42,5 @@ The Developers section covers the following areas:
punt
quic_plugin
cross_compile_macos.rst
cnat
VPPAPI.md
+244
View File
@@ -540,6 +540,54 @@ certain cli command has the potential to hurt packet processing
performance by running for too long, do the work incrementally in a
process node. The client can wait.
### Macro expansion
The vpp debug CLI engine includes a recursive macro expander. This
is quite useful for factoring out address and/or interface name
specifics:
```
define ip1 192.168.1.1/24
define ip2 192.168.2.1/24
define iface1 GigabitEthernet3/0/0
define iface2 loop1
set int ip address $iface1 $ip1
set int ip address $iface2 $(ip2)
undefine ip1
undefine ip2
undefine iface1
undefine iface2
```
Each socket (or telnet) debug CLI session has its own macro
tables. All debug CLI sessions which use CLI_INBAND binary API
messages share a single table.
The macro expander recognizes circular defintions:
```
define foo \$(bar)
define bar \$(mumble)
define mumble \$(foo)
```
At 8 levels of recursion, the macro expander throws up its hands and
replies "CIRCULAR."
### Macro-related debug CLI commands
In addition to the "define" and "undefine" debug CLI commands, use
"show macro [noevaluate]" to dump the macro table. The "echo" debug
CLI command will evaluate and print its argument:
```
vpp# define foo This\ Is\ Foo
vpp# echo $foo
This Is Foo
```
Handing off buffers between threads
-----------------------------------
@@ -645,3 +693,199 @@ enqueue node by freeing dropped packets, or by pushing them to
"error-drop." Either of those actions would be a severe error.
* It's perfectly OK to enqueue packets to the current thread.
Handoff Demo Plugin
-------------------
Check out the sample (plugin) example in
.../src/examples/handoffdemo. If you want to build the handoff demo plugin:
```
$ cd .../src/plugins
$ ln -s ../examples/handoffdemo
```
This plugin provides a simple example of how to hand off packets
between threads. We used it to debug packet-tracer handoff tracing
support.
# Packet generator input script
```
packet-generator new {
name x
limit 5
size 128-128
interface local0
node handoffdemo-1
data {
incrementing 30
}
}
```
# Start vpp with 2 worker threads
The demo plugin hands packets from worker 1 to worker 2.
# Enable tracing, and start the packet generator
```
trace add pg-input 100
packet-generator enable
```
# Sample Run
```
DBGvpp# ex /tmp/pg_input_script
DBGvpp# pa en
DBGvpp# sh err
Count Node Reason
5 handoffdemo-1 packets handed off processed
5 handoffdemo-2 completed packets
DBGvpp# show run
Thread 1 vpp_wk_0 (lcore 0)
Time 133.9, average vectors/node 5.00, last 128 main loops 0.00 per node 0.00
vector rates in 3.7331e-2, out 0.0000e0, drop 0.0000e0, punt 0.0000e0
Name State Calls Vectors Suspends Clocks Vectors/Call
handoffdemo-1 active 1 5 0 4.76e3 5.00
pg-input disabled 2 5 0 5.58e4 2.50
unix-epoll-input polling 22760 0 0 2.14e7 0.00
---------------
Thread 2 vpp_wk_1 (lcore 2)
Time 133.9, average vectors/node 5.00, last 128 main loops 0.00 per node 0.00
vector rates in 0.0000e0, out 0.0000e0, drop 3.7331e-2, punt 0.0000e0
Name State Calls Vectors Suspends Clocks Vectors/Call
drop active 1 5 0 1.35e4 5.00
error-drop active 1 5 0 2.52e4 5.00
handoffdemo-2 active 1 5 0 2.56e4 5.00
unix-epoll-input polling 22406 0 0 2.18e7 0.00
```
Enable the packet tracer and run it again...
```
DBGvpp# trace add pg-input 100
DBGvpp# pa en
DBGvpp# sh trace
sh trace
------------------- Start of thread 0 vpp_main -------------------
No packets in trace buffer
------------------- Start of thread 1 vpp_wk_0 -------------------
Packet 1
00:06:50:520688: pg-input
stream x, 128 bytes, 0 sw_if_index
current data 0, length 128, buffer-pool 0, ref-count 1, trace handle 0x1000000
00000000: 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d0000
00000020: 0000000000000000000000000000000000000000000000000000000000000000
00000040: 0000000000000000000000000000000000000000000000000000000000000000
00000060: 0000000000000000000000000000000000000000000000000000000000000000
00:06:50:520762: handoffdemo-1
HANDOFFDEMO: current thread 1
Packet 2
00:06:50:520688: pg-input
stream x, 128 bytes, 0 sw_if_index
current data 0, length 128, buffer-pool 0, ref-count 1, trace handle 0x1000001
00000000: 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d0000
00000020: 0000000000000000000000000000000000000000000000000000000000000000
00000040: 0000000000000000000000000000000000000000000000000000000000000000
00000060: 0000000000000000000000000000000000000000000000000000000000000000
00:06:50:520762: handoffdemo-1
HANDOFFDEMO: current thread 1
Packet 3
00:06:50:520688: pg-input
stream x, 128 bytes, 0 sw_if_index
current data 0, length 128, buffer-pool 0, ref-count 1, trace handle 0x1000002
00000000: 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d0000
00000020: 0000000000000000000000000000000000000000000000000000000000000000
00000040: 0000000000000000000000000000000000000000000000000000000000000000
00000060: 0000000000000000000000000000000000000000000000000000000000000000
00:06:50:520762: handoffdemo-1
HANDOFFDEMO: current thread 1
Packet 4
00:06:50:520688: pg-input
stream x, 128 bytes, 0 sw_if_index
current data 0, length 128, buffer-pool 0, ref-count 1, trace handle 0x1000003
00000000: 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d0000
00000020: 0000000000000000000000000000000000000000000000000000000000000000
00000040: 0000000000000000000000000000000000000000000000000000000000000000
00000060: 0000000000000000000000000000000000000000000000000000000000000000
00:06:50:520762: handoffdemo-1
HANDOFFDEMO: current thread 1
Packet 5
00:06:50:520688: pg-input
stream x, 128 bytes, 0 sw_if_index
current data 0, length 128, buffer-pool 0, ref-count 1, trace handle 0x1000004
00000000: 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d0000
00000020: 0000000000000000000000000000000000000000000000000000000000000000
00000040: 0000000000000000000000000000000000000000000000000000000000000000
00000060: 0000000000000000000000000000000000000000000000000000000000000000
00:06:50:520762: handoffdemo-1
HANDOFFDEMO: current thread 1
------------------- Start of thread 2 vpp_wk_1 -------------------
Packet 1
00:06:50:520796: handoff_trace
HANDED-OFF: from thread 1 trace index 0
00:06:50:520796: handoffdemo-2
HANDOFFDEMO: current thread 2
00:06:50:520867: error-drop
rx:local0
00:06:50:520914: drop
handoffdemo-2: completed packets
Packet 2
00:06:50:520796: handoff_trace
HANDED-OFF: from thread 1 trace index 1
00:06:50:520796: handoffdemo-2
HANDOFFDEMO: current thread 2
00:06:50:520867: error-drop
rx:local0
00:06:50:520914: drop
handoffdemo-2: completed packets
Packet 3
00:06:50:520796: handoff_trace
HANDED-OFF: from thread 1 trace index 2
00:06:50:520796: handoffdemo-2
HANDOFFDEMO: current thread 2
00:06:50:520867: error-drop
rx:local0
00:06:50:520914: drop
handoffdemo-2: completed packets
Packet 4
00:06:50:520796: handoff_trace
HANDED-OFF: from thread 1 trace index 3
00:06:50:520796: handoffdemo-2
HANDOFFDEMO: current thread 2
00:06:50:520867: error-drop
rx:local0
00:06:50:520914: drop
handoffdemo-2: completed packets
Packet 5
00:06:50:520796: handoff_trace
HANDED-OFF: from thread 1 trace index 4
00:06:50:520796: handoffdemo-2
HANDOFFDEMO: current thread 2
00:06:50:520867: error-drop
rx:local0
00:06:50:520914: drop
handoffdemo-2: completed packets
DBGvpp#
```
+1 -1
View File
@@ -11,7 +11,7 @@ code that provides tools that are used in a development environment.
This section covers the following:
* Describes how to manually install VPP Binaries on different OS platforms (Ubuntu, Centos, openSUSE) and then how to configure and use VPP.
* Describes how to manually install VPP Binaries on different OS platforms (Ubuntu, Centos) and then how to configure and use VPP.
* Describes the different types of VPP packages, which are used in both basic and developer installs.
* A VPP tutorial which is a great way to learn VPP basics.

Some files were not shown because too many files have changed in this diff Show More