From owner-p4-projects@FreeBSD.ORG Mon Sep 7 19:44:37 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CEA111065672; Mon, 7 Sep 2009 19:44:37 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7ACB4106568B for ; Mon, 7 Sep 2009 19:44:37 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 697FD8FC17 for ; Mon, 7 Sep 2009 19:44:37 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n87Jibsw008180 for ; Mon, 7 Sep 2009 19:44:37 GMT (envelope-from andre@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n87JibV3008178 for perforce@freebsd.org; Mon, 7 Sep 2009 19:44:37 GMT (envelope-from andre@freebsd.org) Date: Mon, 7 Sep 2009 19:44:37 GMT Message-Id: <200909071944.n87JibV3008178@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andre@freebsd.org using -f From: Andre Oppermann To: Perforce Change Reviews Cc: Subject: PERFORCE change 168295 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2009 19:44:38 -0000 http://perforce.freebsd.org/chv.cgi?CH=168295 Change 168295 by andre@andre_t61 on 2009/09/07 19:43:55 Update TODO list. Fix spelling errors and improve comments. Save DSACK start and end values. Make use of TCP reassembly queue flush timeout. tcp_reass_merge gives back overlap size for DSACK. Affected files ... .. //depot/projects/tcp_reass/netinet/tcp_reass.c#54 edit Differences ... ==== //depot/projects/tcp_reass/netinet/tcp_reass.c#54 (text+ko) ==== @@ -95,9 +95,12 @@ * TODO: * - Improve comments and annotate RFC references. * - Style improvements. - * - Acticate timeout on first insert. + * - Activate timeout on first insert. * - Partial D-SACK support. + * - D-SACK when only one SACK slot available? + * - Direct pointer to last block in RB-tree. * - Return flags should be same minus FIN. + * - Remove T/TCP gonk. * - Lots of testing. */ @@ -258,7 +261,7 @@ /* * Remove a single block from the reassembly queue - * and free all its mbufs, if any. + * and free all of its mbufs, if any. */ static void tcp_reass_free(struct tcpcb *tp, struct tcp_reass_block *trb) @@ -355,7 +358,8 @@ /* * Store TCP header information in local variables as - * we may lose access to it after mbuf compacting. + * we may lose access to it after header dropping and + * mbuf compacting. */ thflags = th->th_flags; th_seq = th->th_seq; @@ -490,6 +494,8 @@ */ if ((len = SEQ_DELTA(trbs.trb_seqs, trbs.trb_seqe)) > 0) { tp->rcv_reass_size -= len; + tp->rcv_reass_dsack.start = trbs.trb_seqs; + tp->rcv_reass_dsack.end = trbs.trb_seqe; TCPSTAT_INC(tcps_rcvpartduppack); TCPSTAT_ADD(tcps_rcvpartdupbyte, len); } @@ -521,8 +527,11 @@ LIST_INSERT_HEAD(&tp->rcv_reass_sack, trb, trb_sack); tp->rcv_reass_size += SEQ_DELTA(trbs.trb_seqs, trbs.trb_seqe); tp->rcv_reass_blocks++; - if (RB_EMPTY(&tp->rcv_reass)) + if (RB_EMPTY(&tp->rcv_reass)) { + KASSERT(tcp_timer_active(tp, TT_REASS) == 0, + ("%s: ", __func__)); tcp_timer_activate(tp, TT_REASS, tcp_reass_timeout); + } TCPSTAT_INC(tcps_reass_blocks); } else { /* Memory allocation failure. */ @@ -585,7 +594,7 @@ */ if (tcp_reass_timeout && !RB_EMPTY(&tp->rcv_reass)) tcp_timer_activate(tp, TT_REASS, tcp_reass_timeout); - else + else if (tcp_timer_active(tp, TT_REASS)) tcp_timer_activate(tp, TT_REASS, 0); ND6_HINT(tp); @@ -597,7 +606,7 @@ } /* - * Trim a SACK block. + * Trim a reassembly block. * A positive value is from head, negative from tail. */ static void @@ -630,6 +639,7 @@ tcp_reass_merge(struct tcp_reass_block *trb, struct tcp_reass_block *trbn) { int i; + tcp_seq s; KASSERT(trb != NULL && trbn != NULL, ("%s: incomplete input", __func__)); @@ -644,6 +654,7 @@ SEQ_GEQ(trbn->trb_seqe, trb->trb_seqe)) { i = SEQ_DELTA(trb->trb_seqs, trbn->trb_seqe); + s = trb->trb_seqs; m_freem(trb->trb_m); trb->trb_seqs = trbn->trb_seqs; @@ -658,6 +669,7 @@ if ((i = SEQ_DELTA(trb->trb_seqs, trbn->trb_seqe)) > 0) tcp_reass_trim(trbn, -i); + s = trb->trb_seqs; trb->trb_seqs = trbn->trb_seqs; trbn->trb_mt->m_next = trb->trb_m; trb->trb_m = trbn->trb_m; @@ -672,6 +684,7 @@ if ((i = SEQ_DELTA(trb->trb_seqe, trbn->trb_seqs)) > 0) tcp_reass_trim(trbn, i); + s = trb->trb_seqe; trb->trb_seqe = trbn->trb_seqe; trb->trb_mt->m_next = trbn->trb_m; @@ -684,8 +697,8 @@ } else return (NULL); - trbn->trb_seqs = 0; - trbn->trb_seqe = i; + trbn->trb_seqs = s; + trbn->trb_seqe = trbn->trb_seqs + i; trbn->trb_m = NULL; trbn->trb_mt = NULL; return (trbn);