From owner-p4-projects@FreeBSD.ORG Mon May 31 19:58:07 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C3DE116A4D0; Mon, 31 May 2004 19:58:06 -0700 (PDT) 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 9D3CE16A4CE for ; Mon, 31 May 2004 19:58:06 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 93C5743D31 for ; Mon, 31 May 2004 19:58:06 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i512vqp0025287 for ; Mon, 31 May 2004 19:57:52 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i512vqg8025284 for perforce@freebsd.org; Mon, 31 May 2004 19:57:52 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Mon, 31 May 2004 19:57:52 -0700 (PDT) Message-Id: <200406010257.i512vqg8025284@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Subject: PERFORCE change 53924 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, 01 Jun 2004 02:58:07 -0000 http://perforce.freebsd.org/chv.cgi?CH=53924 Change 53924 by rwatson@rwatson_tislabs on 2004/05/31 19:57:28 Integrate rwatson_netperf_merge: - More module.h cleanup - Don Lewis's introduction of MSG_NBIO to avoid frobbing SS_NBIO in fifofs resulting in races with other fifo consumers. - Loopback of so_qstate and SQ_INCOMP/SQ_COMP. Affected files ... .. //depot/projects/netperf_socket/sys/fs/fifofs/fifo_vnops.c#5 integrate .. //depot/projects/netperf_socket/sys/i386/i386/nexus.c#3 integrate .. //depot/projects/netperf_socket/sys/kern/uipc_socket.c#12 integrate .. //depot/projects/netperf_socket/sys/kern/uipc_socket2.c#10 integrate .. //depot/projects/netperf_socket/sys/kern/uipc_syscalls.c#12 integrate .. //depot/projects/netperf_socket/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c#4 integrate .. //depot/projects/netperf_socket/sys/netgraph/ng_ksocket.c#4 integrate .. //depot/projects/netperf_socket/sys/sys/socket.h#6 integrate .. //depot/projects/netperf_socket/sys/sys/socketvar.h#6 integrate .. //depot/projects/netperf_socket/sys/vm/uma.h#3 integrate Differences ... ==== //depot/projects/netperf_socket/sys/fs/fifofs/fifo_vnops.c#5 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)fifo_vnops.c 8.10 (Berkeley) 5/27/95 - * $FreeBSD: src/sys/fs/fifofs/fifo_vnops.c,v 1.94 2004/05/17 20:16:40 truckman Exp $ + * $FreeBSD: src/sys/fs/fifofs/fifo_vnops.c,v 1.95 2004/06/01 01:18:50 truckman Exp $ */ #include @@ -312,7 +312,7 @@ struct uio *uio = ap->a_uio; struct socket *rso = ap->a_vp->v_fifoinfo->fi_readsock; struct thread *td = uio->uio_td; - int error; + int error, flags; #ifdef DIAGNOSTIC if (uio->uio_rw != UIO_READ) @@ -320,14 +320,11 @@ #endif if (uio->uio_resid == 0) return (0); - if (ap->a_ioflag & IO_NDELAY) - rso->so_state |= SS_NBIO; VOP_UNLOCK(ap->a_vp, 0, td); + flags = (ap->a_ioflag & IO_NDELAY) ? MSG_NBIO : 0; error = soreceive(rso, (struct sockaddr **)0, uio, (struct mbuf **)0, - (struct mbuf **)0, (int *)0); + (struct mbuf **)0, &flags); vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY, td); - if (ap->a_ioflag & IO_NDELAY) - rso->so_state &= ~SS_NBIO; return (error); } @@ -346,20 +343,17 @@ { struct socket *wso = ap->a_vp->v_fifoinfo->fi_writesock; struct thread *td = ap->a_uio->uio_td; - int error; + int error, flags; #ifdef DIAGNOSTIC if (ap->a_uio->uio_rw != UIO_WRITE) panic("fifo_write mode"); #endif - if (ap->a_ioflag & IO_NDELAY) - wso->so_state |= SS_NBIO; VOP_UNLOCK(ap->a_vp, 0, td); + flags = (ap->a_ioflag & IO_NDELAY) ? MSG_NBIO : 0; error = sosend(wso, (struct sockaddr *)0, ap->a_uio, 0, - (struct mbuf *)0, 0, td); + (struct mbuf *)0, flags, td); vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY, td); - if (ap->a_ioflag & IO_NDELAY) - wso->so_state &= ~SS_NBIO; return (error); } ==== //depot/projects/netperf_socket/sys/i386/i386/nexus.c#3 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/i386/nexus.c,v 1.55 2004/05/04 21:02:56 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/i386/nexus.c,v 1.56 2004/06/01 01:04:25 njl Exp $"); /* * This code implements a `root nexus' for Intel Architecture @@ -519,8 +519,6 @@ struct resource_list_entry *rle; rle = resource_list_find(rl, type, rid); - device_printf(child, "type %d rid %d startp %p countp %p - got %p\n", - type, rid, startp, countp, rle); if (!rle) return(ENOENT); if (startp) ==== //depot/projects/netperf_socket/sys/kern/uipc_socket.c#12 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/uipc_socket.c,v 1.171 2004/05/31 21:46:04 bmilekic Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/uipc_socket.c,v 1.173 2004/06/01 02:42:55 rwatson Exp $"); #include "opt_inet.h" #include "opt_mac.h" @@ -299,10 +299,10 @@ SOCKBUF_LOCK(&so->so_rcv); if (so->so_head != NULL) { head = so->so_head; - if (so->so_state & SS_INCOMP) { + if (so->so_qstate & SQ_INCOMP) { TAILQ_REMOVE(&head->so_incomp, so, so_list); head->so_incqlen--; - } else if (so->so_state & SS_COMP) { + } else if (so->so_qstate & SQ_COMP) { /* * We must not decommission a socket that's * on the accept(2) queue. If we do, then @@ -314,7 +314,7 @@ } else { panic("sofree: not queued"); } - so->so_state &= ~SS_INCOMP; + so->so_qstate &= ~SQ_INCOMP; so->so_head = NULL; } SOCKBUF_UNLOCK(&so->so_rcv); @@ -359,7 +359,7 @@ /* Dequeue from so_comp since sofree() won't do it */ TAILQ_REMOVE(&so->so_comp, sp, so_list); so->so_qlen--; - sp->so_state &= ~SS_COMP; + sp->so_qstate &= ~SQ_COMP; sp->so_head = NULL; (void) soabort(sp); } @@ -604,7 +604,7 @@ snderr(EMSGSIZE); if (space < resid + clen && (atomic || space < so->so_snd.sb_lowat || space < clen)) { - if (so->so_state & SS_NBIO) + if ((so->so_state & SS_NBIO) || (flags & MSG_NBIO)) snderr(EWOULDBLOCK); error = sbwait(&so->so_snd); if (error) @@ -903,7 +903,8 @@ } if (uio->uio_resid == 0) goto release; - if ((so->so_state & SS_NBIO) || (flags & MSG_DONTWAIT)) { + if ((so->so_state & SS_NBIO) || + (flags & (MSG_DONTWAIT|MSG_NBIO))) { error = EWOULDBLOCK; goto release; } ==== //depot/projects/netperf_socket/sys/kern/uipc_socket2.c#10 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/uipc_socket2.c,v 1.125 2004/05/31 21:46:04 bmilekic Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/uipc_socket2.c,v 1.126 2004/06/01 02:42:55 rwatson Exp $"); #include "opt_mac.h" #include "opt_param.h" @@ -125,7 +125,7 @@ SOCK_LOCK(so); so->so_state &= ~(SS_ISCONNECTING|SS_ISDISCONNECTING|SS_ISCONFIRMING); so->so_state |= SS_ISCONNECTED; - if (head && (so->so_state & SS_INCOMP)) { + if (head && (so->so_qstate & SQ_INCOMP)) { if ((so->so_options & SO_ACCEPTFILTER) == 0) { if (need_lock) SOCK_UNLOCK(so); @@ -242,7 +242,7 @@ SOCKBUF_LOCK(&head->so_rcv); if (connstatus) { TAILQ_INSERT_TAIL(&head->so_comp, so, so_list); - so->so_state |= SS_COMP; + so->so_qstate |= SQ_COMP; head->so_qlen++; } else { if (head->so_incqlen > head->so_qlimit) { @@ -251,7 +251,7 @@ (void) soabort(sp); } TAILQ_INSERT_TAIL(&head->so_incomp, so, so_list); - so->so_state |= SS_INCOMP; + so->so_qstate |= SQ_INCOMP; head->so_incqlen++; } SOCKBUF_UNLOCK(&head->so_rcv); ==== //depot/projects/netperf_socket/sys/kern/uipc_syscalls.c#12 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/uipc_syscalls.c,v 1.184 2004/05/31 21:46:04 bmilekic Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/uipc_syscalls.c,v 1.185 2004/06/01 02:42:55 rwatson Exp $"); #include "opt_compat.h" #include "opt_ktrace.h" @@ -346,7 +346,7 @@ /* connection has been removed from the listen queue */ KNOTE(&head->so_rcv.sb_sel.si_note, 0); - so->so_state &= ~SS_COMP; + so->so_qstate &= ~SQ_COMP; so->so_head = NULL; pgid = fgetown(&head->so_sigio); if (pgid != 0) ==== //depot/projects/netperf_socket/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c#4 (text+ko) ==== @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $Id: ng_btsocket_rfcomm.c,v 1.28 2003/09/14 23:29:06 max Exp $ - * $FreeBSD: src/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c,v 1.6 2004/04/27 16:38:15 emax Exp $ + * $FreeBSD: src/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c,v 1.7 2004/06/01 02:42:56 rwatson Exp $ */ #include @@ -1369,7 +1369,7 @@ s0->l2so->so_qlen --; soref(l2so); - l2so->so_state &= ~SS_COMP; + l2so->so_qstate &= ~SQ_COMP; l2so->so_state |= SS_NBIO; l2so->so_head = NULL; ==== //depot/projects/netperf_socket/sys/netgraph/ng_ksocket.c#4 (text+ko) ==== @@ -36,7 +36,7 @@ * * Author: Archie Cobbs * - * $FreeBSD: src/sys/netgraph/ng_ksocket.c,v 1.40 2004/05/29 00:51:11 julian Exp $ + * $FreeBSD: src/sys/netgraph/ng_ksocket.c,v 1.41 2004/06/01 02:42:55 rwatson Exp $ * $Whistle: ng_ksocket.c,v 1.1 1999/11/16 20:04:40 archie Exp $ */ @@ -1204,7 +1204,7 @@ soref(so); - so->so_state &= ~SS_COMP; + so->so_qstate &= ~SQ_COMP; so->so_state |= SS_NBIO; so->so_head = NULL; ==== //depot/projects/netperf_socket/sys/sys/socket.h#6 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)socket.h 8.4 (Berkeley) 2/21/94 - * $FreeBSD: src/sys/sys/socket.h,v 1.79 2004/05/10 02:24:56 emax Exp $ + * $FreeBSD: src/sys/sys/socket.h,v 1.80 2004/06/01 01:18:51 truckman Exp $ */ #ifndef _SYS_SOCKET_H_ @@ -393,6 +393,7 @@ #if __BSD_VISIBLE #define MSG_DONTWAIT 0x80 /* this message should be nonblocking */ #define MSG_EOF 0x100 /* data completes connection */ +#define MSG_NBIO 0x4000 /* FIONBIO mode, used by fifofs */ #define MSG_COMPAT 0x8000 /* used in sendit() */ #endif ==== //depot/projects/netperf_socket/sys/sys/socketvar.h#6 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)socketvar.h 8.3 (Berkeley) 2/19/95 - * $FreeBSD: src/sys/sys/socketvar.h,v 1.111 2004/04/07 04:19:49 imp Exp $ + * $FreeBSD: src/sys/sys/socketvar.h,v 1.112 2004/06/01 02:42:54 rwatson Exp $ */ #ifndef _SYS_SOCKETVAR_H_ @@ -52,6 +52,7 @@ short so_options; /* from socket call, see socket.h */ short so_linger; /* time to linger while closing */ short so_state; /* internal state flags SS_*, below */ + int so_qstate; /* internal state flags SQ_* */ void *so_pcb; /* protocol control block */ struct protosw *so_proto; /* protocol handle */ /* @@ -163,11 +164,15 @@ #define SS_ASYNC 0x0200 /* async i/o notify */ #define SS_ISCONFIRMING 0x0400 /* deciding to accept connection req */ -#define SS_INCOMP 0x0800 /* unaccepted, incomplete connection */ -#define SS_COMP 0x1000 /* unaccepted, complete connection */ #define SS_ISDISCONNECTED 0x2000 /* socket disconnected from peer */ /* + * Socket state bits stored in so_qstate. + */ +#define SQ_INCOMP 0x0800 /* unaccepted, incomplete connection */ +#define SQ_COMP 0x1000 /* unaccepted, complete connection */ + +/* * Externalized form of struct socket used by the sysctl(3) interface. */ struct xsocket { ==== //depot/projects/netperf_socket/sys/vm/uma.h#3 (text+ko) ==== @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/vm/uma.h,v 1.17 2004/05/31 21:46:05 bmilekic Exp $ + * $FreeBSD: src/sys/vm/uma.h,v 1.18 2004/06/01 01:36:26 bmilekic Exp $ * */ @@ -185,9 +185,9 @@ * zinit/zfini (unset by default for master zone) with * uma_zone_set_zinit/zfini() (note subtle 'z' prefix). * - * align A bitmask that corisponds to the requested alignment - * eg 4 would be 0x3 - * flags A set of parameters that control the behavior of the zone + * master A reference to this zone's Master Zone (Primary Zone), + * which contains the backing Keg for the Secondary Zone + * being added. * * Returns: * A pointer to a structure which is intended to be opaque to users of