aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp_input.c
AgeCommit message (Collapse)AuthorFilesLines
2024-03-12misc: remove GNU Indent directivesDamjan Marion1-24/+0
Type: refactor Change-Id: I5235bf3e9aff58af6ba2c14e8c6529c4fc9ec86c Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-02-17tcp: retransmit fins in last-ackFlorin Coras1-1/+1
Fix instances where timers are reset after programming fin. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ib80e3a401d585f388a97c7f2bb62e68ee774d50d
2023-11-28tcp: add counter for accepted connectionsFlorin Coras1-1/+1
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2925134cfcfa36c14b3b69efa892b9b96fce2e6f
2023-11-01tcp: remove redundant ack checksFlorin Coras1-18/+0
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I4001f39afde8c33b60c15f74034bcce013fbbf70
2023-11-01tcp: allow ooo data in syn-rcvdFlorin Coras1-9/+0
As long as ack and segment are legitimate accept ooo data as we transition to established. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I85cdc65d70cb8ae689a9ce9bbe4f86228b1ac533
2023-11-01tcp: postpone cleanup on connect failuresFlorin Coras1-2/+6
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I231b319d4d7aa3e17cc8cfe8aaa4762995a5b2c4
2023-10-16tcp: allow fins in syns in syn-rcvdFlorin Coras1-7/+11
Also make sure connection is properly cleaned up. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I02f83e9a1e17cbbbd2ee74044d02049b2fd2f21c
2023-10-16tcp: handle syn-ack in fin-wait-2 in rcv processFlorin Coras1-0/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: If74e04498423bed42593e79ec92482421cfda8d2
2023-08-09session: async rx event notificationsFlorin Coras1-13/+6
Move from synchronous flushing of io and ctrl events from transports to applications to an async model via a new session_input input node that runs in interrupt mode. Events are coalesced per application worker. On the one hand, this helps by minimizing message queue locking churn. And on the other, it opens the possibility for further optimizations of event message generation, obviates need for rx rescheduling rpcs and is a first step towards a fully async data/io rx path. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id6bebcb65fc9feef8aa02ddf1af6d9ba6f6745ce
2023-06-08tcp: cleanup next nodes and drop logicFlorin Coras1-136/+58
TCP nodes consume the buffers so they have no nexts. To avoid long drop path through vlib graph, add drop node. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ibe6e075e83612ed16270934398c6a013f236ae35
2023-04-20tcp: fix tcp packet traceFilip Tehlar1-38/+59
Type: fix Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: Id4ca9a749a343c55b24f6eb4b5eb0909a57e0c23
2023-03-06tcp: allow syns in closed stateFlorin Coras1-2/+3
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: If223096cf912c1748ae417b40585a9bea5d9d9a9
2023-02-28tcp: add dispatch errors to countersFlorin Coras1-9/+10
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I27112947071a757065162f0e50f69983d258525d
2023-02-25tcp: fix error countersFilip Tehlar1-41/+5
Type: fix Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: I9f4944f77ecf94f16f809392f28466e33f7f779d
2022-08-30tcp: do not overcount ooo bytesFlorin Coras1-1/+3
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic81702bffb5b3189db48efe1ab3b237fa2bf75f2
2022-04-04vppinfra: make _vec_len() read-onlyDamjan Marion1-3/+3
Use of _vec_len() to set vector length breaks address sanitizer. Users should use vec_set_len(), vec_inc_len(), vec_dec_len () instead. Type: improvement Change-Id: I441ae948771eb21c23a61f3ff9163bdad74a2cb8 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-15tcp: update error counters in listen nodeFlorin Coras1-9/+7
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ib2e1d847607c9c7d928b174b87e5c21d53153ebe
2022-03-15tcp: update persist timer if data ackedFlorin Coras1-3/+7
Update persist timer if data sent during snd_wnd < snd_mss was acked. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I5c75ff8ddc0e49750b2088237d32afa4eda99e7f
2022-01-06tcp: update snd_congestion only during congestionFlorin Coras1-9/+0
If running without sacks, if snd_una does not cover snd_congestion fast recovery can be missed but the two heuristics from RFC6582 should avoid that. Also snd_congestion was used as a means of inferring if the connection recently exited congestion while setting the persist timer but that does not always work correctly if not congested. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I94d4ac738cdd4f7f23f62e97dd63059de1cd4af9
2022-01-06tcp: always exit recovery if not in fastrecoveryFlorin Coras1-3/+3
Stay in fast recovery only if it's already on. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Idcdbbacfed3e5f3c991fa293c532be1c671f5217
2022-01-06tcp: exit retransmit before processing feedbackFlorin Coras1-21/+17
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I5838e4c370d0c02a21b5eadb4af3baae781df097
2022-01-06tcp: use bytes delivered to compute cwndFlorin Coras1-2/+4
Should estimated cwnd better with loss Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Idd75d40dbab212ac0a5d533009c5540b1a58f4c4
2022-01-05interface: refactor interface capabilities codeDamjan Marion1-1/+1
Make it shorter to type, easier to debug, make adding callbacks in future simpler. Type: improvement Change-Id: I6cdd6375e36da23bd452a7c7273ff42789e94433 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-10-25tcp: fix: TCP timewait port reuse rfc complianceMichal Kalderon1-3/+77
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-06tcp: fix severity infoFilip Tehlar1-14/+14
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 Coras1-1/+0
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id0e67a9ce9c5d8bca2cd7a30493f03a02a46dc46
2021-07-06tcp: use main thread pool for half-opensFlorin Coras1-1/+1
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I4b3427b966f9ff1ba8895fed7db662d56650f3f5
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-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-14session tcp vcl: api to update connection attributesFlorin Coras1-0/+6
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ifdd6024daf044751895bb8d2deabad41d3a80c92
2021-04-05tcp: time infra improvementsFlorin Coras1-4/+4
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I998c0686f9f7dc556dda8b28e23bbed127d0aafc
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-02-05tcp: fix port reuse with multiple listenersFlorin Coras1-2/+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-11-12tcp: push last buffered sequenceFlorin Coras1-6/+0
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-23tcp: remove snd_una_maxFlorin Coras1-3/+3
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I03f923053499f219035c9b7b6640fc575568d474
2020-10-13tcp: fix listener trace coverity warningFlorin Coras1-6/+2
Type: fix Change-Id: I75c0bd862260e188f625271c3bd545a7ab37af5d Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-10-12tcp: fix connection reuse with no listenerFlorin Coras1-0/+6
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I674872f68406ac778779a68d3ad991f41765d4e2
2020-09-02tcp: fix connection refused errorFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I436741e061f11685980a71fb3989befc7af1e081
2020-08-20tcp: track reorder with sacksFlorin Coras1-11/+2
Type: feature Change-Id: I041bff2e8d589c171661de286fa1503531dff891 Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-08-03tcp: improve timestamp rtt accuracyFlorin Coras1-22/+21
- switch to using vlib_time as reference for timestamps - use us precision ticks for tcp but keep using ms precision for timestamps. As a result, srtt, rttvar and rto are now measured in us instead of ms. MRTT samples from timestamps are converted from ms to us (not accurate under ms) while high precision samples are used with us precision, i.e., they're no longer converted to ms precision samples. Type: improvement Change-Id: Ibda559575d9b4fdc85b0985264f7c865ff367e34 Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-07-30tcp: process syn in fin-wait-2Florin Coras1-0/+1
Type: improvement Change-Id: I379ba4270dad56fb0a06427a43e97bed36bdaa13 Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-07-29tcp: fix skipping RSTs in SYN_SENT stateIvan Shvedunov1-0/+1
Type: fix Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com> Change-Id: Ieddf8f03fdd14e71efaf4c78fe5b7f0d15c5cf5a