aboutsummaryrefslogtreecommitdiffstats
path: root/src/vat
AgeCommit message (Collapse)AuthorFilesLines
2020-04-28lisp: API cleanupJakub Grajciar1-313/+243
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: Ib7f73a0b6de188982a09040f7739dc46be3cb1de Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-04-27virtio: support virtio 1.1 packed ring in vhostSteven Luong1-2/+10
virtio 1.1 defines a number of new features. Packed ring is among the most notable and important one. It combines used, available, and descripptor rings into one. This patch provides experimental support for packed ring. To avoid regression, when packed ring is configured for the interface, it is branched to a separate RX and TX driver. Non packed ring should continue to perform as it was before. Packed ring is tested using qemu4.2 and ubuntu focal fossa (kernel 5.4.0-12) on the guess VM which supports packed ring. To configure VPP with packed ring, just add the optional keyword "packed" when creating the vhost interface. To bring up the guest VM with packed ring, add "packed=on" in the qemu launch command. To facilitate troubleshooting, also added "verbose" option in show vhost desc CLI to include displaying the indirect descriptors. Known qemu reconnect issue - If VPP is restarted, guest VMs also need to be restarted. The problem is kernel virtio-net-pci keeps track of the previous available and used indices. For virtio 1.0, these indices are in shared memory and qemu can easily copy them to pass to the backend for reconnect. For virio 1.1, these indices are no longer in shared memory. Qemu needs a new mechanism to retrieve them and it is not currently implemented. So when the protocol reconnects, qemu does not have the correct available and used indices to pass to the backend. As a result, after the reconnect, virtio-net-pci is reading the TX ring from the wrong position in the ring, not the same position which the backend is writing. Similar problem exists also in the RX. Type: feature Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I5afc50b0bafab5a1de7a6dd10f399db3fafd144c
2020-04-21vat: fix increment_address(...)Dave Barach1-2/+2
vl_api_address_t uses a packed enum for the address family, compare a->af directly with ADDRESS_IP4 / ADDRESS_IP6 instead of running a->af through clib_host_to_net_u32(...) before compare. Indirectly fixes api_ip_route_add_del(...) w/ count > 1. Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ib7f562ec9e92ee63e52a338d318fcf1ce6221755
2020-04-17vat: fix static analysis warningAndreas Schultz1-2/+1
replace hand crafted version with existing vector function Type: fix Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com> Change-Id: I94834852469ed316c7bdbd48bb7f479648b2c8e5
2020-04-14vat: fix socket connectionDave Barach1-0/+3
vat_socket_connect(...) needs to set the api main client index. The M2 helper macro needed to allocate a buffer of size sizeof(*mp) + n, not sizeof(*mp). Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I7abf35d2ba045d82765bd27f88899287fd351602
2020-04-07vat: fix vat strncpy stringop-overflowRay Kinsella1-2/+1
Fix GCC 9.0 barf on vat strncpy. Type: fix Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: I5e41225d6ac9673a9d953046720df55e7b69c479 Signed-off-by: Dave Barach <dave@barachs.net>
2020-04-06vat: fix static analysis warningDave Barach1-2/+3
Type: fix Ticket: VPP-1837 Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ia46f865082dcf0cf06af99a7c958c4a5b02193ce
2020-04-02ipsec: provide stat index in sa detailsMatthew Smith1-2/+3
Type: improvement When IPsec SAs are dumped, include the index that can be used to find byte & packet counters for the SA in the stat segment. Removed the field total_data_size from the details since it was not being populated and put the stat index field in its place. Change-Id: If73efc230542a11944551b6e710b57b575450da3 Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-04-02misc: fix static analysis warningsDave Barach1-1/+1
One actual bugfix. Type: fix Ticket: VPP-1837 Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Icef25167f97a70cc795c0a481174de319ed79ad5
2020-03-23sr: srv6 API cleanupJakub Grajciar1-10/+5
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I3c348ad2fca8bb3d9a246af7a2aa9dc9c33f57c3 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-03-21vlib: leave SIGPROF signal with its default handlerJieqiang Wang1-0/+1
When profiling VPP with MAP (a software profile suite on Arm CPUs, see details in https://www.arm.com/products/development-tools/server-and-hpc/forge/map) on Arm servers, VPP will receive SIGPROF signal because MAP uses SIGPROF signal to drive its sampler to do profiling on VPP. However, the default action of SIGPROF signal handler in VPP such as unix_signal_handler() is process termination. To profile VPP with MAP, the SIGPROF handler should be left as default, and MAP sampler will overwrite it with its own implementation. Type: feature Change-Id: Ie14e513d35ec27a66e95067689408bad8ed1ad6b Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
2020-03-19ip: change ip API enums address_family and ip_proto size to u8Jakub Grajciar1-1/+1
Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I73d27520726543d6375caad76a841339f68c3533 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-03-17ip: ip_address_t uses ip46_address_tNeale Ranns2-0/+533
Type: improvement type re-use. Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: Ic2a2e6babf9ae66a1e53aec53a6cd157e1893dc8
2020-03-16vxlan: vxlan/vxlan.api API cleanupJakub Grajciar1-13/+15
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I7f6f37ec6eed780322e2488d6eb0f5681945ba09 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-03-12policer: API cleanupJakub Grajciar1-24/+24
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: Ia14f33992353b419b70b55beed63ab8ed6a2e837 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-03-05session: API cleanupJakub Grajciar1-29/+47
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: Ib752a3425c076eb53bc5255a48039cbb74b1fcce Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-03-05tap: add support for persistanceMohsin Kazmi1-1/+5
Type: feature Change-Id: I775f53531972447ebae0d69b9e2dfeee84d115e5 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-03-04vxlan: vxlan-gpe/vxlan-gpe.cpi API cleanupJakub Grajciar1-66/+29
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: Ic428e35141724b47a944211b4d95c3e41796c81e Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-02-26vat: add ip api types parser definitionsJakub Grajciar4-1/+34
build vat with src/vnet/ip/ip_types_api.c Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: Iab0f18bf7a89cf9512beab0629bc3a349edec383 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-02-26lldp: API cleanupJakub Grajciar1-2/+2
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I2fe6b56dc0f224f438ed5f14c0f276d94afbaea8 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-02-26pg: API cleanupJakub Grajciar1-6/+2
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: Ibf693e4b178d2579bc3afb9653bffc07fbb7dd0a Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-02-26sr: API cleanupJakub Grajciar1-1/+1
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I6238ec79b916c23c07c3f7e2ac8e635f5a0d6112 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-02-26api: improve api string safetyJakub Grajciar1-12/+7
- Remove vl_api_from_api_string to prevent use of not nul-terminated strings. - Rename vl_api_from_api_to_vec -> vl_api_from_api_to_new_vec to imply a new vector is created. NOT nul terminated. - Add vl_api_from_api_to_new_c_string. Returns nul terminated string in a new vector. - Add vl_api_c_string_to_api_string. Convert nul terminated string to vl_api_string_t - Add vl_api_vec_to_api_string. Convert NON nul terminated vector to vl_api_string_t Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: Iadd59b612c0d960a34ad0dd07a9d17f56435c6ea Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-02-15tap: fix the default parameter for num_rx_queuesMohsin Kazmi1-31/+48
Type: fix Change-Id: I1a20fea56f1ba1fada7c7ce96ea333bf097b1273 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-01-30misc: deprecate netmap and ixge driversDamjan Marion1-101/+0
Both are out of sync for long time... Type: refactor Change-Id: I7de3170d35330fc172501d87655dfef91998b8fe Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-01-16misc: binary-api sw_interface_vhost_user_dump is brokenSteven Luong1-0/+1
Recent modificaton to vhost_user APIs for typing which added a sw_if_index filter to the API sw_interface_vhost_user_dump with the default value -1 to mean all interfaces. But the default is not set from api_format.c, causing the binary-api command for sw_interface_vhost_user_dump to display nothing. Also missing is the proper display on custom dump for the aformentioned API. Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I05546e2318165af7531977fbed66ea7224c4a7ce
2020-01-08tap: split gso and checksum offload functionalityMohsin Kazmi1-0/+2
Type: refactor Change-Id: I0d4b79ef384c11c841576d264bfd8ccb21783e10 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-01-08virtio: split gso and checksum offload functionalityMohsin Kazmi1-1/+5
Type: refactor Change-Id: I897e36bd5db593b417c2bac9f739bc51cf45bc08 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-01-03devices: virtio API cleanupJakub Grajciar1-3/+18
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I38a409af770c88c1eb2c68b24abef2a5a91e1b9a
2019-12-17ip: Protocol Independent IP NeighborsNeale Ranns1-869/+8
Type: feature - ip-neighbour: generic neighbour handling; APIs, DBs, event handling, aging - arp: ARP protocol implementation - ip6-nd; IPv6 neighbor discovery implementation; separate ND, MLD, RA - ip6-link; manage link-local addresses - l2-arp-term; events separated from IP neighbours, since they are not the same. vnet retains just enough education to perform ND/ARP packet construction. arp and ip6-nd to be moved to plugins soon. Change-Id: I88dedd0006b299344f4c7024a0aa5baa6b9a8bbe Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-12-11api: Use vl_msg_push/pop_heapNathan Skrzypczak1-15/+6
Type: refactor Change-Id: I0eb46676fc22ce6825b2d879498df344b5a855e8 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-12-11devices: vhost API cleanupJakub Grajciar1-3/+12
Use consistent API types. Type: fix Change-Id: I2dec594cb834a45004edc9ca58ad7c7b4bd7ff06 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-12-11devices: tap API cleanupJakub Grajciar1-13/+15
Use consistent API types. Type: fix Change-Id: I11cc7f6347b7a60e5fd41e54f0c7994e2d81199f Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-12-10api: multiple connections per processDave Barach2-6/+6
Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I2272521d6e69edcd385ef684af6dd4eea5eaa953
2019-12-04gre: Multi-point interfacesNeale Ranns1-6/+6
Type: feature Change-Id: I0129ad6ace44a50a8a3b26db8e445cd06b2b49e8 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-11-26fib: Table ReplaceNeale Ranns1-15/+78
Type: feature from the API doc, a table replace is: " The use-case is that, for some unspecified reason, the control plane has a very different set of entries it wants in the table than VPP currently has. The CP would thus like to 'replace' VPP's current table only by specifying what the new set of entries shall be, i.e. it is not going to delete anything that already eixts. the CP delcartes the start of this procedure with this begin_replace API Call, and when it has populated all the entries it wants, it calls the below end_replace API. From this point on it is of coursce free to add and delete entries as usual. The underlying mechanism by which VPP implements this replace is purposefully left unspecified. " In the FIB, the algorithm is implemented using mark and sweep. Algorithm goes: 1) replace_begin: this marks all the entries in that table as 'stale' 2) download all the entries that should be in this table - this clears the stale flag on those entries 3) signal the table converged: ip_table_replace_end - this removes all entries that are still stale this procedure can be used when an agent first connects to VPP, as an alternative to dump and diff state reconciliation. Change-Id: I168edec10cf7670866076b129ebfe6149ea8222e Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-11-19srv6-mobileTetsuya Murakami1-0/+1
Type: feature Plug-in for IPv6 Segment Routing Mobile This funcion was developed by Signed-off-by: Satoru Matsuchima <satoru.matsushima@gmail.com> Signed-off-by: Filip Varga <filipvarga89@gmail.com> Signed-off-by: Tetsuya Murakami <tetsuya.mrk@gmail.com> Signed-off-by: Tetsuya Murakami <tetsuya.mrk@gmail.com> Change-Id: Ie995adc73d8f8d444339aab71619c3599e69f12d Signed-off-by: Tetsuya Murakami <tetsuya.mrk@gmail.com>
2019-11-12ip: IP address and prefix types (moved from LISP)Neale Ranns1-3/+3
Type: refactor Change-Id: I2c6b59013bfd21136a2955442c779685f951932b Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-10-30l2: l2tp API cleanupJakub Grajciar1-6/+6
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I9015fc60e8d77e5d5ac36bf2862c1fe794addb81 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-10-22ip: ipfix-export API updateJakub Grajciar1-2/+3
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I5b03e5de111c3a3b8da4e9f02cba0aa99e3ee9f3
2019-10-14gso: Add gso feature arcMohsin Kazmi1-0/+43
Type: refactor Change-Id: Ib4a8e7e64093b2db1deda6663325080bc8337605 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-10-10geneve: API cleanupJakub Grajciar1-13/+24
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I1964e4f0afe6f030ae9c8e28fcba5fd81aa1f130
2019-10-09interface: dump the interface device typeMohsin Kazmi1-0/+2
Type: feature Change-Id: I22e2ef34631c9432311ff6457504e0649e0512b4 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-10-09interface: callback to manage extra MAC addressesMatthew Smith1-0/+52
Type: feature New callback vnet_hw_interface_add_del_mac_address(). Add or delete secondary MAC addresses on a hardware interface. This will allow packets to be processed which have a destination MAC address other than the primary programmed MAC address without needing to put the device into promiscuous mode. Change-Id: I6beecbcb8932fc1fe45b567f76fa3706feefae2c Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2019-10-07dhcp: Move to pluginNeale Ranns1-396/+0
Type: feature Change-Id: I3fe27a8ef577741d9a5c4f090ec91cf68fb44fe3 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-10-03dhcp: API cleanupJakub Grajciar1-10/+9
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: Ia63d920788add2584060a240321acced7a471640
2019-09-16api: autogenerate api trace print/endianOle Troan1-0/+2
In addition to the external vppapitrace tool, VPP itself supports dumping of API trace files. In two formats, "custom-dump" and "dump". "dump" gives a human friendly list, and "custom-dump" is meant to give a list of commands that can be fed to VAT. This patch only deals with "dump". Prior to this fix, auto-generation was only done for the basic types. This fix adds support for any type, including lists, and supports pretty-printing of enums, strings, IP addresses, MAC addresses and so on. Usage: api trace dump <api-trace-file> For example Change-Id: I4e485680e6dcfce7489299ae6cf31d835071ac40 ---------- trace 48 ----------- vl_api_sw_interface_set_flags_t: _vl_msg_id: 75 client_index: 0 context: 10 sw_if_index: 1 flags: IF_STATUS_API_FLAG_ADMIN_UP ---------- trace 49 ----------- vl_api_sw_interface_add_del_address_t: _vl_msg_id: 88 client_index: 0 context: 11 sw_if_index: 1 is_add: 1 del_all: 0 prefix: 172.16.1.1/24 ---------- trace 51 ----------- vl_api_cli_inband_t: _vl_msg_id: 819 client_index: 0 context: 13 cmd: packet-generator capture pg0 pcap /tmp/vpp-unittest-TestMAP-YhcmDX/pg0_out.pcap disable ---------- trace 58 ----------- vl_api_ip_neighbor_add_del_t: _vl_msg_id: 199 client_index: 0 context: 20 is_add: 1 neighbor: sw_if_index: 2 flags: IP_API_NEIGHBOR_FLAG_NONE mac_address: 0202.0000.ff02 ip_address: fd01:2::2 Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I5556d06008de2762e7c2d35a8b0963ae670b3db1 Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com>
2019-09-11bonding: API cleanupJakub Grajciar1-6/+6
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: Idbba4ab6a412b75338e3149e51476693f0862f16 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-09-11build: fix running error with vmxnet3_test_plugin.sojialv011-10/+4
vpp_api_test load vmxnet3_test_plugin.so error: "load_one_plugin:42:/vpp/lib/vpp_api_test_plugins/vmxnet3_test_plugin.so: undefined symbol: unformat_vlib_pci_addr" Type: fix Signed-off-by: Jianlin Lv <Jianlin.Lv@arm.com> Change-Id: I444aa05d0bc3c4f4f25082388243f1adb305dd0a
2019-09-06bonding: add weight support for active-backup modeSteven Luong1-6/+56
Not all interfaces have the same characteristics within the bonding group. For active-backup mode, we should do our best to select the slave that performs the best as the primary slave. We already did that by preferring the slave that is local numa. Sometimes, this is not enough. For example, when all are local numas, the selection is arbitrary. Some slave interfaces may have higher speed or better qos than the others. But this is hard to infer. One rule does not fit all. So we let the operator to optionally specify the weight for each slave interface. Our primary slave selection rule is now 1. biggest weight 2. is local numa 3. current primary slave (to avoid churn) 4. lowest sw_if_index (for deterministic behavior) This selection rule only applies to active-backup mode which only one slave is used for forwarding traffic until it becomes unreachable. At that time, the next "best" slave candidate is automatically promoted. The slaves are sorted according to the preference rule when they are up. So there is no need to find the next best candidate when the primary slave goes down. Another good thing about this rule is when the down slave comes back up, it is selected as the primary slave again unless there is indeed a "better" slave than this down slave that were added during that period. To set the weight for the slave interface, do this after the interface is enslaved set interface bond <interface-name> weight <value> Type: feature Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I59ced6d20ce1dec532e667dbe1afd1b4243e04f9