aboutsummaryrefslogtreecommitdiffstats
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.
span>->u.mpls.fesm_lfes[eos] = FIB_NODE_INDEX_INVALID; } } /** * Source deinitialisation Function */ static void fib_entry_src_mpls_deinit (fib_entry_src_t *src) { } static void fib_entry_src_mpls_remove (fib_entry_src_t *src) { src->fes_pl = FIB_NODE_INDEX_INVALID; src->u.mpls.fesm_label = MPLS_LABEL_INVALID; } static void fib_entry_src_mpls_add (fib_entry_src_t *src, const fib_entry_t *entry, fib_entry_flag_t flags, dpo_proto_t proto, const dpo_id_t *dpo) { src->fes_pl = fib_path_list_create_special(proto, FIB_PATH_LIST_FLAG_DROP, drop_dpo_get(proto)); } static void fib_entry_src_mpls_set_data (fib_entry_src_t *src, const fib_entry_t *entry, const void *data) { fib_protocol_t payload_proto; fib_node_index_t fei; mpls_label_t label; mpls_eos_bit_t eos; /* * post MPLS table alloc and the possible rea-alloc of fib entrys * the entry pointer will no longer be valid. so save its index */ payload_proto = entry->fe_prefix.fp_proto; fei = fib_entry_get_index(entry); label = *(mpls_label_t*)data; if (MPLS_LABEL_INVALID == label) { /* * removing the local label */ FOR_EACH_MPLS_EOS_BIT(eos) { fib_table_entry_delete_index(src->u.mpls.fesm_lfes[eos], FIB_SOURCE_SPECIAL); } fib_table_unlock(MPLS_FIB_DEFAULT_TABLE_ID, FIB_PROTOCOL_MPLS, FIB_SOURCE_MPLS); src->u.mpls.fesm_label = label; } else { fib_prefix_t prefix = { .fp_proto = FIB_PROTOCOL_MPLS, .fp_label = label, }; fib_node_index_t fib_index; dpo_id_t dpo = DPO_INVALID; /* * adding a new local label. make sure the MPLS fib exists. */ if (MPLS_LABEL_INVALID == src->u.mpls.fesm_label) { fib_index = fib_table_find_or_create_and_lock(FIB_PROTOCOL_MPLS, MPLS_FIB_DEFAULT_TABLE_ID, FIB_SOURCE_MPLS); } else { fib_index = mpls_fib_index_from_table_id(MPLS_FIB_DEFAULT_TABLE_ID); /* * if this is a change in label, remove the old one first */ if (src->u.mpls.fesm_label != label) { FOR_EACH_MPLS_EOS_BIT(eos) { ASSERT(FIB_NODE_INDEX_INVALID != src->u.mpls.fesm_lfes[eos]); fib_table_entry_delete_index(src->u.mpls.fesm_lfes[eos], FIB_SOURCE_SPECIAL); } } } src->u.mpls.fesm_label = label; FOR_EACH_MPLS_EOS_BIT(eos) { prefix.fp_eos = eos; prefix.fp_payload_proto = fib_proto_to_dpo(payload_proto); fib_entry_contribute_forwarding(fei, (eos ? FIB_FORW_CHAIN_TYPE_MPLS_EOS : FIB_FORW_CHAIN_TYPE_MPLS_NON_EOS), &dpo); src->u.mpls.fesm_lfes[eos] = fib_table_entry_special_dpo_add(fib_index, &prefix, FIB_SOURCE_SPECIAL, FIB_ENTRY_FLAG_EXCLUSIVE, &dpo); dpo_reset(&dpo); } } } static const void * fib_entry_src_mpls_get_data (fib_entry_src_t *src, const fib_entry_t *entry) { return (&(src->u.mpls.fesm_label)); } static u8* fib_entry_src_mpls_format (fib_entry_src_t *src, u8* s) { return (format(s, " local-label:%d", src->u.mpls.fesm_label)); } const static fib_entry_src_vft_t mpls_src_vft = { .fesv_init = fib_entry_src_mpls_init, .fesv_deinit = fib_entry_src_mpls_deinit, .fesv_add = fib_entry_src_mpls_add, .fesv_remove = fib_entry_src_mpls_remove, .fesv_format = fib_entry_src_mpls_format, .fesv_set_data = fib_entry_src_mpls_set_data, .fesv_get_data = fib_entry_src_mpls_get_data, /* * .fesv_fwd_update = fib_entry_src_mpls_fwd_update, * When the forwarding for the IP entry is updated, any MPLS chains * it has created are also updated. Since the MPLS entry will have already * installed that chain/load-balance there is no need to update the netry * FIXME: later: propagate any walk to the children of the MPLS entry. for SR */ }; void fib_entry_src_mpls_register (void) { fib_entry_src_behaviour_register(FIB_SOURCE_BH_MPLS, &mpls_src_vft); }