From owner-cvs-src-old@FreeBSD.ORG Mon Jun 1 21:17:29 2009 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C518F1065678 for ; Mon, 1 Jun 2009 21:17:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id AEC6D8FC17 for ; Mon, 1 Jun 2009 21:17:29 +0000 (UTC) (envelope-from jhb@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 n51LHTRA065109 for ; Mon, 1 Jun 2009 21:17:29 GMT (envelope-from jhb@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n51LHTjk065108 for cvs-src-old@freebsd.org; Mon, 1 Jun 2009 21:17:29 GMT (envelope-from jhb@repoman.freebsd.org) Message-Id: <200906012117.n51LHTjk065108@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to jhb@repoman.freebsd.org using -f From: John Baldwin Date: Mon, 1 Jun 2009 21:17:03 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/dev/cxgb/ulp/iw_cxgb iw_cxgb_cm.c src/sys/kern uipc_sockbuf.c uipc_socket.c vfs_aio.c src/sys/netgraph ng_ksocket.c src/sys/netgraph/bluetooth/socket ng_btsocket_rfcomm.c src/sys/netinet accf_data.c accf_dns.c accf_http.c src/sys/netsmb ... X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 21:17:30 -0000 jhb 2009-06-01 21:17:03 UTC FreeBSD src repository Modified files: sys/dev/cxgb/ulp/iw_cxgb iw_cxgb_cm.c sys/kern uipc_sockbuf.c uipc_socket.c vfs_aio.c sys/netgraph ng_ksocket.c sys/netgraph/bluetooth/socket ng_btsocket_rfcomm.c sys/netinet accf_data.c accf_dns.c accf_http.c sys/netsmb smb_trantcp.c sys/nfsclient nfs_socket.c sys/nfsserver nfs.h nfs_srvsock.c nfs_syscalls.c sys/rpc clnt_dg.c clnt_vc.c svc_dg.c svc_vc.c sys/sys sockbuf.h socketvar.h Log: SVN rev 193272 on 2009-06-01 21:17:03Z by jhb Rework socket upcalls to close some races with setup/teardown of upcalls. - Each socket upcall is now invoked with the appropriate socket buffer locked. It is not permissible to call soisconnected() with this lock held; however, so socket upcalls now return an integer value. The two possible values are SU_OK and SU_ISCONNECTED. If an upcall returns SU_ISCONNECTED, then the soisconnected() will be invoked on the socket after the socket buffer lock is dropped. - A new API is provided for setting and clearing socket upcalls. The API consists of soupcall_set() and soupcall_clear(). - To simplify locking, each socket buffer now has a separate upcall. - When a socket upcall returns SU_ISCONNECTED, the upcall is cleared from the receive socket buffer automatically. Note that a SO_SND upcall should never return SU_ISCONNECTED. - All this means that accept filters should now return SU_ISCONNECTED instead of calling soisconnected() directly. They also no longer need to explicitly clear the upcall on the new socket. - The HTTP accept filter still uses soupcall_set() to manage its internal state machine, but other accept filters no longer have any explicit knowlege of socket upcall internals aside from their return value. - The various RPC client upcalls currently drop the socket buffer lock while invoking soreceive() as a temporary band-aid. The plan for the future is to add a new flag to allow soreceive() to be called with the socket buffer locked. - The AIO callback for socket I/O is now also invoked with the socket buffer locked. Previously sowakeup() would drop the socket buffer lock only to call aio_swake() which immediately re-acquired the socket buffer lock for the duration of the function call. Discussed with: rwatson, rmacklem Revision Changes Path 1.3 +10 -13 src/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c 1.181 +14 -4 src/sys/kern/uipc_sockbuf.c 1.331 +63 -6 src/sys/kern/uipc_socket.c 1.242 +1 -2 src/sys/kern/vfs_aio.c 1.31 +9 -14 src/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c 1.63 +9 -13 src/sys/netgraph/ng_ksocket.c 1.12 +4 -7 src/sys/netinet/accf_data.c 1.3 +4 -7 src/sys/netinet/accf_dns.c 1.18 +20 -33 src/sys/netinet/accf_http.c 1.30 +4 -5 src/sys/netsmb/smb_trantcp.c 1.168 +19 -16 src/sys/nfsclient/nfs_socket.c 1.89 +1 -1 src/sys/nfsserver/nfs.h 1.114 +2 -2 src/sys/nfsserver/nfs_srvsock.c 1.127 +4 -6 src/sys/nfsserver/nfs_syscalls.c 1.5 +24 -19 src/sys/rpc/clnt_dg.c 1.6 +15 -15 src/sys/rpc/clnt_vc.c 1.4 +6 -11 src/sys/rpc/svc_dg.c 1.5 +8 -17 src/sys/rpc/svc_vc.c 1.6 +2 -0 src/sys/sys/sockbuf.h 1.169 +14 -3 src/sys/sys/socketvar.h