MFC r264348 by mav@:
Improve use of socket buffer upcalls.
Use soreadable()/sowriteable() in socket upcalls to avoid extra wakeups
until we have enough data to read or space to write.
Increase partial receive len from 1K to 128K to not wake up on every
received packet.
This significantly reduces locks congestion and CPU usage and improves
throughput for large I/Os on NICs without TSO and LRO.
MFC r264552 by mav@:
Close the race in older code, that caused connection stuck after r264348.
Sponsored by: iXsystems, Inc.
git-svn-id: svn://svn.freebsd.org/base/stable/10@265524
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f