]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoMFV r293415:
delphij [Fri, 8 Jan 2016 15:53:48 +0000 (15:53 +0000)]
MFV r293415:

ntp 4.2.8p5

Reviewed by: cy, roberto
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D4828

8 years agoUpdate generated efi boot image templates
smh [Fri, 8 Jan 2016 13:58:36 +0000 (13:58 +0000)]
Update generated efi boot image templates

r279533 increased the boot1 size from 64k to 128k but didn't regenerate the
fat templates, hence the change was never activated.

With recent and upcoming changes the efi boot1 binary is now > 64k.

To avoid fat corruption in the created boot images regenerate the
templates to activate the boot1 size increase.

MFC after: 2 weeks
X-MFC-With: r293268

8 years agoFix issues found by mandoc -Tlint.
brueffer [Fri, 8 Jan 2016 13:33:22 +0000 (13:33 +0000)]
Fix issues found by mandoc -Tlint.

MFC after: 1 week

8 years agoLinuxKPI style changes:
hselasky [Fri, 8 Jan 2016 10:04:19 +0000 (10:04 +0000)]
LinuxKPI style changes:
- Properly prefix internal functions with "linux_" instead of only a
  single underscore to avoid future namespace collisions.
- Make some functions global instead of inline to ease debugging and
  to avoid unnecessary code duplication.
- Remove no longer existing kthread_create() function's prototype.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoVendor import of ntp-4.2.8p5.
delphij [Fri, 8 Jan 2016 08:06:14 +0000 (08:06 +0000)]
Vendor import of ntp-4.2.8p5.

8 years agoAdd support for ZFS Boot Environments to userboot (for bhyve and others)
allanjude [Fri, 8 Jan 2016 05:09:55 +0000 (05:09 +0000)]
Add support for ZFS Boot Environments to userboot (for bhyve and others)

While here, also fix a possible null pointer

Reported by: lattera
MFC after: 3 days
Sponsored by: ScaleEngine Inc.

8 years agoFor SOCK_STREAM socket use sbappendstream() instead of sbappend().
glebius [Fri, 8 Jan 2016 01:16:03 +0000 (01:16 +0000)]
For SOCK_STREAM socket use sbappendstream() instead of sbappend().

8 years agoRevert r293201, r293202 (rtld: populate DT_DEBUG iff DYNAMIC segment is writable)
emaste [Fri, 8 Jan 2016 00:56:41 +0000 (00:56 +0000)]
Revert r293201, r293202 (rtld: populate DT_DEBUG iff DYNAMIC segment is writable)

It turns out MIPS binaries may have other oddities that can trigger a
fault at startup.

PR: 206017
Reported by: ray

8 years agoMake sure that the /set directive gets put at the top of the file,
imp [Fri, 8 Jan 2016 00:05:47 +0000 (00:05 +0000)]
Make sure that the /set directive gets put at the top of the file,
instead of in sort order. Slash sorts after period.

8 years agoSetup /pkg as a spot for pkg to operate. This is for testing purposes
imp [Fri, 8 Jan 2016 00:05:28 +0000 (00:05 +0000)]
Setup /pkg as a spot for pkg to operate. This is for testing purposes
only. You need to remount / rw and export TMPDIR=/pkg/tmp. pkg will
then work. It's slow though: 15 minutes to pkg install git on an RPi 2
with a decently fast SD card. Since this is for testing, we set
DEFAULT_ALWAYS_YES and ASSUME_ALWAYS_YES to YES.

8 years agosh: Reduce size of options table.
jilles [Thu, 7 Jan 2016 23:13:20 +0000 (23:13 +0000)]
sh: Reduce size of options table.

8 years agoioat(4): Add ioat_acquire_reserve() KPI
cem [Thu, 7 Jan 2016 23:02:15 +0000 (23:02 +0000)]
ioat(4): Add ioat_acquire_reserve() KPI

ioat_acquire_reserve() is an extended version of ioat_acquire().  It
allows users to reserve space in the channel for some number of
descriptors.  If this succeeds, it guarantees that at least submission
of N valid descriptors will succeed.

Sponsored by: EMC / Isilon Storage Division

8 years agoBump copyright (forgotten part of r293340)
dteske [Thu, 7 Jan 2016 22:13:17 +0000 (22:13 +0000)]
Bump copyright (forgotten part of r293340)

MFC after: 3 days
X-MFC-to: stable/10
X-MFC-with: r293340

8 years agosh: Add a test for 'cd -'.
jilles [Thu, 7 Jan 2016 21:46:07 +0000 (21:46 +0000)]
sh: Add a test for 'cd -'.

Redirect 'cd -' output to /dev/null since POSIX requires it to write the new
directory name even if not interactive, but we currently only write it if
interactive.

8 years agoext2fs: reading mmaped file in Ext4 causes panic
pfg [Thu, 7 Jan 2016 21:43:43 +0000 (21:43 +0000)]
ext2fs: reading mmaped file in Ext4 causes panic

Always call brelse(path.ep_bp), fixing reading EXT4 files using mmap().

