Get rid of an old and terrible hack. Local stream sockets enqueue packets
authorMatthew Dillon <dillon@dragonflybsd.org>
Tue, 27 May 2008 05:25:36 +0000 (05:25 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Tue, 27 May 2008 05:25:36 +0000 (05:25 +0000)
commit3a6117bbe0ed6a87605c1e43e12a1438d8844380
treeacfe8a766ea0874a28ffbccb80b4b7c4ecff7fd9
parentdbfd168bf4fe7eed976c83aa46108ee502748dcd
Get rid of an old and terrible hack.  Local stream sockets enqueue packets
directly on the peer's sockbuf, rather then the sender's sockbuf.  That
part of the code is fine, but in order to prevent the sender from queueing
infinite mbufs (because its sockbuf appears to be empty when you do that)
the code dynamically messed around with the sender's high water mark.

This blew up the new SOCK_SEQPACKET.  In particular, it blows up the
use of the PR_ATOMIC on stream sockets and can cause spurious EMSGSIZE
errors to be returned instead of the EWOULDBLOCK that should have been
returned.

Also fix, or partially the resource limit code which tries to reduce the
high water mark when a user is using too many mbufs.  This never worked
well and still doesn't, but it is in better shape now.

Get rid of the crufty code and simply add a flag to the signalsockbuf,
SSB_STOP, to stop the sender.

Also adjust the vkernel to increase the default socket buffer when
connecting to vknet instead of if_tap.  VKE currently issues non-blocking
writes to vknet/tap and we do not want to lose packets for no good reason.
sys/dev/virtual/net/if_vke.c
sys/kern/kern_resource.c
sys/kern/uipc_socket.c
sys/kern/uipc_socket2.c
sys/kern/uipc_usrreq.c
sys/platform/vkernel/platform/init.c
sys/sys/socketvar.h
sys/sys/unpcb.h