Finish MFC of r248291,249741:

Change 'status' command to produce one-line easy-parseable output.

Approved by:	trociny


git-svn-id: svn://svn.freebsd.org/base/stable/9@252776 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r250963, r251013, r251056: Driver 'aacraid' added to support Adaptec by PMC RAID controller families Series 6, 7, 8 and upcoming products.

Approved by:	emaste (co-mentor)


git-svn-id: svn://svn.freebsd.org/base/stable/9@252778 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r291296, r291297, r291393:

 Allow drivers to specify a maximum TSP length in bytes if they
 are limited in the amount of data they can handle at once.

 Apply this to the netfront driver.

 Spare fields in struct tcpcb and struct ifnet are used to keep
 the structure sizes the same.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252781 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r242306, r250365:

 Add logging for socket attach failures in sonewconn() during accept(2).
 Include the pointer to the PCB so it can be attributed to a particular
 application by corresponding it to "netstat -A" output.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252782 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r243627, r243638:

 Fix a race on listen socket teardown where while draining the
 accept queues a new socket/connection may be added to the queue
 due to a race on the ACCEPT_LOCK.

 The submitted patch is slightly changed in comments, teardown
 and locking order and extended with KASSERT's.

 Submitted by:	Vijay Singh <vijju.singh-at-gmail-dot-com>
 Found by:	His team.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252783 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r242309:

 Fix a couple of soreceive_stream() issues.

 Submitted by:	trociny


git-svn-id: svn://svn.freebsd.org/base/stable/9@252785 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r249809:

 When doing RFC3042 limited transmit on the first on second
 duplicate ACK make sure we actually have new data to send.
 This prevents us from sending unneccessary pure ACKs.

 Reported by:	Matt Miller <matt@matthewjmiller.net>


git-svn-id: svn://svn.freebsd.org/base/stable/9@252786 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r249317:

 Fix a race condition on tcp listen socket teardown with pending
 connections in the accept queue and contiguous new incoming SYNs.

 Compared to the original submitters patch I've moved the test
 next to the SYN handling to have it together in a logical unit
 and reworded the comment explaining the issue.

 Submitted by:	Matt Miller <matt@matthewjmiller.net>
 Submitted by:	Juan Mojica <jmojica@gmail.com>
 Reviewed by:	Matt Miller (changes)
 Tested by:	pho


git-svn-id: svn://svn.freebsd.org/base/stable/9@252787 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r226447:

 Remove the ss_fltsz and ss_fltsz_local sysctl's which have
 long been superseded by the RFC3390 initial CWND sizing.

 Also remove the remnants of TCP_METRICS_CWND which used the
 TCP hostcache to set the initial CWND in a non-RFC compliant
 way.

MFC r242249:

 Adjust the initial default CWND upon connection establishment to the
 new and increased values specified by RFC5681 Section 3.1.

 The even larger initial CWND per RFC3390, if enabled, is not affected.

MFC r242250:

 When SYN or SYN/ACK had to be retransmitted RFC5681 requires us to
 reduce the initial CWND to one segment.  This reduction got lost
 some time ago due to a change in initialization ordering.

 Additionally in tcp_timer_rexmt() avoid entering fast recovery when
 we're still in TCPS_SYN_SENT state.

MFC r242255:

 Allow arbitrary MSS sizes and don't mind about the cluster size anymore.
 We've got more cluster sizes for quite some time now and the orginally
 imposed limits and the previously codified thoughts on efficiency gains
 are no longer true.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252788 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r242266:

 Increase the initial CWND to 10 segments as defined in IETF TCPM
 draft-ietf-tcpm-initcwnd-05. It explains why the increased initial
 window improves the overall performance of many web services without
 risking congestion collapse.

 As long as it remains a draft it is placed under a sysctl marking it
 as experimental:
  net.inet.tcp.experimental.initcwnd10 = 1
 When it becomes an official RFC soon the sysctl will be changed to
 the RFC number and moved to net.inet.tcp.

 This implementation differs from the RFC draft in that it is a bit
 more conservative in the case of packet loss on SYN or SYN|ACK because
 we haven't reduced the default RTO to 1 second yet.  Also the restart
 window isn't yet increased as allowed.  Both will be adjusted with
 upcoming changes.

 Is is enabled by default.  In Linux it is enabled since kernel 3.0.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252789 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r242253:

 Simplify implementation of net.inet.tcp.reass.maxsegments and
 net.inet.tcp.reass.cursegments.

MFC r242254:

 Change the syncache count reporting the current number of entries
 from an unprotected u_int that reports garbage on SMP to a function
 based sysctl obtaining the current value from UMA.

 Also read back the actual cache_limit after page size rounding by UMA.
 PR:		kern/165879

MFC r244680:

 Fix sysctl_handle_int() usage. Either arg1 or arg2 should be supplied,
 and arg2 doesn't pass size of arg1.