Patch by Damjan Jovanovic.

PR: 205938
MFC after: 1 week

8 years agoismt: fix ISMT_DESC_ADDR_RW macro
jimharris [Thu, 7 Jan 2016 21:16:44 +0000 (21:16 +0000)]
ismt: fix ISMT_DESC_ADDR_RW macro

Submitted by: Masanobu SAITOH <msaitoh@netbsd.org>
MFC after: 3 days

8 years agoAllow libnv to be built externally using GCC.
bdrewery [Thu, 7 Jan 2016 20:52:35 +0000 (20:52 +0000)]
Allow libnv to be built externally using GCC.

GCC does not define _VA_LIST_DECLARED.  It defines _VA_LIST_ and others.
This was causing the prototype to not be defined and leading to an error
later due to using nvlist_add_stringv(3) without a prototype in
nvlist_add_stringf(3).

This uses the same check as other va_list prototypes in the original
change in r279438.

8 years agosh: Ensure OPTIND=1 in subshell without forking does not affect outer env.
jilles [Thu, 7 Jan 2016 20:48:24 +0000 (20:48 +0000)]
sh: Ensure OPTIND=1 in subshell without forking does not affect outer env.

Command substitutions containing a single simple command and here-document
expansion are performed in a subshell environment, but may not fork. Any
modified state of the shell environment should be restored afterward.

The state that OPTIND=1 had been done was not saved and restored here.

Note that the other parts of shellparam need not be saved and restored,
since they are not modified in these situations (a fork is done before such
modifications).

8 years agoObsolete inetd related files when WITHOUT_INETD is set
garga [Thu, 7 Jan 2016 20:37:18 +0000 (20:37 +0000)]
Obsolete inetd related files when WITHOUT_INETD is set

Reviewed by: bapt
Approved by: gnn
MFC after: 1 week
Sponsored by: Rubiconn Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D4742

8 years agonvme: replace NVME_CEILING macro with howmany()
jimharris [Thu, 7 Jan 2016 20:35:26 +0000 (20:35 +0000)]
nvme: replace NVME_CEILING macro with howmany()

Suggested by: rpokala
MFC after: 3 days

8 years agonvme: add hw.nvme.min_cpus_per_ioq tunable
jimharris [Thu, 7 Jan 2016 20:32:04 +0000 (20:32 +0000)]
nvme: add hw.nvme.min_cpus_per_ioq tunable

Due to FreeBSD system-wide limits on number of MSI-X vectors
(https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199321),
it may be desirable to allocate fewer than the maximum number
of vectors for an NVMe device, in order to save vectors for
other devices (usually Ethernet) that can take better
advantage of them and may be probed after NVMe.

This tunable is expressed in terms of minimum number of CPUs
per I/O queue instead of max number of queues per controller,
to allow for a more even distribution of CPUs per queue.  This
avoids cases where some number of CPUs have a dedicated queue,
but other CPUs need to share queues.  Ideally the PR referenced
above will eventually be fixed and the mechanism implemented
here becomes obsolete anyways.

While here, fix a bug in the CPUs per I/O queue calculation to
properly account for the admin queue's MSI-X vector.

Reviewed by: gallatin
MFC after: 3 days
Sponsored by: Intel

8 years agoConvert sys/cam to use make_dev_s().
kib [Thu, 7 Jan 2016 20:22:55 +0000 (20:22 +0000)]
Convert sys/cam to use make_dev_s().

Reviewed by: hps, jhb
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks
Differential revision: https://reviews.freebsd.org/D4746

8 years agoConvert tty common code to use make_dev_s().
kib [Thu, 7 Jan 2016 20:15:09 +0000 (20:15 +0000)]
Convert tty common code to use make_dev_s().

Tty.c was untypical in that it handled the si_drv1 issue consistently
and correctly, by always checking for si_drv1 being non-NULL and
sleeping if NULL.  The removed code also illustrated unneeded
complications in drivers which are eliminated by the use of new KPI.

Reviewed by: hps, jhb
Discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks
Differential revision: https://reviews.freebsd.org/D4746

8 years agoProvide yet another KPI for cdev creation, make_dev_s(9).
kib [Thu, 7 Jan 2016 20:08:02 +0000 (20:08 +0000)]
Provide yet another KPI for cdev creation, make_dev_s(9).

Immediate problem fixed by the new KPI is the long-standing race
between device creation and assignments to cdev->si_drv1 and
cdev->si_drv2, which allows the window where cdevsw methods might be
called with si_drv1,2 fields not yet set.  Devices typically checked
for NULL and returned spurious errors to usermode, and often left some
methods unchecked.

The new function interface is designed to be extensible, which should
allow to add more features to make_dev_s(9) without inventing yet
another name for function to create devices, while maintaining KPI and
even KBI backward-compatibility.

Reviewed by: hps, jhb
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks
Differential revision: https://reviews.freebsd.org/D4746

