]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoCatch up with head.
Navdeep Parhar [Fri, 4 Dec 2015 19:32:51 +0000 (19:32 +0000)]
Catch up with head.

8 years agoFix i386 build WITH_OFED=YES. Remove some redundant KASSERTs.
Hans Petter Selasky [Fri, 4 Dec 2015 18:20:55 +0000 (18:20 +0000)]
Fix i386 build WITH_OFED=YES. Remove some redundant KASSERTs.

Suggested by: kib, ian
Sponsored by: Mellanox Technologies
MFC after: 1 week

8 years agoAdd clang patch corresponding to r291701.
Dimitry Andric [Fri, 4 Dec 2015 17:23:19 +0000 (17:23 +0000)]
Add clang patch corresponding to r291701.

8 years agorc.subr: Check for running daemons before a custom start_cmd is executed.
Jilles Tjoelker [Fri, 4 Dec 2015 16:32:29 +0000 (16:32 +0000)]
rc.subr: Check for running daemons before a custom start_cmd is executed.

Currently rc scripts implementing their own start_cmd do not enjoy the
benefits of rc.subr's own check for rc_pid.

This leads to around a third of ports with such a start_cmd not to check for
the process at all and two thirds of ports to re-implement this check
(sometimes wrongly).

This patch moves the check for rc_pid to before ${rc_arg}_cmd is executed.

Submitted by: Dirk Engling
Reviewed by: feld
MFC after: 1 week
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D4156

8 years agoAdd ahci_generic to the ahci module on arm64.
Andrew Turner [Fri, 4 Dec 2015 13:32:00 +0000 (13:32 +0000)]
Add ahci_generic to the ahci module on arm64.

Pointed out by: kib

8 years agoARC-1203 is supported since the latest driver update.
Christian Brueffer [Fri, 4 Dec 2015 10:34:58 +0000 (10:34 +0000)]
ARC-1203 is supported since the latest driver update.

8 years agoFix scope of bridge_header and bridge_pcix_cap in mthca_reset(..)
Enji Cooper [Fri, 4 Dec 2015 09:01:58 +0000 (09:01 +0000)]
Fix scope of bridge_header and bridge_pcix_cap in mthca_reset(..)

They're only used in the __linux__ case

Differential Revision: https://reviews.freebsd.org/D4332
MFC after: 1 week
Reported by: cppcheck
Reviewed by: hselasky
Sponsored by: EMC / Isilon Storage Division

8 years agoFix a bug where a stream reset request wasn't retranmitted when the
Michael Tuexen [Fri, 4 Dec 2015 08:49:27 +0000 (08:49 +0000)]
Fix a bug where a stream reset request wasn't retranmitted when the
peer indicated "In progress".

MFC after: 1 week

8 years agoFix 'install*' and many other missing targets with DIRDEPS_BUILD.
Bryan Drewery [Fri, 4 Dec 2015 07:54:19 +0000 (07:54 +0000)]
Fix 'install*' and many other missing targets with DIRDEPS_BUILD.

My changes in r291635 broke 'make install*' for DIRDEPS_BUILD but also
revealed that some other targets were not guaranteed to be created if
there was a SUBDIR defined.  One example is 'installfiles' was never
defined if SUBDIR was not empty.

Sponsored by: EMC / Isilon Storage Division

8 years agoThe .if redirection on .WAIT is no longer needed with bmake.
Bryan Drewery [Fri, 4 Dec 2015 07:54:16 +0000 (07:54 +0000)]
The .if redirection on .WAIT is no longer needed with bmake.

Sponsored by: EMC / Isilon Storage Division

8 years agoFix 'afterinstall' order not being respected after my changes in r291635.
Bryan Drewery [Fri, 4 Dec 2015 07:54:13 +0000 (07:54 +0000)]
Fix 'afterinstall' order not being respected after my changes in r291635.

The problem was that 'afterinstall' was not coming after SUBDIRs were
installed which was the expectation at least in sys/modules for kldxref.

Reported by: np
Pointyhat to: bdrewery
Sponsored by: EMC / Isilon Storage Division

8 years agoRearrange some common logic.
Bryan Drewery [Fri, 4 Dec 2015 07:54:04 +0000 (07:54 +0000)]
Rearrange some common logic.

8 years agosfxge: [EF10] support RxQ scattering control
Andrew Rybchenko [Fri, 4 Dec 2015 06:54:46 +0000 (06:54 +0000)]
sfxge: [EF10] support RxQ scattering control

If, for example, a VF is configured to use a 1500 byte MTU, but the port
it is attached to is set to 9000 bytes, overlength frames can be received
by the VF. As Huntington scatters by default, these overlength packets
would be scattered across several descriptors, with all except the last
having the CONT bit set.

To avoid this, disable scatter when creating RXQs if the firmware
supports doing so, which all recent versions do. Then we only get
a single descriptor from an overlength frame. This will have the CONT
bit set to indicate it was truncated, so we can discard it.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4354

8 years agosfxge: add additional WRITESIZE value for NVRAM_INFO command
Andrew Rybchenko [Fri, 4 Dec 2015 06:51:37 +0000 (06:51 +0000)]
sfxge: add additional WRITESIZE value for NVRAM_INFO command

Submitted by:   Paul Fox <pfox at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4353

8 years agoRemove disconnected directory RETEST.
Bryan Drewery [Fri, 4 Dec 2015 05:00:51 +0000 (05:00 +0000)]
Remove disconnected directory RETEST.

8 years agoCalculate MPATH for sys/modules to save 92% time in a basic 'obj' tree-walk.
Bryan Drewery [Fri, 4 Dec 2015 04:27:21 +0000 (04:27 +0000)]
Calculate MPATH for sys/modules to save 92% time in a basic 'obj' tree-walk.

Sponsored by: EMC / Isilon Storage Division

