Eliminate a stale comment.  It describes another use case for the pmap in
Mach that doesn't exist in FreeBSD.


git-svn-id: svn://svn.freebsd.org/base/head@241020 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Make sure that each va_start has one and only one matching va_end,
especially in error cases.


git-svn-id: svn://svn.freebsd.org/base/head@241021 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove the topology lock from disk_gone(), it might be called with regular
mutexes held and the topology lock is an sx lock.

The topology lock was there to protect traversing through the list of providers
of disk's geom, but it seems that disk's geom has always exactly one provider.

Change the code to call g_wither_provider() for this one provider, which is
safe to do without holding the topology lock and assert that there is indeed
only one provider.

Discussed with:	ken
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@241022 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Make the loader a bit smarter, when it tries to open disk and the slice
number is not exactly specified. When the disk has MBR, also try to read
BSD label after ptable_getpart() call. When the disk has GPT, also set
d_partition to 255.  Mostly, this is how it worked before.


git-svn-id: svn://svn.freebsd.org/base/head@241023 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add a note to portsnap(8) about the behaviour of the example cron command.

PR:		docs/171759
Submitted by:	Paul Hoffman (phoffman at proper dot com)
Approved by:	cperciva, gabor (mentor)
MFC after:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@241024 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix the mis-handling of the VV_TEXT on the nullfs vnodes.

If you have a binary on a filesystem which is also mounted over by
nullfs, you could execute the binary from the lower filesystem, or
from the nullfs mount. When executed from lower filesystem, the lower
vnode gets VV_TEXT flag set, and the file cannot be modified while the
binary is active. But, if executed as the nullfs alias, only the
nullfs vnode gets VV_TEXT set, and you still can open the lower vnode
for write.

Add a set of VOPs for the VV_TEXT query, set and clear operations,
which are correctly bypassed to lower vnode.

Tested by:	pho (previous version)
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@241025 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Change "only only" to "only" in portsnap(8).

Spotted by:	Ruslan Mahmatkhanov
Approved by:	gabor (mentor, implicit)


git-svn-id: svn://svn.freebsd.org/base/head@241026 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Re-shuffle the <machine/pc/bios.h> headers to move all kernel-specific
  bits under #ifdef _KERNEL but leave definitions for various structures
  defined by standards ($PIR table, SMAP entries, etc.) available to
  userland.
- Consolidate duplicate SMBIOS table structure definitions in ipmi(4)
  and smbios(4) in <machine/pc/bios.h> and make them available to
  userland.

MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@241027 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Change queue overflow checks from DIAGNOSTIC+panic() to KASSERT() to make
them enabled on HEAD by default. It is probably better to do single compare
then hunt for unexpected memory corruption.


git-svn-id: svn://svn.freebsd.org/base/head@241028 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove unnecessary #include.


git-svn-id: svn://svn.freebsd.org/base/head@241029 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Slight stylification.


git-svn-id: svn://svn.freebsd.org/base/head@241031 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Correct NYET handling. Remove superfluous transfer complete interrupt mask.


git-svn-id: svn://svn.freebsd.org/base/head@241032 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove some trailing bytes which are not part of the ethernet packet.

Discussed with:		bgray @


git-svn-id: svn://svn.freebsd.org/base/head@241033 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Make sure we don't leak a mbuf in a fail case.


git-svn-id: svn://svn.freebsd.org/base/head@241034 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix some nearby type and style errors.

Pointed out by:	bde


git-svn-id: svn://svn.freebsd.org/base/head@241035 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
The drbr(9) API appeared to be so unclear, that most drivers in
tree used it incorrectly, which lead to inaccurate overrated
if_obytes accounting. The drbr(9) used to update ifnet stats on
drbr_enqueue(), which is not accurate since enqueuing doesn't
imply successful processing by driver. Dequeuing neither mean
that. Most drivers also called drbr_stats_update() which did
accounting again, leading to doubled if_obytes statistics. And
in case of severe transmitting, when a packet could be several
times enqueued and dequeued it could have been accounted several
times.

o Thus, make drbr(9) API thinner. Now drbr(9) merely chooses between
  ALTQ queueing or buf_ring(9) queueing.
  - It doesn't touch the buf_ring stats any more.
  - It doesn't touch ifnet stats anymore.
  - drbr_stats_update() no longer exists.

o buf_ring(9) handles its stats itself:
  - It handles br_drops itself.
  - br_prod_bytes stats are dropped. Rationale: no one ever
    reads them but update of a common counter on every packet
    negatively affects performance due to excessive cache
    invalidation.
  - buf_ring_enqueue_bytes() reduced to buf_ring_enqueue(), since
    we no longer account bytes.

o Drivers handle their stats theirselves: if_obytes, if_omcasts.

o mlx4(4), igb(4), em(4), vxge(4), oce(4) and  ixv(4) no longer
  use drbr_stats_update(), and update ifnet stats theirselves.

o bxe(4) was the most correct driver, it didn't call
  drbr_stats_update(), thus it was the only driver accurate under
  moderate load. Now it also maintains stats itself.

o ixgbe(4) had already taken stats from hardware, so just
  - drop software stats updating.
  - take multicast packet count from hardware as well.

o mxge(4) just no longer needs NO_SLOW_STATS define.

o cxgb(4), cxgbe(4) need no change, since they obtain stats
  from hardware.

Reviewed by:	jfv, gnn


git-svn-id: svn://svn.freebsd.org/base/head@241037 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Simplify and somewhat redesign interaction between pf_purge_thread() and
pf_purge_expired_states().

Now pf purging daemon stores the current hash table index on stack
in pf_purge_thread(), and supplies it to next iteration of
pf_purge_expired_states(). The latter returns new index back.

The important change is that whenever pf_purge_expired_states() wraps
around the array it returns immediately. This makes our knowledge about
status of states expiry run more consistent. Prior to this change it
could happen that n-th run stopped on i-th entry, and returned (1) as
full run complete, then next (n+1) full run stopped on j-th entry, where
j < i, and that broke the mark-and-sweep algorythm that saves references
rules. A referenced rule was freed, and this later lead to a crash.


git-svn-id: svn://svn.freebsd.org/base/head@241039 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Allow deferred word-splitting via f_sysrc_get() by allowing $IFS in the
"clean-room" environment used to query rc.conf(5) parameters.

This brings bsdconfig(8)'s sysrc.subr in-line with both the sysrc(8) manual
[provided by sysutils/sysrc] and sysrc(8)'s own sysrc.subr (now identical to
bsdconfig(8)'s sysrc.subr as of this patch).

Finally, this will allow a clean import of sysutils/sysrc (sans sysrc.subr,
already provided here).

Reviewed by:	jilles
Approved by:	adrian (co-mentor)


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