8 years agoDIRDEPS_BUILD: Update dependencies.
bdrewery [Thu, 7 Jan 2016 19:58:23 +0000 (19:58 +0000)]
DIRDEPS_BUILD: Update dependencies.

Sponsored by: EMC / Isilon Storage Division

8 years agoMove amd64 metadata.h to x86 and share with i386
emaste [Thu, 7 Jan 2016 19:47:26 +0000 (19:47 +0000)]
Move amd64 metadata.h to x86 and share with i386

MFC after: 1 week

8 years agoAlways try to upgrade to bmake if not already using it.
bdrewery [Thu, 7 Jan 2016 19:37:11 +0000 (19:37 +0000)]
Always try to upgrade to bmake if not already using it.

This is mostly targetting stable/10 which requires bmake to build and
has issues upgrading from <10.

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

8 years agoDon't install /usr/include/stand.h twice after r293040.
bdrewery [Thu, 7 Jan 2016 19:19:23 +0000 (19:19 +0000)]
Don't install /usr/include/stand.h twice after r293040.

Only install it from lib/libstand.

Sponsored by: EMC / Isilon Storage Division

8 years agoIncrease maximum buffer size for `-x cmd' value
dteske [Thu, 7 Jan 2016 18:50:02 +0000 (18:50 +0000)]
Increase maximum buffer size for `-x cmd' value

MFC after: 3 days
X-MFC-to: stable/10

8 years agonet80211 drivers: fix ieee80211_init_channels() usage
avos [Thu, 7 Jan 2016 18:41:03 +0000 (18:41 +0000)]
net80211 drivers: fix ieee80211_init_channels() usage

Fix out-of-bounds read (all) / write (11n capable) for drivers
that are using ieee80211_init_channels() to initialize channel list.

Tested with:
 * RTL8188EU, STA mode.
 * RTL8188CUS, STA mode.
 * WUSB54GC, HOSTAP mode.

