Prevent the creation of an unused variable.

We're only interested in the enumeration fields; we don't want to create
a variable to store them.

MFC after:	1 week
Mark the act_tbl static/const.

This table is only used within this source file and is only accessed
read-only.

MFC after:	1 week
drm: Right-shift I2C slave address before passing it to aux channel

In r249041, I2C slave addresses were left-shifted at creation time to
have the same behavior between i915 and radeon (not committed yet). This
change broke the aux channel. The user-visible change was that display
port on i915 didn't work anymore.

To fix this, we right-shift the address back to restore the original value.

Reported by:	Olivier Cochard-Labbé <olivier@cochard.me>
Tested by:	Olivier Cochard-Labbé <olivier@cochard.me>
Reviewed by:	kib@
Remove reference to the nonexistent sysctl node net.inet6.mld.stats.
Also add cross reference to the icmp6(4).

PR:		177696
MFC after:	1 week
mdoc: sort cross references.
Fix a memory leak that showed up when we delete LUNs.  The memory used for
the LUN was never freed.

ctl.c:		Adjust ctl_alloc_lun() to make sure we don't clear the
		CTL_LUN_MALLOCED flag.

Reported by:	Sreenivasa Honnur <shonnur@chelsio.com>
Sponsored by:	Spectra Logic
MFC after:	3 days
Add support for getting and setting BBU properties related to battery
relearning. Specifically, add subcommands to mfiutil(8) which allow the
user to set the BBU and autolearn modes when the firmware supports it,
and add a subcommand which kicks off a battery relearn.

Reviewed by:	sbruno, rstone
Tested by:	sbruno
Approved by:	rstone (co-mentor)
MFC after:	2 weeks
Sponsored by:	Sandvine Incorporated
Switch to a 2-clause license.

Approved by:	emaste (co-mentor)
X-MFC with:	r249257
Fix a potential socket leak in the NFS server.  If a client closes its
connection after it was accepted by the userland nfsd process but before
it was handled off to svc_vc_create() in the kernel, then svc_vc_create()
would see it as a new listen socket and try to listen on it leaving a
dangling reference to the socket.  Instead, check for disconnected sockets
and treat them like a connected socket.  The call to pru_getaddr() should
fail and cause svc_vc_create() to fail.  Note that we need to lock the
socket to get a consistent snapshot of so_state since there is a window
in soisdisconnected() where both flags are clear.

Reviewed by:	dfr, rmacklem
MFC after:	1 week
Merge from projects/counters: UMA_ZONE_PCPU zones.

  These zones have slab size == sizeof(struct pcpu), but request from VM
enough pages to fit (uk_slabsize * mp_ncpus). An item allocated from such
zone would have a separate twin for each CPU in the system, and these twins
are at a distance of sizeof(struct pcpu) from each other. This magic value
of distance would allow us to make some optimizations later.

  To address private item from a CPU simple arithmetics should be used:

  item = (type *)((char *)base + sizeof(struct pcpu) * curcpu)

  These arithmetics are available as zpcpu_get() macro in pcpu.h.

  To introduce non-page size slabs a new field had been added to uma_keg
uk_slabsize. This shifted some frequently used fields of uma_keg to the
fourth cache line on amd64. To mitigate this pessimization, uma_keg fields
were a bit rearranged and least frequently used uk_name and uk_link moved
down to the fourth cache line. All other fields, that are dereferenced
frequently fit into first three cache lines.

Sponsored by:	Nginx, Inc.
Merge from projects/counters:

  Pad struct pcpu so that its size is denominator of PAGE_SIZE. This
is done to reduce memory waste in UMA_PCPU_ZONE zones.

Sponsored by:	Nginx, Inc.
Forcibly defining _KERNEL is bad idea. Toss some code so that ip_var.h
isn't included with forced _KERNEL define.
Merge from projects/counters: counter(9).

  Introduce counter(9) API, that implements fast and raceless counters,
provided (but not limited to) for gathering of statistical data.

See http://lists.freebsd.org/pipermail/freebsd-arch/2013-April/014204.html
for more details.

In collaboration with:	kib
Reviewed by:		luigi
Tested by:		ae, ray
Sponsored by:		Nginx, Inc.
Vendor import of NetBSD's mtree at 2013-04-08.
Merge from projects/counters: TCP/IP stats.

  Convert 'struct ipstat' and 'struct tcpstat' to counter(9).

  This speeds up IP forwarding at extreme packet rates, and
makes accounting more precise.

Sponsored by:	Nginx, Inc.
Switch some "low-hanging fruit" to acquire read lock on vmobjects
rather than write locks.

Sponsored by:	EMC / Isilon storage division
Reviewed by:	alc
Tested by:	pho
The per-page act_count can be made very-easily protected by the
per-page lock rather than vm_object lock, without any further overhead.
Make the formal switch.

Sponsored by:	EMC / Isilon storage division
Reviewed by:	alc
Tested by:	pho
Add FreeBSD 8.4.

MFC after:	3 days
Fix this to compile when ATH_DEBUG_ALQ is defined but ATH_DEBUG isn't.
FireWire: Don't allow a tlabel to reference an xfer after free.

sys/dev/firewire/firewire.c:
- fw_xfer_unload(): Since we are about to free this xfer, call fw_tl_free()
  to remove the xfer from its tlabel's list, if it has a tlabel.
- In every occasion when a xfer is removed from a tlabel's list, reset
  xfer->tl to -1 while holding fc->tlabel_lock, so that the xfer isn't
  mis-identified as belonging to a tlabel.

This doesn't fix all the use-after-free problems for M_FWMEM, but is an
incremental towards that goal.

Reviewed by:	kan, sbruno
Sponsored by:	Spectra Logic