Return EBADF instead of EMFILE from dup2 when the second argument is
outside the range of valid file descriptors

PR:		kern/164970
Submitted by:	Peter Jeremy <peterjeremy@acm.org>
Reviewed by:	jilles
Approved by:	cperciva
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234131 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Make the item numbers match the crypt magic number

PR:		docs/166497
Submitted by:	Mike Kelly <pioto@pioto.org>
Approved by:	cperciva
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234132 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- remove the length shortening on the path
- make the default prompt a bit more like scp
- make the user show as root even when using 'su' instead of 'su -'
- the key bindings didn't hurt anything but likely hide a bug
- merge history instead of overwriting it

Submitted by:	gavin, joel
Approved by:	cperciva


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234133 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
s/Free Memory Pages/Free Memory/ to avoid confusion, since we're
reporting a number of bytes rather than a number of pages

PR:		misc/165208
Submitted by:	Arnaud Lacombe <lacombar@gmail.com>
Approved by:	cperciva
MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234134 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix typo (add a missing '%/' in sed)

Submitted by:	jmallett
Approved by:	cperciva (implicit)
MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234135 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Enable prefetching of descriptors on the TX ring, using the same
values as in the Intel driver 3.8.21 for linux.  The fact that it
is standard in the above driver suggests that it has no bad side
effects.

But of course there must be a reason for enabling features, not
just "it does not harm", so here it is a good one:

Prefetching enables full line rate even using a single queue (14.88
Mpps, compared to ~12 Mpps without prefetch).  This in turn is
terribly useful when one wants to schedule traffic.

For obvious reasons the difference is only visible with netmap
or other high speed solutions, but presumably the advantage
should be in the order of a fraction of a microsecond when
starting transmission on an empty queue.

Discussed with Jack Vogel.

MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234137 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Support percent-encoded user and password

RFC 1738 specifies that any ":", "@", or "/" within a user name or
password in a URL is percent-encoded, to avoid ambiguity with the use
of those characters as URL component separators.

Reviewed by:    rstone@
MFC after:	1 month


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234138 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Restore the blank line incorrectly removed in r234104.

Pointed out by:	bde


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234139 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
A couple of changes related to ixgbe operation in netmap mode:

- add a sysctl, dev.netmap.ix_crcstrip, to control whether ixgbe should
  strip the CRC on received frames. Defaults to 0, which keeps the CRC.
  and improves performance when receiving min-sized (64-byte) frames.
  This matters because  min-sized frames is one of the standard
  benchmarks for switches and routers, some chipsets seem to issue
  read-modify-write cycles for PCIe transactions that are not a
  full cache line, and a min-sized frame triggers the bug, resulting
  in reduced throughput -- 9.7 instead of 14.88 Mpps -- and heavy
  bus load.

- for the time being, always look for incoming packets on a select/poll
  even if there has not been an interrupt in the meantime. This is
  only a temporary workaround for a probable race condition in keeping
  track of rx interrupts.
  Add a couple of diagnostic vars to help studying the problem.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234140 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix error in r233949. Synchronizing icaches on uncacheable pages turns out
not to be a good idea, and of course the PV entry list for a page is never
empty after the page has been mapped.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234149 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Allow device_busy() and device_unbusy() to be invoked while a device is
being attached.  This is implemented by adding a new DS_ATTACHING state
while a device's DEVICE_ATTACH() method is being invoked.  A driver is
required to not fail an attach of a busy device.  The device's state will
be promoted to DS_BUSY rather than DS_ACTIVE() if the device was marked
busy during DEVICE_ATTACH().

Reviewed by:	kib
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234152 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Trim stray blank line.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234153 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Reapply r223198 which was reverted in the previous vendor import.  Some
portions were already reapplied in r233708:
- Use a dedicated task to handle deferred transmits from the if_transmit
  method instead of reusing the existing per-queue interrupt task.
  Reusing the per-queue interrupt task could result in both an interrupt
  thread and the taskqueue thread trying to handle received packets on a
  single queue resulting in out-of-order packet processing.
- Call ether_ifdetach() earlier in igb_detach().
- Drain tasks and free taskqueues during igb_detach().

MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234154 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Only manipulate the PGA_EXECUTABLE flag on managed pages. This is a proxy
for whether the page is physical. On dense phys mem systems (32-bit),
VM_PHYS_TO_PAGE will not return NULL for device memory pages if device
memory is above physical memory even if there is no allocated vm_page.
Attempting to use the returned page could then cause either memory
corruption or a page fault.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234155 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
We don't need kcopy() in any of the remaining places it is used, so
remove it.

MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234156 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Whitespace cleanup.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234157 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Export vinactive() from kern/vfs_subr.c (e.g., make it no longer
static and declare its prototype in sys/vnode.h) so that it can be
called from process_deferred_inactive() (in ufs/ffs/ffs_snapshot.c)
instead of the body of vinactive() being cut and pasted into
process_deferred_inactive().

Reviewed by: kib
MFC after:   2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234158 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Sort completions
Add a new one for sysctl

Submitted by:	rm (the new completion)
Approved by:	cperciva (implicit)
MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234159 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Set the proto to LAGG_PROTO_NONE before calling the detach routine so packets
are discarded, this is an issue because lacp drops the lock which may allow
network threads to access freed memory. Expand the lock coverage so the
detach/attach happen atomically.

Submitted by:	Andrew Boyer (earlier version)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234163 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
The BIND 9.8.2 tarball was re-rolled to remove 9.8.1 release notes.
This change was noticed by ISC at:

https://lists.isc.org/pipermail/bind-users/2012-April/087345.html

and verified by me both by comparing the contents of the old and new
distfiles and by verifying the PGP signature on the new distfile.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234165 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f