aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp
AgeCommit message (Collapse)AuthorFilesLines
2021-11-10ip: always set ip rx_sw_if_indexFlorin Coras1-4/+1
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I43f6bfa028ee37227f27a2fe0303662bf2631b10
2021-11-08tcp: refactor reset nodeFlorin Coras1-49/+71
Use vectorized buffer translate function and refactor tracing. Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I5a014cea1a753eb10a564ac316c1727a18f884ff
2021-11-06tcp: fix reset with packet ack numberFlorin Coras1-0/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I35c1fc75df065398821cc275e853a3caa9db94c2
2021-11-06tcp: in place tcp header for buffer resetsFlorin Coras1-2/+2
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2a5de36175bca1181ffd4a1865d41f0a1f6bc035
2021-11-03tcp: make buffer reset function publicFlorin Coras2-32/+28
Also does a bit of code cleanup. Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ifbff1e03a2e1fdca98925fdd3db7eb230ff24a37
2021-11-02tcp: fix uninitializad valueDamjan Marion1-1/+1
May not be valid error but gcc-11 complains. Type: fix Change-Id: I207b8b4966c5eadd534495e29c873663249a377f Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-10-27tcp: fix use of invalid local sw_if_indexFlorin Coras1-1/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id58ac44d45fb8b8a0d803f02e0242ec6f4b3db05
2021-10-25tcp: fix: TCP timewait port reuse rfc complianceMichal Kalderon2-4/+84
This patch provides a fix for early-kill of timewait sockets that is based on rfc's 1122, 6191. The following commits provided a solution for port re-use. However, they are not fully compliant with rfc 1122 4.2.2.13 ( Closing a connection ) and rfc 6191 (Reducing the TIME-WAIT State Using TCP Timestamps) commit b092b77cf238ba ("tcp: Enable TCP timewait port use") introduced a significant improvement by enabling TCP timewait port re-use. commit ee1cb469b2dd ("tcp: fix port reuse with multiple listeners") fixed usage of the wrong value for connection_index when searching for a listener, by storing the state in tcp.flags. Implementation details: When a SYN is received during time-wait state, the code checks whether all the requirements for accepting the SYN packet are met. If they aren't, the SYN can't be accepted and the packet is dropped, otherwise, connection is deleted and a new connection with same port is opened. Type: fix Signed-off-by: Ofer Heifetz <oferh@marvell.com> Signed-off-by: Yuval Caduri <cyuval@marvell.com> Signed-off-by: Michal Kalderon <mkalderon@marvell.com> Change-Id: I38a33c6e321c760d45ebec9154399e1c90dd0250
2021-10-21ip: Add ip46-local node for local swif[rx]Nathan Skrzypczak1-0/+7
Type: improvement This adds a new ip[46]-receive node, sibling of ip[46]-local. Its goal is to set vnet_buffer (b)->ip.rx_sw_if_index to the sw_if_index of the local interface. In dependant nodes further down the line (e.g. hoststack) we then set sw_if_idx[rx] to this value. So that we know which local interface did receive the packet. The TCP issue this fixes is that : On accepts, we were setting tc->sw_if_index to the source sw_if_index. We should use the dest sw_if_index, so that packets coming back on this connection have the right source sw_if_index. And also setting it in the tx-ed packet. Change-Id: I569ed673e15c21e71f365c3ad45439b05bd14a9f Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-10-06tcp: fix severity infoFilip Tehlar5-66/+66
Type: fix Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ibe39bc045c3b154209a83b59ef95a37c61b32c0c
2021-09-13tcp session: initialize sw_if_index at connect timeFlorin Coras4-4/+5
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id0e67a9ce9c5d8bca2cd7a30493f03a02a46dc46
2021-07-15misc: replace CLIB_PREFETCH with clib_prefetch_{load,store}Damjan Marion1-4/+4
Type: refactor Change-Id: Id10cbf52e8f2dd809080a228d8fa282308be84ac Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-07-13tcp session: next node config on connectsFlorin Coras1-0/+2
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ief06b1509d31b55efc8d1436b6ff9e01c6037a32
2021-07-06tcp: use tcp output for half open connectionsFlorin Coras1-39/+12
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I05be39671a9ed0688d4e006f0f9354aa6560a41b
2021-07-06tcp: use main thread pool for half-opensFlorin Coras5-146/+29
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I4b3427b966f9ff1ba8895fed7db662d56650f3f5
2021-06-29tcp: add ACK flag to RST packetliuyacan1-1/+1
According to RFC 793, the ACK control bit is always sent once the connection is established. Type: fix Signed-off-by: liuyacan <liuyacan@corp.netease.com> Change-Id: Id0fe19114a0cc468dbce4c0938b345c2ac339e73
2021-06-22tcp: api cleanupFilip Tehlar2-43/+9
Use autogenerated code. Does not change API definitions. Type: improvement Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: I3c06e9cb3fabdcdce9c17e93cfedfd771295f589
2021-06-15tcp: prevent timer handler being called frequentlyliuyacan4-6/+18
In the current implement, tcp would start or up an one tick retransmit timer for that connection if vlib_buffer_alloc() return 0. Now the tick is 0.1ms, this means that if VPP is in a buffer shortage state, there would be a large number of burst timer expirations. This commit limits the minimum interval of the retransmission timer to 100ms. Type: fix Signed-off-by: liuyacan <liuyacan@corp.netease.com> Change-Id: Ia11d693fe46119c5dc16b24ca93c30c31109057a
2021-06-12tcp: fix proto in port reuse checkFlorin Coras1-2/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I338e61654a62ed6308ecd8bb15e1a8b13cd859b9
2021-05-14tcp: remove ho lockFlorin Coras3-13/+0
Half-open sessions are allocated by main thread and cleaned up on main with timers. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I37f000920a45908b62b5501ae9d54a88a9e4c609
2021-05-12session: support half-close connectionliuyacan1-1/+25
Some app(e.g. Envoy) may call shutdown() instead of close() when draining connection. Type: improvement Signed-off-by: liuyacan <liuyacan@corp.netease.com> Change-Id: I9543b9ca3caa87b10b134fd1fc4019124e41e4d2
2021-05-10session: use half-open sessions for vc establishmentFlorin Coras1-3/+15
Use half-open sessions to track virtual circuit connection establishment. These sesssions can only be allocated and freed by the thread that allocates half-open connections (main). Consequently, they can only be freed on half-open cleanup notifications from transports. Goal is to simplify state tracking within the session layer but it's also a first step towards allowing builtin apps to track and cleanup outstanding connects. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I8a535906d13eb7f8966deb82333839de80f8049f
2021-05-05tcp: cleanup rcv-process and bulk buffer translationFlorin Coras1-141/+160
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2ca8a5e30e55a84d4567422e4b7fcf90830921d3
2021-05-05tcp: cleanup listen node and bulk buffer translationFlorin Coras1-41/+48
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2d11b1411a7653b94fddd889a5f28640c5f5566c
2021-05-05tcp: cleanup syn-sent and bulk buffer translationFlorin Coras1-112/+124
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Idb286e77a877a6a60aa532263277f002fc002e48
2021-05-04tcp: cleanup established and bulk buffer translationFlorin Coras1-29/+28
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic37f640b7f0d0a041c003e76c8f29c21b5e664b3
2021-05-01vlib: refactor trajectory trace debug featureBenoît Ganne2-15/+1
trajectory trace has been broken for a while because we used to save the buffer trajectory in a vector pointed to in opaque2. This does not work well when opaque2 is copied (eg. because of a clone) as 2 buffers end up sharing the same vector. This dedicates a full cacheline in the buffer metadata instead when trajectory is compiled in. No dynamic allocation, no sharing, no tears. Type: refactor Change-Id: I6a028ca1b48d38f393a36979e5e452c2dd48ad3f Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-04-23tcp: try to update sack list only if not emptyFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ieb5af96de5be33356dbab7bc4ab4696731fa8866
2021-04-23tcp: reorganize connection membersFlorin Coras2-8/+8
Optimize connection size and move timestamp_delta closer to other timestamp related members. Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iec42efb46482ebfdf234518a4e91af836e4f4c07
2021-04-20tcp: req app deq notification on fifo fullFlorin Coras2-1/+26
If fifo full, default to requesting an app deq notification and forcing an ack (window update) if zero rcv window sent is still active. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iade7e1722503da149c62c465c472edbb0a5599f7
2021-04-15tcp: support for rate sample attr flagFlorin Coras1-0/+14
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I94b8063c9d8f9b811589c6815cb5c8ca6220f2b5
2021-04-14session tcp vcl: api to update connection attributesFlorin Coras3-0/+103
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ifdd6024daf044751895bb8d2deabad41d3a80c92
2021-04-05tcp: time infra improvementsFlorin Coras7-33/+46
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I998c0686f9f7dc556dda8b28e23bbed127d0aafc
2021-03-26vlib: convert foreach_vlib_main macro to be more gdb and clang-format friendlyDamjan Marion1-13/+13
Type: improvement Change-Id: I1152e58d7bfcb3c4347147f87a834d45ad51cdfe Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-26vlib: introduce vlib_get_main_by_index(), vlib_get_n_threads()Damjan Marion1-1/+1
Type: improvement Change-Id: If3da7d4338470912f37ff1794620418d928fb77f Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-19interface: add capabilities flagsMohsin Kazmi1-1/+1
Type: improvement This patch adds flags to represent the modern NICs capabilities. Change-Id: I96d38d9ab7eac55974d72795cd100d8337168e1e Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-03-08tcp: account for option alignment in initial snd_mssFlorin Coras1-2/+3
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I24225ada6623c5b5543341ecac0d6c1db43cc8a9
2021-02-15vlib: refactor checksum offload supportMohsin Kazmi1-1/+1
Type: refactor This patch refactors the offload flags in vlib_buffer_t. There are two main reasons behind this refactoring. First, offload flags are insufficient to represent outer and inner headers offloads. Second, room for these flags in first cacheline of vlib_buffer_t is also limited. This patch introduces a generic offload flag in first cacheline. And detailed offload flags in 2nd cacheline of the structure for performance optimization. Change-Id: Icc363a142fb9208ec7113ab5bbfc8230181f6004 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-02-05tcp: fix port reuse with multiple listenersFlorin Coras2-3/+11
The check in listen state that the listener is not valid is not enough if the time wait session's index overlaps an actual listener's index. Thanks wanghanlin@corp.netease.com for the report! Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I3dff0cb134940a8265ff908faa607c67dba5e56b
2021-01-16tcp: remove bad assertIvan Shvedunov1-5/+2
Don't assume that half-open connections pending removal are always successful. Type: fix Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com> Change-Id: I955077a4ed2389b9ee38d97e27a7c7761c860a4a
2020-12-21tcp: terminate options with nopsFlorin Coras1-8/+4
On the one hand, make sure options are terminated with NOPs to avoid issues with clients that can't parse options that don't end on an u32 boundary. On the other, make sure the padding is rfc compliant. If options end with EOL the padding should be zeros. The current change does not use EOL so the padding is NOPs. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I608056707ef9658ca90b9c095e84a0689d8000d7
2020-12-14misc: move to new pool_foreach macrosDamjan Marion1-2/+2
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-11-25tcp: enable lc if any other debug option enabledFlorin Coras2-11/+34
Also fix debug build after snd_una_nxt removal. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ife52689cd30cdebf36057cf4d20d7f6207f1e29e
2020-11-12tcp: push last buffered sequenceFlorin Coras2-6/+7
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iba914ac69585e89f174f09e74ae716df1b080c59
2020-11-11tcp: validate fin seq in closing statesFlorin Coras1-0/+3
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id8673cff699cfdc1ac68797b9ab5cdf6f6b578a3
2020-11-10tcp: fix test for trailing bytesFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I6455f2d38a2927f16fd4cb0e26b8560a2357cebe
2020-11-09session: delegate fifo ooo lookup init to transportsFlorin Coras1-0/+3
Fifo chunk ooo lookup data structures are private (not allocated on segment heap) and should only be initialized by transport protocols that require out-of-order enqueues/dequeues (like tcp). Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iaa15d6850385bf903cc501c54c2752e8e811449e
2020-11-05tcp: avoid consuming trailing bytesFlorin Coras1-0/+4
Thanks to Shaligram Prakash <Shaligram.Prakash@enea.com> for reporting. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I135d23957a0dbb56a30994dfe3a316efd1eabad1
2020-10-28misc: Break the big IP header files to improve compile timeNeale Ranns1-0/+2
Type: refactor Signed-off-by: Neale Ranns <neale.ranns@cisco.com> Change-Id: Id1801519638a9b97175847d7ed58824fb83433d6
2020-10-26tcp: byte tracker fixRyujiro Shibuya1-1/+5
Type: fix Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com> Change-Id: If7e22978a6b65f5b68ccb2bd97b5e0fba167b3bf