From owner-p4-projects@FreeBSD.ORG Tue Dec 16 11:12:19 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CE07316A4D0; Tue, 16 Dec 2003 11:12:18 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A954A16A4CE for ; Tue, 16 Dec 2003 11:12:18 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3C63043D35 for ; Tue, 16 Dec 2003 11:12:17 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id hBGJCH0B025909 for ; Tue, 16 Dec 2003 11:12:17 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id hBGJCGYv025906 for perforce@freebsd.org; Tue, 16 Dec 2003 11:12:16 -0800 (PST) (envelope-from sam@freebsd.org) Date: Tue, 16 Dec 2003 11:12:16 -0800 (PST) Message-Id: <200312161912.hBGJCGYv025906@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 43979 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2003 19:12:19 -0000 http://perforce.freebsd.org/chv.cgi?CH=43979 Change 43979 by sam@sam_ebb on 2003/12/16 11:11:23 add some locking missed in my first pass merging from bsd/os Affected files ... .. //depot/projects/netperf+sockets/sys/netinet/tcp_input.c#3 edit .. //depot/projects/netperf+sockets/sys/nfsclient/nfs_socket.c#4 edit Differences ... ==== //depot/projects/netperf+sockets/sys/netinet/tcp_input.c#3 (text+ko) ==== @@ -1039,6 +1039,7 @@ acked = th->th_ack - tp->snd_una; tcpstat.tcps_rcvackpack++; tcpstat.tcps_rcvackbyte += acked; + SOCKBUF_LOCK(&so->so_snd); sbdrop(&so->so_snd, acked); if (SEQ_GT(tp->snd_una, tp->snd_recover) && SEQ_LEQ(th->th_ack, tp->snd_recover)) @@ -1076,7 +1077,8 @@ tp->t_rxtcur, tcp_timer_rexmt, tp); - sowwakeup(so); + sowwakeup_locked(so); + SOCKBUF_UNLOCK(&so->so_snd); if (so->so_snd.sb_cc) (void) tcp_output(tp); goto check_delack; @@ -1964,6 +1966,7 @@ incr = incr * incr / cw; tp->snd_cwnd = min(cw+incr, TCP_MAXWIN<snd_scale); } + SOCKBUF_LOCK(&so->so_snd); if (acked > so->so_snd.sb_cc) { tp->snd_wnd -= so->so_snd.sb_cc; sbdrop(&so->so_snd, (int)so->so_snd.sb_cc); @@ -1973,7 +1976,8 @@ tp->snd_wnd -= acked; ourfinisacked = 0; } - sowwakeup(so); + sowwakeup_locked(so); + SOCKBUF_UNLOCK(&so->so_snd); /* detect una wraparound */ if (tcp_do_newreno && !IN_FASTRECOVERY(tp) && SEQ_GT(tp->snd_una, tp->snd_recover) && ==== //depot/projects/netperf+sockets/sys/nfsclient/nfs_socket.c#4 (text+ko) ==== @@ -160,7 +160,7 @@ nfs_connect(struct nfsmount *nmp, struct nfsreq *rep) { struct socket *so; - int s, error, rcvreserve, sndreserve; + int error, rcvreserve, sndreserve; int pktscale; struct sockaddr *saddr; struct thread *td = &thread0; /* only used for socreate and sobind */ @@ -243,25 +243,25 @@ * connect system call but with the wait timing out so * that interruptible mounts don't hang here for a long time. */ - s = splnet(); + SOCK_LOCK(so); while ((so->so_state & SS_ISCONNECTING) && so->so_error == 0) { - (void) tsleep(&so->so_timeo, + (void) msleep(&so->so_timeo, SOCK_MTX(so), PSOCK, "nfscon", 2 * hz); if ((so->so_state & SS_ISCONNECTING) && so->so_error == 0 && rep && (error = nfs_sigintr(nmp, rep, rep->r_td)) != 0) { so->so_state &= ~SS_ISCONNECTING; - splx(s); + SOCK_UNLOCK(so); goto bad; } } if (so->so_error) { error = so->so_error; so->so_error = 0; - splx(s); + SOCK_UNLOCK(so); goto bad; } - splx(s); + SOCK_UNLOCK(so); } so->so_rcv.sb_timeo = 5 * hz; so->so_snd.sb_timeo = 5 * hz;