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
This commit is contained in:
Richard Scheffenegger 2024-05-08 14:36:53 +02:00
parent dcdfe44901
commit 2a9aae9e5f
5 changed files with 12 additions and 4 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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 */

View File

@ -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");