MFC r251770:

Internalise handling of virtualised hook points inside
hhook_{add|remove}_hook_lookup() so that khelp (and other potential API
consumers) do not have to care when they attempt to (un)hook a particular hook
point identified by id and type.

Reviewed by:	scottl


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

Add a private KPI between hhook and khelp that allows khelp modules to insert
hook functions into hhook points which register after the modules were loaded -
potentially useful during boot or if hhook points are dynamically registered.


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

Cleanup and simplification in khelp_{register|deregister}_helper(). No
functional changes.


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

Move hhook's per-vnet initialisation to an earlier SYSINIT SI_SUB stage to
ensure all per-vnet related hhook initialisation is completed prior to any
virtualised hhook points attempting registration.

vnet_register_sysinit() requires that a stage later than SI_SUB_VNET be chosen.
There are no per-vnet initialisors in the source tree at this time which run
earlier than SI_SUB_INIT_IF. A quick audit of non-virtualised SYSINITs indicates
there are no subsystems pre SI_SUB_MBUF that would likely be interested in
registering a virtualised hhook point.

Settle on SI_SUB_MBUF as hhook's per-vnet initialisation stage as it's the first
overtly network-related initilisation stage to run after SI_SUB_VNET. If a
subsystem that initialises earlier than SI_SUB_MBUF ends up wanting to register
virtualised hhook points in future, hhook's use of SI_SUB_MBUF will need to be
revisited and would probably warrant creating a dedicated SI_SUB_HHOOK which
runs immediately after SI_SUB_VNET.


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

Now that the necessary infrastructure is in place to ensure hhook points which
register after a khelp module will get hooked, move khelp module initialisation
to the earlier SI_SUB_KLD stage.


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

Non-virtualised hhook points are supported as of r251732.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252551 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r252471:
Remove forced timeout of in-flight commands from mfi_timeout.

While this prevents commands getting stuck forever there is no way to guarantee
that data from the command hasn't been committed to the device.

In addition older mfi firmware has a bug that would cause the controller to
frequently stall IO for over our timeout value, which when combined with
a forced timeout often resulted in panics in UFS; which would otherwise be
avoided when the command eventually completed if left alone.

For reference this timeout issue is resolved in Dell FW package 21.2.1-0000.
Fixed FW package version for none Dell controller will likely vary.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252554 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC/backport core kernel and userspace parts of r237263 (TCP_OFFLOAD
rework).  MFC r237563, r239511, r243603, r245915, r245916, r245919,
r245921, r245922, r245924, r245925, r245932, r245934 too.

Build tested with make universe.

r237263:
- Updated TOE support in the kernel.
...

r237563:
Fix clang warning when compiling iw_cxgb.

r239511:
Correctly handle the case where an inp has already been dropped by the time
the TOE driver reports that an active open failed.  toe_connect_failed is
supposed to handle this but it should be provided the inpcb instead of the
tcpcb which may no longer be around.

r243603:
Make sure that tcp_timer_activate() correctly sees TCP_OFFLOAD (or not).

r245915:
Heed SO_NO_OFFLOAD.

r245916:
Teach toe_4tuple_check() to deal with IPv6 4-tuples too.

r245919:
Add TCP_OFFLOAD hook in syncache_respond for IPv6 too, just like the one
that exists for IPv4.

r245921:
There is no need to call into the TOE driver twice in pru_rcvd (tod_rcvd
and then tod_output right after that).

r245922:
Avoid NULL dereference in nd6_storelladdr when no mbuf is provided.  It
is called this way from a couple of places in the OFED code.  (toecore
calls it too but that's going to change shortly).

r245924:
Move lle_event to if_llatbl.h

lle_event replaced arp_update_event after the ARP rewrite and ended up
in if_ether.h simply because arp_update_event used to be there too.
IPv6 neighbor discovery is going to grow lle_event support and this is a
good time to move it to if_llatbl.h.

The two in-tree consumers of this event - OFED and toecore - are not
affected.

r245925:
Generate lle_event in the IPv6 neighbor discovery code too.

r245932:
Teach toe_l2_resolve to resolve IPv6 destinations too.

r245934:
Add checks for SO_NO_OFFLOAD in a couple of places that I missed earlier
in r245915.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252555 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251995:
  Use ICMP6STAT_INC() macro for ICMPv6 errors accounting.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252563 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r252007:
  Use RIP6STAT_INC() macro for raw ip6 statistics accounting.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252565 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r252009:
  Use PIM6STAT_INC() and MRT6STAT_INC() macros for IPv6 multicast
  statistics accounting.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252566 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC: r238051:
     Add "hier" as an alternate spelling of "hierarchy" to match hier(9).


git-svn-id: svn://svn.freebsd.org/base/stable/9@252588 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r252414:
truss: recognize O_DIRECTORY, O_EXEC, O_TTY_INIT and O_CLOEXEC


git-svn-id: svn://svn.freebsd.org/base/stable/9@252595 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix grammar in a comment.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252600 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r250982: sigreturn(2): Remove ancient compatibility warning about 4.2BSD

The HISTORY subsection still says that sigreturn() was added in 4.3BSD.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252604 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251078,r251433: sleep: Improve nanosleep() error handling:

 * Work around kernel bugs that cause a spurious [EINTR] return if a
   debugger (such as truss(1)) is attached.

 * Write an error message if an error other than [EINTR] occurs.

PR:		bin/178664


git-svn-id: svn://svn.freebsd.org/base/stable/9@252606 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251209: test(1): List non-standard primaries.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252607 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r248692: sh(1): Mention possible ambiguities with $(( and ((.

In some other shells, things like $((a);(b)) are command substitutions.

Also, there are shells that have an extension ((ARITH)) that evaluates an
arithmetic expression and returns status 1 if the result is zero, 0
otherwise. This extension may lead to ambiguity with two subshells starting
in sequence.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252609 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r248870 by joel: Minor mdoc fix in previous commit.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252610 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251763: sh(1): A subshell environment has its own rlimits (ulimit).

This has always been the case and is intended (just like cd).

This matches Austin group issue #706.


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