From owner-p4-projects@FreeBSD.ORG Fri Mar 12 18:48:11 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 67CFC1065670; Fri, 12 Mar 2010 18:48:11 +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 2B04B1065674 for ; Fri, 12 Mar 2010 18:48:11 +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 F37C18FC17 for ; Fri, 12 Mar 2010 18:48:10 +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 o2CImAHL095523 for ; Fri, 12 Mar 2010 18:48:10 GMT (envelope-from andre@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o2CImA7S095521 for perforce@freebsd.org; Fri, 12 Mar 2010 18:48:10 GMT (envelope-from andre@freebsd.org) Date: Fri, 12 Mar 2010 18:48:10 GMT Message-Id: <201003121848.o2CImA7S095521@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 Precedence: bulk Cc: Subject: PERFORCE change 175636 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Mar 2010 18:48:11 -0000 http://p4web.freebsd.org/chv.cgi?CH=175636 Change 175636 by andre@andre_t61 on 2010/03/12 18:47:41 Fold tcp_send() back into tcp_output(). Both are an integrated code flow and there is not much benefit in having them separate except of lots of argument passing. Affected files ... .. //depot/projects/tcp_new/netinet/tcp_output.c#17 edit Differences ... ==== //depot/projects/tcp_new/netinet/tcp_output.c#17 (text+ko) ==== @@ -102,9 +102,6 @@ &tcp_autosndbuf_max, 0, "Max size of automatic send buffer"); static int ip_optlen(struct inpcb *inp); -static int tcp_send(struct tcpcb *tp, struct socket *so, - struct tcpopt *to, u_char *opt, int len, - int optlen, int rwin, int flags); static int tcp_retransmit(struct tcpcb *tp, struct socket *so, struct tcpopt *to, u_char *opt, int *len, int optlen, int rwin, int dlen, int slen, int flags); @@ -146,10 +143,11 @@ { int flags, error, optlen = 0; tcp_win len; - int duna, swnd, cwnd, dlen, slen, inflight, rwin; + int duna, swnd, cwnd, dlen, slen, inflight, rwin, off; int tcp_min_idle = 1; /* XXXAO */ struct inpcb *inp = tp->t_inpcb; struct socket *so = inp->inp_socket; + struct tcphdr ths, *th = &ths; struct tcpopt to; u_char opt[TCP_MAXOLEN]; #ifdef TCP_SIGNATURE @@ -260,6 +258,7 @@ break; case TP_LOSSRECOV: case TP_REXMT: + optlen = tcp_options(tp, so, &to, &opt[0], flags); error = tcp_retransmit(tp, so, &to, &opt[0], &len, optlen, rwin, dlen, slen, flags); break; case TP_PERSIST: @@ -490,22 +489,13 @@ return (0); send: - optlen = tcp_options(tp, so, &to, &opt[0], flags); - error = tcp_send(tp, so, &to, &opt[0], len, optlen, rwin, flags); - - if (!error) - tcp_snd_autoscale(tp, so, swnd); + /* + * Only compute options if not already done for retransmit. + * XXXAO: NOOPT + */ + if (optlen == 0) + optlen = tcp_options(tp, so, &to, &opt[0], flags); - return (error); -} - -static int -tcp_send(struct tcpcb *tp, struct socket *so, struct tcpopt *to, - u_char *opt, int len, int optlen, int rwin, int flags) -{ - int off, error; - struct tcphdr ths, *th = &ths; - KASSERT((flags & TH_SYN) || (tp->t_flags & TF_SENTSYN), ("%s: retransmitting SYN", __func__)); KASSERT((flags & TH_FIN) || (tp->t_flags & TF_SENTFIN), @@ -650,6 +640,11 @@ } /* + * Scale the send window. + */ + tcp_snd_autoscale(tp, so, swnd); + + /* * Set retransmit timer if not currently set, * and not doing a pure ack or a keep-alive probe. * Initial value for retransmit timer is smoothed @@ -767,7 +762,7 @@ else tcpstat.tcps_sndwinup++; - return (0); + return (error); } /*