MFC r246208:

 uma_zone_set_max() directly returns the rounded effective zone
 limit.  Use the return value directly instead of doing a second
 uma_zone_set_max() step.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252790 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r243147:

 Change fetch(1) to:
 o Report the instantaneous bandwidth instead of an average since the
   beginning of the download.
 o At the finish of the download report the average bandwidth and also
   the total time it took instead of 00m00s.

 Reviewed by:	des

MFC r244058:

 Fix bandwidth reporting when doing a restarted download with "-r".
 The offset is already accounted for in xs->lastrcvd and doesn't
 have to be subtracted again.

 Reported by:	Florian Smeets <flo@smeets.im>
 Submitted by:	Mateusz Guzik <mjguzik@gmail.com>
 Tested by:	Florian Smeets <flo@smeets.im>


git-svn-id: svn://svn.freebsd.org/base/stable/9@252791 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r244039:

 Remove outdated reference to tcp inflight tuning.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252792 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r242251, r242311:

 Defer sending an independent window update if a delayed ACK is pending
 saving a packet.  The window update then gets piggy-backed on the next
 already scheduled ACK.

MFC r242252:

 Prevent a flurry of forced window updates when an application is
 doing small reads on a (partially) filled receive socket buffer.

 Normally one would a send a window update every time the available
 space in the socket buffer increases by two times MSS.  This leads
 to a flurry of window updates that do not provide any meaningful
 new information to the sender.  There still is available space in
 the window and the sender can continue sending data.  All window
 updates then get carried by the regular ACKs.  Only when the socket
 buffer was (almost) full and the window closed accordingly a window
 updates delivery new information and allows the sender to start
 sending more data again.

 Send window updates only every two MSS when the socket buffer
 has less than 1/8 space available, or the available space in the
 socket buffer increased by 1/4 its full capacity, or the socket
 buffer is very small.  The next regular data ACK will carry and
 report the exact window size again.

 Reported by:	sbruno
 Tested by:	darrenr
 Tested by:	Darren Baginski
 PR:		kern/116335


git-svn-id: svn://svn.freebsd.org/base/stable/9@252793 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r242257:

 Remove bogus 'else' in #ifdef that prevented the rttvar from being reset
 tcp_timer_rexmt() on retransmit for IPv6 sessions.

MFC r242260:

 When retransmitting SYN in TCPS_SYN_SENT state use TCPTV_RTOBASE,
 the default retransmit timeout, as base to calculate the backoff
 time until next try instead of the TCP_REXMTVAL() macro which only
 works correctly when we already have measured an actual RTT+RTTVAR.

MFC r242263, r242264:

 Add SACK_PERMIT to the list of TCP options that are switched off after
 retransmitting a SYN three times.

MFC r242267:

 If the user has closed the socket then drop a persisting connection
 after a much reduced timeout.

 Typically web servers close their sockets quickly under the assumption
 that the TCP connections goes away as well.  That is not entirely true
 however.  If the peer closed the window we're going to wait for a long
 time with lots of data in the send buffer.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252794 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r242256:

 Improve m_cat() by being able to also merge contents from M_EXT
 mbuf's by doing proper testing with M_WRITABLE().

 In m_collapse() replace an incomplete manual check for M_RDONLY
 with the M_WRITABLE() macro that also tests for shared buffers
 and other cases that make a particular mbuf immutable.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252796 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251601, r251685:

  Handle options that override other options


git-svn-id: svn://svn.freebsd.org/base/stable/9@252812 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- MFC r252661, r252705, r252711, r252715, r252716, r252724, r252728,
  r252747.
- Connect t3_tom and t4_tom to the build (r252555 enables them).

r252661:
- Include the T5 firmware with the driver.
- Update the T4 firmware to the latest.
- Minor reorganization and updates to the version macros, etc.

r252705:
- Read all TP parameters in one place.
- Read the filter mode, calculate various shifts, and use them
  properly during active open (in select_ntuple).

r252711:
The T5 allows the driver to specify the ISS.  Do so; use the ISS picked
by the kernel.

r252715:
Ring the egress queue's doorbell as soon as there are 8 or more
descriptors ready to be processed.

r252716:
Pay attention to TCP_NODELAY when it's set/unset after the connection
is established.

r252724:
On-the-fly changes to the interrupt coalescing timer should apply to the
TOE rx queues too.

r252728:
- Make note of interface MTU change if the rx queues exist, and not just
  when the interface is up.
- Add a tunable to control the TOE's rx coalesce feature (enabled by
  default as it always has been).  Consider the interface MTU or the
  coalesce size when deciding which cluster zone to use to fill the
  offload rx queue's free list.  The tunable is:
  dev.{t4nex,t5nex}.<N>.toe.rx_coalesce

r252747:
- Show the reason why link is down if this information is available.
- Display the temperature and PHY firmware version of the BT PHY.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252814 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r252472:

Make hastctl(1) ('list' command) output a worker pid.

Reviewed by:	pjd


git-svn-id: svn://svn.freebsd.org/base/stable/9@252818 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r252516, r252540:

Add a mib for worker process ID.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252820 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f