]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoioat: Allocate memory for ring resize sanely
Conrad Meyer [Mon, 26 Oct 2015 03:30:38 +0000 (03:30 +0000)]
ioat: Allocate memory for ring resize sanely

Add a new flag for DMA operations, DMA_NO_WAIT.  It behaves much like
other NOWAIT flags -- if queueing an operation would sleep, abort and
return NULL instead.

When growing the internal descriptor ring, the memory allocation is
performed outside of all locks.  A lock-protected flag is used to avoid
duplicated work.  Threads that cannot sleep and attempt to queue
operations when the descriptor ring is full allocate a larger ring with
M_NOWAIT, or bail if that fails.

ioat_reserve_space() could become an external API if is important to
callers that they have room for a sequence of operations, or that those
operations succeed each other directly in the hardware ring.

This patch splits the internal head index (->head) from the hardware's
head-of-chain (DMACOUNT) register (->hw_head).  In the future, for
simplicity's sake, we could drop the 'ring' array entirely and just use
a linked list (with head and tail pointers rather than indices).

Suggested by: Witness
Sponsored by: EMC / Isilon Storage Division

8 years agoioat: Expose more softc members in sysctls
Conrad Meyer [Mon, 26 Oct 2015 02:21:32 +0000 (02:21 +0000)]
ioat: Expose more softc members in sysctls

Kill some unused softc variables while we're here.

Sponsored by: EMC / Isilon Storage Division

8 years agoioat: Introduce KTR probes
Conrad Meyer [Mon, 26 Oct 2015 02:21:19 +0000 (02:21 +0000)]
ioat: Introduce KTR probes

Sponsored by: EMC / Isilon Storage Division

8 years agoFix bus numbering in ThunderX ITS quirk
Zbigniew Bodek [Sun, 25 Oct 2015 23:27:08 +0000 (23:27 +0000)]
Fix bus numbering in ThunderX ITS quirk

Internal busses (thus ECAM access) should be mapped to
all values from 0 to 143.

Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D3753

8 years agoAdd support for unspecified ranges on ThunderX system
Zbigniew Bodek [Sun, 25 Oct 2015 23:22:40 +0000 (23:22 +0000)]
Add support for unspecified ranges on ThunderX system

When one tries to allocate a resource with unspecified range,
read already configured BAR values (by UEFI or whatever).
This is necessary to make VNIC VFs working and to allow them to be
properly allocated.

Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D3752

8 years agoImprove style in mge driver
Zbigniew Bodek [Sun, 25 Oct 2015 22:20:13 +0000 (22:20 +0000)]
Improve style in mge driver

Minor improvements introduced to ensure code follows FreeBSD style
guidelines.

Reviewed by:    adrian
Obtained from:  Semihalf
Submitted by:   Bartosz Szczepanek <bsz@semihalf.com>
Differential revision: https://reviews.freebsd.org/D3904

8 years agoChange improper locking assertion in mge
Zbigniew Bodek [Sun, 25 Oct 2015 22:17:10 +0000 (22:17 +0000)]
Change improper locking assertion in mge

Assertion used here was invalid. If current thread helds any of locks,
we never want to recurse on them.

Obtained from:  Semihalf
Submitted by:   Bartosz Szczepanek <bsz@semihalf.com>
Differential revision: https://reviews.freebsd.org/D3903

8 years agoIntroduce e6000sw etherswitch support
Zbigniew Bodek [Sun, 25 Oct 2015 22:14:04 +0000 (22:14 +0000)]
Introduce e6000sw etherswitch support

Add e6000sw driver supporting Marvell 88E635288E617288E6176 switches.
It needs to be attached to mdio interface, exporting SMI access
functionality. e6000sw supports port-based VLAN configuration, per-port
media changing, accessing PHY and switch registers.

e6000sw attaches miibuses and PHY drivers as children. Instead of typical
tick as callout, kthread-based tick is used. This combined with SX locks
allows MDIO read/write calls to sleep. It is expected, because this
hardware requires long delays in SMI read/write procedures, which can not
be handled by busy-waiting.

Reviewed by:    adrian
Obtained from:  Semihalf
Submitted by:   Bartosz Szczepanek <bsz@semihalf.com>
Differential revision: https://reviews.freebsd.org/D3902

8 years agoAdd etherswitch support to mge
Zbigniew Bodek [Sun, 25 Oct 2015 22:00:56 +0000 (22:00 +0000)]
Add etherswitch support to mge

This commit introduces support for etherswitch devices that utilize SMI as
a way of accessing its registers. SMI register is located in address space
of mge -- access to it was exported through MDIO interface.

Attachment functions were enhanced so as to ensure proper initialisation
in both cases: 1) PHYs attached directly to mge, 2) PHYs attached to
switch device and switch attached to mge. Attachment of etherswitch device
depends on dts entry with compatible="mrvl,sw" property. If none is found,
typical PHY attachment procedure follows.

In case of switch attached, PHYs' status and configuration is accessible
via etherswitchcfg, and ifconfig shows always-up, non-configurable mge
interfaces.

Due to the fact that there may be simultaneous accessess to SMI
registers (e.g. from PHY attached to one of mge instances and switch
to the other), SMI access interlock was added. It is SX lock,
because sleep ability is necessary -- busy-waiting would result
in poor performance due to long delays required by hardware.
Underlying switch driver is obliged to use sleepable locks as well.

Reviewed by:    adrian
Obtained from:  Semihalf
Submitted by:   Bartosz Szczepanek <bsz@semihalf.com>
Differential revision: https://reviews.freebsd.org/D3900

