summaryrefslogtreecommitdiffstats
path: root/src/vnet/udp
AgeCommit message (Collapse)AuthorFilesLines
2023-03-13udp: Use udp_output_get_connection instead of udp_connection_getSteven Luong1-12/+11
udp_output_get_connection handles correctly if the connection is a listener whereas udp_connection_get does not which may lead to a crash. Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I40b57287a8686820d29872cae2cfd6ae27a57c26
2023-03-07udp: crash in format_udp_connectionSteven Luong1-1/+1
format_udp_connection takes 2 arguments from the caller. Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: Ie618a809936a01c094982f9a8c81309826e0b087
2023-03-01udp: fix optimistic assert for UDP RXMohammed Hawari2-1/+6
Change-Id: I431c4a6f409b129e4290dba2e1acadea460ac797 Signed-off-by: Mohammed Hawari <mohammed@hawari.fr> Type: improvement
2023-02-28session: consolidate port alloc logicFlorin Coras1-24/+10
Move port allocation logic from transports into generic transport layer. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I55a21f185d00f5e118c36bcc4a6ffba2cbda885e
2023-01-10udp: avoid listener cleanups with active opensFlorin Coras2-0/+15
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ibff9f32e4fcaf0344207d8e43f3547180cbd4eef
2023-01-10udp: initialize gso_size on dgram enqueueFlorin Coras1-0/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I1b5a35b9d53cc56d4d8050de70f40b95e92f1011
2022-12-20udp: fix tx handling of non-connected sessionsFlorin Coras2-27/+31
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I659b9914fcfa4619a68e9807ef241f88c96b3bd0
2022-11-29udp: refactor port allocation and sharingFlorin Coras4-72/+28
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I4f7314ddf95d26f1939bd3772d29d011fb4cea47
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-11-28udp: preallocate ports sparse vec mapFlorin Coras1-2/+80
Not ideal. The sparse vector used to map ports to next nodes assumes only a few ports are ever used. When udp transport is enabled this does not hold and, to make matters worse, ports are consumed in a random order. This can lead to a lot of slow updates to internal data structures which in turn can slow udp connection allocations until all ports are eventually consumed. Consequently, reallocate sparse vector, preallocate all ports and have them point to UDP_NO_NODE_SET. We could consider switching the sparse vector to a preallocated vector but that would increase memory consumption for vpp deployments that do not rely on host stack. For reference, populating one of the v4 or v6 sparse vectors in reverse order takes about 9.8s on a skylake cpu. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id795e1805d0d3ba54f56a152a9506a7a2a06ecbc
2022-10-25udp: use new wrk context for connectionsFlorin Coras2-18/+19
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I9c4050f96c310f1e6eb2cae8d908c44968526c3c
2022-10-25udp: postpone cleanup of udp connectionsFlorin Coras2-2/+48
Avoid deleting connections in session layer io event handler. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I87b3e53f9039161688467d9716875583ad797c07
2022-10-20udp: support for disabling tx csumFlorin Coras5-4/+62
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I84843eb3a0a66c64cd46536624633e0dae1c4681
2022-10-19udp: explicit udp output nodeFlorin Coras4-12/+282
This allows for custom next node selection on output. Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ib0fee71a01847184e95c18097bbbfdadfbd9d030
2022-09-30udp: add udp encap source port entropy supportVladislav Grishenko6-33/+151
Encode entropy value in UDP source port when requested per RFC 7510. CLI already has "src-port-is-entropy", use zero UDP source port in API to avoid breaking changes, since zero port is not something to be used in wild. Also, mark UDP encapsualtion API as mp-safe as already done for CLI. Type: feature Change-Id: Ieb61ee11e058179ed566ff1f251a3391eb169d52 Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
2022-08-31udp: store mss and sw_if_index to udp_connection_tSteven Luong4-4/+11
Store mss and sw_if_index to udp_connection_t and display them via show sessipn verbose 2 Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I32928f3f4195b178873dc1bada702e035d99c464
2022-06-08udp: add cli to dump registered portsBenoît Ganne1-0/+93
Type: improvement Change-Id: Ic949e3136a7cf27011d098a50e91920f83226ea9 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-05-05udp: remove buggy assert in udp encapBenoît Ganne1-2/+0
It looks like in a distant past we were using a vnet_rewrite but this no longer the case. Type: fix Change-Id: Ib8d336aec7d5abd7749f543739f531144e76e551 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-04-04vppinfra: make _vec_len() read-onlyDamjan Marion1-1/+1
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-04udp: use pool safe reallocsFlorin Coras3-81/+8
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I5bd0b300af07424d1ce4807fa0b17e375001f089
2022-03-30udp: fix inner packet checksum calculation in udp-encapMauro Sardara4-41/+103
When computing the inner packet checksum, the code wrongly assumes that the IP version of the inner packet is the same of the outer one. On the contrary, it is perfectly possible to encapsulate v6 packets into v4 and viceversa, so we need to check the IP format of the inner header before calling vnet_calc_checksums_inline. Ticket: VPP-2020 Type: fix Signed-off-by: Mauro Sardara <msardara@cisco.com> Change-Id: Ia4515563c164f6dd5096832c831a48cb0a29b3ad Signed-off-by: Mauro Sardara <msardara@cisco.com>
2022-03-22session: use safe realloc for poolsFlorin Coras1-5/+1
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I313c916d268c4b2b448b93e90bc67da341b803e3
2022-03-18udp: avoid grabbing vlib main if not neededFlorin Coras1-6/+4
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I88a747cac70cb88755f50c7b337207f4ba256530
2022-03-18vppinfra: refactor *_will_expand() functionsDamjan Marion1-3/+1
Type: refactor Change-Id: I3625eacf9e04542ca8778df5d46075a8654642c7 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-02-10session: use transport endpoint cfg for listenFlorin Coras1-1/+1
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 Coras1-8/+36
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1025cccd784f80b557847f69c3ea1ada5c9de60d
2021-11-17session: support close during migrationFlorin Coras1-1/+1
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ife1e046b62bb0679419fd1346e973d0e3ea55489
2021-11-12session: add support for DSCPFilip Tehlar1-2/+3
Type: feature Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: I817b1503ada1ae53c1134a85263f9b801d74e88a
2021-10-07udp: fix severity error infoFilip Tehlar4-25/+25
Type: fix Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: I415d68b39ecac546b531f6eb98bca51e7eb6f7f7
2021-07-27udp: add option to disable icmp unreachablesFlorin Coras3-82/+49
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I90c2a191ab34a2a7df3fb0a951e5fc78f40ccfe2
2021-06-21udp: api cleanupFilip Tehlar2-47/+9
Use autogenerated code. Does not change API definitions. Type: improvement Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: I0994241df94ad7536be323b9d7c48caf38cc4267
2021-06-01udp: calculate inner checksums if needed before udp encapArthur de Kerhor2-1/+7
We do not want to encap headers containing wrong checksums. Additionnally, this clears the checksums offlads flags, which was something missing since the outer headers checksums were calculated during the encap. Hence, those should not be recalculated afterwards. Type: fix Change-Id: I7fd07987b4f13f76c6990a1c08dc2f960bdd8de1 Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com>
2021-05-29udp: add udp decapsulationArthur de Kerhor3-9/+189
Possibility to register a port via CLI or API to decap incoming UDP packets: - For CLI, a user needs to specify the inner protocol (only MPLS supported for now) - For API, the protocol is specified by index Added unittests Type: feature Change-Id: Ifedd86d8db2e355b7618472554fd67d77a13a4aa Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com>
2021-05-18tls: fix dtls with no workersFlorin Coras1-3/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iecc33fda7f28c037289775ffe0525a50f89a2b8c
2021-03-03udp: allocate rx lock only for non-connectedFlorin Coras1-3/+7
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ib5395a51fbfb2123549f7c96534fa763b4669243
2021-02-26udp: avoid locking connected udp sessions on rxFlorin Coras3-2/+8
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I52aa2322980b51cfc0b282fb37d7f63d30777dee
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>
2020-12-14misc: move to new pool_foreach macrosDamjan Marion2-9/+9
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-28misc: Break the big IP header files to improve compile timeNeale Ranns2-3/+2
Type: refactor Signed-off-by: Neale Ranns <neale.ranns@cisco.com> Change-Id: Id1801519638a9b97175847d7ed58824fb83433d6
2020-10-21misc: minimize dependencies on udp.hFlorin Coras7-260/+328
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id13f33843b230a1d169560742c4f7b2dc17d8718
2020-10-07misc: Purge unused pg includesNeale Ranns2-2/+0
Type: style Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: I26a19e42076e031ec5399d5ca05cb49fd6fbe1cd
2020-09-24session tcp udp tls quic: improve cli formattingFlorin Coras1-2/+3
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iae5dbb8aaaf82d8e95c2ee8bbbe6844c9dd49f80
2020-06-27udp: align udp_encap_t_ to 2 cachelinesVadym Martsynovskyy1-4/+4
Based on the comments in the struct, udp_encap_t_ is meant to span 2 cachelines. Due to the 64 bit alignment of dpo_id_t, the struct spanned 3 cachelines. This caused fetching ue_ip_proto to trigger an additional cache miss. This patch rearranges the ordering of the struct fields so that udp_encap_t_ only spans 2 cachelines as intended. before: (gdb) print (int)&((struct udp_encap_t_*)0)->cacheline1 $8 = 128 after: (gdb) print (int)&((struct udp_encap_t_*)0)->cacheline1 $1 = 64 Type: fix Signed-off-by: Vadym Martsynovskyy <vmartsyn@fb.com> Change-Id: I066c08654d4a8ef3e2d3954e957d4c5d382b209f
2020-06-23udp: jump over ip4 optionsFlorin Coras1-3/+3
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I4f57a776302e11815fcea433ba8cf6724799ff65
2020-05-29misc: ipfix-export unformat u16 collector_port fixElias Rudberg2-0/+18
Use %U and unformat_udp_port instead of %u for unformat() call for u16 collector_port number in set_ipfix_exporter_command_fn() to avoid corruption of other variables which can happen if unformat() with %u is used with a 16-bit variable. This avoids crash due to corrupted fib_index value. Type: fix Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net> Change-Id: Id54273fcc458a7f9c5aa4025aa91711f160c1c1a
2020-04-16udp: fix buffer traceAndreas Schultz1-3/+2
Type: fix Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com> Change-Id: I774ca50582281cb3cc5e43417e74d178bf4909bd
2020-04-10udp: remove connected udp transport protoFlorin Coras1-60/+0
Type: refactor To reproduce functionality, use udp in combination with TRANSPORT_CFG_F_CONNECTED transport flag set in connect and listen parameters. Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id88470c38326f8168b9646b0de49a674e0f4266f
2020-04-10udp: fix local node no port error counterFlorin Coras1-9/+6
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie0c5a86aedfa38fdcbb835aee7c9e91d59b222d6
2020-04-09udp: fix coverity warningFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I8efde7a4be9b04eae7e30b153de5edab7854496b
2020-04-08udp: cleanup input nodeFlorin Coras4-175/+211
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ida9daefc20a161b36d6f36c56267123c7f2efc01