45 Commits

Author SHA1 Message Date
Dave Barach
f9c231ec12 vpp-189 Clean up more coverity warnings
Time to make the donuts

Change-Id: I528937800f7daefce19723dda0216e58d857942c
Signed-off-by: Dave Barach <dave@barachs.net>
2016-08-05 10:10:38 -04:00
Dave Barach
56faee8372 VPP-189 Clean up more coverity warnings
Change-Id: I1b971ab326dc334a4743fd7d4184cef106b0523d
Signed-off-by: Dave Barach <dave@barachs.net>
2016-08-05 13:21:59 +00:00
Dave Barach
dd3a57f36e VPP-223 Bounded-index extensible hash documentation
Change-Id: If162252062014dbd8ef44f7f10649d54d9a288b0
Signed-off-by: Dave Barach <dave@barachs.net>
2016-07-28 13:02:37 -04:00
Chris Luke
8e5b041f2b VPP-223 General documentation updates
Per the TWS session...

- Some simple treatment of the contents of pool.h
- Changing some \brief commands to @brief. (will do a more
  complete pass at this later.)

Change-Id: I050ee69c59c4b572ac295b5f86940b7f4c934cd9
Signed-off-by: Chris Luke <chrisy@flirble.org>
2016-07-26 13:29:58 -04:00
Damjan Marion
ec175104cf Fix clang build
Change-Id: I678d7e0a7c91c7daf9feb3ec23a633b96fab56a7
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-06-30 01:02:17 +02:00
Dave Barach
034fccccab Doubly-linked list element pools
Change-Id: I96e7602be48dfb5bb3867ad1e9f15c543903b3d6
Signed-off-by: Dave Barach <dave@barachs.net>
2016-06-25 17:35:29 +00:00
Pierre Pfister
889178c02a VPP-152: mheap_alloc returns 0 when the requested heap size is too small
mheap_alloc allocates memory_size bytes of memory and returns
a page-aligned memory space prefixed with a word-aligned
header of type mheap_t.

This header includes the actual usable space size, but
when the requested size is too small, the computed size
was incorrect (infinite).

mheap_alloc now returns 0 in such cases.

With help from Yoann Desmouceaux.

Change-Id: I00af63d573d6939aca53dbe7ff612b726bd8f0df
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
2016-06-19 13:31:59 +00:00
Dave Barach
d65346098d Dynamically compute ip feature subgraph order
This change-set enables plugins to add themselves to the ip4/ip6
feature subgraphs without having to modify core vpp engine code
at all. Add VNET_IP4/IP6_UNICAST/MULTICAST_FEATURE_INIT macros
which express the required ordering constraints, and off you go.

Along the way, added an implementation of Warshall's algorithm to
vppinfra; to compute the positive transitive closure of a relation. In
this case, the relation is "feature A runs before feature B."

With that in hand, ip_feature_init_cast(...) computes a partial order
across the set of configured feature subgraph nodes.

In unit-testing, we discovered VPP-145 - ip4/6 inacl wiped out
vnet_buffer(b)->ip>current_config_index, which exists in main. So, we
fixed that by moving b->trace_index, adding b->current_config_index,
and removing the ip opaque union current_config_index.

Change-Id: Iff132116f66413dc6b31ac3377198c7a32d51f48
Signed-off-by: Dave Barach <dave@barachs.net>
2016-06-17 16:24:16 +00:00
Damjan Marion
0b14072b69 Add dpdk per-interface startup config parameter to specify worker threads
New parameter allows specifying which worker threads will process rx
queues. Parameter arguments is list of cores and number of worker specified
must be equal to the number of rx queues configured (num-rx-queues). If
num-rx-queues is not specified, it will be automatically set to
number of workers.

Sample config:

dpdk {
  dev 0000:86:00.0 {
    workers 2,3
    num-rx-queues 2
  }
}

Change-Id: I88bc381e0e542eb02def09a726c6f04de3e1ae17
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-06-14 18:15:43 +00:00
Damjan Marion
0247b46002 Add worker-handoff node
worker-handoff node is universal node which taakes packets
from the input node and hands them over to worker threads.
Currently it supports flow hashing based on ipv4, ipv6 and
mpls headers.

