Module Name: src Committed By: maxv Date: Thu Mar 29 18:54:48 UTC 2018
Modified Files: src/sys/arch/amd64/conf: ALL src/sys/arch/i386/conf: ALL src/sys/netinet: tcp_input.c tcp_subr.c Log Message: Remove TCPREASS_DEBUG. It was introduced 20 years ago when the reassembler was being developed, but it's irrelevant today. Makes the code clearer. To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/sys/arch/amd64/conf/ALL cvs rdiff -u -r1.435 -r1.436 src/sys/arch/i386/conf/ALL cvs rdiff -u -r1.399 -r1.400 src/sys/netinet/tcp_input.c cvs rdiff -u -r1.275 -r1.276 src/sys/netinet/tcp_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/amd64/conf/ALL diff -u src/sys/arch/amd64/conf/ALL:1.83 src/sys/arch/amd64/conf/ALL:1.84 --- src/sys/arch/amd64/conf/ALL:1.83 Fri Mar 16 12:48:54 2018 +++ src/sys/arch/amd64/conf/ALL Thu Mar 29 18:54:48 2018 @@ -1,4 +1,4 @@ -# $NetBSD: ALL,v 1.83 2018/03/16 12:48:54 maxv Exp $ +# $NetBSD: ALL,v 1.84 2018/03/29 18:54:48 maxv Exp $ # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp # # ALL machine description file @@ -17,7 +17,7 @@ include "arch/amd64/conf/std.amd64" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "ALL-$Revision: 1.83 $" +#ident "ALL-$Revision: 1.84 $" maxusers 64 # estimated number of users @@ -2257,7 +2257,6 @@ options TC5165DEBUG options TCICDEBUG options TCICISADEBUG options TCPISS_DEBUG -options TCPREASS_DEBUG options TCTRLDEBUG options TIMECOUNTER_DEBUG options TIMEKEEPER_DEBUG Index: src/sys/arch/i386/conf/ALL diff -u src/sys/arch/i386/conf/ALL:1.435 src/sys/arch/i386/conf/ALL:1.436 --- src/sys/arch/i386/conf/ALL:1.435 Fri Mar 16 12:48:54 2018 +++ src/sys/arch/i386/conf/ALL Thu Mar 29 18:54:48 2018 @@ -1,4 +1,4 @@ -# $NetBSD: ALL,v 1.435 2018/03/16 12:48:54 maxv Exp $ +# $NetBSD: ALL,v 1.436 2018/03/29 18:54:48 maxv Exp $ # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp # # ALL machine description file @@ -17,7 +17,7 @@ include "arch/i386/conf/std.i386" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "ALL-$Revision: 1.435 $" +#ident "ALL-$Revision: 1.436 $" maxusers 64 # estimated number of users @@ -2403,7 +2403,6 @@ options TC5165DEBUG options TCICDEBUG options TCICISADEBUG options TCPISS_DEBUG -options TCPREASS_DEBUG options TCTRLDEBUG options TIMECOUNTER_DEBUG options TIMEKEEPER_DEBUG Index: src/sys/netinet/tcp_input.c diff -u src/sys/netinet/tcp_input.c:1.399 src/sys/netinet/tcp_input.c:1.400 --- src/sys/netinet/tcp_input.c:1.399 Thu Mar 29 17:46:17 2018 +++ src/sys/netinet/tcp_input.c Thu Mar 29 18:54:48 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_input.c,v 1.399 2018/03/29 17:46:17 maxv Exp $ */ +/* $NetBSD: tcp_input.c,v 1.400 2018/03/29 18:54:48 maxv Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -148,7 +148,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.399 2018/03/29 17:46:17 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.400 2018/03/29 18:54:48 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -559,11 +559,6 @@ tcp_reass(struct tcpcb *tp, const struct * for further overlaps. */ if (q->ipqe_seq + q->ipqe_len == pkt_seq) { -#ifdef TCPREASS_DEBUG - printf("tcp_reass[%p]: concat %u:%u(%u) to %u:%u(%u)\n", - tp, pkt_seq, pkt_seq + pkt_len, pkt_len, - q->ipqe_seq, q->ipqe_seq + q->ipqe_len, q->ipqe_len); -#endif pkt_len += q->ipqe_len; pkt_flags |= q->ipqe_flags; pkt_seq = q->ipqe_seq; @@ -632,11 +627,6 @@ tcp_reass(struct tcpcb *tp, const struct if (SEQ_LT(q->ipqe_seq, pkt_seq) && SEQ_GT(q->ipqe_seq + q->ipqe_len, pkt_seq)) { int overlap = q->ipqe_seq + q->ipqe_len - pkt_seq; -#ifdef TCPREASS_DEBUG - printf("tcp_reass[%p]: trim starting %d bytes of %u:%u(%u)\n", - tp, overlap, - pkt_seq, pkt_seq + pkt_len, pkt_len); -#endif m_adj(m, overlap); rcvpartdupbyte += overlap; m_cat(q->ipre_mlast, m); @@ -658,11 +648,6 @@ tcp_reass(struct tcpcb *tp, const struct if (SEQ_GT(q->ipqe_seq, pkt_seq) && SEQ_LT(q->ipqe_seq, pkt_seq + pkt_len)) { int overlap = pkt_seq + pkt_len - q->ipqe_seq; -#ifdef TCPREASS_DEBUG - printf("tcp_reass[%p]: trim trailing %d bytes of %u:%u(%u)\n", - tp, overlap, - pkt_seq, pkt_seq + pkt_len, pkt_len); -#endif m_adj(m, -overlap); pkt_len -= overlap; rcvpartdupbyte += overlap; @@ -676,11 +661,6 @@ tcp_reass(struct tcpcb *tp, const struct * and reinsert the data. */ if (q->ipqe_seq == pkt_seq + pkt_len) { -#ifdef TCPREASS_DEBUG - printf("tcp_reass[%p]: append %u:%u(%u) to %u:%u(%u)\n", - tp, q->ipqe_seq, q->ipqe_seq + q->ipqe_len, q->ipqe_len, - pkt_seq, pkt_seq + pkt_len, pkt_len); -#endif pkt_len += q->ipqe_len; pkt_flags |= q->ipqe_flags; m_cat(m, q->ipqe_m); @@ -776,18 +756,8 @@ insert_it: tiqe->ipqe_flags = pkt_flags; if (p == NULL) { TAILQ_INSERT_HEAD(&tp->segq, tiqe, ipqe_q); -#ifdef TCPREASS_DEBUG - if (tiqe->ipqe_seq != tp->rcv_nxt) - printf("tcp_reass[%p]: insert %u:%u(%u) at front\n", - tp, pkt_seq, pkt_seq + pkt_len, pkt_len); -#endif } else { TAILQ_INSERT_AFTER(&tp->segq, p, tiqe, ipqe_q); -#ifdef TCPREASS_DEBUG - printf("tcp_reass[%p]: insert %u:%u(%u) after %u:%u(%u)\n", - tp, pkt_seq, pkt_seq + pkt_len, pkt_len, - p->ipqe_seq, p->ipqe_seq + p->ipqe_len, p->ipqe_len); -#endif } tp->t_segqlen++; Index: src/sys/netinet/tcp_subr.c diff -u src/sys/netinet/tcp_subr.c:1.275 src/sys/netinet/tcp_subr.c:1.276 --- src/sys/netinet/tcp_subr.c:1.275 Thu Mar 29 08:11:41 2018 +++ src/sys/netinet/tcp_subr.c Thu Mar 29 18:54:48 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_subr.c,v 1.275 2018/03/29 08:11:41 maxv Exp $ */ +/* $NetBSD: tcp_subr.c,v 1.276 2018/03/29 18:54:48 maxv Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -91,7 +91,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.275 2018/03/29 08:11:41 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.276 2018/03/29 18:54:48 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -1236,18 +1236,10 @@ tcp_freeq(struct tcpcb *tp) { struct ipqent *qe; int rv = 0; -#ifdef TCPREASS_DEBUG - int i = 0; -#endif TCP_REASS_LOCK_CHECK(tp); while ((qe = TAILQ_FIRST(&tp->segq)) != NULL) { -#ifdef TCPREASS_DEBUG - printf("tcp_freeq[%p,%d]: %u:%u(%u) 0x%02x\n", - tp, i++, qe->ipqe_seq, qe->ipqe_seq + qe->ipqe_len, - qe->ipqe_len, qe->ipqe_flags & (TH_SYN|TH_FIN|TH_RST)); -#endif TAILQ_REMOVE(&tp->segq, qe, ipqe_q); TAILQ_REMOVE(&tp->timeq, qe, ipqe_timeq); m_freem(qe->ipqe_m);