8 years agoDeliver INOTs only to enabled virtual ports.
Alexander Motin [Sun, 25 Oct 2015 19:55:48 +0000 (19:55 +0000)]
Deliver INOTs only to enabled virtual ports.

8 years agoThe aio_waitcomplete(2) syscall should not sleep when the given timeout
Pawel Jakub Dawidek [Sun, 25 Oct 2015 18:48:09 +0000 (18:48 +0000)]
The aio_waitcomplete(2) syscall should not sleep when the given timeout
is 0. Without this change it was sleeping for one tick. Maybe not a big
deal, but it makes share/dtrace/blocking script to report that.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D3814
Sponsored by: Wheel Systems, http://wheelsystems.com

8 years agopf: Fix compliation warning with gcc
Kristof Provost [Sun, 25 Oct 2015 18:09:03 +0000 (18:09 +0000)]
pf: Fix compliation warning with gcc

While fixing the PF_ANEQ() macro I messed up the parentheses, leading to
compliation warnings with gcc.

Spotted by:     ian
Pointy Hat:     kp

8 years agoRework r289933 using already existing macro.
Alexander Motin [Sun, 25 Oct 2015 17:24:37 +0000 (17:24 +0000)]
Rework r289933 using already existing macro.

8 years agoTry to keep Loop IDs persistent across chip reinits.
Alexander Motin [Sun, 25 Oct 2015 16:04:31 +0000 (16:04 +0000)]
Try to keep Loop IDs persistent across chip reinits.

8 years agodrm/i915: Reduce diff with Linux 3.8
Jean-Sébastien Pédron [Sun, 25 Oct 2015 14:57:53 +0000 (14:57 +0000)]
drm/i915: Reduce diff with Linux 3.8

There is no functional change. The goal is to ease the future update to
Linux 3.8's i915 driver.

MFC after: 2 month

8 years agoLots of improvements to the BSD-licensed dtc
David Chisnall [Sun, 25 Oct 2015 14:52:16 +0000 (14:52 +0000)]
Lots of improvements to the BSD-licensed dtc

- Various fixes to includes (including recursive includes)
- Lots of testing that the output exactly matches GPL'd dtc
- Lots of bug fixes to merging
- Fix incorrect mmap usage
- Ad-hoc memory management replaced with C++11 unique_ptr and similar

Patrick Wildt has successfully run many (all?) of the GPL dtc test suite.

8 years agodrm/i915: Reduce diff with Linux 3.8
Jean-Sébastien Pédron [Sun, 25 Oct 2015 14:42:56 +0000 (14:42 +0000)]
drm/i915: Reduce diff with Linux 3.8

There is no functional change. The goal is to ease the future update to
Linux 3.8's i915 driver.

MFC after: 2 months

8 years agoImprove Port Database Changed handling and reporting.
Alexander Motin [Sun, 25 Oct 2015 14:34:07 +0000 (14:34 +0000)]
Improve Port Database Changed handling and reporting.

8 years agoPF_ANEQ() macro will in most situations returns TRUE comparing two identical
Kristof Provost [Sun, 25 Oct 2015 13:14:53 +0000 (13:14 +0000)]
PF_ANEQ() macro will in most situations returns TRUE comparing two identical
IPv4 packets (when it should return FALSE). It happens because PF_ANEQ() doesn't
stop if first 32 bits of IPv4 packets are equal and starts to check next 3*32
bits (like for IPv6 packet). Those bits containt some garbage and in result
PF_ANEQ() wrongly returns TRUE.

Fix: Check if packet is of AF_INET type and if it is then compare only first 32
bits of data.

PR: 204005
Submitted by: Miłosz Kaniewski

8 years agoAccording to POSIX, a write operation shall start at the current size of
Andrey A. Chernov [Sun, 25 Oct 2015 12:09:28 +0000 (12:09 +0000)]
According to POSIX, a write operation shall start at the current size of
the stream (if mode had 'a' as the first character).

MFC after:      1 week

8 years agoFormalize/unify chip (re-)inits.
Alexander Motin [Sun, 25 Oct 2015 10:49:05 +0000 (10:49 +0000)]
Formalize/unify chip (re-)inits.

8 years agoFix compiling with gcc [4.2.1] after r287797 when MK_HESOID == no and
Enji Cooper [Sun, 25 Oct 2015 07:42:56 +0000 (07:42 +0000)]
Fix compiling with gcc [4.2.1] after r287797 when MK_HESOID == no and
MK_NIS == no by converting `i` back to an int, and instead cast the loop
comparison to `int`

The loop comparison is iterating the len(ns_dtab)-1, because
the last element is the sentinel tuple { NULL, NULL, NULL, }, so when
both HESOID and NIS are off, len(ns_dtab)-1 == 1 - 1 == 0, and the loop
is skipped because the expression is tautologically false

While here, convert `(sizeof(x) / sizeof(x[0]))` to `nitems(x)`

Tested with: clang 3.7.0, gcc 4.2.1, and gcc 4.9.4 [*] with MK_NIS={no,yes}
             and by running bash -lc 'id -u && id -g && id'

* gcc 4.9.4 needs another patch in order for the compile to succeed
  with -Werror with lib/libc/gen/getgrent.c

Reported by: jhibbits