New cli:

set interface handoff <intrerface-name> workers <list>

e.g.

set interface handoff TenGigabitEthernet2/0/0 workers 3-6,9-10

Change-Id: Iaf0df83e69bb0e84969865e0e1cdb000b0864cf5
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-06-13 20:39:58 +00:00
Damjan Marion
a7e83ceeac Add format_hexdump function
Function output is compatible with text2pcap tool

Sample output:

00000: 54 68 65 20 71 75 69 63 6b 20 62 72 6f 77 6e 20 [The quick brown ]
00010: 66 6f 78 20 6a 75 6d 70 73 20 6f 76 65 72 20 74 [fox jumps over t]
00020: 68 65 20 6c 61 7a 79 20 64 6f 67 00             [he lazy dog.]

Change-Id: If77ec7d91b77146df770698e0cf35fe2f6dd0821
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-06-09 17:23:22 +00:00
Damjan Marion
1c80e831b7 Add support for multiple microarchitectures in single binary
* compiler -march= parameter is changed from native to corei7
   so code is always genereted with instructions which are available
   on the Nehalem microarchitecture (up to SSE4.2)

 * compiler -mtune= parameter is added so code is optimized for
   corei7-avx which equals to Sandy Bridge microarchitecture

 * set of macros is added which allows run-time detection of available
   cpu instructions (e.g. clib_cpu_supports_avx())

 * set of macros is added which allows us to clone graph node funcitons
   where cloned function is optmized for different microarchitecture
   Those macros are using following attributes:
     __attribute__((flatten))
     __attribute__((target("arch=core-avx2)))

   I.e. If applied to foo_node_fn() macro will generate cloned
   functions foo_node_fn_avx2() and foo_node_fn_avx512() (future)
   It will also generate function void * foo_node_fn_multiarch_select()
   which detects available instruction set and returns pointer to the
   best matching function clone.

Change-Id: I2dce0ac92a5ede95fcb56f47f3d1f3c4c040bac0
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-05-19 18:14:38 +02:00
Christophe Fontaine
9341a1f850 vppinfra - ARM: cycle count 64bits register is only available on ARMv8
Change-Id: I7d622e591020a482af68667f4d1ed2056258d2c8
Signed-off-by: Christophe Fontaine <christophe.fontaine@qosmos.com>
2016-05-17 18:20:10 +00:00
Damjan Marion
793b18de05 VPP-58: Fix build on AMD Opteron
Change-Id: Ib3e10fd4c27dde4f90b8d156f0c8547787ad46e2
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-05-16 16:52:55 +02:00
Chris Luke
aa761e1281 VPP-57 Add missing license headers in doc files
Change-Id: Icd1f8952f66d3cee027c59f3148c67f1839de306
Signed-off-by: Chris Luke <chrisy@flirble.org>
2016-05-16 11:48:16 +00:00
Chris Luke
b585097048 VPP-57 Add Doxygen to VPP
- Configures Doxygen.
- Adds a source filter to do magic on our use of the preprocessor to do
  constructor stuff to make Doxygen grok it better.
- Adds a convenience helper to the root Makefile.
- Adds a README.md to the root directory (and which Doxygem uses as its
  "mainpage".
- Add several other documentative files.
- Currently using SVG for call graphs, though this may have a
  load-time performance impact in browsers.

Change-Id: I25fc6fb5bf634319dcb36a7f0e32031921c125ac
Signed-off-by: Chris Luke <chrisy@flirble.org>
2016-05-13 17:23:36 +00:00
Damjan Marion
6b1d7c55d6 Make automake silent rules default
Change-Id: Ia504ccdac1deac20f20cf7fb76f78b2d8c505474
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-26 19:36:59 +00:00
Damjan Marion
f1213b8277 Add clib_memcpy macro based on DPDK rte_memcpy implementation
Change-Id: I22cb443c4bd0bf298abb6f06e8e4ca65a44a2854
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-22 17:29:47 +02:00
Damjan Marion
bd4b590561 Add Broadwell-EP/EX to the uarch list
Change-Id: I2ab84846ac88d3170b8c847914749e2a728dfa2b
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-21 14:03:55 +00:00
Christophe Fontaine
fef15b4bb8 Add support for AArch32
gcc version 4.9.2 (Raspbian 4.9.2-10)
Tested on Linux raspberrypi 4.4.6-v7+ #875 SMP Tue Apr 12 16:33:02 BST 2016 armv7l GNU/Linux

CPUs may be little or big endian, detect with gcc flags, not the processor architecture
Add a new flag $(PLATFORM)_uses_openssl which allows to disable the link with openssl lib.

vlib/vlib/threads.c:
startup.conf must:
- specify the heapsize as we don't have hugepages on raspbian

cpu {
  main-core 3
}
heapsize 64M

Corrects in various files the assumption uword == u64 and replaces 'u64' cast with 'pointer_to_uword' and 'uword_to_pointer' where appropriate.
256 CPUs may create an OOM when testing with small memory footprint ( heapsize 64M ), allows the number of VLIB_MAX_CPUS to be set in platforms/*.mk

vppinfra/vppinfra/longjmp.S:
ARM - copy r1 (1st parameter of the setjmp call) to r0 (return value)

vppinfra/vppinfra/time.h:
On ARMv7 in AArch32 mode, we can access to a 64bit register to retreive the cycles count.
gcc on rpi only declare ARM_ARCH 6. Override this info, and check if it is possible to use 'mrrc'.
/!\ the time function will NOT work without allowing the user mode access to the PMU.
You may download the source of the kmod here:
https://github.com/christophefontaine/arm_rdtsc

Change-Id: I8142606436d9671a184133b935398427f08a8bd2
Signed-off-by: Christophe Fontaine <christophe.fontaine@qosmos.com>
2016-04-18 13:20:57 +00:00
Florin Coras
e10e372e5a Fix vppinfra unit tests
"make check" in build-root/build-$tag-$arch/vppinfra should now work on a
machine with 3G of spare memory

Change-Id: Ie6a22e8496b56b93aa90fdc81e3e0c10dc7514fb
Signed-off-by: Florin Coras <fcoras@cisco.com>
2016-04-14 14:09:49 +00:00
Damjan Marion
c47e979674 Add configure option to enable building unit tests
Same template should be used for other libs...

Change-Id: Icc771cb6b243d215f30fb51c0dbc028e497a74c6
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-11 13:03:30 +00:00
Dave Barach
e5389bb053 event logger skeletons, improve debug CLI
Change-Id: Ieb2e4043fc7bc3b4a5436a7a6aa35f573d8d4506
Signed-off-by: Dave Barach <dave@barachs.net>
2016-03-28 17:12:36 -04:00
Dave Barach
fb6e59d839 Improve main-loop event-logs
Change-Id: I984debeffe0dce36c9e7ab963f25d862cc7550cc
Signed-off-by: Dave Barach <dave@barachs.net>
2016-03-26 18:45:52 -04:00
Dave Barach
dbf19ca7f9 Make adjacencies shareable
Change-Id: I620871ca715b751d2e487f37341b7118797c9176
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-03-18 12:59:51 +01:00
Damjan Marion
b8abf877ba Declare node, hw_interface_class and device_class instances as external
This fixes issue observed on Ubuntu 16.04 where
dynamic loader is not finding correct instance of
specific structure.

Change-Id: I618d0933c7e171b8a9b40495b36894785af7790a
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-03-14 20:43:12 +01:00
Jean-Mickael Guerin
8e94c2a080 vppinfra: remove generated config.h.in
Change-Id: I04f53789bf1f39fdf16bc813280b24144fedd020
Signed-off-by: Jean-Mickael Guerin <jean-mickael.guerin@6wind.com>
2016-03-04 19:23:07 +00:00
Damjan Marion
522e4864b9 Add CPU detection functions
Change-Id: Id7ea0410d6a789000c747c36a7e50076e31dc29a
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-03-04 15:02:27 +01:00
Damjan Marion
7e437bce90 Use CRC32 instruction only when build for SSE4.2 enabled platforms
This fixes SIGILL crash observed on Penryn CPU

Change-Id: I960878d88f0f088847d4d86605ef082f6600e2c7
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-03-03 18:42:44 +01:00
Dave Barach
8a4a781e96 -O3 warnings be gone
Note that compiling -O3 doesn't improve performance as of this
writing, might as well clean up warnings in any event.

Change-Id: Ic2f4982d12fbbf36f5324075183982731759dc94
Signed-off-by: Dave Barach <dave@barachs.net>
2016-02-29 09:45:28 -05:00
Damjan Marion
ce8debfe0f Increase number of per-cpu mheaps to 256
It also includes check to ensure that number of
per-cpu mheaps is not lower than number of cpus.

Change-Id: Ibc68b34dda130f922243f9ea15b03e44bbcac269
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-02-16 17:50:48 +00:00
Damjan Marion
d0386374d6 Remove vec_sort macro
vec_sort macro was using gcc proprietary nested functions that
require a executable stack and they are considered as unsafe.
Also, nested functions are not supported by other compilers.
vec_sort_with_function() should be used instead.

Change-Id: I05959da63d222ec71c090ba63420b427ce10c79b
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-02-16 17:36:49 +01:00
Damjan Marion
14a44d37a3 Use vppinfra bitmap for dpdk coremask
Change-Id: Iec5ebadf120f742f43a681c4d394aa97ad2ae1e1
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-02-11 15:02:33 +00:00
Dave Barach
61efa140b1 aarch64 CPU arch / ThunderX platform initial support
Change-Id: Ia2edd3cee2c25c26c7c47a9023744b97226434c7
Signed-off-by: Dave Barach <dave@barachs.net>
2016-01-22 08:23:27 -05:00
Dave Barach
bfdedbd5a3 PowerPC64-be arch support. Qemu ("qppc") platform support.
Change-Id: Ib0a05f9d1b08bacef09f6d7c101391737031ee0d
Signed-off-by: Dave Barach <dave@barachs.net>
2016-01-21 12:33:07 +00:00
Dave Barach
2eb349224d Merge "Fix bitmap list parsing" 2016-01-19 23:15:51 +00:00
Dave Barach
2bc1ebaf38 Clean up comment
Change-Id: I487321624d3625e32e661ca378716ec083ce3ce2
Signed-off-by: Dave Barach <dave@barachs.net>
2016-01-19 15:10:35 -05:00
Damjan Marion
75d1f2404d Fix bitmap list parsing
Fixes "cpu_config: no such thread type 'corelist-workers'" issue

Change-Id: Ic0309ee62859ac73fd58c57b5f630aff5daf1775
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-01-19 14:10:52 +01:00
Damjan Marion
2c29d75021 Fix warnings/errors reported by clang
Change-Id: Ifb2de64347526e3218e22067452f249ff878fd32
Signed-off-by: Damjan Marion <damarion@cisco.com>
2015-12-18 13:31:56 +01:00
Dave Barach
7210e9470e Remove autotools generated products
Change-Id: I7f23b8b8e5136cb56768bac3a7473e6df5ee4993
Signed-off-by: Dave Barach <dave@barachs.net>
2015-12-15 19:06:39 -05:00
Dave Wallace
317be03492 Merge "replacing all vec_sort() invocations to vec_sort_with_function()" 2015-12-15 13:22:37 +00:00
Damjan Marion
29b6af9f97 Remove vppversion subtree, move elftool to vppinfra
Change-Id: I26b29a0f53f81a28cbf264f5299f9a3978735574
Signed-off-by: Damjan Marion <damarion@cisco.com>
2015-12-15 10:07:31 +01:00
Matus Fabian
d2dc3df90d replacing all vec_sort() invocations to vec_sort_with_function()
Change-Id: I05895827ed52be292112484cee7d0a2591b67335
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2015-12-15 00:09:46 +01:00
Dave Barach
63a254f37d Reenable memory allocator small-object cache, disabled by mistake.
Change-Id: I006282fd3991f7ba7b8315670724c065bd71a671
Signed-off-by: Dave Barach <dave@barachs.net>
2015-12-12 10:47:01 -05:00
Ed Warnicke
cb9cadad57 Initial commit of vpp code.
Change-Id: Ib246f1fbfce93274020ee93ce461e3d8bd8b9f17
Signed-off-by: Ed Warnicke <eaw@cisco.com>
2015-12-08 15:47:27 -07:00