History log of /vpp/src/vlib/node.h
Revision Date Author Comments
# ef587582 20-May-2020 Damjan Marion <damarion@cisco.com>

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>

# 4830e4f7 10-Mar-2020 Ray Kinsella <mdr@ashroe.eu>

vlib: startup multi-arch variant configuration

Support for startup node multi-arch variant selection through startup.conf.
This is to facilitate unit, functional testing and benchmarking of non-default
multi-arch variant node code path. Also added parameters to make test, to
specific using multi-arch variants in unit testing.

Type: improvement

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I94fd332bb629683b7a7dd770ee9f615a9a424060

# 7ca5aaac 24-Sep-2019 Damjan Marion <damarion@cisco.com>

vlib: add flag to explicitelly mark nodes which can init per-node packet trace

Type: feature

Change-Id: I913f08383ee1c24d610c3d2aac07cef402570e2c
Signed-off-by: Damjan Marion <damarion@cisco.com>

# d770cfc9 02-Sep-2019 Damjan Marion <damarion@cisco.com>

ipsec ip tcp l2: multiarch nodes cannot be declared as static

Credits to ray.kinsella@intel.com who spotted the issue and identified
root cause.

Type: fix

Change-Id: I4afe74c47769484309f6aebca2de56ad32c8041f
Signed-off-by: Damjan Marion <damarion@cisco.com>

# 687c9021 23-Jul-2019 Dave Barach <dave@barachs.net>

vlib: address vlib_error_t scaling issue

Encoding the vpp node index into the vlib_error_t as a 10-bit quantity
limits us to 1K graph nodes. Unfortunately, a few nodes need 6 bit
per-node error codes. Only a very few nodes have so many counters.

It turns out that there are about 2K total error counters in the system,
which is (approximately) the maximum error heap index.

The current (index,code) encoding limits the number of interfaces to
around 250, since each interface has two associated graph nodes and we
have about 500 "normal, interior" graph node

This patch adds an error-index to node-index map, so we can store
error heap indices directly in the vlib_buffer_t.

Type: refactor

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

# 58b2eb1a 15-Jul-2019 Andreas Schultz <andreas.schultz@travelping.com>

vlib: convert frame_index into real pointers

The fast path almost always has to deal with the real
pointers. Deriving the frame pointer from a frame_index requires a
load of the 32bit frame_index from memory, another 64bit load of the
heap base pointer and some calculations.

Lets store the full pointer instead and do a single 64bit load only.

This helps avoiding problems when the heap is grown and frames are
allocated below vm->heap_aligned_base.

Type: refactor
Change-Id: Ifa6e6e984aafe1e2755bff80f0a4dfcddee3623c
Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
Signed-off-by: Dave Barach <dave@barachs.net>

# 8875248f 04-Jun-2019 dongjuan <dong.juan1@zte.com.cn>

trace frame-queue on trigger out of memory

FRAME_QUEUE_NELTS is 64 in thread.c

Change-Id: Ie7e5962afe05dfc7f38e3d597dabc74dcc2dab8d
Signed-off-by: dongjuan <dong.juan1@zte.com.cn>

# c3a0e8d2 11-Mar-2019 Filip Tehlar <ftehlar@cisco.com>


Change-Id: I403173846bc5b1bbbe2a2c41225b0f666f851cb9
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>

# 296988d3 21-Feb-2019 Damjan Marion <damarion@cisco.com>

Add no-append flag to vlib_frame_t

Change-Id: I01c4f5755d579282773ac227b0bc24f8ddbb2bd1
Signed-off-by: Damjan Marion <damarion@cisco.com>

# 652d2e13 01-Feb-2019 Damjan Marion <damarion@cisco.com>

Deprecate old mutliarch code, phase 1

It is causing compilation sloness with gcc-7 so removing it
before it was originally planned.

So far macros are left in the tree so we can know which nodes to
convert to new multiarch code.

Change-Id: Idb14622ca61fdce1eba59723b20d98715b7971e6
Signed-off-by: Damjan Marion <damarion@cisco.com>

# ec595ef0 24-Jan-2019 Dave Barach <dave@barachs.net>

perfmon plugin: 2-way parallel stat collection

As a FUD reduction measure, this patch implements 2-way parallel
counter collection. Synthetic stat component counter pairs run at the
same time. Running two counters (of any kind) at the same time
naturally reduces the aggregate time required by an approximate
factor-of-2, depending on whether an even or odd number of stats have
been requested.

I don't completely buy the argument that computing synthetic stats
such as instructions-per-clock will be inaccurate if component counter
values are collected sequentially. Given uniform traffic pattern, it
must make no difference.

As the collection interval increases, the difference between serial
and parallel component counter collection will approach zero, see also
the Central Limit theorem.

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

# 7fff3d20 27-Nov-2018 Dave Barach <dave@barachs.net>

Metadata / opaque formatting belongs in vpp

VPP graph dispatch trace record description:

