aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp
AgeCommit message (Collapse)AuthorFilesLines
2021-04-18vppinfra: remove linux/syscall.hDamjan Marion1-2/+0
For portabiliy reasons it is better to have all wrapped in clib code. I.e. instead of using getcpu() we have clib_get_current_numa_node () and clib_get_current_cpu_id(). Type: refactor Change-Id: I29b52d7f29bc7f93873402c4070561f564b71c63 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-26vlib: split vlib_main_t into global and per-threadDamjan Marion4-12/+4
Type: refactor Change-Id: I8b273bc3bf16aa360f031f1b2692f766e5fc4613 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-26vlib: introduce vlib_get_main_by_index(), vlib_get_n_threads()Damjan Marion2-3/+3
Type: improvement Change-Id: If3da7d4338470912f37ff1794620418d928fb77f Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-11misc: remove cop API support (part 1)Dave Barach1-35/+0
API marked for deprecation last year due to non-inclusive language. Last supported release: 21.01. See the "adl" plugin. Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I931e58ced9cc8403ca5b23fd6b07e50d0ff7306b
2021-02-22api: fix memory leak in vl_api_cli_inband_t_handlerAndrew Yourtchenko1-0/+1
I noticed the memory leak while sending a lot of cli_inband APIs: DBGvpp# memory-trace on main-heap ... send a lot of API cli_inband ... DBGvpp# show memory main-heap Thread 0 vpp_main base 0x7f85c8302000, size 1g, locked, unmap-on-destroy, name 'main heap' page stats: page-size 4K, total 262144, mapped 33129, not-mapped 229015 numa 0: 33129 pages, 129.41m bytes total: 1023.99M, used: 125.78M, free: 898.22M, trimmable: 897.59M Bytes Count Sample Traceback 9751632 145034 0x7f85d01696e8 clib_mem_alloc_aligned_at_offset + 0x80 vec_resize_allocate_memory + 0xa8 _vec_resize_inline + 0x240 va_unformat + 0xe4 unformat + 0x159 vlib_cli_dispatch_sub_commands + 0x11e vlib_cli_input + 0x8f vl_api_cli_inband_t_handler + 0xd9 vl_msg_api_handler_with_vm_node + 0x488 void_mem_api_handle_msg_i + 0x6f vl_mem_api_handle_msg_main + 0x38 vl_api_clnt_process + 0x28d 9723904 145034 0x7f85cd677238 clib_mem_alloc_aligned_at_offset + 0x80 vec_resize_allocate_memory + 0xa8 _vec_resize_inline + 0x240 unformat_init_string + 0x10d vl_api_cli_inband_t_handler + 0xc1 vl_msg_api_handler_with_vm_node + 0x488 void_mem_api_handle_msg_i + 0x6f vl_mem_api_handle_msg_main + 0x38 vl_api_clnt_process + 0x28d vlib_process_bootstrap + 0x5d 0x7f8608b0e038 290077 total traced objects Solution: free the input data structure. Type: fix Change-Id: I42de5572e8760237e793a53c1a94bce65a4ac5fa Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2021-02-16stats: coverity errors leaking fdOle Troan1-1/+4
Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I21368e37d70c5a64babd904bcf5f79339a5ab064 Signed-off-by: Ole Troan <ot@cisco.com>
2021-02-12policer: remove SSE2 prefixBrian Russell1-13/+13
The policer code uses a naming convention of prefixing a lot of its definitions with "SSE2" when in fact there is nothing SSE2 specific about them. This is confusing so remove the prefix. Unfortunately it has to stay in the API definitions for backward compatibility. Type: improvement Signed-off-by: Brian Russell <brian@graphiant.com> Change-Id: I59a7df9fd5ded2575f2e587b2768a025a213b07c
2021-02-11policer: use ip dscpBrian Russell1-6/+4
Use the common IP definitions of DSCP rather than duplicating in the policer code. Type: improvement Signed-off-by: Brian Russell <brian@graphiant.com> Change-Id: Iff4bc789356edc290b9c31eca33e93cf5b6211bf
2021-01-08vhost: Add event index for interrupt notification to driverSteven Luong1-0/+53
VPP only supports a poor man's approach for interrupt notification to the driver. It uses a simple binary flag for "interrupt needed" or "interrupt not needed". Most drivers support more sophisticated event index already. This feature is to add the long due missing feature and make it configurable, off by default. Type: feature Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I68dab7dd07045cafb49af97b7f70db9b8131ae03
2021-01-07ipsec: Deprecated the old IPsec Tunnel interfaceNeale Ranns1-43/+0
Type: fix it's been 2 releases since it was marked deprecated. Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: I0eba7ed607826ed0d00e7d2d8f9b27d09e8e9a6e
2020-12-14misc: refactor clib_bitmap_foreach macroDamjan Marion1-3/+3
Type: refactor Change-Id: I077110e1a422722e20aa546a6f3224c06ab0cde5 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-12-14misc: move to new pool_foreach macrosDamjan Marion2-4/+4
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-12-14api: add missing version infoPaul Vinciguerra1-0/+1
Type: fix Change-Id: I269214e3eae72e837f25ee61d714556d976d410f Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2020-12-08fib: Source Address SelectionNeale Ranns1-22/+0
Type: feature Use the FIB to provide SAS (in so far as it is today) - Use the glean adjacency as the record of the connected prefixes = there's a glean per-{interface, protocol, connected-prefix} - Keep the glean up to date with whatever the recieve host prefix is (since it can change) Signed-off-by: Neale Ranns <neale.ranns@cisco.com> Change-Id: I0f3dd1edb1f3fc965af1c7c586709028eb9cdeac
2020-12-04stats: fix coverity issuesAndrew Yourtchenko1-4/+3
Usage of the possibly negative value with subsequent check on it makes coverity very unhappy, so put the check before use. Change-Id: I731fbe6246f9e4212d546fd9277bc1ddcd3c2ec1 Type: fix Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-11-26gre: Move to new API generated types/messagesNeale Ranns1-42/+0
Type: improvement also clean up GRE includes across the code base. Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: I90928b0da3927b7ca1a23683aa80d4b53bbf63fd
2020-11-25api: vat2 and json autogeneration for api messagesOle Troan1-0/+7
VAT2: A completely auto-generated replacement of VAT. Reads input message in JSON from stdin and outputs received messages in JSON. A VAT2 plugin is automatically built for a .api file. There no longer a need for a separate _test.c. Example: vat2 show_version {} { "_msgname": "show_version_reply", "retval": 0, "program": "vpe", "version": "21.01-rc0~411-gf6eb348a6", "build_date": "2020-11-19T09:49:25", "build_directory": "/vpp/autogen3" } vat2 sw_interface_dump '{"sw_if_index": -1, "name_filter_valid": 0, "name_filter": ""}' [{ "_msgname": "sw_interface_details", "sw_if_index": 0, "sup_sw_if_index": 0, "l2_address": "00:00:00:00:00:00", "flags": "Invalid ENUM", "type": "IF_API_TYPE_HARDWARE", "link_duplex": "LINK_DUPLEX_API_UNKNOWN", "link_speed": 0, "link_mtu": 0, "mtu": [0, 0, 0, 0], "sub_id": 0, "sub_number_of_tags": 0, "sub_outer_vlan_id": 0, "sub_inner_vlan_id": 0, "sub_if_flags": "Invalid ENUM", "vtr_op": 0, "vtr_push_dot1q": 0, "vtr_tag1": 0, "vtr_tag2": 0, "outer_tag": 0, "b_dmac": "00:00:00:00:00:00", "b_smac": "00:00:00:00:00:00", "b_vlanid": 0, "i_sid": 0, "interface_name": "local0", "interface_dev_type": "local", "tag": "" }] This is the first phase and vat2 is not integrated in packaging yet. Type: feature Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: Ib45ddeafb180ea7da8c5dc274a9274d7a4edc876 Signed-off-by: Ole Troan <ot@cisco.com>
2020-11-24buffers: add page-size configNathan Skrzypczak1-0/+5
Type: feature Add a `buffers {page-size}` parameter to specify page size for buffers. This also fixes an issue with the parsing in unformat_log2_page_size. Change-Id: I7d7b1fa0bb7febaa7509cf2c625882f07eeafaad Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-11-10vpp: use vpp heap for libcBenoît Ganne3-0/+150
This makes libc use vpp main heap instead of the default libc heap. This gives better visibility (accounting, tracing) on allocations happening in external libraries called from vpp (eg. OpenSSL). Type: feature Change-Id: I5d8a673472145a4e090bedb443b8c58a967d1cca Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-11-04vlib: add postmortem pcap dispatch traceDave Barach1-3/+3
Inspired by a real-life conundrum: scenario X involves a vpp crash in ip4-load-balance because vnet_buffer(b)->ip.adj_index[VLIB_TX] is (still) set to ~0. The problem takes most of a day to occur, and we need to see the broken packet's graph trajectory, metadata, etc. to understand the problem. Fix a signed/unsigned ASSERT bug in vlib_get_trace_count(). Rename elog_post_mortem_dump() -> vlib_post_mortem_dump(), add dispatch trace post-mortem dump. Add FILTER_FLAG_POST_MORTEM so we can (putatively) capture a ludicrous number of buffer traces, without actually using more than one dispatch cycle's worth of memory. Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: If093202ef071df46e290370bd9b33bf6560d30e6
2020-10-21vlib: per-class logging configuration in startup.confDamjan Marion1-0/+2
logging { class avf { rate-limit 200 level debug syslog-level debug } class dpdk/cryptodev { rate-limit 200 level disabled syslog-level disabled } } Type: improvement Change-Id: Iebe49b3ed4dfbfd589e80fcd2f9a63a8fe66b83b Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-21stats: missing dimension in stat_set_simple_counterOle Troan1-1/+2
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: 7d29e320fb2855a1ddb7a6af09078b8ed636de01 Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I94f124ec71d98218c4eda5d124ac5594743d93d6
2020-10-21vlib: print logs to stderr if interactive or nosyslog setDamjan Marion1-0/+17
If VPP is started in interactive mode, instead of sending logs to syslog server we print them directly to stderr. Output is colorized, but that can be turned off with unix { nocolor } Type: improvement Change-Id: I9a0f0803e4cba2849a6efa0b6a86b9614ed33ced Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-10misc: clib_unix_warning usage errorjiangxiaoming1-1/+1
Type: fix Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com> Change-Id: Ibc4e961388d0976b55b9b936d6a37d36cddab5fe
2020-10-05ipsec: Use bihash for tunnel lookupNeale Ranns1-0/+12
Type: improvement Change-Id: I0c82722dfce990345fe6eeecdb335678543367e0 Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-09-30vpp: update 'show bihash' commandDamjan Marion1-51/+1
Type: improvement Change-Id: I6d00ba840d2168af0658f97c45a42d39be7cbbad Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-28vppinfra: don't call dlmalloc API directly from the codeDamjan Marion6-12/+7
- it is confusing from end consumer perspective that some thing is somewhere called heap and somewhere mspace - this is base for additional work where heap pointer is not the same thing like mspace Type: improvement Change-Id: I644d5a0de17690d65d164d8cec3c5654571629ef Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-28virtio: add packet buffering on txMohsin Kazmi1-0/+2
Type: feature This patch adds packet buffering on tx for slow backend which have some jitter/delays in freeing the vrings. There are some limitations to the current design: 1) It only works in poll mode. 2) Atleast 1 rx queue of an interface (with buffering enabled) should be placed on each worker and main thread. Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ib93c350298b228e80426e58ac77f3bbc93b8be27
2020-09-22lisp: Move to pluginNeale Ranns1-405/+7
Type: refactor Change-Id: I54df533a8f863c4e49742903cf2457f18b4fc506 Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-09-21geneve: Move to pluginNeale Ranns1-1/+0
Type: refactor Change-Id: I613bf4d6517591351b212bfe6c8d93abf235f5dc Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-09-21misc: Move l2tp to pluginNeale Ranns1-100/+0
Type: refactor Change-Id: Ifb36eeb146b87e9e305881429d32d6879e955e1e Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-09-21lldp: Move to pluginNeale Ranns1-43/+0
Type: refactor Change-Id: Ifd770ff4850e63474bf4682ad463021b03786b4b Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-09-18vat: add infrastructure to align vnet test code and plugin test codeOle Troan3-70/+24
Split vat/api_format.c also for VNET features. Use auto-generated VAT test code and support dynamic message ID allocation as for plugins. The arp and geneve features as Guinea pigs. Type: improvement Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I461591496766bdf10c5f950fd30f1a0ae05909da Signed-off-by: Ole Troan <ot@cisco.com>
2020-09-18vpp: make main heap page size configurable from startup.confDamjan Marion2-15/+68
Type: improvement Change-Id: I190c6896152c626aa7cb1055cfce5d9cfcd5b68b Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-17stats: configurable page sizeDamjan Marion3-13/+23
Type: improvement Change-Id: I9973bce20a0a2a8a7e227cf96518de5b79374425 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-16vpp: fix main heap initBenoît Ganne1-4/+1
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>
2020-09-14l2: allocate l2fib only when neededDamjan Marion1-0/+9
Currently l2 fib allocates 512MB hash table unconditionally on startup. This patch postpones table creation up to the point where first interface is put into l2 mode or mac entry is added. In addition it reduces default table size to 128MB and increases number of buckets 4 times. This default setting should be enough to keep 1M mac entries. Also, new startup.conf section is added which allows user to change memory and bucket size. .i.e: l2fib { table-size 512M num-buckets 524288 } Type: improvement Change-Id: I2a29209aa3545181f0087544c97a54d8157b6ec5 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-09interface: support configuring RSS steering queuesChenmin Sun1-0/+4
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-04vpp: Fix node APIsNathan Skrzypczak1-4/+4
Type: fix Change-Id: Ic6e2b7e05b50945a8e2222019c2942a6ee52e465 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-09-03api: fix ipsec custom_dump functionChristian Hopps1-8/+5
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-02bonding: add bond_create2 API to include gso optionSteven Luong1-0/+26
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-02virtio: add virtio 1.1 api flagsMohsin Kazmi1-0/+29
Type: feature Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I95d7fc1cc8db5199570c66535f45e867a7cae676
2020-09-02tap: add virtio 1.1 API flagMohsin Kazmi1-0/+4
Type: feature Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I3e00deb94943c545d1649865b2efdf7d51b90f4d
2020-08-25flow: add vnet/flow formal APIChenmin Sun1-1/+2
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-20tap: fix flags in custom-dumpMohsin Kazmi1-6/+6
Type: fix Change-Id: I4cd0b1855eab05344897686dc17b7df44de6c786 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-08-14gso: packet coalesce libraryMohsin Kazmi1-0/+16
Type: feature Change-Id: Ia19d3611e596d9ec47509889b34e8fe793a0ccc3 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-08-13stats: remove offsets on vpp sideOle Troan3-142/+31
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-06misc: harmonize namesDave Barach1-3/+3
Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ibad744788e200ce012ad88ff59c2c34920742454
2020-07-28bonding lacp: replace slave string with memberSteven Luong1-16/+18
- 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-21stats: memory leak in stat_validate_counter_vectorSteven Luong1-2/+10
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>