summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp
AgeCommit message (Collapse)AuthorFilesLines
2023-06-08tcp: cleanup next nodes and drop logicFlorin Coras2-136/+60
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-05-04session: cleanup ho lookup table on closeFlorin Coras1-0/+8
Make sure half-open table is cleaned up on close and cleanup of half-open. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id7ad177f364d6395f7379dc927e449a40547510e
2023-04-21tcp: remove unused codeFilip Tehlar2-7/+0
Type: improvement Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: Ib188f3331696dff6357a18f5bac5f1db3cefaeab
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-16session: support active opens with same source portFlorin Coras1-2/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2b426e9e988c32d261f36367087f358d8cc25e2f
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-28session: consolidate port alloc logicFlorin Coras1-21/+8
Move port allocation logic from transports into generic transport layer. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I55a21f185d00f5e118c36bcc4a6ffba2cbda885e
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 Tehlar4-44/+43
Type: fix Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: I9f4944f77ecf94f16f809392f28466e33f7f779d
2022-12-07tcp: avoid retransmit head with no dataFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iefabc7b9dd1109fd6dcf65e5d9794173421b7369
2022-12-02session: move connects to first workerFlorin Coras3-8/+15
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I035e3fdbb52eca010ad7b2c20ca2930cb1645978
2022-11-29session: transport endpt cleanup on owner threadFlorin Coras1-2/+2
Maintain a single writer multiple readers usage model for transport endpoints pool. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I8555700ed725971341f145ea97f031042a298e83
2022-10-07tcp: cmake option VPP_TCP_DEBUG_ALWAYS=ON not taken by all filesSteven Luong1-0/+1
Some files include tcp_debug.h without including <vpp/vnet/config.h> As a result, those files do not get VPP_TCP_DEBUG_ALWAYS option set. The fix is to include <vpp/vnet/config.h> in tcp_debug.h Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I0c141147f1e8d1b49c5a1440fac1e97cbd96aaa7
2022-10-07tcp: build image with TCP_DEBUG_ALWAYS via makeSteven Luong1-0/+4
Add cmake option to enable TCP_DEBUG_ALWAYS. make rebuild VPP_EXTRA_CMAKE_ARGS=-DVPP_TCP_DEBUG_ALWAYS=ON make rebuild VPP_EXTRA_CMAKE_ARGS=-DVPP_TCP_DEBUG_ALWAYS=OFF Type: improvement Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I911a8d615f76516ae0a988bc6135c3b0d8fcb3df
2022-10-03tcp: replace tcp_time_now with tcp_time_now_usSteven Luong1-28/+29
It looks like tcp_time_now has been deprecated for a while and the replacement is tcp_time_now_us Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: Ifaed2632baa49d489d4e03f2623d8cc9a6f36e64
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-08-11ip: only set rx_sw_if_index when connection found to avoid following crash ↵Xiaoming Jiang1-5/+5
like tcp punt Type: fix Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com> Change-Id: I894a881cec1888b392d26fdfb385f97c31113ef1
2022-04-12tcp: limit persist segment size if window availableFlorin Coras1-1/+3
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie1ae401d5105aa42761d3cac5dfbe523f3995c87
2022-04-04vppinfra: make _vec_len() read-onlyDamjan Marion2-4/+4
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-04-04tcp: use safe realloc poolFlorin Coras1-3/+3
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I8ba93643236aaa50eeb4755b74821a8c4ca6179b
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-02-15tcp: Do not include the tcp_packet.h file in the ip4_packet.hNeale Ranns1-1/+96
Type: refactor IP4 does not depend on TCP (it's the other way around). This upside down dependency leads to some nasty circular includes when trying to use ip46_address.h in interface.h Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: I4a1bd21543b08b9c1cf1e5563da738414734a878
2022-02-10session: use transport endpoint cfg for listenFlorin Coras1-2/+2
Makes it similar to connects. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I38c328670054e1a9ba4dc4ea8fe7519a5a09e8be
2022-01-12session: pass tx buffers in bulk to transportsFlorin Coras2-6/+35
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1025cccd784f80b557847f69c3ea1ada5c9de60d
2022-01-10session: deschedule sessions with no data to sendFlorin Coras1-1/+0
This ensures the scheduler always tracks sessions that are descheduled, i.e., do not have events in the old io events list. When app retries to send, clear descheduled flag and potentially the pacer. Consequently, transports no longer need to reset the pacer when sessions are rescheduled after a long app tx pause. This also fixes a tcp bug whereby the pacer was reset too often when snd_una was equal to snd_nxt as there was no way to distinguish betwen app tx breaks and congestion. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id3cc6c98cd76299e15030e504380dcf3c04c5189
2022-01-07tcp: fix cubic cwnd accumulate use of bytes ackedFlorin Coras1-1/+1
Use what was provided instead of tc->bytes_acked Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I0ed736d2ee247e231fccdf4a969fcf6bc15b7978
2022-01-06tcp: optimize newreno cong ack handlerFlorin Coras1-19/+20
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I196ee5f4630cec637245493f370b5f83a939fe44
2022-01-06tcp: update snd_congestion only during congestionFlorin Coras3-31/+14
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: mark lost first sack hole on timeoutFlorin Coras3-1/+27
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1abff943f3fe3ff0219126b5b8beded4ad859758
2022-01-06tcp: handle start tx event in cubicFlorin Coras1-0/+18
If app was idle update start time of current congestion avoidance phase unless tcp connection was not idle. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Idf6a03a9ef96c409462de9f9cb19df609f730afe
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 Coras3-7/+9
Should estimated cwnd better with loss Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Idd75d40dbab212ac0a5d533009c5540b1a58f4c4
2022-01-06tcp: cast timer ticks to u32Florin Coras3-7/+8
tc->rto * TCP_TO_TIMER_TICK can return garbage if not cast to u32 and that confuses clib_max Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> signed-off-by: Vipul Agrawal <Vipul.Agrawal@enea.com> Change-Id: Ief4d29b9625e2ef2e75e0c7e3d731ab147465f6d
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-12-26tcp: set sw_if_index in tcp src-address cliMercury1-2/+2
the receive dpo added by tcp src-address cli do not have a valid sw_if_index , ip4_local_check_src() and tcp_input_lookup_buffer() will set ~0 to vnet_buffer(b)->sw_if_index[VLIB_RX], which will cause crash in tcp46_reset_inline, Type: fix Signed-off-by: Mercury <mercury124185@gmail.com> Change-Id: Ie01c31f3575e14187c6380ebcfff96fcb6098cde
2021-12-23tcp: fix endpoint lookup failed caused by key uninitializedMercury1-0/+1
fix ipv4 key uninitialized in local_endpoints_table, which will cause transport_endpoint_cleanup() failed to lookup the endpoint and can not delete it, as for ipv6, clib_memcpy_fast() will change all bytes of lcl_addr and there maybe no need to initalize, Type: fix Signed-off-by: Mercury <mercury124185@gmail.com> Change-Id: I56676493a393b1d64eaa438224e256094ca75d2f
2021-12-12tcp: fix the tcp src-address cliMercury1-0/+2
When the src-address to add match a route without a valid output interface(such as default route 0.0.0.0/0), fib_entry_get_resolving_interface() will return (u32)~0, which will cause crash in ip4_neighbor_proxy_enable(). Type: fix Signed-off-by: Mercury <mercury124185@gmail.com> Change-Id: I5aee5676a2ff43ec06745ebed4dba2b9e5b98c4d
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