8 years agoLimit RESOLUTION_MAX to INT_MAX, not UINT_MAX (all spelled out) so the
Enji Cooper [Sun, 25 Oct 2015 04:37:00 +0000 (04:37 +0000)]
Limit RESOLUTION_MAX to INT_MAX, not UINT_MAX (all spelled out) so the
mode value isn't always clipped to -1 when (resolution * size) == 32, which
would have been the case with values => {4i,32b,32t}.

This seems to have been broken in r64382.

MFC after: 1 week
X-MFC with: r289915
PR: 200619
Reported by: Michael Baptist
Submitted by: Lars Skodje
Sponsored by: EMC / Isilon Storage Division

8 years agoUse 't' (bit-field) not 'b' (bit-sized integral type) for describing MRIE (aka
Enji Cooper [Sun, 25 Oct 2015 04:04:25 +0000 (04:04 +0000)]
Use 't' (bit-field) not 'b' (bit-sized integral type) for describing MRIE (aka
"Method of Reporting Informational Exceptions") in the SCSI mode database.
T10/04-371 revision 2 (revision 4; page 2, table 1) describes it as a
bit-field of 4 bits wide.

1. http://www.t10.org/ftp/t10/document.04/04-371r2.pdf

This a recommit of head@r289913 to fix the original commit message, in
particular:
- I incorrectly claimed that unit change was 'i' -> 't'.
- The spec I reference in this commit is 2 decades newer than the one noted in
  r289913. The fields in the SCSI mode database are more complete in the newer
  spec, so it'll be easier for someone to decipher this commit if need be
  later.
- I screwed up the bug entry in the previous commit message

Pointyhat to: ngie (for botching up r289913)
PR: 200619
Reported by: Michael Baptist
Submitted by: Lars Skodje
Sponsored by: EMC / Isilon Storage Divisionf

8 years agoRevert r289913 -- I botched up the commit message by accident
Enji Cooper [Sun, 25 Oct 2015 03:22:21 +0000 (03:22 +0000)]
Revert r289913 -- I botched up the commit message by accident

Will redo the commit shortly

8 years agoUse 't' (bits) not 'i' (bytes) for describing MRIE (aka
Enji Cooper [Sun, 25 Oct 2015 03:16:08 +0000 (03:16 +0000)]
Use 't' (bits) not 'i' (bytes) for describing MRIE (aka
"Method of Reporting Informational Exceptions") in the SCSI mode database as
the field described in X3T10/94-190 (revision 4; page 2, table 1) [1.] is
4 bits wide, not 4 bytes wide

1. http://ftp.t10.org/ftp/t10/document.94/94-190r4.pdf

Bug 200619
MFC after: 1 week
Reported by: Michael Baptist <mbaptist@isilon.com>
Submitted by: Lars Skodje <lskodje@isilon.com>
Sponsored by: EMC / Isilon Storage Division

8 years agoioat: Actually bring the hardware back online after reset
Conrad Meyer [Sat, 24 Oct 2015 23:46:32 +0000 (23:46 +0000)]
ioat: Actually bring the hardware back online after reset

We need to reset the chancmp and chainaddr MMIO registers to bring the
device back to a working state.

Name the chanerr bits while we're here.

Sponsored by: EMC / Isilon Storage Division

8 years agoioat: Use bus_alloc_resource_any(9)
Conrad Meyer [Sat, 24 Oct 2015 23:46:20 +0000 (23:46 +0000)]
ioat: Use bus_alloc_resource_any(9)

Sponsored by: EMC / Isilon Storage Division

8 years agoioat: Extract halted error-debugging to a function
Conrad Meyer [Sat, 24 Oct 2015 23:46:08 +0000 (23:46 +0000)]
ioat: Extract halted error-debugging to a function

Sponsored by: EMC / Isilon Storage Division

8 years agoioat: Always re-arm interrupts in process_events
Conrad Meyer [Sat, 24 Oct 2015 23:45:56 +0000 (23:45 +0000)]
ioat: Always re-arm interrupts in process_events

It doesn't hurt, even if there is nothing to do.

Sponsored by: EMC / Isilon Storage Division

8 years agoioat: Add sysctl to force hw reset
Conrad Meyer [Sat, 24 Oct 2015 23:45:45 +0000 (23:45 +0000)]
ioat: Add sysctl to force hw reset

To enable controlled testing.

Sponsored by: EMC / Isilon Storage Division

8 years agoioat: refcnt users so we can drain them at detach
Conrad Meyer [Sat, 24 Oct 2015 23:45:33 +0000 (23:45 +0000)]
ioat: refcnt users so we can drain them at detach

We only need to borrow a mutex for the drain sleep and the 0->1
transition, so just reuse an existing one for now.

The wchan is arbitrary.  Using refcount itself would have required
__DEVOLATILE(), so use the lock's address instead.

Different uses are tagged by kind, although we only do anything with
that information in INVARIANTS builds.

Sponsored by: EMC / Isilon Storage Division

8 years agoioat: When queueing operations, assert the submit lock
Conrad Meyer [Sat, 24 Oct 2015 23:45:21 +0000 (23:45 +0000)]
ioat: When queueing operations, assert the submit lock

Callers should have acquired this lock when they invoked ioat_acquire()
before issuing operations.  Assert it is held.

Sponsored by: EMC / Isilon Storage Division

8 years agoioat: Don't use sleeping allocation in lock path
Conrad Meyer [Sat, 24 Oct 2015 23:45:10 +0000 (23:45 +0000)]
ioat: Don't use sleeping allocation in lock path

This is still the worst possible way to allocate memory if it will ever
be under pressure, but at least it won't deadlock.

Suggested by: WITNESS
Sponsored by: EMC / Isilon Storage Division

8 years agoioat: Pull out timer callout delay into a constant
Conrad Meyer [Sat, 24 Oct 2015 23:44:58 +0000 (23:44 +0000)]
ioat: Pull out timer callout delay into a constant

Pull out the timer callout delay into IOAT_INTR_TIMO and shorten it
considerably (5s -> 100ms).  Single operations do not take 5-10 seconds
and when interrupts aren't working, waiting 100ms sucks a lot less than
5s.

Sponsored by: EMC / Isilon Storage Division

8 years agoAdd libvmmapi to OptionalObsoleteFiles.inc when MK_BHYVE == no
Enji Cooper [Sat, 24 Oct 2015 23:25:43 +0000 (23:25 +0000)]
Add libvmmapi to OptionalObsoleteFiles.inc when MK_BHYVE == no

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd a regression test for r289899 to validate rockridge encoding
Enji Cooper [Sat, 24 Oct 2015 23:21:08 +0000 (23:21 +0000)]
Add a regression test for r289899 to validate rockridge encoding
of device types

X-MFC with: r289899
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove an ls -l I was using for debugging
Enji Cooper [Sat, 24 Oct 2015 23:19:24 +0000 (23:19 +0000)]
Remove an ls -l I was using for debugging

MFC after: 2 weeks
X-MFC with: r289897
Sponsored by: EMC / Isilon Storage Division

8 years agoUpdate jemalloc to version 4.0.4.
Jason Evans [Sat, 24 Oct 2015 23:18:05 +0000 (23:18 +0000)]
Update jemalloc to version 4.0.4.

8 years agoImport the fix from NetBSD kern/48852 (sic) to fix rockridge encoding of
Enji Cooper [Sat, 24 Oct 2015 23:16:13 +0000 (23:16 +0000)]
Import the fix from NetBSD kern/48852 (sic) to fix rockridge encoding of
device nodes

In particular, use st_rdev (the device type), not st_dev (the device inode),
and fix the comparison to be correct with the st_rdev field

Bug 203648
MFC after: 2 weeks
Submitted by: Thomas Schmitt <scdbackup@gmx.net>
Coverity CID: 1008927
Sponsored by: EMC / Isilon Storage Division

8 years agoarge(4): flip this on for AR9344 SoCs.
Adrian Chadd [Sat, 24 Oct 2015 22:37:59 +0000 (22:37 +0000)]
arge(4): flip this on for AR9344 SoCs.

I couldn't test arge0->arge1 bridging, only arge0 VLAN bridging.
The DIR-825C1 only hooks up arge0 to the switch GMAC0 and so
you need to abuse VLANs to test.

Tested:

* DIR-825C1 (AR9344)

8 years agoAdd more cd9660/FFS makefs testcases
Enji Cooper [Sat, 24 Oct 2015 22:12:23 +0000 (22:12 +0000)]
Add more cd9660/FFS makefs testcases

General changes:
- Parameterize out the mount command.
- Use mtree to verify the contents of an image (check_image_contents) instead
  of using diff (diff verifies content, but not file metadata).
- Move common logic out to functions (common_cleanup, mount_image,
  check_image_contents)
- Add stub testcases for makefs -D (crashes with SIGBUS, similar to bug # 192839)
- Add a note about the ISO-9660 and rockridge specs
- Add testcases that exercise:
-- Creating disk images from an mtree and multiple directories.
-- -F flag use (not really an extensive testcase right now)

cd9660-specific test changes:

- Remove an XXX comment about symlinks; I forgot that non-rockridge images turn
  symlinks into hardlinks.
- Add testcases that exercise:
-- -o allow-deep-trees
-- -o allow-max-name stub testcase (doesn't seem to be implemented in makefs)
-- -o preparer (existence in image; not conformance to spec)
-- -o publisher (existence in image; not conformance to spec)
-- -o rockridge (basic)

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoMake vers.c creation atomic by using a temporary file, then moving
Enji Cooper [Sat, 24 Oct 2015 21:59:58 +0000 (21:59 +0000)]
Make vers.c creation atomic by using a temporary file, then moving
the temporary file to vers.c at the end of the script

The previous logic wrote out to vers.c multiple times, so the file
could be incorrectly interpreted as being completely written out
after one of the echo calls with recursive make, when in reality it
was only partially written.

Also, in the event the build was interrupted when creating vers.c
(small race window), it would have a leftover file that needed to
be cleaned up before resuming the build.

MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoReduce the amount of calls to VOP_BMAP() made from the local vnode
Konstantin Belousov [Sat, 24 Oct 2015 21:59:22 +0000 (21:59 +0000)]
Reduce the amount of calls to VOP_BMAP() made from the local vnode
pager.  It is enough to execute VOP_BMAP() once to obtain both the
disk block address for the requested page, and the before/after limits
for the contiguous run.  The clipping of the vm_page_t array passed to
the vnode_pager_generic_getpages() and the disk address for the first
page in the clipped array can be deduced from the call results.

While there, remove some noise (like if (1) {...}) and adjust nearby
code.

Reviewed by: alc
Discussed with: glebius
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

8 years agoIntel SDM before revision 56 described the CLFLUSH instruction as only
Konstantin Belousov [Sat, 24 Oct 2015 21:37:47 +0000 (21:37 +0000)]
Intel SDM before revision 56 described the CLFLUSH instruction as only
ordered with the MFENCE instruction.  Similar weak guarantees are also
specified by the AMD APM vol. 3 rev. 3.22.  x86 pmap methods
pmap_invalidate_cache_range() and pmap_invalidate_cache_pages() braced
CLFLUSH loop with MFENCE both before and after the loop.

In the revision 56 of SDM, Intel stated that all existing
implementations of CLFLUSH are strict, CLFLUSH instructions execution
is ordered WRT other CLFLUSH and writes.  Also, the strict behaviour
is made architectural.

A new instruction CLFLUSHOPT (which was documented for some time in
the Instruction Set Extensions Programming Reference) provides the
weak behaviour which was previously attributed to CLFLUSH.

Use CLFLUSHOPT when available.  When CLFLUSH is used on Intel CPUs, do
not execute MFENCE before and after the flushing loop.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation

8 years agoDefine a couple macros to access cacheline size/mask in an arch-dependent
Ian Lepore [Sat, 24 Oct 2015 21:27:09 +0000 (21:27 +0000)]
Define a couple macros to access cacheline size/mask in an arch-dependent
way.  This code should now work for all arm versions v4 thru v7.

8 years agoProvide armv4/v5 implementations of several of the armv6 cache maintenance
Ian Lepore [Sat, 24 Oct 2015 21:25:53 +0000 (21:25 +0000)]
Provide armv4/v5 implementations of several of the armv6 cache maintenance
functions.  This will make it possible to use the same busdma code for all
arm platforms v4 thru v7.

8 years agourtwn(4): fix mbuf leak in the TX path
Andriy Voskoboinyk [Sat, 24 Oct 2015 19:59:15 +0000 (19:59 +0000)]
urtwn(4): fix mbuf leak in the TX path

Reviewed by: kevlo
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D3988

8 years agoSkip reserved IP Broadcast handle from using.
Alexander Motin [Sat, 24 Oct 2015 19:47:54 +0000 (19:47 +0000)]
Skip reserved IP Broadcast handle from using.

8 years ago- Plugging a memory leak when malloc() failed during initialisation;
Tai-hwa Liang [Sat, 24 Oct 2015 19:40:03 +0000 (19:40 +0000)]
- Plugging a memory leak when malloc() failed during initialisation;
- Plugging another memory leak inside the destructor.

Reviewed by: matk
MFC after: 3 weeks

8 years agoRename dcache_dma_preread() to dcache_inv_poc_dma() to make it clear that it
Ian Lepore [Sat, 24 Oct 2015 19:39:41 +0000 (19:39 +0000)]
Rename dcache_dma_preread() to dcache_inv_poc_dma() to make it clear that it
is a dcache invalidate to point of coherency just like dcache_inv_poc(), but
a slightly different version specific to dma operations.  Elaborate the
comment about how and why it's different.

8 years agoAdd new field to Abort IOCB.
Alexander Motin [Sat, 24 Oct 2015 19:38:06 +0000 (19:38 +0000)]
Add new field to Abort IOCB.

8 years agoxen: Add missing semi-colon for BITSET_DEFINE()
Conrad Meyer [Sat, 24 Oct 2015 19:04:55 +0000 (19:04 +0000)]
xen: Add missing semi-colon for BITSET_DEFINE()

Broken when it was removed from the macro in r289867.

Pointy-hat: markj
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd PIM_EXTLUNS support to isp(4) driver.
Alexander Motin [Sat, 24 Oct 2015 17:34:40 +0000 (17:34 +0000)]
Add PIM_EXTLUNS support to isp(4) driver.

Now 24xx and above chips support full 8-byte LUN address space.
Older FC chips may support up to 16K LUNs when firmware allows.
Tested in both initiator and target modes for 23xx, 24xx and 25xx.

8 years agoGive CTL support for PIM_EXTLUNS when talking to CAM.
Alexander Motin [Sat, 24 Oct 2015 17:24:19 +0000 (17:24 +0000)]
Give CTL support for PIM_EXTLUNS when talking to CAM.

CTL itself still lives in flat LUN space, but it can generate extended
numbers if CAM SIM reports such capability.

8 years agonewsyslog.conf: allow to configure the signal using the signal name.
Baptiste Daroussin [Sat, 24 Oct 2015 13:55:12 +0000 (13:55 +0000)]
newsyslog.conf: allow to configure the signal using the signal name.

Submitted by: Alexandre Perrin <alex@kaworu.ch>
MFC after: 1 week
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D3961

8 years agotimeout(1): fix the acceptable range values for parse_signal()
Baptiste Daroussin [Sat, 24 Oct 2015 13:47:03 +0000 (13:47 +0000)]
timeout(1): fix the acceptable range values for parse_signal()

Before both 0 and sys_nsig would be successfully returned by parse_signal()
although being invalid signal numbers.

PR: Alexandre Perrin <alex@kaworu.ch>
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D3990

8 years agoRemove ISP_INTERNAL_TARGET code.
Alexander Motin [Sat, 24 Oct 2015 13:45:45 +0000 (13:45 +0000)]
Remove ISP_INTERNAL_TARGET code.

We have CTL now, which is real and much more functional then this joke.

8 years agoFix some mdoc(7) issues
Baptiste Daroussin [Sat, 24 Oct 2015 13:43:10 +0000 (13:43 +0000)]
Fix some mdoc(7) issues

Obtained from: DragonflyBSD

8 years agoDecode few more response info codes.
Alexander Motin [Sat, 24 Oct 2015 10:01:04 +0000 (10:01 +0000)]
Decode few more response info codes.

Though CAM still does not send any requests that would require those.

8 years agoBump date. Missed in r289873.
Michael Tuexen [Sat, 24 Oct 2015 09:41:43 +0000 (09:41 +0000)]
Bump date. Missed in r289873.

MFC after: 1 week
X-MFC with: r289873

8 years agoAdd support to systat to display SCTP statistics.
Michael Tuexen [Sat, 24 Oct 2015 09:34:40 +0000 (09:34 +0000)]
Add support to systat to display SCTP statistics.

MFC after: 1 week

8 years agoReplace gcc reference with 'cc' and document the default ${CC}.
Bryan Drewery [Sat, 24 Oct 2015 05:16:30 +0000 (05:16 +0000)]
Replace gcc reference with 'cc' and document the default ${CC}.

MFC after: 1 week

8 years agoSort properly.
Bryan Drewery [Sat, 24 Oct 2015 05:00:20 +0000 (05:00 +0000)]
Sort properly.

MFC after: 1 week
X-MFC-With: r289870

8 years agoAdd bsd.crunchgen.mk to bsd.README.
Bryan Drewery [Sat, 24 Oct 2015 04:55:17 +0000 (04:55 +0000)]
Add bsd.crunchgen.mk to bsd.README.

MFC after: 1 week

8 years agoSlightly rework the comments and logic for default Clang/GCC.
Bryan Drewery [Sat, 24 Oct 2015 04:03:32 +0000 (04:03 +0000)]
Slightly rework the comments and logic for default Clang/GCC.

This is because the previous version was very obscure about the fact
that despite having Clang "on by default" for architectures such as powerpc, it
does not actually build due to the GCC it uses not having C++11 support.
Using an external compiler that supports C++11 does allow this to work.
This whole block should be rethought more given "on by default" is not
really default without extra work which could actually be surprising for
why Clang is showing up when using a newer GCC.

Sponsored by: EMC / Isilon Storage Division

8 years agoConfigs should not be under MK_INCLUDES control.
Bryan Drewery [Sat, 24 Oct 2015 04:03:29 +0000 (04:03 +0000)]
Configs should not be under MK_INCLUDES control.

'buildconfig' is connected to 'all', but 'installconfig' is only called
manually.  There is not much need to conditionalize this file right
now due to how it is hooked up and its impact on various build phases.

Sponsored by: EMC / Isilon Storage Division

8 years agoRemove an erroneous semicolon.
Mark Johnston [Sat, 24 Oct 2015 03:16:40 +0000 (03:16 +0000)]
Remove an erroneous semicolon.

MFC after: 3 days

8 years agoDWARF emitted by clang 3.7 encodes array sizes using the DW_AT_count
Mark Johnston [Sat, 24 Oct 2015 03:14:36 +0000 (03:14 +0000)]
DWARF emitted by clang 3.7 encodes array sizes using the DW_AT_count
attribute rather than DW_AT_upper_bound. Teach ctfconvert about this so that
array type sizes are encoded correctly.

PR: 203772
MFC after: 1 week

8 years agoA few more whitespace, style, and comment cleanups. No functional changes.
Ian Lepore [Sat, 24 Oct 2015 03:01:47 +0000 (03:01 +0000)]
A few more whitespace, style, and comment cleanups.  No functional changes.

8 years agoBring in all the new(-ish) statistics code from armv6.
Ian Lepore [Sat, 24 Oct 2015 02:44:13 +0000 (02:44 +0000)]
Bring in all the new(-ish) statistics code from armv6.

8 years agoSince no room left in the _flags, reuse __SALC for O_APPEND.
Andrey A. Chernov [Sat, 24 Oct 2015 02:23:15 +0000 (02:23 +0000)]
Since no room left in the _flags, reuse __SALC for O_APPEND.
It helps to remove _fcntl() call from _ftello() and optimize seek position
calculation in _swrite().

MFC after:      3 weeks

8 years agoChange the preallocation of a busdma segment mapping array from per-tag to
Ian Lepore [Sat, 24 Oct 2015 02:18:14 +0000 (02:18 +0000)]
Change the preallocation of a busdma segment mapping array from per-tag to
per-map.  The per-tag scheme is not safe, and a mutex can't be used to
protect it because the mapping routines can't sleep.  Code brought in
from armv6 implementation.

8 years agonative-xtools: Replace common path with NXBDESTDIR.
Bryan Drewery [Sat, 24 Oct 2015 01:39:31 +0000 (01:39 +0000)]
native-xtools: Replace common path with NXBDESTDIR.

Also combine some mkdir calls.

Sponsored by: EMC / Isilon Storage Division

8 years agonative-xtools: Fix build with WITH_DEBUG_FILES.
Bryan Drewery [Fri, 23 Oct 2015 23:07:45 +0000 (23:07 +0000)]
native-xtools: Fix build with WITH_DEBUG_FILES.

Sponsored by: EMC / Isilon Storage Division

8 years agoInstead of all memory allocations using M_DEVBUF, use new categories
Ian Lepore [Fri, 23 Oct 2015 22:52:00 +0000 (22:52 +0000)]
Instead of all memory allocations using M_DEVBUF, use new categories
M_BUSDMA for allocations of metadata (tags, maps, segment tracking lists),
and M_BOUNCE for bounce pages.

8 years agoInstead of all memory allocations using M_DEVBUF, use new categories
Ian Lepore [Fri, 23 Oct 2015 22:51:48 +0000 (22:51 +0000)]
Instead of all memory allocations using M_DEVBUF, use new categories
M_BUSDMA for allocations of metadata (tags, maps, segment tracking lists),
and M_BOUNCE for bounce pages.

8 years agoRework r289778 to always parallelize known targets, without ordering.
Bryan Drewery [Fri, 23 Oct 2015 21:30:27 +0000 (21:30 +0000)]
Rework r289778 to always parallelize known targets, without ordering.

- Rather than allow 'make clean*' to ignore dependencies, make a static
  list of targets in STANDALONE_SUBDIR_TARGETS that are known to be safe.
  This allows a user to override them if needed and avoids adding this feature
  to user-defined targets that are in ${SUBDIR_TARGETS}. [1]
- This now also allows to force SUBDIR_PARALLEL when calling these
  targets, since no dependencies are needed.

Reported by: ian [1]
Sponsored by: EMC / Isilon Storage Division
MFC after: 3 weeks
X-MFC-With: r289778

8 years agoMinor additions to Status Type 0 IOCB.
Alexander Motin [Fri, 23 Oct 2015 21:30:18 +0000 (21:30 +0000)]
Minor additions to Status Type 0 IOCB.

8 years agoCatch up to r232356: change the boundary constraint type to bus_addr_t.
Ian Lepore [Fri, 23 Oct 2015 21:29:37 +0000 (21:29 +0000)]
Catch up to r232356: change the boundary constraint type to bus_addr_t.
This code lived in the projects/armv6 branch when that change got applied
to all the other arches.

8 years agoAdd aarch64 files to the hwpmc(4) module build
Ed Maste [Fri, 23 Oct 2015 21:09:28 +0000 (21:09 +0000)]
Add aarch64 files to the hwpmc(4) module build

This was probably missed because FreeBSD/arm64 did not yet support
modules when aarch64 support was added to hwpmc(4).

Submitted by: andrew

8 years agoMissed addition for r289812.
Alexander Motin [Fri, 23 Oct 2015 21:01:46 +0000 (21:01 +0000)]
Missed addition for r289812.

8 years agoWhitespace and style nits, no functional changes.
Ian Lepore [Fri, 23 Oct 2015 20:49:34 +0000 (20:49 +0000)]
Whitespace and style nits, no functional changes.

The goal is to make these two files cosmetically alike so that the actual
implementation differences are visible.  The only changes which aren't
spaces<->tabs and rewrapping and reindenting lines are a couple fields
shuffled around in the tag and map structs so that everything is in the same
order in both versions (which should amount to no functional change).

8 years agoFix regression from r289734 that caused crunchgen "subdirs" to not be
Bryan Drewery [Fri, 23 Oct 2015 19:41:58 +0000 (19:41 +0000)]
Fix regression from r289734 that caused crunchgen "subdirs" to not be
properly recursed.

The .for loop was defining a ${__dir} variable that was being set at a
different evaluation time than the target itself, so every 'cd ${__dir}'
became the last value that was in ${__dir}.  This resulted in 'make obj'
not properly being ran in the tree that would leave .depend files
scattered around when 'make all' was ran in rescue/.

To fix this, define a CRUNCH_SRCDIR_* for every prog if it does not
already have one and then use that variable in every relevant place.
This allows simplifying some logic as well.

Reported by: emaste
X-MFC-With: r289734
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoFix various Coverity issues in sbin/savecore/savecore.c:
Alan Somers [Fri, 23 Oct 2015 19:28:24 +0000 (19:28 +0000)]
Fix various Coverity issues in sbin/savecore/savecore.c:

CID1009429: Fix unchecked return value from lseek while clearing dump
CID1007781: Fix file descriptor leak in DoFile
CID1007261: Don't send potentially unterminated string to syslog(3)

Coverity CID: 1009429
Coverity CID: 1007781
Coverity CID: 1007261
MFC after: 2 weeks
Sponsored by: Spectra Logic
Differential Revision: https://reviews.freebsd.org/D3991

8 years agoAdd partial support for QUERY TMF to CAM and isp(4).
Alexander Motin [Fri, 23 Oct 2015 18:34:18 +0000 (18:34 +0000)]
Add partial support for QUERY TMF to CAM and isp(4).

This change allows to decode respective functions in isp(4) in target mode
and pass them through CAM to CTL.  Unfortunately neither CAM nor isp(4)
support returning response info for those task management functions now.

On the other side I just have no initiator to test this functionality.

8 years agoMerge bmake 20151020
Simon J. Gerraty [Fri, 23 Oct 2015 17:38:01 +0000 (17:38 +0000)]
Merge bmake 20151020

8 years agorun(4): convert to ieee80211_tx_complete()
Andriy Voskoboinyk [Fri, 23 Oct 2015 17:35:03 +0000 (17:35 +0000)]
run(4): convert to ieee80211_tx_complete()

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D3992

8 years agolldb: Add arm64 FreeBSD ProcessMonitor register context
Ed Maste [Fri, 23 Oct 2015 17:30:41 +0000 (17:30 +0000)]
lldb: Add arm64 FreeBSD ProcessMonitor register context

This is an adaptation of upstream LLDB commit r251088.

Sponsored by: The FreeBSD Foundation

8 years agodtc needs to be installed if MK_GPL_DTC is not set, which doesn't fit into the
Bryan Drewery [Fri, 23 Oct 2015 17:24:34 +0000 (17:24 +0000)]
dtc needs to be installed if MK_GPL_DTC is not set, which doesn't fit into the
SUBDIR.yes pattern well.

This fixes installation of the BSDL dtc after r288904.

Reported by: jhibbits
Discussed with: imp
Sponsored by: EMC / Isilon Storage Division

8 years agoImprove INOTs handling for 24xx and above chips.
Alexander Motin [Fri, 23 Oct 2015 16:54:24 +0000 (16:54 +0000)]
Improve INOTs handling for 24xx and above chips.

8 years agoresolver: abuse _res a little less
Eric van Gyzen [Fri, 23 Oct 2015 15:56:17 +0000 (15:56 +0000)]
resolver: abuse _res a little less

In the past, _res was a global variable.  Now, it's multiple function calls.
Several functions in the resolver use _res multiple times and therefore
call the function(s) far more than necessary.

Fix those callers to store the result of _res in a local variable.

Add __noinline to the definition of res_init() to avoid the code bloat
that these changes would have otherwise incurred.  Thanks to jilles
for noticing this.

Reviewed by: jilles
MFC after: 1 week
Sponsored by: Dell Inc.
Differential Revision: https://reviews.freebsd.org/D3887

8 years agoblkfront: add support for unmapped IO
Roger Pau Monné [Fri, 23 Oct 2015 15:46:42 +0000 (15:46 +0000)]
blkfront: add support for unmapped IO

Using unmapped IO is really beneficial when running inside of a VM,
since it avoids IPIs to other vCPUs in order to invalidate the
mappings.

This patch adds unmapped IO support to blkfront. The following tests
results have been obtained when running on a Xen host without HAP:

PVHVM
     3165.84 real      6354.17 user      4483.32 sys
PVHVM with unmapped IO
     2099.46 real      4624.52 user      2967.38 sys

This is because when running using shadow page tables TLB flushes and
range invalidations are much more expensive, so using unmapped IO
provides a very important performance boost.

Sponsored by: Citrix Systems R&D
MFC after: 2 weeks
X-MFC-with: r289834

8 years agosysctl(8): Fix style nits
Conrad Meyer [Fri, 23 Oct 2015 15:40:44 +0000 (15:40 +0000)]
sysctl(8): Fix style nits

Suggested by: bde
Sponsored by: EMC / Isilon Storage Division

8 years agox86/dma_bounce: rework _bus_dmamap_load_ma implementation
Roger Pau Monné [Fri, 23 Oct 2015 15:39:59 +0000 (15:39 +0000)]
x86/dma_bounce: rework _bus_dmamap_load_ma implementation

The implementation of bus_dmamap_load_ma_triv currently calls
_bus_dmamap_load_phys on each page that is part of the passed in buffer.
Since each page is treated as an individual buffer, the resulting behaviour
is different from the behaviour of _bus_dmamap_load_buffer. This breaks
certain drivers, like Xen blkfront.

If an unmapped buffer of size 4096 that starts at offset 13 into the first
page is passed to the current _bus_dmamap_load_ma implementation (so the ma
array contains two pages), the result is that two segments are created, one
with a size of 4083 and the other with size 13 (because two independant
calls to _bus_dmamap_load_phys are performed, one for each physical page).
If the same is done with a mapped buffer and calling _bus_dmamap_load_buffer
the result is that only one segment is created, with a size of 4096.

This patch relegates the usage of bus_dmamap_load_ma_triv in x86 bounce
buffer code to drivers requesting BUS_DMA_KEEP_PG_OFFSET and implements
_bus_dmamap_load_ma so that it's behaviour is the same as the mapped version
(_bus_dmamap_load_buffer). This patch only modifies the x86 bounce buffer
code, other arches are left untouched.

Reviewed by: kib, jah
Differential Revision: https://reviews.freebsd.org/D888
Sponsored by: Citrix Systems R&D

8 years agoarm64: remove exception instruction length assertion
Ed Maste [Fri, 23 Oct 2015 15:24:00 +0000 (15:24 +0000)]
arm64: remove exception instruction length assertion

From the (now removed) comment:

 * It is unclear in some cases if the bit is implementation defined.
 * The Foundation Model and QEMU disagree on if the IL bit should
 * be set when we are in a data fault from the same EL and the ISV
 * bit (bit 24) is also set.

Instead of adding even more special cases just remove the assertion.

Approved by: andrew
Sponsored by: The FreeBSD Foundation

8 years agosysctl(9): Document U8/U16 types from r289773
Conrad Meyer [Fri, 23 Oct 2015 15:08:16 +0000 (15:08 +0000)]
sysctl(9): Document U8/U16 types from r289773

Suggested by: ngie
Sponsored by: EMC / Isilon Storage Division

8 years agoBuild fix for non-i386 and non-amd64 platforms.
Hans Petter Selasky [Fri, 23 Oct 2015 14:52:05 +0000 (14:52 +0000)]
Build fix for non-i386 and non-amd64 platforms.

Sponsored by: Mellanox Technologies

8 years agoMove dtrace/opensolaris/zfs module option to common section
Ed Maste [Fri, 23 Oct 2015 12:59:54 +0000 (12:59 +0000)]
Move dtrace/opensolaris/zfs module option to common section

These are not target-specific modules, so the logic to build them should
be common.  This also enables them for arm64.

Sponsored by: The FreeBSD Foundation

8 years agoFix capitalization
Jason A. Harmening [Fri, 23 Oct 2015 12:06:06 +0000 (12:06 +0000)]
Fix capitalization