aboutsummaryrefslogtreecommitdiff
path: root/cddl/lib/libdtrace/tcp.d
Commit message (Collapse)AuthorAgeFilesLines
* libdtrace: Fix TCP data offset handling in the tcpinfo_t translatorMark Johnston2024-01-011-2/+2
| | | | | | | | | | The header gives an offset in 32-bit words, and the translator is supposed to convert that to a byte count. But, the conversion was incorrect. Reviewed by: tuexen, rscheff MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43264
* libdtrace: decode all tcp header flags and addRichard Scheffenegger2023-12-311-16/+19
| | | | | | | | | | decoding capability of TH_AE to dtrace, including the example provided with tcpdebug. MFC after: 1 week Reviewed By: markj, mav Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D43243
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* tcp: embed inpcb into tcpcbGleb Smirnoff2022-12-071-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the TCP protocol inpcb storage specify allocation size that would provide space to most of the data a TCP connection needs, embedding into struct tcpcb several structures, that previously were allocated separately. The most import one is the inpcb itself. With embedding we can provide strong guarantee that with a valid TCP inpcb the tcpcb is always valid and vice versa. Also we reduce number of allocs/frees per connection. The embedded inpcb is placed in the beginning of the struct tcpcb, since in_pcballoc() requires that. However, later we may want to move it around for cache line efficiency, and this can be done with a little effort. The new intotcpcb() macro is ready for such move. The congestion algorithm data, the TCP timers and osd(9) data are also embedded into tcpcb, and temprorary struct tcpcb_mem goes away. There was no extra allocation here, but we went through extra pointer every time we accessed this data. One interesting side effect is that now TCP data is allocated from SMR-protected zone. Potentially this allows the TCP stacks or other TCP related modules to utilize that for their own synchronization. Large part of the change was done with sed script: s/tp->ccv->/tp->t_ccv./g s/tp->ccv/\&tp->t_ccv/g s/tp->cc_algo/tp->t_cc/g s/tp->t_timers->tt_/tp->tt_/g s/CCV\(ccv, osd\)/\&CCV(ccv, t_osd)/g Dependency side effect is that code that needs to know struct tcpcb should also know struct inpcb, that added several <netinet/in_pcb.h>. Differential revision: https://reviews.freebsd.org/D37127
* sack_newdata and snd_recover hold the same value. Therefore, use onlyMichael Tuexen2020-02-131-1/+1
| | | | | | | | | | a single instance: use snd_recover also where sack_newdata was used. Submitted by: Richard Scheffenegger Differential Revision: https://reviews.freebsd.org/D18811 Notes: svn path=/head/; revision=357858
* Add support for TCP state names used by Solaris.Michael Tuexen2018-07-141-0/+26
| | | | | | | | | | | | | For compatibility, add the TCP state names used by Solaris and given in the Dtrace Guide available at https://docs.oracle.com/cd/E37838_01/html/E61035/glhgu.html#OSDTGglhmv Reviewed by: markj@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D16269 Notes: svn path=/head/; revision=336285
* The IP, TCP, and UDP provider report IP addresses as strings.Michael Tuexen2018-06-181-2/+2
| | | | | | | | | | | | | | | | In some cases, the required information is not available and the UDP provider reported an empty string in this case and the IP and TCP provider reported a NULL pointer. This patch changes the value provided in this case to the string "<unknown>". This make the behaviour consistent and in-line with the behaviour of Solaris. Reviewed by: markj@, dteske@, gnn@ Differential Revision: https://reviews.freebsd.org/D15855 Notes: svn path=/head/; revision=335325
* Load balance sockets with new SO_REUSEPORT_LB option.Sean Bruno2018-06-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new socket option, SO_REUSEPORT_LB, which allow multiple programs or threads to bind to the same port and incoming connections will be load balanced using a hash function. Most of the code was copied from a similar patch for DragonflyBSD. However, in DragonflyBSD, load balancing is a global on/off setting and can not be set per socket. This patch allows for simultaneous use of both the current SO_REUSEPORT and the new SO_REUSEPORT_LB options on the same system. Required changes to structures: Globally change so_options from 16 to 32 bit value to allow for more options. Add hashtable in pcbinfo to hold all SO_REUSEPORT_LB sockets. Limitations: As DragonflyBSD, a load balance group is limited to 256 pcbs (256 programs or threads sharing the same socket). This is a substantially different contribution as compared to its original incarnation at svn r332894 and reverted at svn r332967. Thanks to rwatson@ for the substantive feedback that is included in this commit. Submitted by: Johannes Lundberg <johalun0@gmail.com> Obtained from: DragonflyBSD Relnotes: Yes Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D11003 Notes: svn path=/head/; revision=334719
* Revert r332894 at the request of the submitter.Sean Bruno2018-04-241-4/+4
| | | | | | | | Submitted by: Johannes Lundberg <johalun0_gmail.com> Sponsored by: Limelight Networks Notes: svn path=/head/; revision=332967
* Load balance sockets with new SO_REUSEPORT_LB optionSean Bruno2018-04-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new socket option, SO_REUSEPORT_LB, which allow multiple programs or threads to bind to the same port and incoming connections will be load balanced using a hash function. Most of the code was copied from a similar patch for DragonflyBSD. However, in DragonflyBSD, load balancing is a global on/off setting and can not be set per socket. This patch allows for simultaneous use of both the current SO_REUSEPORT and the new SO_REUSEPORT_LB options on the same system. Required changes to structures Globally change so_options from 16 to 32 bit value to allow for more options. Add hashtable in pcbinfo to hold all SO_REUSEPORT_LB sockets. Limitations As DragonflyBSD, a load balance group is limited to 256 pcbs (256 programs or threads sharing the same socket). Submitted by: Johannes Lundberg <johanlun0@gmail.com> Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D11003 Notes: svn path=/head/; revision=332894
* Use tabs in io.d, fix alignment issues, remove extraneous newlinesDevin Teske2018-02-121-70/+70
| | | | Notes: svn path=/head/; revision=329188
* Remove uneeded parentheses.Mark Johnston2018-01-251-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=328398
* On FreeBSD there is a setsockopt option SO_USER_COOKIE which allowsGeorge V. Neville-Neil2016-07-081-0/+3
| | | | | | | | | | | | | | | | | setting a 32 bit value on each socket. This can be used by applications and DTrace as a rendezvous point so that an applicaton's data can more easily be captured at run time. Expose the user cookie via DTrace by updating the translator in tcp.d and add a quick test program, a TCP server, that sets the cookie on each connection accepted. Reviewed by: hiren MFC after: 1 week Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D7152 Notes: svn path=/head/; revision=302474
* Fix the 'type' for a few variables from tcpcb.Hiren Panchasara2016-04-151-4/+4
| | | | | | | | | Reviewed by: markj Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D5973 Notes: svn path=/head/; revision=298087
* fix tcpdebug: - assign to "flags" in each probe, not only debug-inputGeorge V. Neville-Neil2016-03-031-0/+14
| | | | | | | | | | | compute "len" in the same way in each probe Submitted by: Hannes Mehnert MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D5524 Notes: svn path=/head/; revision=296335
* dd DTrace probe points, translators and a corresponding scriptGeorge V. Neville-Neil2015-09-131-1/+132
| | | | | | | | | | | | to provide the TCPDEBUG functionality with pure DTrace. Reviewed by: rwatson MFC after: 2 weeks Sponsored by: Limelight Networks Differential Revision: D3530 Notes: svn path=/head/; revision=287759
* - Use an explicit "depends_on module kernel" guard in DTrace libraries thatMark Johnston2015-08-071-0/+1
| | | | | | | | | | | | | | | | | | reference types defined in the kernel. Otherwise dtrace(1) expects to find CTF definitions for all referenced types, which is not very reasonable when it is being used in a build environment. This was previously worked around by adding "-x nolibs" to dtrace -h or -G invocations, but as of r283025, dtrace(1) actually handles dependencies properly, so this is no longer necessary. - Remove "pragma ident" directives from DTrace libraries, as they're being phased out upstream as well. Submitted by: Krister Johansen <Krister.Johansen@isilon.com> [1] MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=286420
* Actually remove siftr-related definitions from tcp.d, missed in r283026.Mark Johnston2015-05-171-75/+0
| | | | Notes: svn path=/head/; revision=283027
* Brief demo script showing the various values that can be read viaGeorge V. Neville-Neil2015-04-291-0/+75
| | | | | | | | | | the new SIFTR statically defined tracepoint (SDT). Differential Revision: https://reviews.freebsd.org/D2387 Reviewed by: bz, markj Notes: svn path=/head/; revision=282240
* Correct the calculation of tcps_rto in the struct tcpcb -> tcpsinfo_tMark Johnston2014-10-211-1/+1
| | | | | | | | | | translator. Submitted by: Grenville Armitage <garmitage@swin.edu.au> MFC after: 1 week Notes: svn path=/head/; revision=273370
* Update the TCP structure used by DTrace to show the smoothed RTT.George V. Neville-Neil2014-10-191-0/+2
| | | | | | | | | | This will allow similar functionality to SIFTR to be built with DTrace. Submitted by: Grenville Armitage MFC after: 2 weeks Notes: svn path=/head/; revision=273293
* Bind ip/tcp/udp provider translators and symbols to the same versions as inMark Johnston2014-05-141-25/+25
| | | | | | | | | | | | | | illumos, rather than using "1.0" everywhere. Some of the translators use D functions that are not present in version 1.0 (e.g. inet_ntoa()) which can result in libdtrace crashing when running scripts that restrict themselves to version 1.0 (e.g. with "-x version=1.0"). MFC after: 1 week Notes: svn path=/head/; revision=266082
* Add a separate translator for headers passed to the TCP probes in theMark Johnston2013-10-021-1/+39
| | | | | | | | | | | | input path. These probes get some of the fields in host order, whereas the output probes get them in network order, so a single translator isn't enough. This workaround ensures that the problem is essentially invisble to users: none of the probe arguments or their fields have changed. Approved by: re (hrs) Notes: svn path=/head/; revision=255993
* Use the address of the inpcb rather than the tcpcb to identify TCPMark Johnston2013-09-151-1/+1
| | | | | | | | | | connections. This keeps the tcp provider consistent with the other network providers. Approved by: re (delphij) Notes: svn path=/head/; revision=255604
* Implement the ip, tcp, and udp DTrace providers. The probe definitions useMark Johnston2013-08-251-0/+203
dynamic translation so that their arguments match the definitions for these providers in Solaris and illumos. Thus, existing scripts for these providers should work unmodified on FreeBSD. Tested by: gnn, hiren MFC after: 1 month Notes: svn path=/head/; revision=254889