8 years agoWe need to zero out the clustering variables in a freed vnode structure.
Kirk McKusick [Fri, 4 Dec 2015 03:54:18 +0000 (03:54 +0000)]
We need to zero out the clustering variables in a freed vnode structure.
For completeness add a VNASSERT that there are no threads waiting on a
range lock (this was previously checked on every vnode free).

Reported by; Rick Macklem
Fix from:    Mateusz Guzik
PR:          204949

8 years agoFix a style issue in g_disk_limit().
Kenneth D. Merry [Fri, 4 Dec 2015 03:44:12 +0000 (03:44 +0000)]
Fix a style issue in g_disk_limit().

Noticed by: bdrewery
MFC after: 1 week

8 years agoFix g_disk_vlist_limit() to work properly with deletes.
Kenneth D. Merry [Fri, 4 Dec 2015 03:38:35 +0000 (03:38 +0000)]
Fix g_disk_vlist_limit() to work properly with deletes.

Add a new bp argument to g_disk_maxsegs(), and add a new function,
g_disk_maxsize() tha will properly determine the maximum I/O size for a
delete or non-delete bio.

Submitted by: will
MFC after: 1 week
Sponsored by: Spectra Logic

8 years agoMove obscure lib/ installation of /usr/lib/include symlink to include/.
Bryan Drewery [Fri, 4 Dec 2015 03:18:02 +0000 (03:18 +0000)]
Move obscure lib/ installation of /usr/lib/include symlink to include/.

This avoids the need for an afterinstall: hook and a check for LIBRARIES_ONLY.
It also now respects INCLUDEDIR.

This came in r249484.

Sponsored by: EMC / Isilon Storage Division

8 years agoAdd assertion for when LIBADD should be used rather than LDADD/DPADD.
Bryan Drewery [Fri, 4 Dec 2015 03:17:59 +0000 (03:17 +0000)]
Add assertion for when LIBADD should be used rather than LDADD/DPADD.

Sponsored by: EMC / Isilon Storage Division

8 years agoFix LDADD/DPADD that should be LIBADD.
Bryan Drewery [Fri, 4 Dec 2015 03:17:47 +0000 (03:17 +0000)]
Fix LDADD/DPADD that should be LIBADD.

Sponsored by: EMC / Isilon Storage Division

8 years agoRework unknown LIBADD assertion to be more clear and to not suggest adding
Bryan Drewery [Fri, 4 Dec 2015 03:17:24 +0000 (03:17 +0000)]
Rework unknown LIBADD assertion to be more clear and to not suggest adding
DPADD/LDADD_<foo> variables that are a special case.

Sponsored by: EMC / Isilon Storage Division

8 years agoSupport all of the CDDL/ZFS libraries for LIBADD.
Bryan Drewery [Fri, 4 Dec 2015 03:17:21 +0000 (03:17 +0000)]
Support all of the CDDL/ZFS libraries for LIBADD.

Sponsored by: EMC / Isilon Storage Division

8 years agoFor INTERNALLIB always add in the corresponding _DP_ and use LIBADD in
Bryan Drewery [Fri, 4 Dec 2015 03:17:17 +0000 (03:17 +0000)]
For INTERNALLIB always add in the corresponding _DP_ and use LIBADD in
the real build file.

This lessens the need to define DPADD_<lib> and LDADD_<lib> to just very
special cases.

Sponsored by: EMC / Isilon Storage Division

8 years agoReplace ln -s calls with INSTALL_SYMLINK
Bryan Drewery [Fri, 4 Dec 2015 03:17:14 +0000 (03:17 +0000)]
Replace ln -s calls with INSTALL_SYMLINK

Sponsored by: EMC / Isilon Storage Division

8 years agoDon't create a Makefile.depend in share/mk.
Bryan Drewery [Fri, 4 Dec 2015 03:17:10 +0000 (03:17 +0000)]
Don't create a Makefile.depend in share/mk.

This would cause it to be included everywhere in the build since it is
the MAKESYSPATH.  This leads to including dirdeps.mk more times than
desired.

Sponsored by: EMC / Isilon Storage Division

8 years agoDIRDEPS_BUILD: Install new Makefile.depend files atomically.
Bryan Drewery [Fri, 4 Dec 2015 03:17:07 +0000 (03:17 +0000)]
DIRDEPS_BUILD: Install new Makefile.depend files atomically.

Sponsored by: EMC / Isilon Storage Division

8 years agoDIRDEPS_BUILD: For the bootstrapped LIBADD from DPADD, resolve paths to RELDIR.
Bryan Drewery [Fri, 4 Dec 2015 03:17:04 +0000 (03:17 +0000)]
DIRDEPS_BUILD: For the bootstrapped LIBADD from DPADD, resolve paths to RELDIR.