0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
| Major Version | Minor Version | NStrings | ProtoHint |
| Buffer index (big endian) |
+ VPP graph node name ... ... | NULL octet |
| Buffer Metadata ... ... | NULL octet |
| Buffer Opaque ... ... | NULL octet |
| Buffer Opaque 2 ... ... | NULL octet |
| VPP ASCII packet trace (if NStrings > 4) | NULL octet |
| Packet data (up to 16K) |

Graph dispatch records comprise a version stamp, an indication of how
many NULL-terminated strings will follow the record header, and a
protocol hint.

The buffer index allows downstream consumers of these data to easily
filter/track single packets as they traverse the forwarding
graph. FWIW, the 32-bit buffer index is stored in big endian format.

As of this writing, major version = 1, minor version = 0. Nstrings
will be either 4 or 5.

Here is the current set of protocol hints:

typedef enum
} vlib_node_proto_hint_t;

Example: VLIB_NODE_PROTO_HINT_IP6 means that the first octet of packet
data SHOULD be 0x60, and should begin an ipv6 packet header.

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

# b7b92993 17-Oct-2018 Dave Barach <dave@barachs.net>

c11 safe string handling support

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

# 4d1a866a 10-Sep-2018 Dave Barach <dave@barachs.net>

X86_64 perf counter plugin

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

# 633b6fd6 14-Sep-2018 Damjan Marion <damarion@cisco.com>

vlib: introduce user flags in vlib_frame_t

Those flags have local significance and they can be used for
sending hints to the next node.

Change-Id: Ic2596ee81c64cd16f96344365370e8fcdc465354
Signed-off-by: Damjan Marion <damarion@cisco.com>

# 69abe444 27-Aug-2018 Damjan Marion <damarion@cisco.com>

vlib: add 'show node' and 'set node function' CLI

Change-Id: I084d7c9e34329f10b5fe45e0b157c4defe0f2811
Signed-off-by: Damjan Marion <damarion@cisco.com>

# 6e36351f 10-Aug-2018 Damjan Marion <damarion@cisco.com>

Multiarch handling in different constructor macros

This significantly reduces need for


in multiarch code. Simply constructor macros will jost create static unused
entry if CLIB_MARCH_VARIANT is defined and that will be optimized out by

Change-Id: I17d1c4ac0c903adcfadaa4a07de1b854c7ab14ac
Signed-off-by: Damjan Marion <damarion@cisco.com>

# 812b32dd 28-May-2018 Damjan Marion <damarion@cisco.com>

Add VLIB_NODE_FN() macro to simplify multiversioning of node functions

Change-Id: Ibab5e27277f618ceb2d543b9d6a1a5f191e7d1db
Signed-off-by: Damjan Marion <damarion@cisco.com>

# 72d2c4f3 05-Apr-2018 Damjan Marion <damarion@cisco.com>

plugins: unload plugin if early init fails

Change-Id: I32f68e2ee8f5d32962acdefb0193583f71d342b3
Signed-off-by: Damjan Marion <damarion@cisco.com>

# d84ba85c 22-Aug-2017 Dave Barach <dbarach@cisco.com>

TCP horizontal scaling

- Remove frame handoff support machinery. We haven't used it in a long
- Configuration support for the local endpoints bihash table
- Drop lookup failure packets in tcp46_syn_sent

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

# 5c20a013 13-Jun-2017 Dave Barach <dave@barachs.net>

switch vlib process model to tw_timer_template timer impl

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

# 36c1308b 24-Apr-2017 Damjan Marion <damarion@cisco.com>

Fix structure alignment with 32-bit pointers

Change-Id: I740de6c0f12dab452b4349e3bf89ff976a6268c0
Signed-off-by: Damjan Marion <damarion@cisco.com>

# 586afd76 05-Apr-2017 Damjan Marion <damarion@cisco.com>

Use thread local storage for thread index

This patch deprecates stack-based thread identification,
Also removes requirement that thread stacks are adjacent.

Finally, possibly annoying for some folks, it renames
all occurences of cpu_index and cpu_number with thread
index. Using word "cpu" is misleading here as thread can
be migrated ti different CPU, and also it is not related
to linux cpu index.

Change-Id: I68cdaf661e701d2336fc953dcb9978d10a70f7c1
Signed-off-by: Damjan Marion <damarion@cisco.com>

# 2c2b6407 28-Mar-2017 Damjan Marion <damarion@cisco.com>

vlib: make vlib_node_interrupt_pending(...) thread safe

Change-Id: I24577bd32ae23fbe8515cc8d960eab5448ce3b5c
Signed-off-by: Damjan Marion <damarion@cisco.com>

# e9f929b5 16-Mar-2017 Damjan Marion <damarion@cisco.com>

vlib: make runtime_data thread-local

Change-Id: I4aa3e7e42fb81211de1aed07dc7befee87a1e18b
Signed-off-by: Damjan Marion <damarion@cisco.com>

# 7cd468a3 19-Dec-2016 Damjan Marion <damarion@cisco.com>

Reorganize source tree to use single autotools instance

Change-Id: I7b51f88292e057c6443b12224486f2d0c9f8ae23
Signed-off-by: Damjan Marion <damarion@cisco.com>