summaryrefslogtreecommitdiffstats
path: root/README.md
blob: 4cc283b5e530fd12246a33599306cb375fdc26ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
Vector Packet Processing
========================

## Introduction

The VPP platform is an extensible framework that provides out-of-the-box
production quality switch/router functionality. It is the open source version
of Cisco's Vector Packet Processing (VPP) technology: a high performance,
packet-processing stack that can run on commodity CPUs.

The benefits of this implementation of VPP are its high performance, proven
technology, its modularity and flexibility, and rich feature set.

For more information on VPP and its features please visit the
[FD.io website](http://fd.io/) and
[What is VPP?](https://wiki.fd.io/view/VPP/What_is_VPP%3F) pages.


## Changes

Details of the changes leading up to this version of VPP can be found under
@ref release_notes.


## Directory layout

| Directory name         | Description                                 |
| ---------------------- | ------------------------------------------- |
|      build-data        | Build metadata                              |
|      build-root        | Build output directory                      |
|      doxygen           | Documentation generator configuration       |
|      dpdk              | DPDK patches and build infrastructure       |
| @ref extras/libmemif   | Client library for memif                    |
| @ref src/examples      | VPP example code                            |
| @ref src/plugins       | VPP bundled plugins directory               |
| @ref src/svm           | Shared virtual memory allocation library    |
|      src/tests         | Standalone tests (not part of test harness) |
|      src/vat           | VPP API test program                        |
| @ref src/vlib          | VPP application library                     |
| @ref src/vlibapi       | VPP API library                             |
| @ref src/vlibmemory    | VPP Memory management                       |
| @ref src/vnet          | VPP networking                              |
| @ref src/vpp           | VPP application                             |
| @ref src/vpp-api       | VPP application API bindings                |
| @ref src/vppinfra      | VPP core library                            |
| @ref src/vpp/api       | Not-yet-relocated API bindings              |
|      test              | Unit tests and Python test harness          |

## Getting started

In general anyone interested in building, developing or running VPP should
consult the [VPP wiki](https://wiki.fd.io/view/VPP) for more complete
documentation.

In particular, readers are recommended to take a look at [Pulling, Building,
Running, Hacking, Pushing](https://wiki.fd.io/view/VPP/Pulling,_Building,_Run
ning,_Hacking_and_Pushing_VPP_Code) which provides extensive step-by-step
coverage of the topic.

For the impatient, some salient information is distilled below.


### Quick-start: On an existing Linux host

To install system dependencies, build VPP and then install it, simply run the
build script. This should be performed a non-privileged user with `sudo`
access from the project base directory:

    ./extras/vagrant/build.sh

If you want a more fine-grained approach because you intend to do some
development work, the `Makefile` in the root directory of the source tree
provides several convenience shortcuts as `make` targets that may be of
interest. To see the available targets run:

    make


### Quick-start: Vagrant

The directory `extras/vagrant` contains a `VagrantFile` and supporting
scripts to bootstrap a working VPP inside a Vagrant-managed Virtual Machine.
This VM can then be used to test concepts with VPP or as a development
platform to extend VPP. Some obvious caveats apply when using a VM for VPP
since its performance will never match that of bare metal; if your work is
timing or performance sensitive, consider using bare metal in addition or
instead of the VM.

For this to work you will need a working installation of Vagrant. Instructions
for this can be found [on the Setting up Vagrant wiki page]
(https://wiki.fd.io/view/DEV/Setting_Up_Vagrant).


## More information

Several modules provide documentation, see @subpage user_doc for more
end-user-oriented information. Also see @subpage dev_doc for developer notes.

Visit the [VPP wiki](https://wiki.fd.io/view/VPP) for details on more
advanced building strategies and other development notes.


## Test Framework

There is PyDoc generated documentation available for the VPP test framework.
See @ref test_framework_doc for details.
clib_bihash_value *next_free; /**< used when a KVP page (or block thereof) is on a freelist */ }; } clib_bihash_value_t /** bihash bucket structure */ typedef struct { union { struct { u32 offset; /**< backing page offset in the clib memory heap */ u8 pad[3]; /**< log2 (size of the packing page block) */ u8 log2_pages; }; u64 as_u64; }; } clib_bihash_bucket_t; /** A bounded index extensible hash table */ typedef struct { clib_bihash_bucket_t *buckets; /**< Hash bucket vector, power-of-two in size */ volatile u32 *writer_lock; /**< Writer lock, in its own cache line */ BVT (clib_bihash_value) ** working_copies; /**< Working copies (various sizes), to avoid locking against readers */ clib_bihash_bucket_t saved_bucket; /**< Saved bucket pointer */ u32 nbuckets; /**< Number of hash buckets */ u32 log2_nbuckets; /**< lg(nbuckets) */ u8 *name; /**< hash table name */ BVT (clib_bihash_value) ** freelists; /**< power of two freelist vector */ uword alloc_arena; /**< memory allocation arena */ uword alloc_arena_next; /**< first available mem chunk */ uword alloc_arena_size; /**< size of the arena */ } clib_bihash_t; /** Get pointer to value page given its clib mheap offset */ static inline void *clib_bihash_get_value (clib_bihash * h, uword offset); /** Get clib mheap offset given a pointer */ static inline uword clib_bihash_get_offset (clib_bihash * h, void *v); /** initialize a bounded index extensible hash table @param h - the bi-hash table to initialize @param name - name of the hash table @param nbuckets - the number of buckets, will be rounded up to a power of two @param memory_size - clib mheap size, in bytes */ void clib_bihash_init (clib_bihash * h, char *name, u32 nbuckets, uword memory_size); /** Destroy a bounded index extensible hash table @param h - the bi-hash table to free */ void clib_bihash_free (clib_bihash * h); /** Add or delete a (key,value) pair from a bi-hash table @param h - the bi-hash table to search @param add_v - the (key,value) pair to add @param is_add - add=1, delete=0 @returns 0 on success, < 0 on error @note This function will replace an existing (key,value) pair if the new key matches an existing key */ int clib_bihash_add_del (clib_bihash * h, clib_bihash_kv * add_v, int is_add); /** Search a bi-hash table, use supplied hash code @param h - the bi-hash table to search @param hash - the hash code @param in_out_kv - (key,value) pair containing the search key @returns 0 on success (with in_out_kv set), < 0 on error */ int clib_bihash_search_inline_with_hash (clib_bihash * h, u64 hash, clib_bihash_kv * in_out_kv); /** Search a bi-hash table @param h - the bi-hash table to search @param in_out_kv - (key,value) pair containing the search key @returns 0 on success (with in_out_kv set), < 0 on error */ int clib_bihash_search_inline (clib_bihash * h, clib_bihash_kv * in_out_kv); /** Prefetch a bi-hash bucket given a hash code @param h - the bi-hash table to search @param hash - the hash code @note see also clib_bihash_hash to compute the code */ void clib_bihash_prefetch_bucket (clib_bihash * h, u64 hash); /** Prefetch bi-hash (key,value) data given a hash code @param h - the bi-hash table to search @param hash - the hash code @note assumes that the bucket has been prefetched, see clib_bihash_prefetch_bucket */ void clib_bihash_prefetch_data (clib_bihash * h, u64 hash); /** Search a bi-hash table @param h - the bi-hash table to search @param search_key - (key,value) pair containing the search key @param valuep - (key,value) set to search result @returns 0 on success (with valuep set), < 0 on error @note used in situations where key modification is not desired */ int clib_bihash_search_inline_2 (clib_bihash * h, clib_bihash_kv * search_key, clib_bihash_kv * valuep); /** Visit active (key,value) pairs in a bi-hash table @param h - the bi-hash table to search @param callback - function to call with each active (key,value) pair @param arg - arbitrary second argument passed to the callback function First argument is the (key,value) pair to visit @note Trying to supply a proper function prototype for the callback function appears to be a fool's errand. */ void clib_bihash_foreach_key_value_pair (clib_bihash * h, void *callback, void *arg); /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */