]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoDefault loader.conf: Drop efi_max_resolution to 1x1
kevans [Tue, 3 Apr 2018 02:41:32 +0000 (02:41 +0000)]
Default loader.conf: Drop efi_max_resolution to 1x1

Effectively disabling the mode changing bits in the loader. No matter which
way we go with it, it seems to be wrong- either the firmware doesn't change
the resolution and reports the resolution we requested, or the firmware
changes the resolution and doesn't report the resolution we requested. It
some cases, it does the right thing, but the bad cases outweight those.

Interested individuals can still set efi_max_resolution to 1080p or whatnot
in loader.conf(5) to restore the new behavior, but the new behavior does not
work out well for many cases.

Discussed with: imp

6 years agocxgbe: Implement tcp_info handler for connections handled by t4_tom.
np [Tue, 3 Apr 2018 01:22:15 +0000 (01:22 +0000)]
cxgbe: Implement tcp_info handler for connections handled by t4_tom.

The TCB is read using a memory window right now.  A better alternate to
get self-consistent, uncached information would be to use a GET_TCB
request but waiting for a reply from hw while holding non-sleepable
locks is quite inconvenient.

Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D14817

6 years agoAdd a hook to allow the toedev handling an offloaded connection to
np [Tue, 3 Apr 2018 01:08:54 +0000 (01:08 +0000)]
Add a hook to allow the toedev handling an offloaded connection to
provide accurate TCP_INFO.

Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D14816

6 years agoAdd support for a pmap direct map for 64-bit Book-E
jhibbits [Tue, 3 Apr 2018 00:45:38 +0000 (00:45 +0000)]
Add support for a pmap direct map for 64-bit Book-E

As with AIM64, map the DMAP at the beginning of the fourth "quadrant" of
memory, and move the KERNBASE to the the start of KVA.

Eventually we may run the kernel out of the DMAP, but for now, continue
booting as it has been.

6 years agoImport CK as of commit b19ed4c6a56ec93215ab567ba18ba61bf1cfbac8
cognet [Mon, 2 Apr 2018 23:40:50 +0000 (23:40 +0000)]
Import CK as of commit b19ed4c6a56ec93215ab567ba18ba61bf1cfbac8
It should fix ck_pr_[load|store]_ptr on mips and riscv, make sure no
*fence instructions are used on i386, as older cpus don't support it, and
make sure we don't rely on gcc builtins that can lead to calls to
libatomic when linked with -O0.

MFC after: 1 week

6 years agoFix formatting in snd_hda.4
bjk [Mon, 2 Apr 2018 22:59:33 +0000 (22:59 +0000)]
Fix formatting in snd_hda.4

Submitted by: 0mp
Reviewed by: skreuzer
Differential Revision: https://reviews.freebsd.org/D14922

6 years agoBring some order to horizontal and vertical spacing in hier(7).
trasz [Mon, 2 Apr 2018 21:33:16 +0000 (21:33 +0000)]
Bring some order to horizontal and vertical spacing in hier(7).

MFC after: 2 weeks

6 years agoEnsure the background laundering threshold is positive after a scan.
markj [Mon, 2 Apr 2018 15:07:41 +0000 (15:07 +0000)]
Ensure the background laundering threshold is positive after a scan.

The division added in r331732 meant that we wouldn't attempt a
background laundering until at least v_free_target - v_free_min clean
pages had been freed by the page daemon since the last laundering. If
the inactive queue is depleted but not completely empty (e.g., because
it contains busy pages), it can thus take a long time to meet this
threshold. Restore the pre-r331732 behaviour of using a non-zero
background laundering threshold if at least one inactive queue scan has
elapsed since the last attempt at background laundering.

Submitted by: tijl (original version)

6 years agounify amd64 and i386 cpu_reset() in x86/cpu_machdep.c
avg [Mon, 2 Apr 2018 13:45:23 +0000 (13:45 +0000)]
unify amd64 and i386 cpu_reset() in x86/cpu_machdep.c

Because I didn't see any reason not too.
I've been making some changes to the code and couldn't help but notice
that the i386 and am64 code was nearly identical.

MFC after: 17 days

6 years agoAdd the missing header for malloc(9). It was pulled in through header
andrew [Mon, 2 Apr 2018 13:36:48 +0000 (13:36 +0000)]
Add the missing header for malloc(9). It was pulled in through header
pollution that doesn't seem to exist in some configurations.

6 years agox86 cpu_reset: if failed to switch to BSP proceed to cpu_reset_real
avg [Mon, 2 Apr 2018 08:06:18 +0000 (08:06 +0000)]
x86 cpu_reset: if failed to switch to BSP proceed to cpu_reset_real

If cpu_reset() is called on an AP and if it somehow fails to wake the
BSP, then it's better to attempt the reset on the AP than just sit there
spinning on an unusable and undebuggable system.

MFC after: 16 days

6 years agox86 cpu_reset_proxy: no need to stop_cpus() the original processor
avg [Mon, 2 Apr 2018 07:45:13 +0000 (07:45 +0000)]
x86 cpu_reset_proxy: no need to stop_cpus() the original processor

The processor is "parked" in a spin-loop already and that's sufficient
for the reset.  There is nothing that stop_cpus() would add here, only
extra complexity and fragility.
The original processor does not need to enable interrupts now, in fact,
it must not do that.

MFC after: 2 weeks

6 years agoUse UMA_SLAB_SPACE macro. No functional change here.
glebius [Mon, 2 Apr 2018 05:15:25 +0000 (05:15 +0000)]
Use UMA_SLAB_SPACE macro. No functional change here.

6 years agoIn uma_startup_count() handle special case when zone will fit into
glebius [Mon, 2 Apr 2018 05:14:31 +0000 (05:14 +0000)]
In uma_startup_count() handle special case when zone will fit into
single slab, but with alignment adjustment it won't. Again, when
there is only one item in a slab alignment can be ignored. See
previous revision of this file for more info.

PR: 227116

6 years agoHandle a special case when a slab can fit only one allocation,
glebius [Mon, 2 Apr 2018 05:11:59 +0000 (05:11 +0000)]
Handle a special case when a slab can fit only one allocation,
and zone has a large alignment. With alignment taken into
account uk_rsize will be greater than space in a slab. However,
since we have only one item per slab, it is always naturally
aligned.

Code that will panic before this change with 4k page:

z = uma_zcreate("test", 3984, NULL, NULL, NULL, NULL, 31, 0);
uma_zalloc(z, M_WAITOK);

A practical scenario to hit the panic is a machine with 56 CPUs
and 2 NUMA domains, which yields in zone size of 3984.

PR: 227116
MFC after: 2 weeks

6 years agoFix the build on arches with default unsigned char. Capture the fubyte()
ian [Sun, 1 Apr 2018 18:53:27 +0000 (18:53 +0000)]
Fix the build on arches with default unsigned char.  Capture the fubyte()
return value in an int as well as the char, and test the full int value
for fubyte() failure.

6 years agoAdd opt_platform.h for several modules that have #ifdef FDT in the source.
ian [Sun, 1 Apr 2018 18:22:24 +0000 (18:22 +0000)]
Add opt_platform.h for several modules that have #ifdef FDT in the source.

Submitted by: Andre Albsmeier <Andre.Albsmeier@siemens.com>

6 years agoAdd a uma cache of free pages in the DEFAULT freepool. This gives us
jeff [Sun, 1 Apr 2018 04:50:05 +0000 (04:50 +0000)]
Add a uma cache of free pages in the DEFAULT freepool.  This gives us
per-cpu alloc and free of pages.  The cache is filled with as few trips
to the phys allocator as possible by the use of a new
vm_phys_alloc_npages() function which allocates as many as N pages.

This code was originally by markj with the import function rewritten by
me.

Reviewed by: markj, kib
Tested by: pho
Sponsored by: Netflix, Dell/EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14905

6 years agoAdd the flag ZONE_NOBUCKETCACHE. This flag instructions UMA not to keep
jeff [Sun, 1 Apr 2018 04:47:05 +0000 (04:47 +0000)]
Add the flag ZONE_NOBUCKETCACHE.  This flag instructions UMA not to keep
a cache of fully populated buckets.  This will be used in a follow-on
commit.

The flag idea was originally from markj.

Reviewed by: markj, kib
Tested by: pho
Sponsored by: Netflix, Dell/EMC Isilon

6 years agolualoader: Don't try to lookup a nil logo
kevans [Sun, 1 Apr 2018 01:21:00 +0000 (01:21 +0000)]
lualoader: Don't try to lookup a nil logo

6 years agolualoader: Split logodefs out into logo-* files
kevans [Sun, 1 Apr 2018 01:07:15 +0000 (01:07 +0000)]
lualoader: Split logodefs out into logo-* files

This commit splits all of the logodefs/graphics out into their own own files
and provides a method for these files to register their logodefs with the
drawer. Graphics are now loaded on demand if they don't exist in the current
set of logodefs.

The drawer module becomes a little easier to navigate through without all of
the graphics mixed in. It's also easy to do one-off graphics like the
9.2 Die Hard tribute by dteske@ without adding even more to our memory
requirements.

6 years agoThe Uninorth ID was really for Uninorth 2.
imp [Sun, 1 Apr 2018 00:25:47 +0000 (00:25 +0000)]
The Uninorth ID was really for Uninorth 2.

Submitted by: Sevan Janiyan
Differential Revision: https://reviews.freebsd.org/D14919

6 years agolualoader: Simplify some expressions
kevans [Sun, 1 Apr 2018 00:22:51 +0000 (00:22 +0000)]
lualoader: Simplify some expressions

- No need for a 'goto' when our entire loop body is then wrapped in a
  conditional.

- No need to leave commented out prints laying around

- If an expression is clearly going to be either nil or an expression that
  isn't likely to be a boolean, we might as well use `or` to specify a
  default value for the expression. e.g. `loader.getenv(...) or "no"`

6 years agolualoader: revert whitespace change that snuck in
kevans [Sat, 31 Mar 2018 23:50:20 +0000 (23:50 +0000)]
lualoader: revert whitespace change that snuck in

6 years agolualoader: Don't assume that {module}_load is set
kevans [Sat, 31 Mar 2018 23:49:00 +0000 (23:49 +0000)]
lualoader: Don't assume that {module}_load is set

The previous iteration of this assumed that {module}_load was set. In the
old world order of default loader.conf(5), this was probably a safe
assumption given that we had almost every module explicitly not-loaded in
it.

In the new world order, this is no longer the case, so one could delete a
_load line inadvertently while leaving a _name, _type, _flags, _before,
_after, or _error. This would have caused a confusing Lua error and borked
module loading.

6 years agolualoader: Do case-insensitive comparison of "yes"
kevans [Sat, 31 Mar 2018 23:40:05 +0000 (23:40 +0000)]
lualoader: Do case-insensitive comparison of "yes"

6 years agoDon't verify td_locks accounting after a panic.
markj [Sat, 31 Mar 2018 23:24:28 +0000 (23:24 +0000)]
Don't verify td_locks accounting after a panic.

Reported by: pho
X-MFC with: r331738

6 years agofwohcireg.h is 99% the same between the boot loader and the
imp [Sat, 31 Mar 2018 22:02:59 +0000 (22:02 +0000)]
fwohcireg.h is 99% the same between the boot loader and the
kernel. Delete it and fix up the 1% difference because there's no need
for them to be different.

6 years agoFix memory leaks in route(8).
melifaro [Sat, 31 Mar 2018 15:06:14 +0000 (15:06 +0000)]
Fix memory leaks in route(8).

Submitted by: Tom Rix (trix_juniper.net)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D9676

6 years agoSynchronise with NetBSD's version of EFI handling for El Torito images.
benno [Sat, 31 Mar 2018 15:04:41 +0000 (15:04 +0000)]
Synchronise with NetBSD's version of EFI handling for El Torito images.

When I implemented my EFI support I failed to check if the upstream version
of makefs in NetBSD had done the same. Override my version with theirs to
make it easier to stay in sync with them in the future.

Reviewed by: imp, mav
Obtained from: NetBSD
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D14913

6 years agoRemove MK_AUTO_OBJ from env passed to PORTS_MODULES
jah [Sat, 31 Mar 2018 05:17:12 +0000 (05:17 +0000)]
Remove MK_AUTO_OBJ from env passed to PORTS_MODULES

This fixes a failure to resolve object file paths seen when buildkernel
(which sets MK_AUTO_OBJ=yes) and installkernel (which sets MK_AUTO_OBJ=no)
are run as separate steps.  r329232 partially fixed this scenario by removing
MAKEOBJDIR, but it seems the AUTO_OBJ setting also needs to be on the same
page for the build and install steps.

Reviewed by: bdrewery
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D14143

6 years agoDocument and enforce assumptions about struct (in6_)ifreq.
brooks [Fri, 30 Mar 2018 21:38:53 +0000 (21:38 +0000)]
Document and enforce assumptions about struct (in6_)ifreq.

- The two types must be type-punnable for shared members of ifr_ifru.
  This allows compatibility accessors to be shared.

- There must be no padding gap between ifr_name and ifr_ifru.  This is
  assumed in tcpdump's use of SIOCGIFFLAGS output which attempts to be
  broadly portable.  This is true for all current architectures, but very
  large (256-bit) fat-pointers could violate this invariant.

Reviewed by: kib
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14910

6 years agoAdd deprecation notices for Arcnet and FDDI drivers.
brooks [Fri, 30 Mar 2018 20:27:47 +0000 (20:27 +0000)]
Add deprecation notices for Arcnet and FDDI drivers.

We intend to remove support before FreeBSD 12 is branched.

Reviewed by: imp, emaste
MFC after: 3 days
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14890

6 years agoFall back to ether_ioctl() by default.
brooks [Fri, 30 Mar 2018 20:24:29 +0000 (20:24 +0000)]
Fall back to ether_ioctl() by default.

The common pratice in ethernet device drivers is to fall back to
ether_ioctl() to implement generic ioctls not implemented by the driver
and to fail if no handler exists.

Convert these drivers to follow that practice rather than calling
ether_ioctl() for specific cases.

vxge(4) aready had the default case, but it was only called on failure
to match.

Reviewed by: imp
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14895

6 years agoOptimise use of Giant in the LinuxKPI.
hselasky [Fri, 30 Mar 2018 20:11:12 +0000 (20:11 +0000)]
Optimise use of Giant in the LinuxKPI.

- Make sure Giant is locked when calling PCI device methods.
Newbus currently requires this.

- Avoid unlocking Giant right before aquiring the sleepqueue lock.
This can save a task switch.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoRemove unused structure field in mlx5core.
hselasky [Fri, 30 Mar 2018 19:58:58 +0000 (19:58 +0000)]
Remove unused structure field in mlx5core.

MFC after: 3 days
Sponsored by: Mellanox Technologies

6 years agoBump mlx5core driver version.
hselasky [Fri, 30 Mar 2018 19:55:31 +0000 (19:55 +0000)]
Bump mlx5core driver version.

MFC after: 3 days
Sponsored by: Mellanox Technologies

6 years agoFix for use after free in mlx5core.
hselasky [Fri, 30 Mar 2018 19:50:45 +0000 (19:50 +0000)]
Fix for use after free in mlx5core.

Make sure the command completion handler is not called when the device is
in internal error state. This can easily trigger use after free situations.

MFC after: 3 days
Sponsored by: Mellanox Technologies

6 years agoMake sure Giant is locked when allocating bus resources in mlx5core.
hselasky [Fri, 30 Mar 2018 19:49:35 +0000 (19:49 +0000)]
Make sure Giant is locked when allocating bus resources in mlx5core.

During health care IRQ resources will be reallocated.
Newbus requires that Giant is locked before accessing
these resources.

MFC after: 3 days
Sponsored by: Mellanox Technologies

6 years agoCollect firmware dump when mlx5core is in device error state.
hselasky [Fri, 30 Mar 2018 19:48:25 +0000 (19:48 +0000)]
Collect firmware dump when mlx5core is in device error state.

Firmware dump collecting should be triggered in case firmware syndrome
with request for reset bit is set.

MFC after: 3 days
Submitted by: slavash@
Sponsored by: Mellanox Technologies

6 years agoReorganize health recovery in mlx5core.
hselasky [Fri, 30 Mar 2018 19:45:48 +0000 (19:45 +0000)]
Reorganize health recovery in mlx5core.

- Move the semaphore locking and unlocking to the same function.
- Flags are no longer needed if the reset and crdump will be done in the
  same function.

MFC after: 3 days
Submitted by: slavash@
Sponsored by: Mellanox Technologies

6 years agoPrepare for FW dump in error state in mlx5core.
hselasky [Fri, 30 Mar 2018 19:43:15 +0000 (19:43 +0000)]
Prepare for FW dump in error state in mlx5core.

- Move firmware dump prep and cleanup to init_one() and remove_one() so that
the init and cleanup will happen only upon driver reload.
- Add some prints to indicate firmware dump.

MFC after: 3 days
Submitted by: slavash@
Sponsored by: Mellanox Technologies

6 years agoProperly check if crspace is supported in mlx5core.
hselasky [Fri, 30 Mar 2018 19:39:27 +0000 (19:39 +0000)]
Properly check if crspace is supported in mlx5core.

The old code checked for MLX5_CR_SPACE_DOMAIN which is irrelevant here.
However, if dev->vsec_addr would be 0, an access to wrong offset would
happen.

MFC after: 3 days
Submitted by: slavash@
Sponsored by: Mellanox Technologies

6 years agoAdd missing newline character in print in mlx5core.
hselasky [Fri, 30 Mar 2018 19:35:31 +0000 (19:35 +0000)]
Add missing newline character in print in mlx5core.

MFC after: 3 days
Submitted by: slavash@
Sponsored by: Mellanox Technologies

6 years agoAdd logic for "families" for GCE images.
gjb [Fri, 30 Mar 2018 19:08:37 +0000 (19:08 +0000)]
Add logic for "families" for GCE images.

This allows for GCE consumers to easily detect the latest major
version of FreeBSD when using the gcloud command line utility.

To ensure snapshot builds do not conflict with release-style
builds (ALPHA, BETA, RC, RELEASE), the '-snap' suffix is appended
to the GCE image family name.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

6 years agoUse an accessor function to access ifr_data.
brooks [Fri, 30 Mar 2018 18:50:13 +0000 (18:50 +0000)]
Use an accessor function to access ifr_data.

This fixes 32-bit compat (no ioctl command defintions are required
as struct ifreq is the same size).  This is believed to be sufficent to
fully support ifconfig on 32-bit systems.

Reviewed by: kib
Obtained from: CheriBSD
MFC after: 1 week
Relnotes: yes
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14900

6 years agoRemove a comment that suggests checking that a non-pointer is non-NULL.
brooks [Fri, 30 Mar 2018 18:26:29 +0000 (18:26 +0000)]
Remove a comment that suggests checking that a non-pointer is non-NULL.

Reviewed by: melifaro, markj, hrs, ume
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14904

6 years agoocs_fc(4): Fix GCC build (-Wredundant-decls)
cem [Fri, 30 Mar 2018 16:44:54 +0000 (16:44 +0000)]
ocs_fc(4): Fix GCC build (-Wredundant-decls)

These objects are defined earlier in the same file; an extern declaration
after definition is redundant.

Broken in r331766 (introduction of ocs_fc(4)).

Sponsored by: Dell EMC Isilon

6 years agoefinet: Do not return only if ReceiveFilter fails
manu [Fri, 30 Mar 2018 16:37:08 +0000 (16:37 +0000)]
efinet: Do not return only if ReceiveFilter fails

If the network interface or the uefi implementation do not support the
ReceiveFilter interface do not return only and just print a message.
U-Boot doesn't support is and likely never will. Also even if this fails
it doesn't mean that network in EFI isn't supported.

6 years agoBring in the Broadcom/Emulex Fibre Channel driver, ocs_fc(4).
ken [Fri, 30 Mar 2018 15:28:25 +0000 (15:28 +0000)]
Bring in the Broadcom/Emulex Fibre Channel driver, ocs_fc(4).

The ocs_fc(4) driver supports the following hardware:

Emulex 16/8G FC GEN 5 HBAS
LPe15004 FC Host Bus Adapters
LPe160XX FC Host Bus Adapters

Emulex 32/16G FC GEN 6 HBAS
LPe3100X FC Host Bus Adapters
LPe3200X FC Host Bus Adapters

The driver supports target and initiator mode, and also supports FC-Tape.

Note that the driver only currently works on little endian platforms.  It
is only included in the module build for amd64 and i386, and in GENERIC
on amd64 only.

Submitted by: Ram Kishore Vegesna <ram.vegesna@broadcom.com>
Reviewed by: mav
MFC after: 5 days
Relnotes: yes
Sponsored by: Broadcom
Differential Revision: https://reviews.freebsd.org/D11423

6 years agoFix missing n after \ of Eric Turgeon entry
ericbsd [Fri, 30 Mar 2018 14:41:16 +0000 (14:41 +0000)]
Fix missing n after \ of Eric Turgeon entry

Approved by: bapt (mentor)

6 years agoAdding Eric Turgeon (ericbsd) to calendar.freebsd
ericbsd [Fri, 30 Mar 2018 13:37:33 +0000 (13:37 +0000)]
Adding Eric Turgeon (ericbsd) to calendar.freebsd

Approved by: bapt (mentor)

6 years agoAdd Eric Turgeon (ericbsd) in committers-ports.dot with mentor/mentee.
ericbsd [Fri, 30 Mar 2018 11:30:48 +0000 (11:30 +0000)]
Add Eric Turgeon (ericbsd) in committers-ports.dot with mentor/mentee.

Approved by: bapt (mentor)

6 years agoalign i386 cpu_reset() with amd64 version
avg [Fri, 30 Mar 2018 11:25:30 +0000 (11:25 +0000)]
align i386 cpu_reset() with amd64 version

Maybe this code could be moved to x86.

MFC after: 1 week

6 years agoMake vm_map_max/min/pmap KBI stable.
kib [Fri, 30 Mar 2018 10:55:31 +0000 (10:55 +0000)]
Make vm_map_max/min/pmap KBI stable.

There are out of tree consumers of vm_map_min() and vm_map_max(), and
I believe there are consumers of vm_map_pmap(), although the later is
arguably less in the need of KBI-stable interface. For the consumers
benefit, make modules using this KPI not depended on the struct vm_map
layout.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D14902

6 years agomakefs: sync fragment and block size with newfs
emaste [Fri, 30 Mar 2018 03:38:08 +0000 (03:38 +0000)]
makefs: sync fragment and block size with newfs

r222319 in newfs raised the default blocksize for UFS/FFS filesystems
from 16K to 32K and the default fragment size from 2K to 4K, with a
rationale that most disks were now running with 4K sectors.

MFC after: 2 weeks
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

6 years agoCorrect comment typo in Hyper-V
emaste [Fri, 30 Mar 2018 02:25:12 +0000 (02:25 +0000)]
Correct comment typo in Hyper-V

PR: 226665
Submitted by: Ryo ONODERA
MFC after: 3 days

6 years agobhnd(4): Use the new BHND_CAP_BP64 capability flag to exclude DMA
landonf [Thu, 29 Mar 2018 19:48:50 +0000 (19:48 +0000)]
bhnd(4): Use the new BHND_CAP_BP64 capability flag to exclude DMA
translations unsupported by the backplane.

6 years agoFix RSS build (broken in r331309).
np [Thu, 29 Mar 2018 19:48:17 +0000 (19:48 +0000)]
Fix RSS build (broken in r331309).

Sponsored by: Chelsio Communications

6 years agobhnd(4): include a subset of the ChipCommon capability flags in bhnd_chipid;
landonf [Thu, 29 Mar 2018 19:44:15 +0000 (19:44 +0000)]
bhnd(4): include a subset of the ChipCommon capability flags in bhnd_chipid;
this provides early access to device capability flags required by bhnd(4)
bus and bhndb(4) bridge drivers.

6 years agoAdd libdl to clibs package
kevans [Thu, 29 Mar 2018 19:43:29 +0000 (19:43 +0000)]
Add libdl to clibs package

libdl is a filter on libc, and pretty lightweight. Add it to the 'clibs'
package with libc, effectively tying them together in a pkgbase world.

Reviewed by: gjb
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D13997

6 years agoIt is March not May.
brooks [Thu, 29 Mar 2018 17:44:55 +0000 (17:44 +0000)]
It is March not May.

Reported by: jkim

6 years ago1. Add additional debug prints.
davidcs [Thu, 29 Mar 2018 17:36:34 +0000 (17:36 +0000)]
1. Add additional debug prints.
2. Break transmit when IFF_DRV_RUNNING is OFF.
3. set desc_count=0 for default case in switch in ql_rcv_isr()
MFC after:5 days

6 years agoHave TD_LOCKS_DEC() assert that td_locks is positive.
markj [Thu, 29 Mar 2018 17:19:59 +0000 (17:19 +0000)]
Have TD_LOCKS_DEC() assert that td_locks is positive.

This makes it easier to catch lock accounting bugs, since the problem
is otherwise only detected upon a return to user mode (or never, for
kernel threads).

Reviewed by: cem
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14896

6 years agoGC never enabled support for SIOCGADDRROM and SIOCGCHIPID.
brooks [Thu, 29 Mar 2018 15:58:49 +0000 (15:58 +0000)]
GC never enabled support for SIOCGADDRROM and SIOCGCHIPID.

When de(4) was imported in 1997 the world was not ready for these ioctls.
In over 20 years that hasn't changed so it seems safe to assume their
time will never come.

Reviewed by: imp, jhb
Approved by: CheriBSD
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14889

6 years agoFix the background laundering mechanism after r329882.
markj [Thu, 29 Mar 2018 14:27:40 +0000 (14:27 +0000)]
Fix the background laundering mechanism after r329882.

Rather than using the number of inactive queue scans as a metric for
how many clean pages are being freed by the page daemon, have the
page daemon keep a running counter of the number of pages it has freed,
and have the laundry thread use that when computing the background
laundering threshold.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D14884

6 years agoPull in r328738 from upstream lld trunk (by Rafael Espindola):
dim [Thu, 29 Mar 2018 13:55:23 +0000 (13:55 +0000)]
Pull in r328738 from upstream lld trunk (by Rafael Espindola):

  Strip @VER suffices from the LTO output.

  This fixes pr36623.

  The problem is that we have to parse versions out of names before LTO
  so that LTO can use that information.

  When we get the LTO produced .o files, we replace the previous symbols
  with the LTO produced ones, but they still have @ in their names.

  We could just trim the name directly, but calling parseSymbolVersion
  to do it is simpler.

This is a follow-up to r331366, since we discovered that lld could
append version strings to symbols twice, when using Link Time
Optimization.

MFC after: 3 months
X-MFC-With: r327952

6 years agocryptocheck: Add Chacha20 cipher to tool
cem [Thu, 29 Mar 2018 04:14:37 +0000 (04:14 +0000)]
cryptocheck: Add Chacha20 cipher to tool

6 years agocryptotest: Add chacha20 cipher
cem [Thu, 29 Mar 2018 04:07:53 +0000 (04:07 +0000)]
cryptotest: Add chacha20 cipher

6 years agoopencrypto: Integrate Chacha20 algorithm into OCF
cem [Thu, 29 Mar 2018 04:02:50 +0000 (04:02 +0000)]
opencrypto: Integrate Chacha20 algorithm into OCF

Mostly this is a thin shim around existing code to integrate with enc_xform
and cryptosoft (+ cryptodev).

Expand the cryptodev buffer used to match that of Chacha20's native block
size as a performance enhancement for chacha20_xform_crypt_multi.

6 years agoImplement several enhancements to NUMA policies.
jeff [Thu, 29 Mar 2018 02:54:50 +0000 (02:54 +0000)]
Implement several enhancements to NUMA policies.

Add a new "interleave" allocation policy which stripes pages across
domains with a stride or width keeping contiguity within a multi-page
region.

Move the kernel to the dedicated numbered cpuset #2 making it possible
to assign kernel threads and memory policy separately from user.  This
also eliminates the need for the complicated interrupt binding code.

Add a sysctl API for viewing and manipulating domainsets.  Refactor some
of the cpuset_t manipulation code using the generic bitset type so that
it can be used for both.  This probably belongs in a dedicated subr file.

Attempt to improve the include situation.

Reviewed by: kib
Discussed with: jhb (cpuset parts)
Tested by: pho (before review feedback)
Sponsored by: Netflix, Dell/EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14839

6 years agotimeout.1: Try to improve clarity
cem [Thu, 29 Mar 2018 02:13:58 +0000 (02:13 +0000)]
timeout.1: Try to improve clarity

Minor rewordings, markup fixes or enhancements, and some typo fixes.  Add a few
sentences clarifying the special zero duration.

PR: 227012
Submitted by: Mateusz Piotrowski (0mp@) (earlier version)

6 years agostand: Add workaround for HP BIOS issues
kevans [Thu, 29 Mar 2018 00:55:11 +0000 (00:55 +0000)]
stand: Add workaround for HP BIOS issues

hrs@ and kuriyama@ have found that on some HP BIOS, a system will fail to
boot immediately after installation with the claim that it can't work out
which disk they are booting from.

They tracked it down to a buffer overrun, and found that it could be
alleviated by doing a dummy read before-hand.

Submitted by: kuriyama
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D14341

6 years agoReformat the enum of syscall argument types.
jhb [Thu, 29 Mar 2018 00:12:50 +0000 (00:12 +0000)]
Reformat the enum of syscall argument types.

List enum values on separate lines to minimize diffs as new types are
added.  Split the enum values up into groups and use some simple sorting
within groups (scalar enums are sorted by size, then base, all other
groups are generally sorted alphabetically).

No functional change.

6 years agoRename ClouduABIFDSFlags to CloudABIFDSFlags.
jhb [Thu, 29 Mar 2018 00:04:07 +0000 (00:04 +0000)]
Rename ClouduABIFDSFlags to CloudABIFDSFlags.

6 years agoRemove infrastructure for token-ring networks.
brooks [Wed, 28 Mar 2018 23:33:26 +0000 (23:33 +0000)]
Remove infrastructure for token-ring networks.

Reviewed by: cem, imp, jhb, jmallett
Relnotes: yes
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14875

6 years agoMFV r331712:
mav [Wed, 28 Mar 2018 23:17:29 +0000 (23:17 +0000)]
MFV r331712:
9280 Assertion failure while running removal_with_ganging test with 4K devices

illumos/illumos-gate@243952c7eeef020886e3e2e3df99a513df40584a

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Matt Ahrens <Matt.Ahrens@delphix.com>

6 years agoMFV 331710:
mav [Wed, 28 Mar 2018 23:05:48 +0000 (23:05 +0000)]
MFV 331710:
9188 increase size of dbuf cache to reduce indirect block decompression

illumos/illumos-gate@268bbb2a2fa79c36d4695d13a595ba50a7754b76

With compressed ARC (6950) we use up to 25% of our CPU to decompress indirect
blocks, under a workload of random cached reads. To reduce this decompression
cost, we would like to increase the size of the dbuf cache so that more
indirect blocks can be stored uncompressed.

If we are caching entire large files of recordsize=8K, the indirect blocks
use 1/64th as much memory as the data blocks (assuming they have the same
compression ratio). We suggest making the dbuf cache be 1/32nd of all memory,
so that in this scenario we should be able to keep all the indirect blocks
decompressed in the dbuf cache. (We want it to be more than the 1/64th that
the indirect blocks would use because we need to cache other stuff in the
dbuf cache as well.)

In real world workloads, this won't help as dramatically as the example
above, but we think it's still worth it because the risk of decreasing
performance is low. The potential negative performance impact is that we
will be slightly reducing the size of the ARC (by ~3%).

Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Allan Jude <allanjude@freebsd.org>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: George Wilson <george.wilson@delphix.com>

6 years agoMFV r331708:
mav [Wed, 28 Mar 2018 22:50:05 +0000 (22:50 +0000)]
MFV r331708:
9321 arc_loan_compressed_buf() can increment arc_loaned_bytes by the wrong value

illumos/illumos-gate@9be12bd737714550277bd02b0c693db560976990

arc_loan_compressed_buf() increments arc_loaned_bytes by psize unconditionally
In the case of zfs_compressed_arc_enabled=0, when the buf is returned via
arc_return_buf(), if ARC_BUF_COMPRESSED(buf) is false, then arc_loaned_bytes
is decremented by lsize, not psize.

Switch to using arc_buf_size(buf), instead of psize, which will return
psize or lsize, depending on the result of ARC_BUF_COMPRESSED(buf).

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Allan Jude <allanjude@freebsd.org>

6 years agoMFV r331706:
mav [Wed, 28 Mar 2018 22:29:11 +0000 (22:29 +0000)]
MFV r331706:
9235 rename zpool_rewind_policy_t to zpool_load_policy_t

illumos/illumos-gate@5dafeea3ebd2dd77affc802bcb90f63faf01589f

We want to be able to pass various settings during import/open of a pool,
which are not only related to rewind. Instead of adding a new policy and
duplicate a bunch of code, we should just rename rewind_policy to a more
generic term like load_policy.

For instance, we'd like to set spa->spa_import_flags from the nvlist,
rather from a flags parameter passed to spa_import as in some cases we want
those flags not only for the import case, but also for the open case. One
such flag could be ZFS_IMPORT_MISSING_LOG (as used in zdb) which would
allow zfs to open a pool when logs are missing.

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>

6 years agoMFV 331704:
mav [Wed, 28 Mar 2018 22:10:06 +0000 (22:10 +0000)]
MFV 331704:
9191 dump vdev tree to zfs_dbgmsg when spa load fails due to missing log devices

illumos/illumos-gate@ccef24b493bcbd146fcd6d8946666cae081470b6

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matt Ahrens <matt@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>

6 years agoMFV 331702:
mav [Wed, 28 Mar 2018 22:07:31 +0000 (22:07 +0000)]
MFV 331702:
9187 racing condition between vdev label and spa_last_synced_txg in vdev_validate

illumos/illumos-gate@d1de72cfa29ab77ff80e2bb0e668a6afa5bccaf0

ztest failed with uncorrectable IO error despite having the fix for #7163.
Both sides of the mirror have CANT_OPEN_BAD_LABEL, which also distinguishes
it from that issue.

Definitely seems like a racing condition between the vdev_validate and spa_sync:
1. Thread A (spa_sync): vdev label is updated to latest txg
2. Thread B (vdev_validate): vdev label's txg is compared to spa_last_synced_txg and is ahead.
3. Thread A (spa_sync): spa_last_synced_txg is updated to latest txg.

Solution: do not check txg in vdev_validate unless config lock is held.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matt Ahrens <matthew.ahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>

6 years agoMFV r331695, 331700: 9166 zfs storage pool checkpoint
mav [Wed, 28 Mar 2018 22:01:27 +0000 (22:01 +0000)]
MFV r331695, 331700: 9166 zfs storage pool checkpoint

illumos/illumos-gate@8671400134a11c848244896ca51a7db4d0f69da4

The idea of Storage Pool Checkpoint (aka zpool checkpoint) deals with
exactly that.  It can be thought of as a “pool-wide snapshot” (or a
variation of extreme rewind that doesn’t corrupt your data).  It remembers
the entire state of the pool at the point that it was taken and the user
can revert back to it later or discard it.  Its generic use case is an
administrator that is about to perform a set of destructive actions to ZFS
as part of a critical procedure.  She takes a checkpoint of the pool before
performing the actions, then rewinds back to it if one of them fails or puts
the pool into an unexpected state.  Otherwise, she discards it.  With the
assumption that no one else is making modifications to ZFS, she basically
wraps all these actions into a “high-level transaction”.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>

6 years agoAdd files missed from r331695.
mav [Wed, 28 Mar 2018 21:00:34 +0000 (21:00 +0000)]
Add files missed from r331695.

6 years agoPartial MFV r329753:
mav [Wed, 28 Mar 2018 20:41:15 +0000 (20:41 +0000)]
Partial MFV r329753:
8809 libzpool should leverage work done in libfakekernel

illumos/illumos-gate@f06dce2c1f0f3af78581e7574f65bfba843ddb6e

Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Gordon Ross <gordon.w.ross@gmail.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Andrew Stormont <astormont@racktopsystems.com>

We do not have libfakekernel, but need to reduce code divergence.

6 years agoRestore r331606 with a bugfix to setup cpuset_domain[] earlier on all
jeff [Wed, 28 Mar 2018 18:47:35 +0000 (18:47 +0000)]
Restore r331606 with a bugfix to setup cpuset_domain[] earlier on all
platforms.  Original commit message as follows:

Only use CPUs in the domain the device is attached to for default
assignment.  Device drivers are able to override the default assignment
if they bind directly.  There are severe performance penalties for
handling interrupts on remote CPUs and this should only be done in
very controlled circumstances.

Reviewed by:    jhb, kib
Tested by:      pho
Sponsored by:   Netflix, Dell/EMC Isilon
Differential Revision:  https://reviews.freebsd.org/D14838

6 years agoAdd an example for building SD card images for the RPI-B and
gjb [Wed, 28 Mar 2018 18:43:06 +0000 (18:43 +0000)]
Add an example for building SD card images for the RPI-B and
RPI3.

MFC after: 3 days
Suggested by: Arshan Khanifar
Reviewed by: Arshan Khanifar <arshan@freebsdfoundation.org>
Sponsored by: The FreeBSD Foundation

6 years agoUpdate the Release Engineering article URL to the modern version.
gjb [Wed, 28 Mar 2018 18:28:27 +0000 (18:28 +0000)]
Update the Release Engineering article URL to the modern version.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

6 years ago9166 zfs storage pool checkpoint
mav [Wed, 28 Mar 2018 18:12:06 +0000 (18:12 +0000)]
9166 zfs storage pool checkpoint

illumos/illumos-gate@8671400134a11c848244896ca51a7db4d0f69da4

The idea of Storage Pool Checkpoint (aka zpool checkpoint) deals with
exactly that.  It can be thought of as a “pool-wide snapshot” (or a
variation of extreme rewind that doesn’t corrupt your data).  It remembers
the entire state of the pool at the point that it was taken and the user
can revert back to it later or discard it.  Its generic use case is an
administrator that is about to perform a set of destructive actions to ZFS
as part of a critical procedure.  She takes a checkpoint of the pool before
performing the actions, then rewinds back to it if one of them fails or puts
the pool into an unexpected state.  Otherwise, she discards it.  With the
assumption that no one else is making modifications to ZFS, she basically
wraps all these actions into a “high-level transaction”.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>

6 years agoSwap two instances of regular macros with function macros in the LinuxKPI,
hselasky [Wed, 28 Mar 2018 17:54:34 +0000 (17:54 +0000)]
Swap two instances of regular macros with function macros in the LinuxKPI,
to narrow down the substitution scope.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoFix for regression issue in USB keyboard driver after r304735.
hselasky [Wed, 28 Mar 2018 17:39:23 +0000 (17:39 +0000)]
Fix for regression issue in USB keyboard driver after r304735.

A series of zero delay callouts can happen causing high CPU usage of the
timer subsystem when trying to repeat keys, because the time of the
absolute timeout is not moving forward. The condition clears when all
keys are released.

Reported by: Johannes Lundberg <johalun0@gmail.com>
Discussed with: bde@
PR: 226968
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoExpand remaining instances of 'make kernel' to buildkernel + installkernel.
jhb [Wed, 28 Mar 2018 16:51:05 +0000 (16:51 +0000)]
Expand remaining instances of 'make kernel' to buildkernel + installkernel.

The 'kernel' target is a bit more obscure compared to buildkernel and
installkernel.  One instance was already expanded previously in r325097.

6 years agoAvoid looping if SYSDIR already known.
bdrewery [Wed, 28 Mar 2018 16:28:24 +0000 (16:28 +0000)]
Avoid looping if SYSDIR already known.

Sponsored by: Dell EMC

6 years agoAvoid upwards directory walk in kernel build for finding known SYSDIR.
bdrewery [Wed, 28 Mar 2018 16:28:20 +0000 (16:28 +0000)]
Avoid upwards directory walk in kernel build for finding known SYSDIR.

Sponsored by: Dell EMC

6 years agoFix kernel builds without options DDB after r331650.
jhb [Wed, 28 Mar 2018 16:24:56 +0000 (16:24 +0000)]
Fix kernel builds without options DDB after r331650.

Reported by: cy

6 years agoRework ipfw rules parsing and printing code.
ae [Wed, 28 Mar 2018 12:44:28 +0000 (12:44 +0000)]
Rework ipfw rules parsing and printing code.

Introduce show_state structure to keep information about printed opcodes.
Split show_static_rule() function into several smaller functions. Make
parsing and printing opcodes into several passes. Each printed opcode
is marked in show_state structure and will be skipped in next passes.
Now show_static_rule() function is simple, it just prints each part
of rule separately: action, modifiers, proto, src and dst addresses,
options. The main goal of this change is avoiding occurrence of wrong
result of `ifpw show` command, that can not be parsed by ipfw(8).
Also now it is possible to make some simple static optimizations
by reordering of opcodes in the rule.

PR: 222705
Discussed with: melifaro
MFC after: 2 weeks
Sponsored by: Yandex LLC

6 years agoZFS vn_rele_async: catch up with the use of refcount(9) for the vnode use count
avg [Wed, 28 Mar 2018 08:55:31 +0000 (08:55 +0000)]
ZFS vn_rele_async: catch up with the use of refcount(9) for the vnode use count

It's not sufficient nor required to use the vnode interlock when
checking if we are going to drop the last use count as the code in
vputx() uses refcount (atomic) operations for both checking and
decrementing the use code.  Apply the same method to vn_rele_async().
While here, remove vn_rele_inactive(), a wrapper around vrele() that
didn't add any value.

Also, the change required making vfs_refcount_release_if_not_last()
public.  I've made vfs_refcount_acquire_if_not_zero() public as well.
They are in sys/refcount.h now.  While making the move I've dropped the
vfs_ prefix.

Reviewed by: mjg
MFC after: 2 weeks
Sponsored by: Panzura
Differential Revision: https://reviews.freebsd.org/D14869

6 years ago[iwm] Add support for iwm 3168 cards
eadler [Wed, 28 Mar 2018 07:59:16 +0000 (07:59 +0000)]
[iwm] Add support for iwm 3168 cards

```
iwm0@pci0:5:0:0:        class=0x028000 card=0x21108086 chip=0x24fb8086
rev=0x10 hdr=0x00
vendor     = 'Intel Corporation'
device     = 'Dual Band Wireless-AC 3168NGW [Stone Peak]'
class      = network
[94829] iwm0: <Intel(R) Dual Band Wireless AC 3168> mem
0xef700000-0xef701fff at device 0.0 on pci5
[94829] iwm0: hw rev 0x220, fw ver 22.361476.0, address
28:c6:3f:15:43:c5
```

MFC After: 2 weeks
Reviewed by: ivadasz (over IRC)
PR: 224886
Differential Revision: https://reviews.freebsd.org/D14865

6 years agoAdd Bruce Evans
rgrimes [Wed, 28 Mar 2018 07:49:36 +0000 (07:49 +0000)]
Add Bruce Evans
Update my mentors to bde and phk

Approved by: core, bde (mentor), phk (mentor)
MFC after: 3 days

6 years agoseq: provide a comment explaining what seq is for and note 2 caveats
mjg [Wed, 28 Mar 2018 04:38:45 +0000 (04:38 +0000)]
seq: provide a comment explaining what seq is for and note 2 caveats