Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Jun 2009 21:17:03 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        cvs-src-old@freebsd.org
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 ...
Message-ID:  <200906012117.n51LHTjk065108@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906012117.n51LHTjk065108>