Fix typo. Check against number of allocated MSI-X vectors.
There is no ale(4) controller that supports MSI-X so this is not
real issue.

PR:	kern/171825


git-svn-id: svn://svn.freebsd.org/base/head@241340 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Limit applying TX data corruption and FIFO workaround to BCM5719
A0. It's believed BCM5720 does not have the issue.


git-svn-id: svn://svn.freebsd.org/base/head@241341 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
No reason to play with IP header before calling sctp_delayed_cksum()
with offset beyond the IP header.


git-svn-id: svn://svn.freebsd.org/base/head@241342 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Rework device detach. While here, move driver lock/callout
initialization to the beginning of device attach for readability.


git-svn-id: svn://svn.freebsd.org/base/head@241343 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
  After r241245 it appeared that in_delayed_cksum(), which still expects
host byte order, was sometimes called with net byte order. Since we are
moving towards net byte order throughout the stack, the function was
converted to expect net byte order, and its consumers fixed appropriately:
  - ip_output(), ipfilter(4) not changed, since already call
    in_delayed_cksum() with header in net byte order.
  - divert(4), ng_nat(4), ipfw_nat(4) now don't need to swap byte order
    there and back.
  - mrouting code and IPv6 ipsec now need to switch byte order there and
    back, but I hope, this is temporary solution.
  - In ipsec(4) shifted switch to net byte order prior to in_delayed_cksum().
  - pf_route() catches up on r241245 changes to ip_output().


git-svn-id: svn://svn.freebsd.org/base/head@241344 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove my pre-commit review request for mergemaster


git-svn-id: svn://svn.freebsd.org/base/head@241345 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
ip6_ipsec_output: fix a typo in r241344

Acting as a remote drone of glebius.


git-svn-id: svn://svn.freebsd.org/base/head@241349 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Restrict the module to varied environments.


git-svn-id: svn://svn.freebsd.org/base/head@241351 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
In a few places, like the implementation of ptrace(), a thread may call
upon pmap_enter() to create a mapping within a different address space,
i.e., not the thread's own address space.  On i386, this entails the
creation of a temporary mapping to the affected page table page (PTP).  In
general, pmap_enter() will read from this PTP, allocate a PV entry, and
write to this PTP.  The trouble comes when the system is short of memory.
In order to allocate a new PV entry, an older PV entry has to be
reclaimed.  Reclaiming a PV entry involves destroying a mapping, which
requires access to the affected PTP.  Thus, the PTP mapped at the
beginning of pmap_enter() is no longer mapped at the end of pmap_enter(),
which leads to pmap_enter() modifying the wrong PTP.  To address this
problem, pmap_pv_reclaim() is changed to use an alternate method of
mapping PTPs.

Update a related comment.

Reported by:	pho
Diagnosed by:	kib
MFC after:	5 days


git-svn-id: svn://svn.freebsd.org/base/head@241353 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add several asserts to i386 pmap, which mostly state that pv entry shall
have corresponding pte.

Reviewed by:	alc
Tested by:	pho
MFC after:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@241356 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Catch up with r241245 and do not return packet back in host byte order.


git-svn-id: svn://svn.freebsd.org/base/head@241359 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Any pfil(9) hooks should be called with already set VNET context.

Reviewed by:	bz


git-svn-id: svn://svn.freebsd.org/base/head@241360 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add an echo to say we're "Booting..." when the overloaded "boot" Ficl word is
executed to better differentiate between loader-specific errors and kernel-
specific errors (if ever any of either).

This type of functionality hasn't been required before the introduction of the
advanced menu system (r222417). Adding this functionality will help different-
iate errors at the loader-level such as a BTX halt caused by heap exhaustion
and errors that may be involved with executing the kernel (wrong architecture
for example). A user can learn that messages before "Booting..." are related to
the loader(8) environment and it's Forth-ilk, while those after are not
related to loader(8) -- the point that loader(8) has ``left the building''.

This patch also includes a man-page update to color.4th(8) as the color logic
moves to a lower-level (from being included by beastie.4th to being included
by loader.4th).

After noticing a delay between execution of the overloaded "boot" FICL word and
the display of text on-screen, gcooper confirmed that the introduction of a
builtin memory test (disabled by adding hw.memtest.tests="0" to loader.conf(5))
was the cause of the delay.

This patch adds an echo to produce "Booting..." when the overloaded "boot" word
is executed (this includes from the interactive command-prompt on all arches,
from the menu system on arches that run the beastie menu, and even those arches
that run the menu but disable it by setting beastie_disable="YES" in
loader.conf(5)). When loader_color="YES" in loader.conf(5), the same message is
produced but in white text on a blue background (only the letters produced have
this background -- opposed to perhaps the entire line).


git-svn-id: svn://svn.freebsd.org/base/head@241361 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Make the "Options:" separator-text configurable by setting $menu_optionstext.

Reviewed by:	eadler, adrian (co-mentor)
Approved by:	adrian (co-mentor)
MFC after:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@241363 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix an oversight that cyclic menu items actually are zero-based and can
accommodate 10 different states.

Reviewed by:	eadler, adrian (co-mentor)
Approved by:	adrian (co-mentor)


git-svn-id: svn://svn.freebsd.org/base/head@241365 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix a typo (s/prefix/suffix/) and comment.

NOTE: This is in an unused portion of the menu framework.

Reviewed by:	eadler, adrian (co-mentor)
Approved by:	adrian (co-mentor)


git-svn-id: svn://svn.freebsd.org/base/head@241367 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge remote-tracking branch 'upstream/master'