This allows the LIBDEPS/DPADD for the clang build to not have
../../../lib/clang/* in DIRDEPS.

Sponsored by: EMC / Isilon Storage Division

8 years agoUpdate isp_put_icb_2400() for new structure fields.
Alexander Motin [Fri, 4 Dec 2015 01:28:48 +0000 (01:28 +0000)]
Update isp_put_icb_2400() for new structure fields.

8 years agoSimplify the LIBRARIES_ONLY hacks so that install: is not needed here.
Bryan Drewery [Fri, 4 Dec 2015 00:29:40 +0000 (00:29 +0000)]
Simplify the LIBRARIES_ONLY hacks so that install: is not needed here.

This uses the same pattern that I applied to the other cases of this in
the csu directories.

Sponsored by: EMC / Isilon Storage Division

8 years agoTweak some unused field defines to have the correct number of zeroes.
Benno Rice [Fri, 4 Dec 2015 00:05:02 +0000 (00:05 +0000)]
Tweak some unused field defines to have the correct number of zeroes.

Reviewed by: jhb
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D4365

8 years agoEnable interrupt handshake for 16Gig chips.
Alexander Motin [Thu, 3 Dec 2015 22:55:40 +0000 (22:55 +0000)]
Enable interrupt handshake for 16Gig chips.

We don't support MSI-X so far, so it is always required.

8 years agorescue/rescue does not yet build in meta mode.
Bryan Drewery [Thu, 3 Dec 2015 22:40:42 +0000 (22:40 +0000)]
rescue/rescue does not yet build in meta mode.

8 years agoRevert r288966 as it is redundant and not right.
Bryan Drewery [Thu, 3 Dec 2015 22:39:42 +0000 (22:39 +0000)]
Revert r288966 as it is redundant and not right.

bsd.prog.mk and bsd.lib.mk already make OBJS depend on headers when there is
not .OBJDIR/.depend file, which is still true for the initial meta mode builds.
If there was something to benefit the meta mode build here then it should be
extended to the non-meta mode build as well.

Some of the problems here were just DPSRCS being hooked up wrongly, fixed in
r291330.

The logic itself is flawed as 'buildfiles' is in a different part of the
dependency tree than the objects and headers are, so the objects will still be
built independent from 'buildfiles'.  'buildfiles' is not ordered in the build
before objects.

Sponsored by: EMC / Isilon Storage Division

8 years agoFix typos in the camdd(8) usage() function output caused by an error in
Kenneth D. Merry [Thu, 3 Dec 2015 22:07:01 +0000 (22:07 +0000)]
Fix typos in the camdd(8) usage() function output caused by an error in
my diff filter script.

Sponsored by: Spectra Logic
MFC after: 1 week

8 years agoFollow-on to r291666: use -ffreestanding instead of -fno-builtin.
Nathan Whitehorn [Thu, 3 Dec 2015 21:25:59 +0000 (21:25 +0000)]
Follow-on to r291666: use -ffreestanding instead of -fno-builtin.

Requested by: kib

8 years agoConvert to LIBADD
Bryan Drewery [Thu, 3 Dec 2015 21:16:52 +0000 (21:16 +0000)]
Convert to LIBADD

Sponsored by: EMC / Isilon Storage Division

8 years agoMerge OpenSSL 1.0.2e.
Jung-uk Kim [Thu, 3 Dec 2015 21:13:35 +0000 (21:13 +0000)]
Merge OpenSSL 1.0.2e.

8 years agoUse proper LIBADD.
Bryan Drewery [Thu, 3 Dec 2015 21:13:08 +0000 (21:13 +0000)]
Use proper LIBADD.

Sponsored by: EMC / Isilon Storage Division

8 years agoDIRDEPS_BUILD: Connect usr.sbin/camdd
Bryan Drewery [Thu, 3 Dec 2015 21:13:05 +0000 (21:13 +0000)]
DIRDEPS_BUILD: Connect usr.sbin/camdd

Sponsored by: EMC / Isilon Storage Division

8 years agoAdd asynchronous command support to the pass(4) driver, and the new
Kenneth D. Merry [Thu, 3 Dec 2015 20:54:55 +0000 (20:54 +0000)]
Add asynchronous command support to the pass(4) driver, and the new
camdd(8) utility.

CCBs may be queued to the driver via the new CAMIOQUEUE ioctl, and
completed CCBs may be retrieved via the CAMIOGET ioctl.  User
processes can use poll(2) or kevent(2) to get notification when
I/O has completed.

While the existing CAMIOCOMMAND blocking ioctl interface only
supports user virtual data pointers in a CCB (generally only
one per CCB), the new CAMIOQUEUE ioctl supports user virtual and
physical address pointers, as well as user virtual and physical
scatter/gather lists.  This allows user applications to have more
flexibility in their data handling operations.

Kernel memory for data transferred via the queued interface is
allocated from the zone allocator in MAXPHYS sized chunks, and user
data is copied in and out.  This is likely faster than the
vmapbuf()/vunmapbuf() method used by the CAMIOCOMMAND ioctl in
configurations with many processors (there are more TLB shootdowns
caused by the mapping/unmapping operation) but may not be as fast
as running with unmapped I/O.

The new memory handling model for user requests also allows
applications to send CCBs with request sizes that are larger than
MAXPHYS.  The pass(4) driver now limits queued requests to the I/O
size listed by the SIM driver in the maxio field in the Path
Inquiry (XPT_PATH_INQ) CCB.

There are some things things would be good to add:

1. Come up with a way to do unmapped I/O on multiple buffers.
   Currently the unmapped I/O interface operates on a struct bio,
   which includes only one address and length.  It would be nice
   to be able to send an unmapped scatter/gather list down to
   busdma.  This would allow eliminating the copy we currently do
   for data.

2. Add an ioctl to list currently outstanding CCBs in the various
   queues.

3. Add an ioctl to cancel a request, or use the XPT_ABORT CCB to do
   that.

4. Test physical address support.  Virtual pointers and scatter
   gather lists have been tested, but I have not yet tested
   physical addresses or scatter/gather lists.

5. Investigate multiple queue support.  At the moment there is one
   queue of commands per pass(4) device.  If multiple processes
   open the device, they will submit I/O into the same queue and
   get events for the same completions.  This is probably the right
   model for most applications, but it is something that could be
   changed later on.

Also, add a new utility, camdd(8) that uses the asynchronous pass(4)
driver interface.

This utility is intended to be a basic data transfer/copy utility,
a simple benchmark utility, and an example of how to use the
asynchronous pass(4) interface.

It can copy data to and from pass(4) devices using any target queue
depth, starting offset and blocksize for the input and ouptut devices.
It currently only supports SCSI devices, but could be easily extended
to support ATA devices.

It can also copy data to and from regular files, block devices, tape
devices, pipes, stdin, and stdout.  It does not support queueing
multiple commands to any of those targets, since it uses the standard
read(2)/write(2)/writev(2)/readv(2) system calls.

The I/O is done by two threads, one for the reader and one for the
writer.  The reader thread sends completed read requests to the
writer thread in strictly sequential order, even if they complete
out of order.  That could be modified later on for random I/O patterns
or slightly out of order I/O.

camdd(8) uses kqueue(2)/kevent(2) to get I/O completion events from
the pass(4) driver and also to send request notifications internally.

For pass(4) devcies, camdd(8) uses a single buffer (CAM_DATA_VADDR)
per CAM CCB on the reading side, and a scatter/gather list
(CAM_DATA_SG) on the writing side.  In addition to testing both
interfaces, this makes any potential reblocking of I/O easier.  No
data is copied between the reader and the writer, but rather the
reader's buffers are split into multiple I/O requests or combined
into a single I/O request depending on the input and output blocksize.

For the file I/O path, camdd(8) also uses a single buffer (read(2),
write(2), pread(2) or pwrite(2)) on reads, and a scatter/gather list
(readv(2), writev(2), preadv(2), pwritev(2)) on writes.

Things that would be nice to do for camdd(8) eventually:

1.  Add support for I/O pattern generation.  Patterns like all
    zeros, all ones, LBA-based patterns, random patterns, etc. Right
    Now you can always use /dev/zero, /dev/random, etc.

2.  Add support for a "sink" mode, so we do only reads with no
    writes.  Right now, you can use /dev/null.

3.  Add support for automatic queue depth probing, so that we can
    figure out the right queue depth on the input and output side
    for maximum throughput.  At the moment it defaults to 6.

4.  Add support for SATA device passthrough I/O.

5.  Add support for random LBAs and/or lengths on the input and
    output sides.

6.  Track average per-I/O latency and busy time.  The busy time
    and latency could also feed in to the automatic queue depth
    determination.

sys/cam/scsi/scsi_pass.h:
Define two new ioctls, CAMIOQUEUE and CAMIOGET, that queue
and fetch asynchronous CAM CCBs respectively.

Although these ioctls do not have a declared argument, they
both take a union ccb pointer.  If we declare a size here,
the ioctl code in sys/kern/sys_generic.c will malloc and free
a buffer for either the CCB or the CCB pointer (depending on
how it is declared).  Since we have to keep a copy of the
CCB (which is fairly large) anyway, having the ioctl malloc
and free a CCB for each call is wasteful.

sys/cam/scsi/scsi_pass.c:
Add asynchronous CCB support.

Add two new ioctls, CAMIOQUEUE and CAMIOGET.

CAMIOQUEUE adds a CCB to the incoming queue.  The CCB is
executed immediately (and moved to the active queue) if it
is an immediate CCB, but otherwise it will be executed
in passstart() when a CCB is available from the transport layer.

When CCBs are completed (because they are immediate or
passdone() if they are queued), they are put on the done
queue.

If we get the final close on the device before all pending
I/O is complete, all active I/O is moved to the abandoned
queue and we increment the peripheral reference count so
that the peripheral driver instance doesn't go away before
all pending I/O is done.

The new passcreatezone() function is called on the first
call to the CAMIOQUEUE ioctl on a given device to allocate
the UMA zones for I/O requests and S/G list buffers.  This
may be good to move off to a taskqueue at some point.
The new passmemsetup() function allocates memory and
scatter/gather lists to hold the user's data, and copies
in any data that needs to be written.  For virtual pointers
(CAM_DATA_VADDR), the kernel buffer is malloced from the
new pass(4) driver malloc bucket.  For virtual
scatter/gather lists (CAM_DATA_SG), buffers are allocated
from a new per-pass(9) UMA zone in MAXPHYS-sized chunks.
Physical pointers are passed in unchanged.  We have support
for up to 16 scatter/gather segments (for the user and
kernel S/G lists) in the default struct pass_io_req, so
requests with longer S/G lists require an extra kernel malloc.

The new passcopysglist() function copies a user scatter/gather
list to a kernel scatter/gather list.  The number of elements
in each list may be different, but (obviously) the amount of data
stored has to be identical.

The new passmemdone() function copies data out for the
CAM_DATA_VADDR and CAM_DATA_SG cases.

The new passiocleanup() function restores data pointers in
user CCBs and frees memory.

Add new functions to support kqueue(2)/kevent(2):

passreadfilt() tells kevent whether or not the done
queue is empty.

passkqfilter() adds a knote to our list.

passreadfiltdetach() removes a knote from our list.

Add a new function, passpoll(), for poll(2)/select(2)
to use.

Add devstat(9) support for the queued CCB path.

sys/cam/ata/ata_da.c:
Add support for the BIO_VLIST bio type.

sys/cam/cam_ccb.h:
Add a new enumeration for the xflags field in the CCB header.
(This doesn't change the CCB header, just adds an enumeration to
use.)

sys/cam/cam_xpt.c:
Add a new function, xpt_setup_ccb_flags(), that allows specifying
CCB flags.

sys/cam/cam_xpt.h:
Add a prototype for xpt_setup_ccb_flags().

sys/cam/scsi/scsi_da.c:
Add support for BIO_VLIST.

sys/dev/md/md.c:
Add BIO_VLIST support to md(4).

sys/geom/geom_disk.c:
Add BIO_VLIST support to the GEOM disk class.  Re-factor the I/O size
limiting code in g_disk_start() a bit.

sys/kern/subr_bus_dma.c:
Change _bus_dmamap_load_vlist() to take a starting offset and
length.

Add a new function, _bus_dmamap_load_pages(), that will load a list
of physical pages starting at an offset.

Update _bus_dmamap_load_bio() to allow loading BIO_VLIST bios.
Allow unmapped I/O to start at an offset.

sys/kern/subr_uio.c:
Add two new functions, physcopyin_vlist() and physcopyout_vlist().

sys/pc98/include/bus.h:
Guard kernel-only parts of the pc98 machine/bus.h header with
#ifdef _KERNEL.

This allows userland programs to include <machine/bus.h> to get the
definition of bus_addr_t and bus_size_t.

sys/sys/bio.h:
Add a new bio flag, BIO_VLIST.

sys/sys/uio.h:
Add prototypes for physcopyin_vlist() and physcopyout_vlist().

share/man/man4/pass.4:
Document the CAMIOQUEUE and CAMIOGET ioctls.

usr.sbin/Makefile:
Add camdd.

usr.sbin/camdd/Makefile:
Add a makefile for camdd(8).

usr.sbin/camdd/camdd.8:
Man page for camdd(8).

usr.sbin/camdd/camdd.c:
The new camdd(8) utility.

Sponsored by: Spectra Logic
MFC after: 1 week

8 years agoImport OpenSSL 1.0.2e.
Jung-uk Kim [Thu, 3 Dec 2015 17:22:58 +0000 (17:22 +0000)]
Import OpenSSL 1.0.2e.

8 years agoif_ntb: Don't roundup MW size to full BAR size unnecessarily
Conrad Meyer [Thu, 3 Dec 2015 17:22:55 +0000 (17:22 +0000)]
if_ntb: Don't roundup MW size to full BAR size unnecessarily

Note that the MW allocation still must be BAR *aligned*.  So, this only
loosens the constraints on MW allocation slightly.  BAR-aligned does not
play well with large (GB+) BAR sizes.

Going forward, if anyone cares about if_ntb on very large BARs, I
suggest they add functionality to allocate a smaller window than the BAR
size, and set the BAR range to cover a window much larger than the
allocated window.  This will require negotiating a window offset and
limit for protocol traffic.  None of this is implemented in this
revision.

Sponsored by: EMC / Isilon Storage Division

8 years agoif_ntb: Log error *before* zeroing relevant variables
Conrad Meyer [Thu, 3 Dec 2015 17:22:45 +0000 (17:22 +0000)]
if_ntb: Log error *before* zeroing relevant variables

Sponsored by: EMC / Isilon Storage Division

8 years agoPull vm_object_scan_all_shadowed out of vm_object_backing_scan
Conrad Meyer [Thu, 3 Dec 2015 17:21:10 +0000 (17:21 +0000)]
Pull vm_object_scan_all_shadowed out of vm_object_backing_scan

These two functions were largely unrelated, they just used the same same
loop logic to walk through a backing object's memq.  Pull out the
all_shadowed test as its own function and eliminate
OBSC_TEST_ALL_SHADOWED.  Rename vm_object_backing_scan to
vm_object_collapse_scan.

No functional change.

Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D4335

8 years agoRegenerate usb.conf .
Hans Petter Selasky [Thu, 3 Dec 2015 16:54:45 +0000 (16:54 +0000)]
Regenerate usb.conf .

MFC after: 1 week

8 years agoBump MAXCPU. We already run on hardware with 32 threads and the same hardware
Nathan Whitehorn [Thu, 3 Dec 2015 16:24:55 +0000 (16:24 +0000)]
Bump MAXCPU. We already run on hardware with 32 threads and the same hardware
is available commercially with up to 96 threads per socket.

MFC after: 3 weeks

8 years agoIn assembler mode, clang defaulted to DWARF3, if only -g was specified.
Dimitry Andric [Thu, 3 Dec 2015 15:41:10 +0000 (15:41 +0000)]
In assembler mode, clang defaulted to DWARF3, if only -g was specified.
Change this to DWARF2, in the simplest way possible.  (Upstream, this
was fixed in clang trunk r250173, but this was done along with a lot of
shuffling around of debug option handling, so it cannot be applied
as-is.)

Noticed by: des
MFC after: 3 days

8 years agoEnsure that outgoing streams get reset when they run dry.
Michael Tuexen [Thu, 3 Dec 2015 15:19:29 +0000 (15:19 +0000)]
Ensure that outgoing streams get reset when they run dry.

MFC after: 1 week

8 years agoConvert the mlxen driver to use the BUSDMA(9) APIs instead of
Hans Petter Selasky [Thu, 3 Dec 2015 14:56:17 +0000 (14:56 +0000)]
Convert the mlxen driver to use the BUSDMA(9) APIs instead of
vtophys() when loading mbufs for transmission and reception. While at
it all pointer arithmetic and cast qualifier issues were fixed, mostly
related to transmission and reception.

MFC after: 1 week
Sponsored by: Mellanox Technologies
Differential Revision: https://reviews.freebsd.org/D4284

8 years agourtwn(4): add error handling for urtwn_write_X() functions.
Andriy Voskoboinyk [Thu, 3 Dec 2015 14:38:55 +0000 (14:38 +0000)]
urtwn(4): add error handling for urtwn_write_X() functions.

- Call ieee80211_stop() when urtwn_init() fails
(i.e., stop vap explicitly)
- Return an error when urtwn_write_<smth>() fails.
- Handle errors from them in:
 * urtwn_fw_cmd();
 * urtwn_llt_write();
 * urtwn_efuse_*();
 * urtwn_*_power_on();
 * urtwn_*_dma_init();
 * urtwn_mac_init();
 * urtwn_init();

Tested with RTL8188EU, STA mode

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

8 years agoAvoid -Wmissing-initializer
Tony Finch [Thu, 3 Dec 2015 14:32:54 +0000 (14:32 +0000)]
Avoid -Wmissing-initializer

8 years agoUpdate to upstream version 2.11
Tony Finch [Thu, 3 Dec 2015 14:21:55 +0000 (14:21 +0000)]
Update to upstream version 2.11

Improved #if expression evaluator and safer modify-in-place.

Obtained from: http://dotat.at/prog/unifdef
MFC after: 1 week

8 years agourtwn(4): move duplicate code from urtwn_(r92c/r88e)_dma_init()
Andriy Voskoboinyk [Thu, 3 Dec 2015 14:17:28 +0000 (14:17 +0000)]
urtwn(4): move duplicate code from urtwn_(r92c/r88e)_dma_init()
to urtwn_dma_init() (noop).

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

8 years agoUpdated the mlx4 and mlxen drivers to the latest version, v2.1.6:
Hans Petter Selasky [Thu, 3 Dec 2015 13:29:20 +0000 (13:29 +0000)]
Updated the mlx4 and mlxen drivers to the latest version, v2.1.6:
- Added support for dumping the SFP EEPROM content to dmesg.
- Fixed handling of network interface capability IOCTLs.
- Fixed race when loading and unloading the mlxen driver by applying
  appropriate locking.
- Removed two unused C-files.

MFC after: 1 week
Submitted by: Mark Bloch <markb@mellanox.com>
Sponsored by: Mellanox Technologies
Differential Revision: https://reviews.freebsd.org/D4283

8 years agoAdd some structures and defines which will be used when decoding small
Hans Petter Selasky [Thu, 3 Dec 2015 12:51:54 +0000 (12:51 +0000)]
Add some structures and defines which will be used when decoding small
form factor, SFF, standards compliant ethernet EEPROMs.

MFC after: 1 week
Obtained from: Linux
Sponsored by: Mellanox Technologies

8 years agoreadelf: add Xen ELF notes
Ed Maste [Thu, 3 Dec 2015 12:21:18 +0000 (12:21 +0000)]
readelf: add Xen ELF notes

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D4356

8 years agonewvers: Honour SOURCE_DATE_EPOCH as a build reproducibility measure
Ed Maste [Thu, 3 Dec 2015 12:17:09 +0000 (12:17 +0000)]
newvers: Honour SOURCE_DATE_EPOCH as a build reproducibility measure

One reason the kernel does not build reproducibly is that it includes
a timestamp in the version string. SOURCE_DATE_EPOCH provides a standard
method to address this: it should be set to the last modification time
of the source, and build processes use the specified timestamp instead
of the "current" date and time.

This change uses SOURCE_DATE_EPOCH if it is set; how it gets set needs
to be addressed elsewhere.

Reviewed by: bapt
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

8 years agoRemove incorrect defines. The proper version of these macros is
Hans Petter Selasky [Thu, 3 Dec 2015 11:45:12 +0000 (11:45 +0000)]
Remove incorrect defines. The proper version of these macros is
defined in linux/etherdevice.h.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoAdd support for a generic AHCI attachment. This allows us to attach to a
Andrew Turner [Thu, 3 Dec 2015 11:24:11 +0000 (11:24 +0000)]
Add support for a generic AHCI attachment. This allows us to attach to a
typically memory mapped bus, for example on the AMD Opteron A1100 the AHCI
device is mapped in the CPUs address space, and not through a PCI
controller.

Further work is needed for this to work with ACPI as this is expected to be
common on ARMv8 servers.

Reviewed by: mav, mmel
Obtained from: mmel, ABT Systems Ltd
Relnotes: yes
Sponsored by: SoftIron Inc
Differential Revision: https://reviews.freebsd.org/D4269

8 years agoFor amd64 non-PCID machines, and for i386 machines with support for
Konstantin Belousov [Thu, 3 Dec 2015 11:14:14 +0000 (11:14 +0000)]
For amd64 non-PCID machines, and for i386 machines with support for
the PG_G global pte flag, pmap_invalidate_all() fails to flush global
TLB entries [*].  This is because TLB shootdown handler for such
configs reloads CR3, and on i386 pmap_invalidate_all() does the same
for the initiating CPU.  Note that current code does not issue total
invalidation requests for the kernel_pmap.

Rename amd64 function invltlb_globpcid() to invltlb_glob(), it is not
specific for PCID for quite some time, and implement the same
functionality for i386.  Use the function instead of invltlb() in
shootdown handlers and in i386 pmap_invalidate_all(), but only for the
kernel pmap (which maps pages with the PG_G attribute set), which
takes care of PG_G TLB entries on flush.

To detect the affected pmap in i386 TLB shootdown handler, pmap should
be passed to the smp_masked_invltlb() function, which makes amd64 and
i386 TLB shootdown code almost identical.  Merge the code under x86/.

Noted by: jhb [*]
Reviewed by: cem, jhb, pho
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D4346

8 years agoIn the SandyBridge x2APIC workaround detection code, only fetch the
Konstantin Belousov [Thu, 3 Dec 2015 10:59:10 +0000 (10:59 +0000)]
In the SandyBridge x2APIC workaround detection code, only fetch the
environment variable when SandyBridge CPU is detected.  Reduce code
duplication.

Sponsored by: The FreeBSD Foundation

8 years agoFix build for !TCP_OFFLOAD case.
Konstantin Belousov [Thu, 3 Dec 2015 10:33:57 +0000 (10:33 +0000)]
Fix build for !TCP_OFFLOAD case.

8 years agoUpdate the mlx5en(4) manual page.
Hans Petter Selasky [Thu, 3 Dec 2015 10:17:01 +0000 (10:17 +0000)]
Update the mlx5en(4) manual page.

MFC after: 1 week
Submitted by: Mark Bloch <markb@mellanox.com>
Sponsored by: Mellanox Technologies
Differential Revision: https://reviews.freebsd.org/D4348

8 years agoAdd glue driver for Amlogic Meson Gigabit Ethernet Controller
Ganbold Tsagaankhuu [Thu, 3 Dec 2015 09:37:20 +0000 (09:37 +0000)]
Add glue driver for Amlogic Meson Gigabit Ethernet Controller
and enable it for Odroid C1 board.
Together with r291676 change, dwc(4) can receive packets now.

8 years agosfxge: regenerate MCDI headers
Andrew Rybchenko [Thu, 3 Dec 2015 08:06:10 +0000 (08:06 +0000)]
sfxge: regenerate MCDI headers

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agoFix a typo in a comment (spacial -> special)
Enji Cooper [Thu, 3 Dec 2015 07:42:00 +0000 (07:42 +0000)]
Fix a typo in a comment (spacial -> special)

Sponsored by: EMC / Isilon Storage Division

8 years agosfxge: remove internal register definitions that should not be used by host code
Andrew Rybchenko [Thu, 3 Dec 2015 07:28:57 +0000 (07:28 +0000)]
sfxge: remove internal register definitions that should not be used by host code

Submitted by:   Guido Barzini <gbarzini at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: add markers for autogenerated defines
Andrew Rybchenko [Thu, 3 Dec 2015 07:24:59 +0000 (07:24 +0000)]
sfxge: add markers for autogenerated defines

Move use defines outside.

Submitted by:   Guido Barzini <gbarzini at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: sync TLV layout headers with firmwaresrc for event merging config
Andrew Rybchenko [Thu, 3 Dec 2015 07:22:53 +0000 (07:22 +0000)]
sfxge: sync TLV layout headers with firmwaresrc for event merging config

Submitted by:   Tom Millington <tmillington at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: add MCDI logging support to common code
Andrew Rybchenko [Thu, 3 Dec 2015 07:13:13 +0000 (07:13 +0000)]
sfxge: add MCDI logging support to common code

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4331

8 years agoDisable EEE(Energy Efficient Ethernet) for RTL8211F PHY.
Pyun YongHyeon [Thu, 3 Dec 2015 05:27:39 +0000 (05:27 +0000)]
Disable EEE(Energy Efficient Ethernet) for RTL8211F PHY.
It seems the EEE made RX MAC enter LPI(Low Power Idle) mode such
that dwc(4) was not able to receive packets.  Ideally dwc(4) should
be able to use EEE to save power during periods of low link
utilization(i.e. gating off clock).  Due to lack of dwc(4)
datasheet it's not easy to take required steps for EEE on LPI
enter/exit events.  Disabling EEE in PHY seems to be easy
workaround until dwc(4) supports EEE.

Updating EEE advertisement register on RTL8211F seems to have no
effect until reprogramming MII_ANAR, MII_100T2CR and MII_BMCR
with auto-negotiation. It's not clear whether it's related with
mii_phy_reset()'s BMCR_ISO handling for RTL8211F though.
It seems rgephy_reset() needs careful investigation for newer
RealTek PHYs.

Ganbold submitted working version based on NetBSD change and
tested lots of changes I made. Thanks a lot!

Submitted by: ganbold (initial version)
In collaboration with: ganbold

8 years agoWe need to zero out the union of pointers in a freed vnode structure.
Kirk McKusick [Thu, 3 Dec 2015 02:04:22 +0000 (02:04 +0000)]
We need to zero out the union of pointers in a freed vnode structure.

PR:        204949
Fix from:  Mateusz Guzik
Tested by: Jason Unovitch

8 years agoCatch up with r291665.
Navdeep Parhar [Thu, 3 Dec 2015 02:00:36 +0000 (02:00 +0000)]
Catch up with r291665.

8 years agoCatch up with head, mostly to merge r291665 with the changes in this branch.
Navdeep Parhar [Thu, 3 Dec 2015 00:15:03 +0000 (00:15 +0000)]
Catch up with head, mostly to merge r291665 with the changes in this branch.

8 years agoProvide support for ELFv2 userland if using a newer compiler (recent clang
Nathan Whitehorn [Thu, 3 Dec 2015 00:10:57 +0000 (00:10 +0000)]
Provide support for ELFv2 userland if using a newer compiler (recent clang
or gcc) and binutils >= 2.24. Not enabled by default.

8 years agoClean up PowerPC bootloader compiler flags to fix the build with GCC 5.2
Nathan Whitehorn [Thu, 3 Dec 2015 00:08:50 +0000 (00:08 +0000)]
Clean up PowerPC bootloader compiler flags to fix the build with GCC 5.2
and binutils 2.25.

8 years agoFix build on GCC 5.2 where, at least on PPC64, the compiler would "optimize"
Nathan Whitehorn [Thu, 3 Dec 2015 00:06:59 +0000 (00:06 +0000)]
Fix build on GCC 5.2 where, at least on PPC64, the compiler would "optimize"
the malloc() + memset() in the local implementation of calloc() into a call
to calloc(), helpfully turning it into an infinite loop. Clean up some
unneeded flags on PPC64 while here.

MFC after: 1 month

8 years agoAdd support for configuring additional virtual interfaces (VIs) on a port.
John Baldwin [Thu, 3 Dec 2015 00:02:01 +0000 (00:02 +0000)]
Add support for configuring additional virtual interfaces (VIs) on a port.

Each virtual interface has its own MAC address, queues, and statistics.
The dedicated netmap interfaces (ncxgbeX / ncxlX) were already implemented
as additional VIs on each port.  This change allows additional non-netmap
interfaces to be configured on each port.  Additional virtual interfaces
use the naming scheme vcxgbeX or vcxlX.

Additional VIs are enabled by setting the hw.cxgbe.num_vis tunable to a
value greater than 1 before loading the cxgbe(4) or cxl(4) driver.
NB: The first VI on each port is the "main" interface (cxgbeX or cxlX).

T4/T5 NICs provide a limited number of MAC addresses for each physical port.
As a result, a maximum of six VIs can be configured on each port (including
the "main" interface and the netmap interface when netmap is enabled).

One user-visible result is that when netmap is enabled, packets received
or transmitted via the netmap interface are no longer counted in the stats
for the "main" interface, but are not accounted to the netmap interface.

The netmap interfaces now also have a new-bus device and export various
information sysctl nodes via dev.n(cxgbe|cxl).X.

The cxgbetool 'clearstats' command clears the stats for all VIs on the
specified port along with the port's stats.  There is currently no way to
clear the stats of an individual VI.

Reviewed by: np
MFC after: 1 month
Sponsored by: Chelsio

8 years agoMake full use of the pool of worker threads instead of using the first one all
Navdeep Parhar [Wed, 2 Dec 2015 23:54:59 +0000 (23:54 +0000)]
Make full use of the pool of worker threads instead of using the first one all
the time.

8 years agos/iscsi_softc/iscsi_ulp_softc to keep things cscope friendly.
Navdeep Parhar [Wed, 2 Dec 2015 23:44:29 +0000 (23:44 +0000)]
s/iscsi_softc/iscsi_ulp_softc to keep things cscope friendly.
(iscsi(4) has a struct iscsi_softc already).

8 years agoRemove reminders for items that have been taken care of.
Navdeep Parhar [Wed, 2 Dec 2015 23:36:14 +0000 (23:36 +0000)]
Remove reminders for items that have been taken care of.

8 years agoSend a flowc to set the max tx payload length. This flowc is ignored by
Navdeep Parhar [Wed, 2 Dec 2015 23:33:33 +0000 (23:33 +0000)]
Send a flowc to set the max tx payload length.  This flowc is ignored by
the firmware because the original flowc sent by t4_tom changed the
firmware-internal state of the tid.  For now I'm setting MAX_DSL to 8K
and PDU accordingly.  This will be tidied up with the next firmware
update that will handle multiple flowc's correctly.

8 years agoMinor cleanup. No functional change.
Michael Tuexen [Wed, 2 Dec 2015 22:44:42 +0000 (22:44 +0000)]
Minor cleanup. No functional change.

MFC after: 1 week

8 years agopw_checkname since the beginning if too strict on GECOS field,
Baptiste Daroussin [Wed, 2 Dec 2015 22:35:25 +0000 (22:35 +0000)]
pw_checkname since the beginning if too strict on GECOS field,
relax it a bit so gecos can be used to store multibytes data.

This was unseen before FreeBSD 10.2 as this validation function was motly unused
since FreeBSD 10.2 the usage of this function has been generalized to improve
validation.

Reported by: des
MFC after: 1 week

8 years agoFix handling of numeric-only names with pw lock
Baptiste Daroussin [Wed, 2 Dec 2015 22:01:37 +0000 (22:01 +0000)]
Fix handling of numeric-only names with pw lock
Add a regression test about it

PR: 204968
MFC after: 1 week

8 years agoAdd initial support for 16Gbps FC QLogic chips.
Alexander Motin [Wed, 2 Dec 2015 20:22:50 +0000 (20:22 +0000)]
Add initial support for 16Gbps FC QLogic chips.

I still don't know how to read NVRAM there, so WWNs and other parameters
are incorrect, but other then that driver seems like attaching normally.

8 years agoThe cdevpriv_dtr_t typedef was not able to be used in a function prototype
John Baldwin [Wed, 2 Dec 2015 18:27:30 +0000 (18:27 +0000)]
The cdevpriv_dtr_t typedef was not able to be used in a function prototype
like the various d_*_t typedefs since it declared a function pointer rather
than a function.  Add a new d_priv_dtor_t typedef that declares the function
and can be used as a function prototype.  The previous typedef wasn't
useful outside of the cdevpriv implementation, so retire it.

The name d_priv_dtor_t was chosen to be more consistent with cdev methods
since it is commonly used in place of d_close_t even though it is not a
direct pointer in struct cdevsw.

Reviewed by: kib, imp
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D4340

8 years agoAdjust the MTU when accepting an SCTP association using
Michael Tuexen [Wed, 2 Dec 2015 16:29:36 +0000 (16:29 +0000)]
Adjust the MTU when accepting an SCTP association using
UDP encapsulation.

MFC after: 1 week

8 years agoARM: Define PCI_RES_BUS resource for platforms having NEW_PCIB enabled.
Michal Meloun [Wed, 2 Dec 2015 14:24:14 +0000 (14:24 +0000)]
ARM: Define PCI_RES_BUS resource for platforms having NEW_PCIB enabled.

Approved by: kib (mentor)

8 years agoARM: Fix of detection of root interrupt controller.
Michal Meloun [Wed, 2 Dec 2015 14:22:58 +0000 (14:22 +0000)]
ARM: Fix of detection of root interrupt controller.
This fixes detection of root interrupt controller for cases,
when interrupt parent is not defined at all or it's not defined directly
in controller node.

Approved by: kib (mentor)

8 years agoOFW: Move code for searching interrupt parent into separate function.
Michal Meloun [Wed, 2 Dec 2015 14:21:16 +0000 (14:21 +0000)]
OFW: Move code for searching interrupt parent into separate function.
It can be used by interrupt controller drivers.

Approved by: kib (mentor)

8 years agoMove RTF_PINNED handling to generic route code.
Alexander V. Chernikov [Wed, 2 Dec 2015 08:17:31 +0000 (08:17 +0000)]
Move RTF_PINNED handling to generic route code.
This eliminates last RTF_RNH_LOCKED rtrequest1_fib() user.

8 years agoAdd initial ar9300 HAL support for the spectral scan mode.
Adrian Chadd [Wed, 2 Dec 2015 05:36:45 +0000 (05:36 +0000)]
Add initial ar9300 HAL support for the spectral scan mode.

8 years agoUpdate arcmsr(4) to 1.30.00.00 in order to add support of
Xin LI [Wed, 2 Dec 2015 05:35:04 +0000 (05:35 +0000)]
Update arcmsr(4) to 1.30.00.00 in order to add support of
ARC-1203 SATA RAID controllers.

Many thanks to Areca for continuing to support FreeBSD.

Submitted by: 黃清隆 <ching2048 areca com tw>
MFC after: 2 weeks

8 years agoMETA MODE: Connect MK_NAND directories.
Bryan Drewery [Wed, 2 Dec 2015 05:31:01 +0000 (05:31 +0000)]
META MODE: Connect MK_NAND directories.

Sponsored by: EMC / Isilon Storage Division

8 years agoAdd LIBNANDFS.
Bryan Drewery [Wed, 2 Dec 2015 05:23:12 +0000 (05:23 +0000)]
Add LIBNANDFS.

Sponsored by: EMC / Isilon Storage Division

8 years agoFix the memory leak that occurs when the nfscommon.ko module is unloaded.
Rick Macklem [Wed, 2 Dec 2015 02:47:13 +0000 (02:47 +0000)]
Fix the memory leak that occurs when the nfscommon.ko module is unloaded.
This leak was introduced by r291527.
Since the nfscommon.ko module is rarely unloaded, this leak would not
have been much of an issue.

MFC after: 2 weeks

8 years agoFix the build for non-amd64.
Bryan Drewery [Wed, 2 Dec 2015 02:11:38 +0000 (02:11 +0000)]
Fix the build for non-amd64.