From owner-p4-projects@FreeBSD.ORG Thu Jul 23 20:53:26 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D6CE91065673; Thu, 23 Jul 2009 20:53:25 +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 96C85106566B for ; Thu, 23 Jul 2009 20:53:25 +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 6A1298FC1C for ; Thu, 23 Jul 2009 20:53:25 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n6NKrPg6087060 for ; Thu, 23 Jul 2009 20:53:25 GMT (envelope-from andre@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n6NKrPj0087058 for perforce@freebsd.org; Thu, 23 Jul 2009 20:53:25 GMT (envelope-from andre@freebsd.org) Date: Thu, 23 Jul 2009 20:53:25 GMT Message-Id: <200907232053.n6NKrPj0087058@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 166475 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: Thu, 23 Jul 2009 20:53:26 -0000 http://perforce.freebsd.org/chv.cgi?CH=166475 Change 166475 by andre@andre_t61 on 2009/07/23 20:52:38 Pass length directly to tcp_reass(). The pointer juggling is no longer necessary as the receiver SACK blocks are generated directly out of the reassembly queue. Affected files ... .. //depot/projects/tcp_reass/netinet/tcp_input.c#15 edit .. //depot/projects/tcp_reass/netinet/tcp_reass.c#42 edit .. //depot/projects/tcp_reass/netinet/tcp_var.h#21 edit Differences ... ==== //depot/projects/tcp_reass/netinet/tcp_input.c#15 (text+ko) ==== @@ -1999,8 +1999,7 @@ * later; if not, do so now to pass queued data to user. */ if (tlen == 0 && (thflags & TH_FIN) == 0) - (void) tcp_reass(tp, (struct tcphdr *)0, 0, - (struct mbuf *)0); + (void)tcp_reass(tp, NULL, 0, NULL); tp->snd_wl1 = th->th_seq - 1; /* FALLTHROUGH */ @@ -2592,7 +2591,7 @@ /* * NB: tcp_reass() always consumes the mbuf chain. */ - thflags = tcp_reass(tp, th, &tlen, m); + thflags = tcp_reass(tp, th, tlen, m); tp->t_flags |= TF_ACKNOW; } #ifdef INVARIANTS ==== //depot/projects/tcp_reass/netinet/tcp_reass.c#42 (text+ko) ==== @@ -277,7 +277,7 @@ * the queue or by freeing it. */ int -tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tlenp, struct mbuf *m) +tcp_reass(struct tcpcb *tp, struct tcphdr *th, int len, struct mbuf *m) { int thflags = 0; tcp_seq th_seq; @@ -303,9 +303,8 @@ } KASSERT(th != NULL, ("%s: th is NULL", __func__)); - KASSERT(tlenp != NULL, ("%s: tlenp is NULL", __func__)); KASSERT(m != NULL, ("%s: m is NULL", __func__)); - KASSERT(*tlenp == m_length(m, NULL), + KASSERT(len == m_length(m, NULL), ("%s: tlen != mbuf length", __func__)); /* @@ -375,7 +374,7 @@ tcp_timer_activate(tp, TT_REASS, 0); return (thflags); } - } else if (*tlenp == 0) + } else if (len == 0) goto done; else thflags &= ~TH_FIN; @@ -394,7 +393,7 @@ /* Set up search structure. */ trbs.trb_seqs = th_seq; - trbs.trb_seqe = th_seq + *tlenp; + trbs.trb_seqe = th_seq + len; trbs.trb_m = m; trbs.trb_mt = m_last(m); @@ -496,7 +495,6 @@ done: m_freem(m); - *tlenp = 0; return (0); } ==== //depot/projects/tcp_reass/netinet/tcp_var.h#21 (text+ko) ==== @@ -652,7 +652,7 @@ void tcp_fini(void *); char *tcp_log_addrs(struct in_conninfo *, struct tcphdr *, void *, const void *); -int tcp_reass(struct tcpcb *, struct tcphdr *, int *, struct mbuf *); +int tcp_reass(struct tcpcb *, struct tcphdr *, int, struct mbuf *); void tcp_reass_init(void); int tcp_reass_sack(struct tcpcb *, u_char *, int); void tcp_reass_flush(struct tcpcb *);