Calculate the baud rate divisor rather than using a hard-coded value.

Submitted by:	Steven Lawrance <stl@koffein.net>


git-svn-id: svn+ssh://svn.freebsd.org/base/head@256815 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Allow the OFW interrupt mapping code to work with PCI devices not enumerated
by Open Firmware, as in the case of FDT.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@256816 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Restructuring of the soft updates code to set it up so that the
single kernel-wide soft update lock can be replaced with a
per-filesystem soft-updates lock. This per-filesystem lock will
allow each filesystem to have its own soft-updates flushing thread
rather than being limited to a single soft-updates flushing thread
for the entire kernel.

Move soft update variables out of the ufsmount structure and into
their own mount_softdeps structure referenced by ufsmount field
um_softdep.  Eventually the per-filesystem lock will be in this
structure. For now there is simply a pointer to the kernel-wide
soft updates lock.

Change all instances of ACQUIRE_LOCK and FREE_LOCK to pass the lock
pointer in the mount_softdeps structure instead of a pointer to the
kernel-wide soft-updates lock.

Replace the five hash tables used by soft updates with per-filesystem
copies of these tables allocated in the mount_softdeps structure.

Several functions that flush dependencies when too many are allocated
in the kernel used to operate across all filesystems. They are now
parameterized to flush dependencies from a specified filesystem.
For now, we stick with the round-robin flushing strategy when the
kernel as a whole has too many dependencies allocated.

While there are many lines of changes, there should be no functional
change in the operation of soft updates.

Tested by:    Peter Holm and Scott Long
Sponsored by: Netflix


git-svn-id: svn+ssh://svn.freebsd.org/base/head@256817 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix 80-column line wrapping in a comment.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@256818 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
When fetching function arguments out of a frame on amd64, explicitly select
the register based on the argument index rather than relying on the fields
in struct reg to be in the right order. This assumption is incorrect on
FreeBSD and generally led to bogus argument values for the sixth argument
of PID and USDT probes; the first five are passed directly to dtrace_probe()
via the fasttrap trap handler and so were correctly handled.

MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@256822 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Update jemalloc to version 3.4.1.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@256823 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Provide a working example line for an interface with 1 address running
with CARP.

Currently, we've got a problem that interface isn't IFF_UP at the time
we assign it a redundant address, and the latter gets stuck in INIT state.
Additional SIOCSIFFLAGS from ifconfig(8) kicks it to a working state.

A proper fix is kernel side and appeared to be non-trivial, not to be
checked in before 10.0-RELEASE.

Submitted by:	Ole Myhre <ole.myhre dataoppdrag.no>


git-svn-id: svn+ssh://svn.freebsd.org/base/head@256824 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Partial MFproject/camlock r256671:
Fix several target mode SIMs to not blindly clear ccb_h.flags field of
ATIO CCBs.  Not all CCB flags there belong to them.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@256826 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Correct MAC revision bits. Previously it always cleared bit 20 and
bit 21.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@256827 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add preliminary support for RTL8106E PCIe FastEthernet.

H/W donated by:	RealTek Semiconductor Corp.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@256828 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFprojects/camlock r256619:
Restore BIO_UNMAPPED and BIO_TRANSIENT_MAPPING in biodonne() when unmapping
temporary mapped buffer.  That fixes double unmap if biodone() called twice
for the same BIO (but with different done methods).

Move mapping removal before calling bio_done() method.  I believe that it is
very wrong to do anything to BIO after reporting completion.  kib@ thinks
it was done for some forgotten now case when bio_done() method needed mapped
buffer. But 1) if BIO was sent as unmapped, then IMO done() should be called
in the same way; 2) IMO there is no guatantee that buffer will be mapped at
this point at all, for example, if all underlying stack supports unmapped
I/O, so bio_done() handler can not expect that.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@256830 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add a note that lacp_compose_key() should be updated, when new media
types will be added.

Submitted by:	melifaro
X-MFC after:	r256689


git-svn-id: svn+ssh://svn.freebsd.org/base/head@256832 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Drop cm_lock before calling mapper_close, which in turn could call
_citrus_mapper_close again and result in a deadlock otherwise.

This is similar to NetBSD PR/24023 (fixed in their r1.5 of this file).

PR:		bin/182994
Submitted by:	Fabian Keil <fk fabiankeil de>
MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@256833 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Fix jail_parallel_start="YES".
- Fix ip[46].addr when interface parameter is not defined.

Spotted by:	rpaulo


git-svn-id: svn+ssh://svn.freebsd.org/base/head@256835 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFprojects/camlock:
Remove hard limit on number of BIOs handled with one ATA TRIM request.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@256836 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Don't test arrays for being NULL.

MFC after:	1 month


git-svn-id: svn+ssh://svn.freebsd.org/base/head@256838 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Move and rename dwc otg driver to more
generic one as it appears to work
for rk3188 SoC based board too.

No objections from: hselasky@
Reviewed by: ray@


git-svn-id: svn+ssh://svn.freebsd.org/base/head@256839 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix 'make delete-old-libs' and 'make check-libs' to delete .debug
files created by WITH_DEBUG_FILES. Also cleanup .symbols files from
the period between r244236 when .symbols were supported and r251512
when they were renamed to .debug.

Only propose to delete a .debug file if the corresponding library
itself was deleted already.

Reported by:	des
Reviewed by:	emaste (earlier version)
Approved by:	bapt
MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@256842 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge CAM locking changes from the projects/camlock branch to radically
reduce lock congestion and improve SMP scalability of the SCSI/ATA stack,
preparing the ground for the coming next GEOM direct dispatch support.

Replace big per-SIM locks with bunch of smaller ones:
 - per-LUN locks to protect device and peripheral drivers state;
 - per-target locks to protect list of LUNs on target;
 - per-bus locks to protect reference counting;
 - per-send queue locks to protect queue of CCBs to be sent;
 - per-done queue locks to protect queue of completed CCBs;
 - remaining per-SIM locks now protect only HBA driver internals.

While holding LUN lock it is allowed (while not recommended for performance
reasons) to take SIM lock.  The opposite acquisition order is forbidden.
All the other locks are leaf locks, that can be taken anywhere, but should
not be cascaded.  Many functions, such as: xpt_action(), xpt_done(),
xpt_async(), xpt_create_path(), etc. are no longer require (but allow) SIM
lock to be held.

To keep compatibility and solve cases where SIM lock can't be dropped, all
xpt_async() calls in addition to xpt_done() calls are queued to completion
threads for async processing in clean environment without SIM lock held.

Instead of single CAM SWI thread, used for commands completion processing
before, use multiple (depending on number of CPUs) threads.  Load balanced
between them using "hash" of the device B:T:L address.

HBA drivers that can drop SIM lock during completion processing and have
sufficient number of completion threads to efficiently scale to multiple
CPUs can use new function xpt_done_direct() to avoid extra context switch.
Make ahci(4) driver to use this mechanism depending on hardware setup.

Sponsored by:	iXsystems, Inc.
MFC after:	2 months


git-svn-id: svn+ssh://svn.freebsd.org/base/head@256843 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix build problem on ARM (which defaults to building without soft updates).

Reported by:  Tinderbox
Sponsored by: Netflix


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