Approved by: adrian (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D4818

8 years agoFix VF handling of VLANs.
sbruno [Thu, 7 Jan 2016 18:34:56 +0000 (18:34 +0000)]
Fix VF handling of VLANs.

This helps immensily with our ability to operate in the Amazon Cloud.

Discussed on Intel Networking Community call this morning.

Submitted by: Jarrod Petz(petz@nisshoko.net)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D4788

8 years agoFixup SFP module insertion on the 82599 when insertion happens after
sbruno [Thu, 7 Jan 2016 17:02:34 +0000 (17:02 +0000)]
Fixup SFP module insertion on the 82599 when insertion happens after
the system is booted and running.

Add PHY detection logic to ixgbe_handle_mod() and add locking to
ixgbe_handle_msf() as well.

PR: 150251
Submitted by: aboyer@averesystems.com
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D3188

8 years agoDisable the reuse of checksum offload context descriptors in the case
sbruno [Thu, 7 Jan 2016 16:48:47 +0000 (16:48 +0000)]
Disable the reuse of checksum offload context descriptors in the case
of multiple queues in em(4).  Document errata in the code.

MFC after: 2 weeks
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D3995

8 years agoSwitch em(4) to the extended RX descriptor format. This matches the
sbruno [Thu, 7 Jan 2016 16:42:48 +0000 (16:42 +0000)]
Switch em(4) to the extended RX descriptor format.  This matches the
e1000/e1000e split in linux.

Split rxbuffer and txbuffer apart to support the new RX descriptor format
structures. Move rxbuffer manipulation to em_setup_rxdesc() to unify the
new behavior changes.

Add a RSSKEYLEN macro for help in generating the RSSKEY data structures
in the card.

Change em_receive_checksum() to process the new rxdescriptor format
status bit.

MFC after: 2 weeks
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D3447

8 years agoWow, um ... sorry about that. The commit log for this code should have
sbruno [Thu, 7 Jan 2016 16:24:18 +0000 (16:24 +0000)]
Wow, um ... sorry about that.  The commit log for this code should have
read that it was for EM_MULTIQUEUE.  Revert this and try again.

8 years agoSwitch em(4) to the extended RX descriptor format. This matches the
sbruno [Thu, 7 Jan 2016 16:20:55 +0000 (16:20 +0000)]
Switch em(4) to the extended RX descriptor format.  This matches the
e1000/e1000e split in linux.

MFC after: 2 weeks
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D3447

8 years agonvme: do not revert o single I/O queue when per-CPU queues not possible
jimharris [Thu, 7 Jan 2016 16:18:32 +0000 (16:18 +0000)]
nvme: do not revert o single I/O queue when per-CPU queues not possible

Previously nvme(4) would revert to a signle I/O queue if it could not
allocate enought interrupt vectors or NVMe submission/completion queues
to have one I/O queue per core.  This patch determines how to utilize a
smaller number of available interrupt vectors, and assigns (as closely
as possible) an equal number of cores to each associated I/O queue.

MFC after: 3 days
Sponsored by: Intel

8 years agonvme: break out interrupt setup code into a separate function
jimharris [Thu, 7 Jan 2016 16:12:42 +0000 (16:12 +0000)]
nvme: break out interrupt setup code into a separate function

MFC after: 3 days
Sponsored by: Intel

8 years agonvme: do not pre-allocate MSI-X IRQ resources
jimharris [Thu, 7 Jan 2016 16:11:31 +0000 (16:11 +0000)]
nvme: do not pre-allocate MSI-X IRQ resources

The issue referenced here was resolved by other changes
in recent commits, so this code is no longer needed.

MFC after: 3 days
Sponsored by: Intel

8 years agonvme: remove per_cpu_io_queues from struct nvme_controller
jimharris [Thu, 7 Jan 2016 16:09:56 +0000 (16:09 +0000)]
nvme: remove per_cpu_io_queues from struct nvme_controller

Instead just use num_io_queues to make this determination.

This prepares for some future changes enabling use of multiple
queues when we do not have enough queues or MSI-X vectors
for one queue per CPU.

MFC after: 3 days
Sponsored by: Intel

8 years agonvme: simplify some of the nested ifs in interrupt setup code
jimharris [Thu, 7 Jan 2016 16:08:04 +0000 (16:08 +0000)]
nvme: simplify some of the nested ifs in interrupt setup code

This prepares for some follow-up commits which do more work in
this area.

MFC after: 3 days
Sponsored by: Intel

8 years agonvd: submit bios directly when BIO_ORDERED not set or in flight
jimharris [Thu, 7 Jan 2016 16:06:23 +0000 (16:06 +0000)]
nvd: submit bios directly when BIO_ORDERED not set or in flight

This significantly improves parallelism in the most common case.
The taskqueue is still used whenever BIO_ORDERED bios are in flight.

This patch is based heavily on a patch from gallatin@.

MFC after: 3 days
Sponsored by: Intel

8 years agonvd: break out submission logic into separate function
jimharris [Thu, 7 Jan 2016 15:59:51 +0000 (15:59 +0000)]
nvd: break out submission logic into separate function

This enables a future patch using this same logic to submit
I/O directly bypassing the taskqueue.

MFC after: 3 days
Sponsored by: Intel

8 years agonvd: skip BIO_ORDERED logic when bio fails submission
jimharris [Thu, 7 Jan 2016 15:58:44 +0000 (15:58 +0000)]
nvd: skip BIO_ORDERED logic when bio fails submission

This ensures the bio flags are not read after biodone().
The ordering will still be enforced, after the bio is
submitted successfully.

MFC after: 3 days
Sponsored by: Intel

8 years agonvd: do not wait for previous bios before submitting ordered bio
jimharris [Thu, 7 Jan 2016 15:57:17 +0000 (15:57 +0000)]
nvd: do not wait for previous bios before submitting ordered bio

Still wait until all in-flight bios (including the ordered bio)
complete before processing more bios from the queue.

MFC after: 3 days
Sponsored by: Intel

8 years agonvd: set DISKFLAG_DIRECT_COMPLETION
jimharris [Thu, 7 Jan 2016 15:55:41 +0000 (15:55 +0000)]
nvd: set DISKFLAG_DIRECT_COMPLETION

Submitted by: gallatin
MFC after: 3 days

8 years agoPrint curpmap in "show pcpu" command.
skra [Thu, 7 Jan 2016 12:31:49 +0000 (12:31 +0000)]
Print curpmap in "show pcpu" command.

Approved by: kib (mentor)

8 years agoDo not use 'struct route_in6' inside hash6_insert().
melifaro [Thu, 7 Jan 2016 12:22:29 +0000 (12:22 +0000)]
Do not use 'struct route_in6' inside hash6_insert().

rin6 was used only as sockaddr_in6 storage. Make rtalloc1_fib()
  use on-stack sin6 and return rtenry directly, instead of doing
  useless work with 'struct route_in6'.

8 years agoApply the changes from r293284 to one additional file.
jtl [Thu, 7 Jan 2016 11:54:20 +0000 (11:54 +0000)]
Apply the changes from r293284 to one additional file.

Discussed with: glebius

8 years agoMake cap_mkdb and services_mkdb file operations sync
garga [Thu, 7 Jan 2016 10:39:13 +0000 (10:39 +0000)]
Make cap_mkdb and services_mkdb file operations sync

Similar fix was done for passwd and group operations in r285050. When a
temporary file is created and then renamed to replace official file there
are no checks to make sure data was written to disk and if a power cycle
happens at this time, system can end up with a 0 length file

Approved by: bapt
MFC after: 1 week
Sponsored by: Netgate
Differential Revision: https://reviews.freebsd.org/D2982

8 years agoConvert pf(4) to the new routing API.
melifaro [Thu, 7 Jan 2016 10:20:03 +0000 (10:20 +0000)]
Convert pf(4) to the new routing API.

Differential Revision: https://reviews.freebsd.org/D4763

8 years agoRemove unused file.
hselasky [Thu, 7 Jan 2016 09:40:19 +0000 (09:40 +0000)]
Remove unused file.

8 years agoConvert cxgb/cxgbe to the new routing API.
melifaro [Thu, 7 Jan 2016 08:07:17 +0000 (08:07 +0000)]
Convert cxgb/cxgbe to the new routing API.

Discussed with: np

8 years agoMake additional parts of sys/geom/eli more usable in userspace
allanjude [Thu, 7 Jan 2016 05:47:34 +0000 (05:47 +0000)]
Make additional parts of sys/geom/eli more usable in userspace

The upcoming GELI support in the loader reuses parts of this code
Some ifdefs are added, and some code is moved outside of existing ifdefs

The HMAC parts of GELI are broken out into their own file, to separate
them from the kernel crypto/openssl dependant parts that are replaced
in the boot code.

Passed the GELI regression suite (tools/regression/geom/eli)
 Files=20 Tests=14996
 Result: PASS

Reviewed by: pjd, delphij
MFC after: 1 week
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D4699

8 years agoAllow /etc/exports to contain usernames/groups with spaces in them.
jpaetzel [Thu, 7 Jan 2016 05:34:39 +0000 (05:34 +0000)]
Allow /etc/exports to contain usernames/groups with spaces in them.

If you are getting your users/groups from a directory service such
as LDAP or AD it's possible for those usernames or groupnames to
contain spaces.

Submitted by: Sean E. Fagan
Reviewed by: rmacklem
MFC after: 1 week
Sponsored by: iXsystems

8 years agocache: ansify functions and fix some style issues
mjg [Thu, 7 Jan 2016 02:04:17 +0000 (02:04 +0000)]
cache: ansify functions and fix some style issues

No functional changes.

8 years agoUpdate dependencies after r292622 moved the ioctl script.
bdrewery [Thu, 7 Jan 2016 00:32:40 +0000 (00:32 +0000)]
Update dependencies after r292622 moved the ioctl script.

Sponsored by: EMC / Isilon Storage Division

8 years agoRevert r293286. It was not intended to come in yet.
bdrewery [Thu, 7 Jan 2016 00:20:47 +0000 (00:20 +0000)]
Revert r293286.   It was not intended to come in yet.

8 years agoAdd in DIRDEPS_BUILD support.
bdrewery [Thu, 7 Jan 2016 00:19:30 +0000 (00:19 +0000)]
Add in DIRDEPS_BUILD support.

Sponsored by: EMC / Isilon Storage Division

8 years agoMove the MAKEOBJDIRPREFIX value guard to sys.mk and expand to MAKEOBJDIR.
bdrewery [Thu, 7 Jan 2016 00:19:03 +0000 (00:19 +0000)]
Move the MAKEOBJDIRPREFIX value guard to sys.mk and expand to MAKEOBJDIR.

This will ensure that the variable was not set as a make override, in
make.conf, src.conf or src-env.conf.  It allows setting the value in
src-env.conf when using WITH_AUTO_OBJ since that case properly handles
changing .OBJDIR (except if MAKEOBJDIRPREFIX does not yet exist which is
being discussed to be changed).

This change allows setting a default MAKEOBJDIRPREFIX via local.sys.env.mk.

Sponsored by: EMC / Isilon Storage Division

8 years agoSwitch GNU ld to be installed as ld.bfd and linked as ld
emaste [Thu, 7 Jan 2016 00:15:02 +0000 (00:15 +0000)]
Switch GNU ld to be installed as ld.bfd and linked as ld

We intend to replace GNU ld with LLVM's lld, and on the path to there
we'll experiment with having lld installed or linked as /usr/bin/ld.
Thus, make ld.bfd the primary install target for GNU ld, to later
facilitate making the ld link optional.

Reviewed by: davide, dim
Differential Revision: https://reviews.freebsd.org/D4790

8 years agoHistorically we have two fields in tcpcb to describe sender MSS: t_maxopd,
glebius [Thu, 7 Jan 2016 00:14:42 +0000 (00:14 +0000)]
Historically we have two fields in tcpcb to describe sender MSS: t_maxopd,
and t_maxseg. This dualism emerged with T/TCP, but was not properly cleaned
up after T/TCP removal. After all permutations over the years the result is
that t_maxopd stores a minimum of peer offered MSS and MTU reduced by minimum
protocol header. And t_maxseg stores (t_maxopd - TCPOLEN_TSTAMP_APPA) if
timestamps are in action, or is equal to t_maxopd otherwise. That's a very
rough estimate of MSS reduced by options length. Throughout the code it
was used in places, where preciseness was not important, like cwnd or
ssthresh calculations.

With this change:

- t_maxopd goes away.
- t_maxseg now stores MSS not adjusted by options.
- new function tcp_maxseg() is provided, that calculates MSS reduced by
  options length. The functions gives a better estimate, since it takes
  into account SACK state as well.

Reviewed by: jtl
Differential Revision: https://reviews.freebsd.org/D3593

8 years agoProvide knob NO_INSTALLEXTRAKERNELS. If defined, extra kernels in KERNCONF
glebius [Wed, 6 Jan 2016 21:58:45 +0000 (21:58 +0000)]
Provide knob NO_INSTALLEXTRAKERNELS. If defined, extra kernels in KERNCONF
won't be installed, only the first one would.

8 years agoUse standard name for ASCII LF and FF control codes
emaste [Wed, 6 Jan 2016 21:47:49 +0000 (21:47 +0000)]
Use standard name for ASCII LF and FF control codes

PR: 205778
MFC after: 2 weeks

8 years agostyle(9) fixes for EFI boot
smh [Wed, 6 Jan 2016 20:48:29 +0000 (20:48 +0000)]
style(9) fixes for EFI boot

Fix some style(9) nits for EFI boot code, no functional changes.

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay

8 years agoFix const conversion warning in lz4_decompress
smh [Wed, 6 Jan 2016 20:28:09 +0000 (20:28 +0000)]
Fix const conversion warning in lz4_decompress

Fix const conversion warning in lz4_decompress which shows when warnings
are enabled (to be done later).

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay

8 years agoFix return from zfs_probe_dev
smh [Wed, 6 Jan 2016 20:25:41 +0000 (20:25 +0000)]
Fix return from zfs_probe_dev

Ensure zfs_probe_dev returns the correct value.

Also fix a style(9) trailing whitespace issue while here.

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay

8 years agoFix _MSC_EXTENSIONS checks
smh [Wed, 6 Jan 2016 20:22:28 +0000 (20:22 +0000)]
Fix _MSC_EXTENSIONS checks

Use #ifdef instead of #if checks to prevent warnings generated by checks
to be enabled shortly.

MFC after: 2 weeks
Sponsored by: Multiplay

8 years agolibunwind: Include header for dl_unwind_find_exidx for ARM EHABI
emaste [Wed, 6 Jan 2016 19:41:06 +0000 (19:41 +0000)]
libunwind: Include header for dl_unwind_find_exidx for ARM EHABI

8 years agoloader.efi style(9) cleanup
emaste [Wed, 6 Jan 2016 19:18:43 +0000 (19:18 +0000)]
loader.efi style(9) cleanup

Submitted by: smh

8 years agoIntroduce and use new EFI_ERROR_CODE macro for EFI errors
emaste [Wed, 6 Jan 2016 19:15:16 +0000 (19:15 +0000)]
Introduce and use new EFI_ERROR_CODE macro for EFI errors

Submitted by: smh
MFC after: 1 week

8 years agoAdd fls() to libstand
emaste [Wed, 6 Jan 2016 17:33:32 +0000 (17:33 +0000)]
Add fls() to libstand

Although we don't use it in tree yet libstand is installed as user-
facing /usr/liblibstand.a, and some work in progress makes use of it.
Instead of conflicting with ongoing libstand Makefile deduplication,
just add it now.

8 years agoTry a little harder to remove firstboot and firstboot-reboot files in
imp [Wed, 6 Jan 2016 17:13:40 +0000 (17:13 +0000)]
Try a little harder to remove firstboot and firstboot-reboot files in
case they accidentally get created as directories or with flags that
prevent their removal. While I wouldn't normally go the extra mile
here and let the normal unix rules prevail, the effects of failure are
large enough that extra care is warranted.

8 years agoEnable the beastie menu for the UEFI console
emaste [Wed, 6 Jan 2016 15:50:21 +0000 (15:50 +0000)]
Enable the beastie menu for the UEFI console

As of r293233 the UEFI console includes basic terminal emulator support.

MFC after: 2 weeks
Relnotes: Yes

8 years agoloader.efi: add terminal emulation support
emaste [Wed, 6 Jan 2016 15:38:39 +0000 (15:38 +0000)]
loader.efi: add terminal emulation support

This is based on the vidconsole implementation.

Submitted by: Toomas Soome <tsoome@me.com>
Reviewed by: adrian
MFC after: 2 weeks
Relnotes: Yes
Differential Revision: https://reviews.freebsd.org/D4797

8 years agoAdd a new target to touch the ${.OBJDIR}/release file, which
gjb [Wed, 6 Jan 2016 05:23:25 +0000 (05:23 +0000)]
Add a new target to touch the ${.OBJDIR}/release file, which
indicates the 'release' target has run (in order to prevent
subsequent invocations that may clobber original build output).

As is, the 'release' target is a dummy target that does nothing
more than depend on subsequent targets.  Unless 'make obj' is
invoked prior to 'make release', .OBJDIR and .CURDIR will always
be '/usr/src/release' (or wherever /usr/src is located).

When 'make release' invokes 'make real-release' (and subsequent
targets), .OBJDIR is not updated, which still leads to src/ tree
pollution.

While arguably a hack, 'make release' will invoke the original
dummy targets as originally intended, but instead of touching an
empty file (or returing @true), will call a 'release-done' target
that will trigger the behavior that was intended to prevent
a subsequent invocation.

Discussed with: hrs
MFC after: 3 days
X-MFC-With: r293173
Sponsored by: The FreeBSD Foundation

8 years ago"source routing" in rpcbind
asomers [Wed, 6 Jan 2016 00:00:11 +0000 (00:00 +0000)]
"source routing" in rpcbind

Fix a bug in rpcbind for multihomed hosts. If the server had interfaces on
two separate subnets, and a client on the first subnet contacted rpcbind at
the address on the second subnet, rpcbind would advertise addresses on the
first subnet. This is a bug, because it should prefer to advertise the
address where it was contacted. The requested service might be firewalled
off from the address on the first subnet, for example.

usr.sbin/rpcbind/check_bound.c
If the address on which a request was received is known, pass that
to addrmerge as the clnt_uaddr parameter. That is what addrmerge's
comment indicates the parameter is supposed to mean. The previous
behavior is that clnt_uaddr would contain the address from which the
client sent the request.

usr.sbin/rpcbind/util.c
Modify addrmerge to prefer to use an IP that is equal to clnt_uaddr,
if one is found. Refactor the relevant portion of the function for
clarity, and to reduce the number of ifdefs.

etc/mtree/BSD.tests.dist
usr.sbin/rpcbind/tests/Makefile
usr.sbin/rpcbind/tests/addrmerge_test.c
Add unit tests for usr.sbin/rpcbind/util.c:addrmerge.

usr.sbin/rpcbind/check_bound.c
usr.sbin/rpcbind/rpcbind.h
usr.sbin/rpcbind/util.c
Constify some function arguments

Reviewed by: imp
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D4690

8 years agoUse the more proper -f. Leave /bin/rm in place since that's what
imp [Tue, 5 Jan 2016 21:20:47 +0000 (21:20 +0000)]
Use the more proper -f. Leave /bin/rm in place since that's what
other rc scripts have, though it isn't strictly necessary.

8 years agoDisable abi variant hook until strangeness with packages can be sorted
imp [Tue, 5 Jan 2016 21:20:46 +0000 (21:20 +0000)]
Disable abi variant hook until strangeness with packages can be sorted
out.

8 years agoMerge ^/projects/release-install-debug:
gjb [Tue, 5 Jan 2016 21:05:17 +0000 (21:05 +0000)]
Merge ^/projects/release-install-debug:

- Rework MANIFEST generation and parsing via bsdinstall(8).
- Allow selecting debugging distribution sets during install.
- Rework bsdinstall(8) to fetch remote debug distribution sets
  when they are not available on the local install medium.
- Allow selecting additional non-GENERIC kernels during install.
  At present, GENERIC is still required, and installed by default.

Tested with: head@r293203
Sponsored by: The FreeBSD Foundation

8 years agoioat(4): Add ioat_get_max_io_size() KPI
cem [Tue, 5 Jan 2016 20:42:19 +0000 (20:42 +0000)]
ioat(4): Add ioat_get_max_io_size() KPI

Consumers need to know the permitted IO size to send maximally sized
chunks to the hardware.

Sponsored by: EMC / Isilon Storage Division

8 years agoiwm: revert r293178
avos [Tue, 5 Jan 2016 20:09:26 +0000 (20:09 +0000)]
iwm: revert r293178

This optimization is not proper (and causes kernel panic),
since driver checks fw_status to optimize away parsing stage
if it was already done.

Reported by: dchagin

8 years agoAdd sbin and /usr/local directories to _PATH_DEFPATH.
jilles [Tue, 5 Jan 2016 16:21:20 +0000 (16:21 +0000)]
Add sbin and /usr/local directories to _PATH_DEFPATH.

Set _PATH_DEFPATH to
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin. This is the
path in the default class in the default /etc/login.conf,
excluding ~/bin which would not be expanded properly in a string
constant.

For normal logins, _PATH_DEFPATH is overridden by /etc/login.conf,
~/.login_conf or shell startup files. _PATH_DEFPATH is still used as a
default by execlp(), execvp(), posix_spawnp() and sh if PATH is not set, and
by cron. Especially the latter is a common trap (most recently in PR
204813).

PR: 204813
Reviewed by: secteam (delphij), alfred

8 years agortld: populate DT_DEBUG iff DYNAMIC segment is writable
emaste [Tue, 5 Jan 2016 15:55:45 +0000 (15:55 +0000)]
rtld: populate DT_DEBUG iff DYNAMIC segment is writable

rtld.h was accidentally missed in r293201

8 years agortld: populate DT_DEBUG iff DYNAMIC segment is writable
emaste [Tue, 5 Jan 2016 15:52:16 +0000 (15:52 +0000)]
rtld: populate DT_DEBUG iff DYNAMIC segment is writable

MIPS has/had a read-only DYNAMIC segment, and uses an extra level of
indirection (through MIPS_RLD_MAP) to locate the debugger rendezvous
data.

Some linkers (e.g. LLVM's lld) may produce MIPS binaries with a writable
DYNAMIC segment, which would allow us to eventually drop a special case.

Therefore, instead of hardcoding knowledge that DYNAMIC is not writable
on MIPS just check the permissions on the segment.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D4791

8 years agoTwo fixes for excessive iterations after r292326.
kib [Tue, 5 Jan 2016 14:48:40 +0000 (14:48 +0000)]
Two fixes for excessive iterations after r292326.

Advance the logical block number to the lblkno of the found block plus
one, instead of incrementing the block number which was used for
lookup.  This change skips sparcely populated buffer ranges, similar
to r292325, instead of doing useless lookups.

Do not restart the bnoreuselist() from the start of the range if
buffer lock cannot be obtained without sleep.  Only retry lookup and
lock for the same queue and same logical block number.

Reported by: benno
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

8 years agoImplement RCU mechanism using shared exclusive locks.
hselasky [Tue, 5 Jan 2016 12:22:45 +0000 (12:22 +0000)]
Implement RCU mechanism using shared exclusive locks.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoFix undefined behavior when using asmc_fan_getstring()
uqs [Tue, 5 Jan 2016 10:25:22 +0000 (10:25 +0000)]
Fix undefined behavior when using asmc_fan_getstring()

It was returning a pointer to stack-allocated memory, so make the
allocation at the caller instead.

Found by: clang static analyzer
Coverity: CID 1245774
Reviewed by: ed, rpaulo
Review URL: https://reviews.freebsd.org/D4740

8 years agoFix for directly connected FULL or LOW speed USB devices.
hselasky [Tue, 5 Jan 2016 09:18:43 +0000 (09:18 +0000)]
Fix for directly connected FULL or LOW speed USB devices.

Found by: Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after: 1 week

8 years agoMFV r293125: less v481.
delphij [Tue, 5 Jan 2016 05:25:16 +0000 (05:25 +0000)]
MFV r293125: less v481.

MFC after: 1 month
Relnotes: yes

8 years agoPrevent memstick installation medium from attempting to mount
gjb [Tue, 5 Jan 2016 03:20:45 +0000 (03:20 +0000)]
Prevent memstick installation medium from attempting to mount
the root filesystem read-write.  This causes problems booting
the memstick installation medium from write-protected USB flash
drives.

Submitted by: A.J. Kehoe IV [1], Oliver Jones [2]
PR: 187161 [1], 205886 [2]
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

8 years agortld: wrap a comment to 80 columns
emaste [Tue, 5 Jan 2016 02:21:57 +0000 (02:21 +0000)]
rtld: wrap a comment to 80 columns

8 years agoHave krping use IB_ACCESS_LOCAL_WRITE because it's required for remote
np [Tue, 5 Jan 2016 01:58:30 +0000 (01:58 +0000)]
Have krping use IB_ACCESS_LOCAL_WRITE because it's required for remote
write or remote atomic operations.

Submitted by: Krishnamraju Eraparaju @ Chelsio

8 years agoiw_cxgbe: Shut down the socket but do not close the fd in case of error.
np [Tue, 5 Jan 2016 01:32:40 +0000 (01:32 +0000)]
iw_cxgbe: Shut down the socket but do not close the fd in case of error.
The fd is closed later in this case.  This fixes a "SS_NOFDREF on enter"
panic.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Reviewed by: Steve Wise @ Open Grid Computing

8 years agoMerge LLVM libunwind revision 256779
emaste [Mon, 4 Jan 2016 21:41:02 +0000 (21:41 +0000)]
Merge LLVM libunwind revision 256779

8 years agourtwn: add bits for R92C_HWSEQ_CTRL and R92C_TXPAUSE registers
avos [Mon, 4 Jan 2016 21:16:49 +0000 (21:16 +0000)]
urtwn: add bits for R92C_HWSEQ_CTRL and R92C_TXPAUSE registers

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

8 years agoiwn: reduce code duplication in iwn_read_firmware()
avos [Mon, 4 Jan 2016 21:11:27 +0000 (21:11 +0000)]
iwn: reduce code duplication in iwn_read_firmware()

- Separate 'firmware_put(sc->fw_fp, FIRMWARE_UNLOAD); sc->fw_fp = NULL;'
into iwn_unload_firmware().
- Move error handling to the end of iwn_read_firmware().

No functional changes.

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

8 years agoiwm: free firmware related resources after uploading it to the hardware
avos [Mon, 4 Jan 2016 21:07:08 +0000 (21:07 +0000)]
iwm: free firmware related resources after uploading it to the hardware

iwn(4) / wpi(4) works in the same way
(read_firmware() -> hw_init() -> firmware_put())

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

8 years agoiwm: store pointer for 'struct firmware' instead of
avos [Mon, 4 Jan 2016 21:03:01 +0000 (21:03 +0000)]
iwm: store pointer for 'struct firmware' instead of
'size_t' and 'void *' pair.

Approved by: adrian (mentor)
Obtained from: DragonFlyBSD
Differential Revision: https://reviews.freebsd.org/D4765

8 years agoGet struct sctp_net_route in sync with struct route again.
tuexen [Mon, 4 Jan 2016 20:34:40 +0000 (20:34 +0000)]
Get struct sctp_net_route in sync with struct route again.