]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
10 years agoMerge r258677.
melifaro [Thu, 8 May 2014 18:09:32 +0000 (18:09 +0000)]
Merge r258677.

Fix key lookup in ipfw(8) broken since r232865.
Print warning for IPv4 address strings which are valid in
inet_aton() but not valid in inet_pton(). (1)

Found by:       Özkan KIRIK <ozkan.kirik@gmail.com>
Submitted by:   Ian Smith <smithi@nimnet.asn.au> (1)

git-svn-id: svn://svn.freebsd.org/base/stable/10@265693 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r265201
brooks [Thu, 8 May 2014 16:12:38 +0000 (16:12 +0000)]
MFC r265201

Fix a 2038 bug.

If time_t is 64-bit (i.e. isn't 32-bit) allow any value of year, not
just years less than 2038.

Don't bother fixing the underflow in the case of years before 1903.

MFC after: 1 week
Sponsored by: DARPA, AFRL

git-svn-id: svn://svn.freebsd.org/base/stable/10@265687 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260234, r260328:
mav [Thu, 8 May 2014 13:31:01 +0000 (13:31 +0000)]
MFC r260234, r260328:
Remove extra conversion to nanoseconds from ddi_get_lbolt64().

As result this uses one multiplication and shifts instead of one division
and two multiplications.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265679 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264145:
mav [Thu, 8 May 2014 13:12:24 +0000 (13:12 +0000)]
MFC r264145:
Add property and sysctl to control how ZVOLs are exposed to OS.

New ZFS property volmode and sysctl vfs.zfs.vol.mode allow switching ZVOL
between three modes:
 geom -- existing fully functional behavior (default);
 dev -- exposing volumes only as raw disk device file in devfs;
 none -- not exposing volumes outside ZFS.

The "dev" mode is less functional (can't be partitioned, mounted, etc),
but it is faster, and in some scenarios with untrusted consumers safer.
It can be useful for NAS, VM block storages, etc.
The "none" mode may be convenient for backup servers, etc. that don't
need direct data access.

Due to the way ZVOL is integrated with main ZFS code, those property
and sysctl are checked only during pool import and volume creation.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265678 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264086:
mav [Thu, 8 May 2014 13:10:39 +0000 (13:10 +0000)]
MFC r264086:
3580 Want zvols to return volblocksize when queried for physical block size

illumos/illumos-gate@a0b60564dfc644f4bfaef1ce26d343b44cf68bc5

It is irrelevant for FreeBSD, just reducing diff.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265677 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r265054:
mav [Thu, 8 May 2014 12:07:40 +0000 (12:07 +0000)]
MFC r265054:
Reduce number of opens by REOM RAID during provider taste.

Instead opening/closing provider by each of metadata classes, do it only
once in core code.  Since for SCSI disks open/close means sending some
SCSI commands to the device, this change reduces taste time.

Sponsored by: iXsystems, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265669 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264313:
mav [Thu, 8 May 2014 12:04:40 +0000 (12:04 +0000)]
MFC r264313:
Do not increment bio_data in case of BIO_DELETE.

This fixes KASSERT() panic in g_io_request().

git-svn-id: svn://svn.freebsd.org/base/stable/10@265668 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r264888
rmacklem [Thu, 8 May 2014 11:59:23 +0000 (11:59 +0000)]
MFC: r264888
The PR reported that the old NFS server did not set uio_td == NULL
for the VOP_READ() call. This patch fixes both the old and new
server for this case.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265667 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264853
smh [Thu, 8 May 2014 08:30:18 +0000 (08:30 +0000)]
MFC r264853

Add some new ATA defines for SATA 3.1 spec

Sponsored by: Multiplay

git-svn-id: svn://svn.freebsd.org/base/stable/10@265659 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264849 & r264883
smh [Thu, 8 May 2014 08:23:24 +0000 (08:23 +0000)]
MFC r264849 & r264883

Exposed debug.acpi.max_tasks and debug.acpi.max_threads via sysctls so their
values can be viewed.

Sponsored by: Multiplay

git-svn-id: svn://svn.freebsd.org/base/stable/10@265655 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264878
smh [Thu, 8 May 2014 08:20:23 +0000 (08:20 +0000)]
MFC r264878

Increase ACPI_MAX_TASKS to be 4 x the number of CPU's as 2 x was still
insufficient on some machines

Sponsored by: Multiplay

git-svn-id: svn://svn.freebsd.org/base/stable/10@265653 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264863
smh [Thu, 8 May 2014 08:18:48 +0000 (08:18 +0000)]
MFC r264863

Add information about supported NCQ functionality to camcontrol identify.

Sponsored by: Multiplay

git-svn-id: svn://svn.freebsd.org/base/stable/10@265652 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264851
smh [Thu, 8 May 2014 08:17:12 +0000 (08:17 +0000)]
MFC r264851

Eliminated optarg global being used outside of the function which called getopt

Sponsored by: Multiplay

git-svn-id: svn://svn.freebsd.org/base/stable/10@265650 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r265159:
mav [Thu, 8 May 2014 07:13:22 +0000 (07:13 +0000)]
MFC r265159:
Respect MAXIMUM TRANSFER LENGTH field of Block Limits VPD page.

Nobody yet reported disk supporting I/Os less then our MAXPHYS value, but
since we any way have code to read Block Limits VPD page, that is easy.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265644 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r265150:
mav [Thu, 8 May 2014 07:12:06 +0000 (07:12 +0000)]
MFC r265150:
Do not reread SCSI disk VPD pages on every device open.

Instead of rereading VPD pages on every device open, do it only on initial
device probe, and in cases when device reported via UNIT ATTENTIONs that
something has changed.  Capacity is still rereaded on every open because
it is more critical for operation and more probable to change in run time.

On my tests with Intel 530 SSDs on mps(4) HBA this change reduces time
GEOM needs to retaste the device (that includes few open/close cycles)
from ~150ms to ~30ms.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265643 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264886:
mav [Thu, 8 May 2014 07:10:38 +0000 (07:10 +0000)]
MFC r264886:
Remove limits on size of READ/WRITE operations.

Instead of allocating up to 16MB or RAM at once to handle whole I/O,
allocate up to 1MB at a time, but do multiple ctl_datamove() and storage
I/Os if needed.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265642 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264884:
mav [Thu, 8 May 2014 07:08:47 +0000 (07:08 +0000)]
MFC r264884:
Make CAM target CTL frontend respect SIM I/O size limitations.

If datamove size is bigger then SIM can handle, or it has more segments
then this code can handle -- split it into several CTIO requests.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265641 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264880 (by trasz):
mav [Thu, 8 May 2014 07:07:51 +0000 (07:07 +0000)]
MFC r264880 (by trasz):
Modify CTL iSCSI frontend to properly handle situations where datamove
routine is called multiple times per SCSI task.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265640 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264834:
mav [Thu, 8 May 2014 07:05:19 +0000 (07:05 +0000)]
MFC r264834:
Disable UNMAP support for STEC 842 SSDs.

In some unknown cases UNMAP commands make device firmware stuck.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265638 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264407:
mav [Thu, 8 May 2014 07:04:13 +0000 (07:04 +0000)]
MFC r264407:
Join CTL worker threads into one process for convenience.
Report their idle state as "-".

git-svn-id: svn://svn.freebsd.org/base/stable/10@265637 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264406:
mav [Thu, 8 May 2014 07:01:54 +0000 (07:01 +0000)]
MFC r264406:
Report more readable state "-" for idle CAM scan thread.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265635 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264274, r264279, r264283, r264296, r264297:
mav [Thu, 8 May 2014 07:00:45 +0000 (07:00 +0000)]
MFC r264274, r264279, r264283, r264296, r264297:
Add support for SCSI UNMAP commands to CTL.

This patch adds support for three new SCSI commands: UNMAP, WRITE SAME(10)
and WRITE SAME(16).  WRITE SAME commands support both normal write mode
and UNMAP flag.  To properly report UNMAP capabilities this patch also adds
support for reporting two new VPD pages: Block limits and Logical Block
Provisioning.

UNMAP support can be enabled per-LUN by adding "-o unmap=on" to `ctladm
create` command line or "option unmap on" to lun sections of /etc/ctl.conf.

At this moment UNMAP supported for ramdisks and device-backed block LUNs.
It was tested to work great with ZFS ZVOLs.  For file-backed LUNs UNMAP
support is unfortunately missing due to absence of respective VFS KPI.

Sponsored by:   iXsystems, Inc

git-svn-id: svn://svn.freebsd.org/base/stable/10@265634 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260509:
mav [Thu, 8 May 2014 06:55:48 +0000 (06:55 +0000)]
MFC r260509:
Replace several instances of -1 with appropriate CAM_*_WILDCARD and types.

It was equal before r259397, but for good or bad, not any more for LUNs.

This change fixes at least CAM debugging.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265632 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r264845
rmacklem [Wed, 7 May 2014 22:33:36 +0000 (22:33 +0000)]
MFC: r264845
Remove an unnecessary level of indirection for an argument.
This simplifies the code and should avoid the clang sparc
port from generating an abort() call.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265621 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r264842
rmacklem [Wed, 7 May 2014 22:27:03 +0000 (22:27 +0000)]
MFC: r264842
Modify the NFSv4 client's Pathconf RPC (actually a Getattr Op.)
so that it only does the RPC for names that are answered by the RPC.
Doing the RPC for other names is harmless, but unnecessary.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265620 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMerge r259393 from head:
gavin [Wed, 7 May 2014 21:38:33 +0000 (21:38 +0000)]
Merge r259393 from head:

  Fix several panics when initialization of an ISA or PC-CARD device fails:

  o  Assign sc->an_dev in an_probe() (which isn't really a probe function in
     the standard newbus sense) as we may need it for printing errors.
  o  Use device_printf() rather than if_printf() in an_reset() - this is
     called from an_probe() long before the ifp structure is initialised
     in an_attach().
  o  Initialize the ifp structure early in an_attach() as we use if_printf()
     in cases where allocation of descriptors etc fails.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265614 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMerge r256782 from head:
gavin [Wed, 7 May 2014 20:57:16 +0000 (20:57 +0000)]
Merge r256782 from head:

  Add 26 new device IDs to uslcom(4).  This brings us in sync with Linux
  v3.12 rc5

git-svn-id: svn://svn.freebsd.org/base/stable/10@265610 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMerge r264984
scottl [Wed, 7 May 2014 20:28:27 +0000 (20:28 +0000)]
Merge r264984

Retire smp_active.  It was racey and caused demonstrated problems with
the cpufreq code.  Replace its use with smp_started.  There's at least
one userland tool that still looks at the kern.smp.active sysctl, so
preserve it but point it to smp_started as well.

Obtained from: Netflix, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265606 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMerged r262424-262425,265085
scottl [Wed, 7 May 2014 20:20:52 +0000 (20:20 +0000)]
Merged r262424-262425,265085

Add the -a option to pmcstat.  This produces a full stack track on the
sampled points.  See the man page for details on how this works.

Obtained from:  Netflix, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265604 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r263445 and r265385. Note that the change to ObsoleteFiles.inc in
asomers [Wed, 7 May 2014 18:49:25 +0000 (18:49 +0000)]
MFC r263445 and r265385.  Note that the change to ObsoleteFiles.inc in
r265385 does not need to be MFCed, because the obsolete files in question
were never MFCed to any stable branch.

r265385
Remove the ifconfig test added in rev 263445.  After discussion with
melifaro, we agreed that ifconfig's behavior was not a bug.  The main
motivation for bin/187551 was to partially resolve kern/187549, but we
resolved kern/187549 in a different way instead.

ObsoleteFiles.inc
etc/mtree/BSD.tests.dist
sbin/ifconfig/tests/fibs_test.sh
sbin/ifconfig/tests/Makefile
sbin/ifconfig/Makefile
        Remove /usr/tests/sbin/ifconfig

r263445
Add several ATF tests that deal with multiple fibs.  They're described in
several different PRs, but the tests share some common code, so I'm
committing them together.

sbin/ifconfig/tests
sbin/ifconfig/tests/fibs_test.sh
sbin/ifconfig/tests/Makefile
sbin/ifconfig/Makefile
        Add fibs_test.sh, which regresses bin/187551

tests/sys/netinet
tests/sys/netinet/fibs_test.sh
tests/sys/netinet/udp_dontroute.c
tests/sys/netinet/Makefile
tests/sys/Makefile
        Add fibs_test.sh, which regresses kern/167947, kern/187552
        kern/187549, kern/187550, and kern/187553

etc/mtree/BSD.tests.dist
        Add newly created directories

git-svn-id: svn://svn.freebsd.org/base/stable/10@265586 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r263311:
jimharris [Wed, 7 May 2014 17:20:15 +0000 (17:20 +0000)]
MFC r263311:

nvme: Allocate all MSI resources up front so that we can fall back to
INTx if necessary.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265577 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r263310:
jimharris [Wed, 7 May 2014 17:18:51 +0000 (17:18 +0000)]
MFC r263310:

nvme: Close hole where nvd(4) would not be notified of all nvme(4)
instances if modules loaded during boot.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265576 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r263303:
jimharris [Wed, 7 May 2014 17:17:16 +0000 (17:17 +0000)]
MFC r263303:

Update nvme(4) and nvd(4) man pages to clarify the differences between
their respective device nodes.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265575 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r263278:
jimharris [Wed, 7 May 2014 17:02:15 +0000 (17:02 +0000)]
MFC r263278:

nvme:  NVMe specification dictates 4-byte alignment for PRPs (not 8).

git-svn-id: svn://svn.freebsd.org/base/stable/10@265573 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r263277:
jimharris [Wed, 7 May 2014 17:00:39 +0000 (17:00 +0000)]
MFC r263277:

nvme: Remove the software progress marker SET_FEATURE command during
controller initialization.

The spec says OS drivers should send this command after controller
initialization completes successfully, but other NVMe OS drivers are
not sending this command.  This change will therefore reduce differences
between the FreeBSD and other OS drivers.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265572 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r263276:
jimharris [Wed, 7 May 2014 16:57:33 +0000 (16:57 +0000)]
MFC r263276:

Base the max number of SG elements on MAXPHYS.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265571 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r263275:
jimharris [Wed, 7 May 2014 16:56:20 +0000 (16:56 +0000)]
MFC r263275:

isci: Ensure ATA passthrough commands with RETURN_RESPONSE bit set
translate their response.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265570 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260382:
jimharris [Wed, 7 May 2014 16:55:08 +0000 (16:55 +0000)]
MFC r260382:

For IDENTIFY passthrough commands to Chatham prototype controllers, copy
the spoofed identify data into the user buffer rather than issuing the
command to the controller, since Chatham IDENTIFY data is always spoofed.

While here, fix a bug in the spoofed data for Chatham submission and
completion queue entry sizes.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265569 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260381:
jimharris [Wed, 7 May 2014 16:53:42 +0000 (16:53 +0000)]
MFC r260381:

For "nvmecontrol devlist", show namespace sizes in terms of MB instead of
GB to improve granularity of the reporting - especially for namespaces
that are on the order of 1 or 2 GB.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265568 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r258071:
jimharris [Wed, 7 May 2014 16:52:29 +0000 (16:52 +0000)]
MFC r258071:

Check for special status code from FIRMWARE_ACTIVATE command
signifying that a reboot is required to complete activation
of the requested firmware image.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265567 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoDocument r265388, addition of mpr(4).
gjb [Wed, 7 May 2014 12:48:18 +0000 (12:48 +0000)]
Document r265388, addition of mpr(4).

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265545 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r265248
marius [Wed, 7 May 2014 09:55:47 +0000 (09:55 +0000)]
MFC: r265248

Allow GEOM_VINUM to be statically compiled into the kernel.

Submitted by: gleb

git-svn-id: svn://svn.freebsd.org/base/stable/10@265536 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264573+264608+264609:
delphij [Wed, 7 May 2014 08:06:54 +0000 (08:06 +0000)]
MFC r264573+264608+264609:

Sync with OpenBSD.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265533 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264405:
trasz [Wed, 7 May 2014 08:04:41 +0000 (08:04 +0000)]
MFC r264405:

Fix periph listing when IOCTL buffer border hits result for wanted bus.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265532 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264355 by mav@:
trasz [Wed, 7 May 2014 08:03:30 +0000 (08:03 +0000)]
MFC r264355 by mav@:

Remove unused val argument value from SYSCTL_INT() calls.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265531 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264877:
trasz [Wed, 7 May 2014 08:00:59 +0000 (08:00 +0000)]
MFC r264877:

Style fixes.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265530 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264876:
trasz [Wed, 7 May 2014 07:59:44 +0000 (07:59 +0000)]
MFC r264876:

Grammar fix.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265529 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264604:
trasz [Wed, 7 May 2014 07:57:53 +0000 (07:57 +0000)]
MFC r264604:

Remove redundant code.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265528 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264549:
trasz [Wed, 7 May 2014 07:56:36 +0000 (07:56 +0000)]
MFC r264549:

Make it possible for the initiator side to operate in both proxy
and normal mode; this makes it possible to compile with the former
by default, but use it only when neccessary.  That's especially
important for the userland part.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265526 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264545:
trasz [Wed, 7 May 2014 07:54:47 +0000 (07:54 +0000)]
MFC r264545:

Fix typo.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265525 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264348 by mav@:
trasz [Wed, 7 May 2014 07:53:24 +0000 (07:53 +0000)]
MFC r264348 by mav@:

Improve use of socket buffer upcalls.

Use soreadable()/sowriteable() in socket upcalls to avoid extra wakeups
until we have enough data to read or space to write.

Increase partial receive len from 1K to 128K to not wake up on every
received packet.

This significantly reduces locks congestion and CPU usage and improves
throughput for large I/Os on NICs without TSO and LRO.

MFC r264552 by mav@:

Close the race in older code, that caused connection stuck after r264348.

Sponsored by: iXsystems, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265524 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264544:
trasz [Wed, 7 May 2014 07:48:32 +0000 (07:48 +0000)]
MFC r264544:

Add kern.iscsi.fail_on_disconnection; this is required for gmultipath
to work.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265523 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264538:
trasz [Wed, 7 May 2014 07:47:29 +0000 (07:47 +0000)]
MFC r264538:

Remove useless debug.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265522 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264537:
trasz [Wed, 7 May 2014 07:46:23 +0000 (07:46 +0000)]
MFC r264537:

Be more strict with locking for is_waiting_for_iscsid variable.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265521 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264536:
trasz [Wed, 7 May 2014 07:45:22 +0000 (07:45 +0000)]
MFC r264536:

Get rid of ISCSIDCLOSE; it wasn't used and is redundant anyway,
because of ISCSIDFAIL.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265520 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264535:
trasz [Wed, 7 May 2014 07:44:17 +0000 (07:44 +0000)]
MFC r264535:

English.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265519 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264534:
trasz [Wed, 7 May 2014 07:43:13 +0000 (07:43 +0000)]
MFC r264534:

If we fail to create LUN, try again on next configuration reload.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265518 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264533:
trasz [Wed, 7 May 2014 07:41:58 +0000 (07:41 +0000)]
MFC r264533:

Use consistent punctuation.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265516 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264532:
trasz [Wed, 7 May 2014 07:40:45 +0000 (07:40 +0000)]
MFC r264532:

Use proper terminology in debug messages.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265515 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264531:
trasz [Wed, 7 May 2014 07:39:16 +0000 (07:39 +0000)]
MFC r264531:

Constify.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265514 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264530:
trasz [Wed, 7 May 2014 07:37:55 +0000 (07:37 +0000)]
MFC r264530:

Properly pass the initiator address when running in proxy mode.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265513 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264529:
trasz [Wed, 7 May 2014 07:36:46 +0000 (07:36 +0000)]
MFC r264529:

Use socket address from accept(2) instead of retrieving it via
getpeername(2).

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265512 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264528:
trasz [Wed, 7 May 2014 07:35:21 +0000 (07:35 +0000)]
MFC r264528:

Rework the way we enable CTL iSCSI port.  Previously conf_apply()
needed it to be already enabled, because listening in proxy mode
requires it; however, it's conf_apply() that opens pidfiles,
so it resulted in port being enabled before pidfile was opened.
This was not so bad, but it was also disabled when pidfile couldn't
be opened due to ctld already running; this means that starting
second ctld instance screwed up the first.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265511 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264527:
trasz [Wed, 7 May 2014 07:33:56 +0000 (07:33 +0000)]
MFC r264527:

Make it possible to interrupt login when running in proxy mode.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265510 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264526:
trasz [Wed, 7 May 2014 07:32:45 +0000 (07:32 +0000)]
MFC r264526:

Properly identify target portal when running in proxy mode.  While here,
remove CTL_ISCSI_CLOSE, it wasn't used or implemented anyway.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265509 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264525:
trasz [Wed, 7 May 2014 07:31:25 +0000 (07:31 +0000)]
MFC r264525:

Add some stuff to make it easier to figure out for the system administrator
whether the ICL_KERNEL_PROXY stuff got compiled in correctly.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265508 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264524:
trasz [Wed, 7 May 2014 07:29:39 +0000 (07:29 +0000)]
MFC r264524:

Make it possible for the iSCSI target side to operate in both normal
and ICL_KERNEL_PROXY mode, and fix some bit rot so the latter actually
works again.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265507 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264500:
trasz [Wed, 7 May 2014 07:28:23 +0000 (07:28 +0000)]
MFC r264500:

Stop treating LUN 0 as mandatory.  There is no reason to do that.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265506 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r263740:
trasz [Wed, 7 May 2014 07:25:47 +0000 (07:25 +0000)]
MFC r263740:

Use a less unusual syntax in debug printfs.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265505 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264264 by mav@:
trasz [Wed, 7 May 2014 07:20:02 +0000 (07:20 +0000)]
MFC r264264 by mav@:

Wakeup only one thread of added in r263978i at a time.

This slightly reduces lock congestion between threads.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265504 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264163:
trasz [Wed, 7 May 2014 07:18:38 +0000 (07:18 +0000)]
MFC r264163:

Remove hack to pass STAILQ to a function and do it properly instead.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265503 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264122:
trasz [Wed, 7 May 2014 07:17:11 +0000 (07:17 +0000)]
MFC r264122:

Rework the iSCSI PDU transmit code to avoid lock contention and coalesce
PDUs before sending.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265502 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264110:
trasz [Wed, 7 May 2014 06:46:59 +0000 (06:46 +0000)]
MFC r264110:

All the iSCSI sysctls are also tunables; advertise that.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265501 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264109:
trasz [Wed, 7 May 2014 06:44:19 +0000 (06:44 +0000)]
MFC r264109:

We don't need TAILQ for iSCSI PDUs; STAILQ is enough.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265500 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264026:
trasz [Wed, 7 May 2014 06:41:33 +0000 (06:41 +0000)]
MFC r264026:

Enable a KASSERT.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265499 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264025:
trasz [Wed, 7 May 2014 06:38:19 +0000 (06:38 +0000)]
MFC r264025:

Get rid of the "autoscaling", instead just set socket buffer sizes
in the usual way.  The only thing the old code did was making things
less predictable.

MFC r264058:

Fix build, broken by r264025.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265498 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264024:
trasz [Wed, 7 May 2014 06:34:03 +0000 (06:34 +0000)]
MFC r264024:

Use atomic ops instead of mutexes where appropriate.

Submitted by: mav@
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265497 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264023:
trasz [Wed, 7 May 2014 06:31:45 +0000 (06:31 +0000)]
MFC r264023:

Instead of "icltx" and "iclrx", use thread names with prefix from upper
layer, so that one can see which side of the stack the threads are for.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265496 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264022:
trasz [Wed, 7 May 2014 06:29:01 +0000 (06:29 +0000)]
MFC r264022:

Get rid of ICL lock; use upper-layer (initiator or target) lock instead.
This avoids extra locking in icl_pdu_queue(); the upper layer needs to call
it while holding its own lock anyway, to avoid sending PDUs out of order.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265495 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264020:
trasz [Wed, 7 May 2014 06:26:34 +0000 (06:26 +0000)]
MFC r264020:

Remove the homegrown ctl_be_block_io allocator, replacing it with UMA.
There is no performance difference.

Reviewed by: mav@
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265494 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r263979:
trasz [Wed, 7 May 2014 06:24:46 +0000 (06:24 +0000)]
MFC r263979:

Hide CTL messages about SCSI error responses.  Too many users take
them for actual target errors.  They can be enabled back by setting
kern.cam.ctl.verbose=1, or booting with bootverbose.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265493 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r263978:
trasz [Wed, 7 May 2014 06:22:51 +0000 (06:22 +0000)]
MFC r263978:

Make it possible to have multiple CTL worker threads.  Leave the default
of 1 for now.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265492 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r263811:
trasz [Wed, 7 May 2014 06:20:35 +0000 (06:20 +0000)]
MFC r263811:

Remove ctl_mem_pool.{c,h}.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265491 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r263810:
trasz [Wed, 7 May 2014 06:18:03 +0000 (06:18 +0000)]
MFC r263810:

Rework cfiscsi_datamove_in() to obey expected data transfer length
received from the initiator.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265490 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r263745:
trasz [Wed, 7 May 2014 06:14:41 +0000 (06:14 +0000)]
MFC r263745:

Target Transfer Tag is opaque; no need to htonl(3) it.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265489 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r263743:
trasz [Wed, 7 May 2014 06:12:59 +0000 (06:12 +0000)]
MFC r263743:

Move the ic_outstanding_count under #ifdef DIAGNOSTIC.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265488 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r263742:
trasz [Wed, 7 May 2014 06:10:55 +0000 (06:10 +0000)]
MFC r263742:

Fix harmless warning after reconnecting a session and not doing anything
with it.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@265487 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r262338
alc [Wed, 7 May 2014 00:32:49 +0000 (00:32 +0000)]
MFC r262338
  When the kernel is running in a virtual machine, it cannot rely upon the
  processor family to determine if the workaround for AMD Family 10h Erratum
  383 should be enabled.  To enable virtual machine migration among a
  heterogeneous collection of physical machines, the hypervisor may have
  been configured to report an older processor family with a reduced feature
  set.  Effectively, the reported processor family and its features are like
  a "least common denominator" for the collection of machines.

  Therefore, when the kernel is running in a virtual machine, instead of
  relying upon the processor family, we now test for features that prove
  that the underlying processor is not affected by the erratum.  (The
  features that we test for are unlikely to ever be emulated in software
  on an affected physical processor.)

PR: 186061

git-svn-id: svn://svn.freebsd.org/base/stable/10@265476 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r261908 by ian: Fix a typo, C_ALSOLUTE -> C_ABSOLUTE.
emaste [Tue, 6 May 2014 23:28:48 +0000 (23:28 +0000)]
MFC r261908 by ian: Fix a typo, C_ALSOLUTE -> C_ABSOLUTE.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265475 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r264739
rmacklem [Tue, 6 May 2014 22:04:50 +0000 (22:04 +0000)]
MFC: r264739
Add {} braces so that the code conforms to the indentation.
Fortunately, I don't think doing the assignment of cap->tsomax
unconditionally causes any problem.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265471 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r264738
rmacklem [Tue, 6 May 2014 21:59:48 +0000 (21:59 +0000)]
MFC: r264738
For an NFSv4 mount with the "nocto" option, don't get the
up to date file attributes upon close. This reduces the
Getattr RPC count by about 65% for software builds.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265470 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r264705, r264749
rmacklem [Tue, 6 May 2014 21:54:52 +0000 (21:54 +0000)]
MFC: r264705, r264749
Modify the NFSv4 client create/mkdir RPC so that it acquires
post-create/mkdir directory attributes. This allows the RPC to
name cache the newly created directory and reduces the lookup RPC
count for applications creating a lot of directories.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265469 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r264681
rmacklem [Tue, 6 May 2014 21:47:43 +0000 (21:47 +0000)]
MFC: r264681
Modify the NFSv4 client open/create RPC so that it acquires
post-open/create directory attributes. This allows the RPC to
name cache the newly created file and reduces the lookup RPC
count by about 10% for software builds.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265466 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r265097:
brooks [Tue, 6 May 2014 14:38:03 +0000 (14:38 +0000)]
MFC r265097:

Merge from CheriBSD:

commit 1d1b908107255ffdff4d17f015d8f057d73cc6cb
Author: Brooks Davis <brooks@one-eyed-alien.net>
Date:   Fri Mar 28 16:24:45 2014 +0000

    Add a long needed seatbelt.

    Exit with an error when make is called without a target at the top level
    rather than poluting the source tree and causing use confusion in future
    builds.

commit a9d9aa341b2f4308a227ab460ba85f1f287ad028
Author: Brooks Davis <brooks@one-eyed-alien.net>
Date:   Tue Apr 29 16:06:12 2014 +0000

    Simplify seatbelt added in 1d1b908 based in feedback.

    Discussed with:     imp@FreeBSD.org

Reviewed by: imp
Sponsored by: DARPA, AFRL

git-svn-id: svn://svn.freebsd.org/base/stable/10@265449 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r265102:
kib [Tue, 6 May 2014 12:31:25 +0000 (12:31 +0000)]
MFC r265102:
Fix two cases of recursive acquisitions of the vm object lock, only
possible in rare failure situations.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265437 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r265100:
kib [Tue, 6 May 2014 12:20:07 +0000 (12:20 +0000)]
MFC r265100:
Fix the comparision for the end of range in vm_phys_fictitious_reg_range().

git-svn-id: svn://svn.freebsd.org/base/stable/10@265435 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r264672
rmacklem [Tue, 6 May 2014 12:15:05 +0000 (12:15 +0000)]
MFC: r264672
Modify the Lookup RPC for NFSv4 so that it acquires directory
attributes. This allows the client to cache directory names
when they are looked up, reducing the Lookup RPC count by
about 40% for software builds.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265434 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r264610:
mav [Tue, 6 May 2014 09:54:24 +0000 (09:54 +0000)]
MFC r264610:
Correct AMD chipsets identification.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265430 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260830:
mav [Tue, 6 May 2014 09:51:15 +0000 (09:51 +0000)]
MFC r260830:
Add ID for one more ASMedia AHCI-compatible controller.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265428 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r259382:
np [Tue, 6 May 2014 07:21:50 +0000 (07:21 +0000)]
MFC r259382:

Read card capabilities after firmware initialization, instead of setting
them up as part of firmware initialization (which the driver gets to do
only if it's the master driver).

Read the range of tids available for the ETHOFLD functionality if it's
enabled.

New is_ftid() and is_etid() functions to test whether a tid falls within
the range of filter tids or ETHOFLD tids respectively.

git-svn-id: svn://svn.freebsd.org/base/stable/10@265426 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f