From 1714e18e79aa8013243d7e3fdccabc1558cefc9a Mon Sep 17 00:00:00 2001 From: Mohan Srinivasan Date: Thu, 6 Apr 2006 17:21:16 +0000 Subject: [PATCH] Eliminate debug code that catches bugs in the hinting of sack variables (tcp_sack_output_debug checks cached hints aginst computed values by walking the scoreboard and reports discrepancies). The sack hinting code has been stable for many months now so it is time for the debug code to go. Leaving tcp_sack_output_debug ifdef'ed out in case we need to resurrect it at a later point. --- sys/netinet/tcp_sack.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c index 2d0a2c1ea12..ca68002f59c 100644 --- a/sys/netinet/tcp_sack.c +++ b/sys/netinet/tcp_sack.c @@ -604,6 +604,7 @@ tcp_sack_partialack(tp, th) (void) tcp_output(tp); } +#if 0 /* * Debug version of tcp_sack_output() that walks the scoreboard. Used for * now to sanity check the hint. @@ -627,6 +628,7 @@ tcp_sack_output_debug(struct tcpcb *tp, int *sack_bytes_rexmt) } return (p); } +#endif /* * Returns the next hole to retransmit and the number of retransmitted bytes @@ -648,11 +650,9 @@ tcp_sack_output_debug(struct tcpcb *tp, int *sack_bytes_rexmt) struct sackhole * tcp_sack_output(struct tcpcb *tp, int *sack_bytes_rexmt) { - struct sackhole *hole = NULL, *dbg_hole = NULL; - int dbg_bytes_rexmt; + struct sackhole *hole = NULL; INP_LOCK_ASSERT(tp->t_inpcb); - dbg_hole = tcp_sack_output_debug(tp, &dbg_bytes_rexmt); *sack_bytes_rexmt = tp->sackhint.sack_bytes_rexmit; hole = tp->sackhint.nexthole; if (hole == NULL || SEQ_LT(hole->rxmit, hole->end)) @@ -664,16 +664,6 @@ tcp_sack_output(struct tcpcb *tp, int *sack_bytes_rexmt) } } out: - if (dbg_hole != hole) { - printf("%s: Computed sack hole not the same as cached value\n", __func__); - hole = dbg_hole; - } - if (*sack_bytes_rexmt != dbg_bytes_rexmt) { - printf("%s: Computed sack_bytes_retransmitted (%d) not " - "the same as cached value (%d)\n", - __func__, dbg_bytes_rexmt, *sack_bytes_rexmt); - *sack_bytes_rexmt = dbg_bytes_rexmt; - } return (hole); }