git: 2a9aae9e5f7a - main - tcp: add counter to track when SACK loss recovery uses TSO
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 08 May 2024 12:55:23 UTC
The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=2a9aae9e5f7a1a218b2c05ed28d811e533912118 commit 2a9aae9e5f7a1a218b2c05ed28d811e533912118 Author: Richard Scheffenegger <rscheff@FreeBSD.org> AuthorDate: 2024-05-08 12:36:53 +0000 Commit: Richard Scheffenegger <rscheff@FreeBSD.org> CommitDate: 2024-05-08 12:37:33 +0000 tcp: add counter to track when SACK loss recovery uses TSO Add a counter to track how frequently SACK has transmitted more than one MSS using TSO. Instances when this will be beneficial is the use of PRR, or when ACK thinning due to GRO/LRO or ACK discards by the network are present. Reviewed By: tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D45070 --- sys/netinet/in_kdtrace.c | 1 + sys/netinet/in_kdtrace.h | 1 + sys/netinet/tcp_output.c | 3 +++ sys/netinet/tcp_var.h | 3 ++- usr.bin/netstat/inet.c | 8 +++++--- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/netinet/in_kdtrace.c b/sys/netinet/in_kdtrace.c index 2a53b11c3be2..8491a4d49d91 100644 --- a/sys/netinet/in_kdtrace.c +++ b/sys/netinet/in_kdtrace.c @@ -294,6 +294,7 @@ MIB_PROBE_TCP(tcps_finwait2_drops); MIB_PROBE_TCP(tcps_sack_recovery_episode); MIB_PROBE_TCP(tcps_sack_rexmits); +MIB_PROBE_TCP(tcps_sack_rexmits_tso); MIB_PROBE_TCP(tcps_sack_rexmit_bytes); MIB_PROBE_TCP(tcps_sack_rcv_blocks); MIB_PROBE_TCP(tcps_sack_send_blocks); diff --git a/sys/netinet/in_kdtrace.h b/sys/netinet/in_kdtrace.h index 780839299993..9896af96eb84 100644 --- a/sys/netinet/in_kdtrace.h +++ b/sys/netinet/in_kdtrace.h @@ -286,6 +286,7 @@ SDT_PROBE_DECLARE(mib, tcp, count, tcps_finwait2_drops); SDT_PROBE_DECLARE(mib, tcp, count, tcps_sack_recovery_episode); SDT_PROBE_DECLARE(mib, tcp, count, tcps_sack_rexmits); +SDT_PROBE_DECLARE(mib, tcp, count, tcps_sack_rexmits_tso); SDT_PROBE_DECLARE(mib, tcp, count, tcps_sack_rexmit_bytes); SDT_PROBE_DECLARE(mib, tcp, count, tcps_sack_rcv_blocks); SDT_PROBE_DECLARE(mib, tcp, count, tcps_sack_send_blocks); diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index e64b7701c453..c318e8517c2e 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1037,6 +1037,9 @@ send: TCPSTAT_ADD(tcps_sndrexmitbyte, len); if (sack_rxmit) { TCPSTAT_INC(tcps_sack_rexmits); + if (tso) { + TCPSTAT_INC(tcps_sack_rexmits_tso); + } TCPSTAT_ADD(tcps_sack_rexmit_bytes, len); } #ifdef STATS diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 6d60c21e64e9..01dd7198511c 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1030,6 +1030,7 @@ struct tcpstat { /* SACK related stats */ uint64_t tcps_sack_recovery_episode; /* SACK recovery episodes */ uint64_t tcps_sack_rexmits; /* SACK rexmit segments */ + uint64_t tcps_sack_rexmits_tso; /* SACK rexmit TSO chunks */ uint64_t tcps_sack_rexmit_bytes; /* SACK rexmit bytes */ uint64_t tcps_sack_rcv_blocks; /* SACK blocks (options) received */ uint64_t tcps_sack_send_blocks; /* SACK blocks (options) sent */ @@ -1088,7 +1089,7 @@ struct tcpstat { uint64_t tcps_tlpresend_bytes; /* number of bytes resent by tlp */ - uint64_t _pad[4]; /* 4 TBD placeholder for STABLE */ + uint64_t _pad[3]; /* 3 TBD placeholder for STABLE */ }; #define tcps_rcvmemdrop tcps_rcvreassfull /* compat */ diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c index 0657926eab80..5d7fd0e46cf1 100644 --- a/usr.bin/netstat/inet.c +++ b/usr.bin/netstat/inet.c @@ -783,11 +783,13 @@ tcp_stats(u_long off, const char *name, int af1 __unused, int proto __unused) p(tcps_sack_recovery_episode, "\t{:recovery-episodes/%ju} " "{N:/SACK recovery episode%s}\n"); - p(tcps_sack_rexmits, "\t{:segment-retransmits/%ju} " + p(tcps_sack_rexmits, "\t{:segment-retransmits/%ju} " "{N:/segment rexmit%s in SACK recovery episodes}\n"); - p(tcps_sack_rexmit_bytes, "\t{:byte-retransmits/%ju} " + p(tcps_sack_rexmits_tso, "\t{:tso-chunk-retransmits/%ju} " + "{N:/tso chunk rexmit%s in SACK recovery episodes}\n"); + p(tcps_sack_rexmit_bytes, "\t{:byte-retransmits/%ju} " "{N:/byte rexmit%s in SACK recovery episodes}\n"); - p(tcps_sack_rcv_blocks, "\t{:received-blocks/%ju} " + p(tcps_sack_rcv_blocks, "\t{:received-blocks/%ju} " "{N:/SACK option%s (SACK blocks) received}\n"); p(tcps_sack_send_blocks, "\t{:sent-option-blocks/%ju} " "{N:/SACK option%s (SACK blocks) sent}\n");