summaryrefslogtreecommitdiffstats
path: root/src/vnet
AgeCommit message (Collapse)AuthorFilesLines
2019-09-07ip: fix udp/tcp checksum corner casesDave Barach2-5/+31
When checksumming chained buffers with odd lengths: insert a NULL byte, or the calculation fails. Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: John Lo <loj@cisco.com> Change-Id: I380f7c42897bdb28c8c29aa1c4cdaaa849cc9ecc
2019-09-06bonding: add weight support for active-backup modeSteven Luong4-82/+258
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
2019-09-06tap: revert clean-up when linux will delete the tap interfaceMohsin Kazmi2-43/+0
Type: fix Ticket: VPP-1766 revert e4ac48e792f4eebfce296cfde844ee73b1abd62f Change-Id: I03feea4008a47859d570ad8d1d08ff3f30d139ef Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> (cherry picked from commit 623a1b7053424b539a51faf866ab839d3da3f45b)
2019-09-04bfd: API cleanupJakub Grajciar2-84/+66
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I4b91ebe8aadbec8b95716ed1cde4b0a13eee3a3f Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-09-04stats: add /if/<n>/<n>/state for lacp interface stateSteven Luong2-2/+31
Add /if/lacp/<bond-sw_if_index>/<slave-sw_if_index>/state <bond-sw_if_index> is a vector of the bond sw_if_index <slave-sw_if_index> is a vector of the slave sw_if_index Content is the integer value of the lacp actor state. The state is actually a bitfield as described in the lacp protocol spec. Type: feature Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: Ic6eca8ce2a1acd2d858e4e50b7eac1d000ea08e5 Signed-off-by: Ole Troan <ot@cisco.com>
2019-09-04session: improve cliFlorin Coras6-145/+345
Type: feature Allow session cli filtering based on thread index, transport protocol, session state and range of session pool indices. For instance show session thread 1 proto tcp state ready range 0 20 verbose Shows the session ids for the first 20 tcp sessions in thread 1 that are in ready state. To avoid excessive output that could reasult in the worker barrier being held by the main thread for long periods of time, the session cli will only output: - session ids (verbose == 1) for a maximum of 50 sessions / worker - verbose > 1 details for a maximum of 10 sessions Change-Id: I2cfb351b548e2e0a1d5b4345810be613e2917d17 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-09-04tcp: cc algos handle cwnd on congestion signalFlorin Coras3-12/+11
Type: refactor Change-Id: I15b10a22d0d0b83075a0eef5ef8c09cf76989866 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-09-04ethernet: move dmac filtering to inline functionMatthew Smith1-56/+63
In eth_input_process_frame(), destination MAC addresses are compared to the interface hardware address in a loop. Move this to a separate inline function to facilitate making changes to the filtering logic more cleanly. Type: refactor Change-Id: I0978f01667e78af5214dbbc9ba223f5b84ce6b7e Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2019-09-04session: avoid bihash list for session tablesFlorin Coras1-12/+38
Type: fix Change-Id: I1dbc822061f43fcc25dfa5d1728f5c7575139f45 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-09-03ethernet: fix dmac check avx2 loop conditionMatthew Smith1-1/+1
In eth_input_process_frame(), a loop which checks the destination MAC address of received packets had a different condition for avx2 than it did for the non-avx2 version of the loop. It could result in one unnecessary execution of the loop body after all packets had been processed. Type: fix Fixes: 8d6f34e2b1cbfde5702e88686631527d5e1e10a0 Change-Id: Ib673f45917a0dea461987fdc8f0ca318b749fb1a Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2019-09-03api: enforce vla is last and fixed string typeOle Troan4-25/+21
Enforce that variable length fields are the last element of API messages. Add a 'fixed' version of string type, since dealing with multiple variable length strings turned out too painful for the C language bindings. The string type is now: { string name[64]; // NUL terminated C-string. Essentially decays to u8 name[64] string name[]; // Variable length string with embedded len field (vl_api_string_t) }; The latter notation could be made available to other types as well. e.g. { vl_api_address_t addresses[]; } instead of { u32 n_addr; vl_api_address_t addresses[n_addr]; }; Type: fix Change-Id: I18fa17ef47227633752ab50453e8d20a652a9f9b Signed-off-by: Ole Troan <ot@cisco.com>
2019-09-03tap: fix tap interface not working on Arm issueLijian.Zhang1-1/+6
The VPP code tries to set all userspace memory in the table via IOCTL to VHOST_SET_MEM_TABLE. But on aarch64, the userspace address range is larger (48 bits) than that on x86 (47 bits). Below is an segment from /proc/[vpp]/maps. fffb41200000-fffb43a00000 rw-s 00000000 00:0e 532232 /anon_hugepage (deleted) Instead of setting all userspace memory space to vhost-net, will only set the address space reserved by pmalloc module during initialization. Type: fix Change-Id: I91cb35e990869b42094cf2cd0512593733d33677 Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com> Reviewed-by: Steve Capper <Steve.Capper@arm.com>
2019-09-03tcp: send rwnd update only if wnd is large enoughFlorin Coras3-7/+15
Type: feature Change-Id: I3e97e05a31806afb6b2e84ecf05fb96d285db92e Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-09-02tap: interface rx counter not increment correctSteven Luong1-1/+1
vlib_increment_combined_counter takes sw_if_index, not hw_if_index. Using hw_if_index may work as long as there is no subinterface created to cause hw_if_index and sw_if_index to differ. Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I6db042186eeeacf32250f7ef261af8cd6f5ce56e
2019-09-02ipsec ip tcp l2: multiarch nodes cannot be declared as staticDamjan Marion8-15/+15
Credits to ray.kinsella@intel.com who spotted the issue and identified root cause. Type: fix Change-Id: I4afe74c47769484309f6aebca2de56ad32c8041f Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-08-31tcp: fix rx min/max fifo size parsingFlorin Coras1-13/+14
Type: fix Change-Id: Iff4a13da654dbdf7f08bb6d0743b466a1e6be01b Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-30session: move svm_fifo_clear_deq_ntf to before calling the app callbackVladimir Kropylev1-2/+2
Type: fix in case the app requests another dequeue notification, it should not be cleared Change-Id: I7e94e8e30ef098f87f5e7f4880af276970ee5b37 Signed-off-by: Vladimir Kropylev <vladimir.kropylev@enea.com>
2019-08-30devices: fix issue of per_interface_next_indexMichael Yu1-3/+4
Per interface, next hop graph node can be customized with vnet_hw_interface_rx_redirect_to_node function, but it doesn't work well for af-packet type interface. In current implementation, with function af_packet_set_interface_next_node invoked next hop graph node index can be set to apif->per_interface_next_index, but it's not set to next0 properly for packet processing in af_packet_device_input_fn. Type: fix Signed-off-by: Michael Yu <michael.a.yu@nokia-sbell.com> Change-Id: I8e132ddd1c3c01b6f476de78546d4a9389b3ff87 Signed-off-by: Michael Yu <michael.a.yu@nokia-sbell.com>
2019-08-30tcp: force zero window on full rx fifoFlorin Coras1-1/+4
Type: feature Change-Id: I7c5684a9f88e56fd62d83a59c14c4e4a6f096b89 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-30tcp: improve mss computationFlorin Coras3-43/+48
Type: fix Use different mss for v4 and v6 packets. Change-Id: Ifcd322c1fd74f749a42bae671dd6cfed8c32b150 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-30tcp: track zero rwnd errorsFlorin Coras2-1/+9
Type: feature Distinguish between rcv window errors and errors after we advertised a zero rcv window, i.e., potential window probes. Change-Id: I6cb453c7aaae456c0a05a8328cfaa55eaca10bf7 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-30session : make sure session layer is enabled when cli operate the sessions.Guanghua Zhang1-0/+4
Type: fix show session rules tcp vpp/src/vnet/session/application_namespace.c:34 (app_namespace_get) assertion `! pool_is_free (app_namespace_pool, _e)' fails Thread 1 "vpp_main" received signal SIGABRT, Aborted. Signed-off-by: Guanghua Zhang <ghzhang@fiberhome.com> Change-Id: I3430339a598a92d0a38826471adeb4547b0b7df4
2019-08-29ip: remove unused function parameterSimon Zhang6-17/+12
Type: refactor Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com> Change-Id: I8674ff5f6f6336b256b7df8187afbb36ddef71fb
2019-08-29svm: fix fifo hdr freelist allocationFlorin Coras1-0/+2
Type: fix Change-Id: Ia362ad821db1fd506e973e1844cc3ec74703cc17 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-28bier: API cleanupJakub Grajciar1-7/+7
Use consistent API types. Type: fix Change-Id: I416171c729193e64a68e85a3f1f25d03a9a559d1 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-08-28session: fix unbind coverity warningFlorin Coras1-0/+7
Type:fix Change-Id: If4fce6bd9b06ed545d72df847afd6a74cdefe042 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-27ipsec: Add 'detail' option to 'sh ipsec sa'Neale Ranns1-4/+8
Type: feature with detail option prints all details for all SAs Change-Id: Ic3c423c085dfc849cf9c3e18a6f624b82150d961 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-08-27interface: Remove residual dpdk bonding codeSteven Luong5-18/+4
dpdk bonding code was removed in 19.08. However, there are still references to VNET_SW_INTERFACE_FLAG_BOND_SLAVE which was set by the already removed code. Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I949a7281e6273f2733dd7532cc4a3bb4f3ce30de
2019-08-27session: move ctrl messages from bapi to mqFlorin Coras9-106/+675
Type:refactor Moves connect, disconnect, bind, unbind and app detach to message queue from binary api. Simplifies app/vcl interaction with the session layer since all session control messages are now handled over the mq. Add/del segment messages require internal C api changes which affect all builtin applications. They'll be moved in a different patch and might not be back portable to 19.08. Change-Id: I93f6d18e551b024effa75d47f5ff25f23ba8aff5 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-27ipsec: Fix NULL encryption algorithmNeale Ranns2-1/+9
Type: fix Ticket: VPP-1756 the block-size was set to 0 resulting in incorrect placement of the ESP footer. add tests for NULL encrypt + integ. Change-Id: I8ab3afda8e68f9ff649540cba3f2cac68f12bbba Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-08-27ip: reassembly: remove unnecessary codeKlement Sekera2-6/+0
Type: refactor Change-Id: I30cb324006c3c6ab88d01c044cf80fab3a34f13a Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-08-26gso: fix segmentation when gso_size greater than vlib buffer sizeMohsin Kazmi1-1/+4
Type: fix Ticket: VPP-1751 Change-Id: I5ffb078492adc97374290de404f2ec0102b75184 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-08-26ip: ip6_preflen_to_mask incorrect result for prefix len > 64Andrew Yourtchenko1-0/+1
The as_u64[0] in the result was not correctly filled in for longer prefix lengths. Type: fix Fixes: 1c7104514c Change-Id: I871772c618475396d1c1c4c699ff77e35097f07e Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-08-23tcp: fix byte tracker samples flushFlorin Coras1-0/+1
Type: fix Change-Id: I3b4cb8fc17387693d6ad6cdef004ca99cd56bc23 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-22dns: make the dns name resolver a pluginDave Barach9-4464/+0
Type: refactor Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I823c2cd307a4613653a2d20f564dda062d4da31b
2019-08-22ip: fix merge issueKlement Sekera1-2/+0
Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: Idd64b0b3eedb7179f6d316b66cea8160ad577990 Type: fix Fixes: 630ab5846bceddf8d663e9f488a2dc0378949827 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-08-22sr: fix sr_set_encap_source replyVratko Polak1-1/+1
Can we get a reply macro that would avoid such copypaste errors? Type: fix Change-Id: I753efb1d82fced668c27f2e44b0318bfd31c0a23 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2019-08-21tcp: add option for always on event loggingFlorin Coras7-184/+370
Type: feature Add option to always compile in debugging infra. Debug verbosity can be controlled via configuration updatable via cli. Compile time inclusion and configuration of event logging verbosity is still available in order to minimize event logging impact. Change-Id: I9d946efe9fa4204fdace1adb1d6588c97b5ae758 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-21dns: add basic functional "make test" caseDave Barach1-0/+4
Type: test Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I88e93b510d8d4f7b59f3e630539dc7e0264afa47
2019-08-21tcp: default to debug disabledFlorin Coras1-1/+1
Type:fix Change-Id: Ib5c33f0bdb3a8b1c2585135fcc8c07b151e47df3 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-20vppapigen: remove support for legacy typedefsPaul Vinciguerra12-45/+32
vppapigen has remapped legacy to typedefs behind the scenes for some time now. - update .api files to use new style typedefs. - issue error on 'typeonly define' in .api files - remove unneeded macros redefining vl_noop_handler Type: refactor Change-Id: I7a8c4a6dafacee6a131f95cd0e9b03a8c60dea8b Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-08-20ip: reassembly: send packet out on correct workerKlement Sekera2-92/+287
Note which worker received fragment with offset zero and use this worker to send out the reassembled packet. Type: fix Change-Id: I1d3cee16788db3b230682525239c0100d51dc380 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-08-20fix pcap_write functionJack Xu3-1/+8
when use pcap cli to capture pcakets into two files rx01.pcap && rx02.pcap, the first time: 1)pcap rx trace on max 100 intfc any file rx01.pcap 2)......the process of capture data to buffer...... 3)pcap rx trace off the second time: 4)pcap rx trace on max 100 intfc any file rx02.pcap 5)......the process of capture data to buffer...... 6)pcap rx trace off the pcap_write function bug in this two lines pm->n_packets_captured = 0; if (pm->n_packets_captured >= pm->n_packets_to_capture) referring to calling pcap_close() will result in that the twice pcap cli both writes the packets into rx01.pcap, but nothing into rx02.pcap. Beside, the rx02.pcap file will not be created. solution: separate the pcap_close() out of pcap_write() Change-Id: Iedeb46f9cf0a4cb12449fd75a4014f95f3bb3fa8 Signed-off-by: Jack Xu <jack.c.xu@ericsson.com>
2019-08-20api: Cleanup APIs interface.apiJakub Grajciar5-188/+256
Use of consistent API types for interface.api Type: fix Change-Id: I88206d7d0907cffd564031f73c9a996df2e5e21a Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-08-20tcp: forward conn resets through tcp-outputFlorin Coras1-32/+20
Type: refactor Change-Id: I5718853d89ebeae9d66be975a803a3674bec5986 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-19dns: handle multiple replies for single requestsDave Barach3-59/+121
The world is a mess. A single DNS request may yield multiple, subtly different responses; all with the same DNS protocol-level ID. Last response wins in terms of what ends up in the cache. First response wins in terms of the response sent to the client. Hard to do otherwise since we have no clue that more than one answer will be forthcoming. Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I3175a40eb1fea237048d16b852a430f5ab51eaef
2019-08-19ip: leverage existing vlib_buffer_advanceZhiyong Yang1-6/+3
The function ip4_rewrite_inline_with_gso can leverage the existing vlib_buffer_advance to simplify code. Type: fix Change-Id: I25d943dc78aba2f67654385cf3f693eb01e0210e Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
2019-08-19devices: skip checksum calculation if guest supports checksum offloadSteven Luong1-3/+7
Set VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD for the interface to skip checksum calculation if guest supports checksum offload. Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: Ie933c3462394f07580ef7f2bec1d2eb3b075bd0c
2019-08-19session: add explicit reset apiFlorin Coras6-6/+72
Type: feature This can be used to forcefully close a session. It's only available to builtin applications for now. Transports must support the reset api otherwise normal close is used. Change-Id: I5e6d681cbc4c8045385e293e0e9d86fa2bf45849 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-19tcp: set cc_algo on connection allocFlorin Coras3-6/+19
Type: feature Change-Id: Ie00329b11e26cab5db64b9c006171d283854c8ef Signed-off-by: Florin Coras <fcoras@cisco.com>