]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoUpdate to zstd 1.3.2
bapt [Sat, 11 Nov 2017 13:54:37 +0000 (13:54 +0000)]
Update to zstd 1.3.2

6 years agoRemove release and acquire semantics when accessing the "state" field of the
hselasky [Sat, 11 Nov 2017 11:01:50 +0000 (11:01 +0000)]
Remove release and acquire semantics when accessing the "state" field of the
LinuxKPI task struct. Change type of "state" variable from "int" to
"atomic_t" to simplify code and avoid unneccessary casting.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoMask away return codes from del_timer() and del_timer_sync() because
hselasky [Sat, 11 Nov 2017 10:46:12 +0000 (10:46 +0000)]
Mask away return codes from del_timer() and del_timer_sync() because
they are not the same like in Linux.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agorwlock: use fcmpset for setting RW_LOCK_WRITE_SPINNER
mjg [Sat, 11 Nov 2017 09:34:11 +0000 (09:34 +0000)]
rwlock: use fcmpset for setting RW_LOCK_WRITE_SPINNER

6 years agosecure: chase removal of pkg_install
eadler [Sat, 11 Nov 2017 07:21:49 +0000 (07:21 +0000)]
secure: chase removal of pkg_install

6 years agoChase removal of pkg_* commands
eadler [Sat, 11 Nov 2017 07:20:14 +0000 (07:20 +0000)]
Chase removal of pkg_* commands

6 years agobadsect(8): case remaining element
eadler [Sat, 11 Nov 2017 07:14:19 +0000 (07:14 +0000)]
badsect(8): case remaining element

r325452 removed badsect(8) - remove pseudo-target for it

6 years agomailaddr(7): wave goodbye
eadler [Sat, 11 Nov 2017 07:00:40 +0000 (07:00 +0000)]
mailaddr(7): wave goodbye

The information here is somewhere between ancient to obsolete.
It refers to a time in the internet's history when manual routing
was still useful, talks about UUCP as if its modern, and refers
to documents which I had trouble tracking down.

It seems unlikely that a manual page in this form would be useful, so
just remove it.

Reviewed By: imp, tsoome, bdrewery(?)
Differential Revision: https://reviews.freebsd.org/D12924

6 years agoDIRDEPS_BUILD: Fix after r325417.
bdrewery [Sat, 11 Nov 2017 01:11:00 +0000 (01:11 +0000)]
DIRDEPS_BUILD: Fix after r325417.

DIRDEPS_BUILD works just fine without defining __objdir or dealing with any of
this logic.  It handles its own TARGET_SPEC in local.meta.sys.mk as well.  Just
let it do its own thing.

Sponsored by: Dell EMC Isilon

6 years agoDon't work out of a TARGET. directory if TARGET_ARCH is not defined.
bdrewery [Sat, 11 Nov 2017 01:10:55 +0000 (01:10 +0000)]
Don't work out of a TARGET. directory if TARGET_ARCH is not defined.

This fixes 'TARGET=<target> make universe_kernels' creating an empty TARGET.
directory and showing it in SIGINFO.

Sponsored by: Dell EMC Isilon

6 years agoMETA_MODE: Avoid some logic if disabled and allow enabling with make argument.
bdrewery [Sat, 11 Nov 2017 01:10:50 +0000 (01:10 +0000)]
META_MODE: Avoid some logic if disabled and allow enabling with make argument.

Sponsored by: Dell EMC Isilon

6 years agoAUTO_OBJ: Disable in non-build targets.
bdrewery [Sat, 11 Nov 2017 01:10:46 +0000 (01:10 +0000)]
AUTO_OBJ: Disable in non-build targets.

There's no reason to create object directories for targets like 'installworld'
or 'distributeworld', and the others in this list.  Specifying MK_AUTO_OBJ as a
make argument allows circumventing this if needed for some reason.

This fixes mergemaster creating a full object tree due to doing a 'make
installconfig' tree walk.

Reported by: Mark Millard
Sponsored by: Dell EMC Isilon

6 years agoHandle MAKEOBJDIRPREFIX when already inside of .OBJDIR.
bdrewery [Sat, 11 Nov 2017 01:10:41 +0000 (01:10 +0000)]
Handle MAKEOBJDIRPREFIX when already inside of .OBJDIR.

This can happen in obscure cases with things like the kernel build.

Sponsored by: Dell EMC Isilon

6 years agocleanworld only needs a tree walk if the expected .OBJDIR is .CURDIR.
bdrewery [Sat, 11 Nov 2017 01:10:08 +0000 (01:10 +0000)]
cleanworld only needs a tree walk if the expected .OBJDIR is .CURDIR.

Sponsored by: Dell EMC Isilon

6 years agoInstall the 4th files in sys/boot/forth instead of each loader
imp [Fri, 10 Nov 2017 23:54:58 +0000 (23:54 +0000)]
Install the 4th files in sys/boot/forth instead of each loader

Also, move generation of loader.help into loader.mk. Set HELP_FILES=
to disable this (so we only install one help file, for now). At the
same time remove some duplicate -I lines. Fix several FILES= and
CLEANFILES= into the += form since we're touching both of those in the
.mk files. Make sure we only build one loader.help file per platform
in a unified way (we were building many on some, with the last to
install winning, though often they were the same text).

Also, we're now installing loader.rc and menu.rc everywhere. arm and
mips uboot installed these as menu.rc.sample, but there's no need
since the loader.rc for those platforms doesn't do menu.rc processing
by default. pcibios.4th is now installed everywhere, but will failsafe
on non x86 platforms (it isn't loaded by default anywhere).

These changes are too intertwined to do separately since aspects of
each are required to have a bug-free commit.

Sponsored by: Netflix

6 years agoMove LOADER_{NO,}_GELI_SUPPORT to MK_LOADER_GELI
imp [Fri, 10 Nov 2017 23:54:48 +0000 (23:54 +0000)]
Move LOADER_{NO,}_GELI_SUPPORT to MK_LOADER_GELI

Transition to WITH/WITHOUT_LOADER_GELI to flag support or not of GELI
in the boot loaders. Add HAVE_GELI so components can flag they need
support (since it's too large to include everywhere). Add temporary
warnings for the old forms to ease transition.

Also, update test script to build without GELI on x86.

Sponsored by: Netflix

6 years agoReplace LOADER_FIREWIRE_SUPPORT variable
imp [Fri, 10 Nov 2017 23:54:41 +0000 (23:54 +0000)]
Replace LOADER_FIREWIRE_SUPPORT variable

Rename LOADER_FIREWIRE_SUPPORT to MK_LOADER_FIREWIRE. Only build
libfirewire when this is "yes". Add note to updating. Fix build script
to build this for x86 so the option doesn't decay. sparc64 supports
ZFS, so also build it MK_ZFS=no.

Sponsored by: Netflix

6 years agoRemove useless PNP define here.
imp [Fri, 10 Nov 2017 23:54:36 +0000 (23:54 +0000)]
Remove useless PNP define here.

We never use HAVE_PNP for anything, so don't define it on the command line.

Sponsored by: Netflix

6 years agoRemove LOADER_ZFS_SUPPORT as a Makefile variable
imp [Fri, 10 Nov 2017 23:54:31 +0000 (23:54 +0000)]
Remove LOADER_ZFS_SUPPORT as a Makefile variable

LOADER_ZFS_SUPPORT is entirely used to select whether or not to
support ZFS in the loader. But it's not a user-servicable part (MK_ZFS
is what's used for that) Change it to the more conventional HAVE_ZFS
and move the ZFS support code into loader.mk. In addition, only build
ZFS libraries and boot loaders when ZFS is enabled.

Sponsored by: Netflix

6 years agoRemove LOADER_FDT_SUPPORT as a Makefile variable.
imp [Fri, 10 Nov 2017 23:54:24 +0000 (23:54 +0000)]
Remove LOADER_FDT_SUPPORT as a Makefile variable.

LOADER_FDT_SUPPORT was used inconsistently in the tree. In some
places, it was used to control whether or not the user wanted FDT
included, and in other places it was a command to include
support. Remove it entirely. The former is now enabled -DWITH_FDT,
while the latter is controlled by Makefiles defining HAVE_FDT.

Supported by: Netflix

6 years agoFDT support doesn't make sense for ps3. There's no support in the ps3
imp [Fri, 10 Nov 2017 23:54:18 +0000 (23:54 +0000)]
FDT support doesn't make sense for ps3. There's no support in the ps3
port for FDT, and it's unlikely to grow support for that anytime soon.
When it does, support can be added back easily enough.

Supported by: Netflix

6 years agoRemove all the empty help files from the powerpc build.
imp [Fri, 10 Nov 2017 23:54:13 +0000 (23:54 +0000)]
Remove all the empty help files from the powerpc build.

Sponsored by: Netflix

6 years agoSimplify this if to a direct assignment.
imp [Fri, 10 Nov 2017 23:54:09 +0000 (23:54 +0000)]
Simplify this if to a direct assignment.

Sponsored by: Netflix

6 years agolibsa32 isn't needed for i386. It's already a 32-bit platform and
imp [Fri, 10 Nov 2017 23:54:03 +0000 (23:54 +0000)]
libsa32 isn't needed for i386. It's already a 32-bit platform and
libfoo32 is only needed when compiling 32-bit libraries on native
64-bit architectures, and only when that 64-bit architecture needs
mixed 32-bit and 64-bit binaries.

Sponsored by: Netflix

6 years agoSimplify the efivar interface a little.
imp [Fri, 10 Nov 2017 23:30:23 +0000 (23:30 +0000)]
Simplify the efivar interface a little.

We started out having Linux compatible libefivar interfaces. This was
in anticipation of porting the GPL'd efibootmgr to FreeBSD via a
port. However, since we need that functionality in the base, that port
isn't going to happened. It also appears that efivar is a private
library that's not used much outside a command line util and
efibootmgr. Reduce compatibility with the Linux version a little by
removing the mode parameter to efi_set_variable (which was unused on
FreeBSD, and not set to something useful in the code we'd
written). Also remove some efi error routines that were never
implemented and existed only to placate early GPL efibootmgr porting
experiments.

Suggested by: Matt Williams
Sponsored by: Netflix

6 years agovnic: apply BPF tap before passing packet to hardware
emaste [Fri, 10 Nov 2017 22:17:30 +0000 (22:17 +0000)]
vnic: apply BPF tap before passing packet to hardware

Previously we passed tx packets to hardware via nicvf_tx_mbuf_locked
and then to the BPF tap, with a possibly invalid mbuf which would result
in a panic.

PR: 223600
Discussed with: bz
MFC after: 1 week
Sponsored by: The FreeBSD Foundation, Packet.net (hardware)

6 years agoRemove rerelease target that was added in r38978.
bdrewery [Fri, 10 Nov 2017 21:52:33 +0000 (21:52 +0000)]
Remove rerelease target that was added in r38978.

I'm not sure what this target is but it doesn't exist now and doesn't seem
to have existed before.

Sponsored by: Dell EMC Isilon

6 years agoboot1: avoid using NULL device path
emaste [Fri, 10 Nov 2017 21:26:44 +0000 (21:26 +0000)]
boot1: avoid using NULL device path

As of r323063 boot1 printed out the path & device from which it was
loaded, but uboot's EFI implementation lacked some support, resulting in
a NULL pointer and a crash.  Check for a NULL pointer and avoid
reporting (and storing in the environment) the device and path in this
case.

Submitted by: Zakary Nafziger <worldofzak@gmail.com>
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D13038

6 years agocxgbe(4): Excluce mdi from the check against port capabilities.
np [Fri, 10 Nov 2017 20:30:10 +0000 (20:30 +0000)]
cxgbe(4): Excluce mdi from the check against port capabilities.

MFC after: 1 week
Sponsored by: Chelsio Communications

6 years agoAUTO_OBJ: Don't create .OBJDIR with 'make -n'.
bdrewery [Fri, 10 Nov 2017 20:10:05 +0000 (20:10 +0000)]
AUTO_OBJ: Don't create .OBJDIR with 'make -n'.

Sponsored by: Dell EMC Isilon

6 years agoTell bsd.dep.mk which depend files to dinclude.
bdrewery [Fri, 10 Nov 2017 20:09:15 +0000 (20:09 +0000)]
Tell bsd.dep.mk which depend files to dinclude.

This allows the _SKIP_DEPEND optimization to work, avoiding reading
the files when not needed.  It also fixes META_MODE incorrectly
reading these files when not needed.

Sponsored by: Dell EMC Isilon

6 years agoAllow consuming Makefiles to add to DEPENDFILES.
bdrewery [Fri, 10 Nov 2017 20:09:11 +0000 (20:09 +0000)]
Allow consuming Makefiles to add to DEPENDFILES.

Sponsored by: Dell EMC Isilon

6 years agoNo need to run 'make depend' with FAST_DEPEND logic in-tree.
bdrewery [Fri, 10 Nov 2017 19:53:17 +0000 (19:53 +0000)]
No need to run 'make depend' with FAST_DEPEND logic in-tree.

Sponsored by: Dell EMC Isilon

6 years agoAUTO_OBJ: No need to tree-walk with 'make obj' here.
bdrewery [Fri, 10 Nov 2017 19:53:14 +0000 (19:53 +0000)]
AUTO_OBJ: No need to tree-walk with 'make obj' here.

Sponsored by: Dell EMC Isilon

6 years agoPass down any PROG-specific buildopts for forwarded targets.
bdrewery [Fri, 10 Nov 2017 19:53:11 +0000 (19:53 +0000)]
Pass down any PROG-specific buildopts for forwarded targets.

This currently has no impact.

Sponsored by: Dell EMC Isilon

6 years agonative-xtools: Fix for GCC archs.
bdrewery [Fri, 10 Nov 2017 19:53:07 +0000 (19:53 +0000)]
native-xtools: Fix for GCC archs.

- This also adds in a _cleanobj step as needed.
- This redirects TARGET/TARGET_ARCH to NXB_TARGET/NXB_TARGET_ARCH in
  Makefile.inc1 as the main build needs to be for MACHINE rather
  than TARGET.

  First build the toolchain and then use that as an external toolchain
  to build the needed directories and NXB_TARGET-toolchain, all as
  MACHINE files though via TARGET_TRIPLE=MACHINE_TRIPLE.

  The NXBDIRS is evaluated in the 'everything' submake as it needs to be
  based on TARGET's src.opts.mk values, such as MK_GCC=yes when building
  on a MK_CLANG=yes MACHINE.  This can likely be changed to a specific
  _native-xtools-everything target later and the funky late evaluation
  of SUBDIR_OVERRIDE removed.

X-MFC-With: r325001
Pointyhat to: bdrewery
MFC after: 2 months
Sponsored by: Dell EMC Isilon

6 years agoDon't append TARGET.TARGET_ARCH if OBJTOP is already set.
bdrewery [Fri, 10 Nov 2017 19:52:31 +0000 (19:52 +0000)]
Don't append TARGET.TARGET_ARCH if OBJTOP is already set.

This avoids flipping the expected TARGET.TARGET_ARCH suffix / OBJTOP when it is
already set by a parent make which wants to control it more such as in
something like 'make native-xtools'.

Sponsored by: Dell EMC Isilon

6 years agoCheck that the pmc index is less than the number of hardware PMCs,
kib [Fri, 10 Nov 2017 19:10:14 +0000 (19:10 +0000)]
Check that the pmc index is less than the number of hardware PMCs,
instead of asserting the condition.

The row index is directly supplied by userspace, the kernel must
handle invalid values.

Submitted by: pho
MFC after: 3 days

6 years agoMFV: r325668
jkim [Fri, 10 Nov 2017 18:46:34 +0000 (18:46 +0000)]
MFV: r325668

Merge ACPICA 20171110.

6 years agoRefactoring the interrupt setup code introduced a bug where the drivers
scottl [Fri, 10 Nov 2017 17:01:51 +0000 (17:01 +0000)]
Refactoring the interrupt setup code introduced a bug where the drivers
would attempt to re-allocate interrupts during a chip reset without
first de-allocating them.  Doing that right is going to be tricky, so
just band-aid it for now so that a re-init doesn't guarantee a failure
due to resource re-use.

Reported by: gallatin
Sponsored by: Netflix

6 years agoStrip EOL whitespace in usr.sbin/{jail,jexec}
emaste [Fri, 10 Nov 2017 14:53:16 +0000 (14:53 +0000)]
Strip EOL whitespace in usr.sbin/{jail,jexec}

6 years agoAdd more and update existing mlx5 core firmware structure definitions and bits.
hselasky [Fri, 10 Nov 2017 14:39:03 +0000 (14:39 +0000)]
Add more and update existing mlx5 core firmware structure definitions and bits.
This change is part of coming ibcore and mlx5ib updates.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoExpose the current hardware MTU in mlx5en(4) as a separate entry
hselasky [Fri, 10 Nov 2017 14:19:22 +0000 (14:19 +0000)]
Expose the current hardware MTU in mlx5en(4) as a separate entry
in the sysctl tree.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoAdd support for configuring local multicast and unicast data traffic loopback
hselasky [Fri, 10 Nov 2017 14:14:54 +0000 (14:14 +0000)]
Add support for configuring local multicast and unicast data traffic loopback
in mlx5en(4) driver via the sysctl interface.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoAdd support for disabling and enabling RX and TX DMA rings in mlx5en(4).
hselasky [Fri, 10 Nov 2017 14:10:41 +0000 (14:10 +0000)]
Add support for disabling and enabling RX and TX DMA rings in mlx5en(4).
This is useful for supporting setups similar to Netmap.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoMake physical address of init segment available in the priv of mlx5 core.
hselasky [Fri, 10 Nov 2017 14:02:12 +0000 (14:02 +0000)]
Make physical address of init segment available in the priv of mlx5 core.
This change is needed by mlx5ib(4).

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoAdd API function to query port performance counters for infiniband and RoCE
hselasky [Fri, 10 Nov 2017 13:58:49 +0000 (13:58 +0000)]
Add API function to query port performance counters for infiniband and RoCE
traffic in mlx5 core.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoAdd API functions to query and modify local loopback of multicast and
hselasky [Fri, 10 Nov 2017 13:56:11 +0000 (13:56 +0000)]
Add API functions to query and modify local loopback of multicast and
unicast traffic in mlx5 core.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoAdd API function to query virtual port counters in mlx5 core.
hselasky [Fri, 10 Nov 2017 13:53:53 +0000 (13:53 +0000)]
Add API function to query virtual port counters in mlx5 core.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoAdd API functions to modify the transport interface send object, TIS,
hselasky [Fri, 10 Nov 2017 13:50:08 +0000 (13:50 +0000)]
Add API functions to modify the transport interface send object, TIS,
in mlx5 core.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoAdd API functions to set and query dropless port mode in mlx5 core.
hselasky [Fri, 10 Nov 2017 13:44:12 +0000 (13:44 +0000)]
Add API functions to set and query dropless port mode in mlx5 core.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoPrevent mlx5 core from accessing host memory after shutdown by disabling
hselasky [Fri, 10 Nov 2017 13:40:27 +0000 (13:40 +0000)]
Prevent mlx5 core from accessing host memory after shutdown by disabling
PCI busmaster.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoSet ATOMIC endian mode in mlx5 core.
hselasky [Fri, 10 Nov 2017 13:38:43 +0000 (13:38 +0000)]
Set ATOMIC endian mode in mlx5 core.

The hardware is capable of 2 requestor endianness modes for standard 8
byte atomics: BE (0x0) and host endianness (0x1). Read the supported
modes from hca atomic capabilities and configure HW to host endianness
mode if supported.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoAdd const keyword to input-only argument in mlx5 core.
hselasky [Fri, 10 Nov 2017 13:30:14 +0000 (13:30 +0000)]
Add const keyword to input-only argument in mlx5 core.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoMake local variable 64-bits to avoid masking away bits in mlx5 core.
hselasky [Fri, 10 Nov 2017 13:28:23 +0000 (13:28 +0000)]
Make local variable 64-bits to avoid masking away bits in mlx5 core.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoImplement support for decoding general port notification event in
hselasky [Fri, 10 Nov 2017 13:25:29 +0000 (13:25 +0000)]
Implement support for decoding general port notification event in
the mlx5 core module.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoloader.efi: efi_devpath_is_prefix should return bool
tsoome [Fri, 10 Nov 2017 12:07:56 +0000 (12:07 +0000)]
loader.efi: efi_devpath_is_prefix should return bool

efi_devpath_is_prefix() is currently returning values 0 or 1, which means
it really should return bool.

Additionally, use unsigned len, because we only get unsigned values from
DevicePathNodeLength().

6 years agoRemove deprecated OVERRIDE_LINUX_BASE_PORT. It can be set via
tijl [Fri, 10 Nov 2017 11:19:47 +0000 (11:19 +0000)]
Remove deprecated OVERRIDE_LINUX_BASE_PORT.  It can be set via
DEFAULT_VERSIONS now (e.g. DEFAULT_VERSIONS+=linux=c7).

Noticed by: xmj
MFC after: 2 weeks

6 years agoRefactor the flowsteering APIs used by mlx5en(4). This change is needed by
hselasky [Fri, 10 Nov 2017 09:49:08 +0000 (09:49 +0000)]
Refactor the flowsteering APIs used by mlx5en(4). This change is needed by
the coming ibcore and mlx5ib updates in order to support traffic redirection
to so-called raw ethernet QPs.

Remove unused E-switch related routines and files while at it.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoMark ipoib device as initialized on device open.
hselasky [Fri, 10 Nov 2017 08:58:42 +0000 (08:58 +0000)]
Mark ipoib device as initialized on device open.

Set the IPOIB_FLAG_INITIALIZED on dev_open and clear it on dev_stop to
avoid a race between ipoib load and the underlying device driver.

The device module must dispatch the IB_EVENT_PORT_ACTIVE event before ipoib
module is loaded. Otherwise, the flush will fail since no one set the
IPOIB_FLAG_INITIALIZED.

Submitted by: Slava Shwartsman <slavash@mellanox.com>
Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoRemove some not needed comments in the LinuxKPI. Use the Linux source tree
hselasky [Fri, 10 Nov 2017 08:31:40 +0000 (08:31 +0000)]
Remove some not needed comments in the LinuxKPI. Use the Linux source tree
to lookup documentation for the functions implemented in the LinuxKPI
instead.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoAdd some missed OBJS_SRCS_FILTER from r323637.
bdrewery [Fri, 10 Nov 2017 08:00:09 +0000 (08:00 +0000)]
Add some missed OBJS_SRCS_FILTER from r323637.

Sponsored by: Dell EMC Isilon

6 years agoAvoid referencing private lib names directly.
bdrewery [Fri, 10 Nov 2017 07:53:02 +0000 (07:53 +0000)]
Avoid referencing private lib names directly.

Sponsored by: Dell EMC Isilon

6 years agorescue ipf: Remove hacks and link in libipf directly.
bdrewery [Fri, 10 Nov 2017 07:52:58 +0000 (07:52 +0000)]
rescue ipf: Remove hacks and link in libipf directly.

Sponsored by: Dell EMC Isilon

6 years agoAdd support for CRUNCH_LIBS_ for specifying a lib only for 1 prog.
bdrewery [Fri, 10 Nov 2017 07:52:46 +0000 (07:52 +0000)]
Add support for CRUNCH_LIBS_ for specifying a lib only for 1 prog.

Sponsored by: Dell EMC Isilon

6 years agoAdd new USB quirk.
hselasky [Fri, 10 Nov 2017 07:44:57 +0000 (07:44 +0000)]
Add new USB quirk.

Submitted by: Kris G <netsick@gmail.com>
Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoProperly initialize the full md_page structure
jhibbits [Fri, 10 Nov 2017 04:23:58 +0000 (04:23 +0000)]
Properly initialize the full md_page structure

6 years agoBook-E pmap_mapdev_attr() improvements
jhibbits [Fri, 10 Nov 2017 04:14:48 +0000 (04:14 +0000)]
Book-E pmap_mapdev_attr() improvements

* Check TLB1 in all mapdev cases, in case the memattr matches an existing
  mapping (doesn't need to be MAP_DEFAULT).
* Fix mapping where the starting address is not a multiple of the widest size
  base.  For instance, it will now properly map 0xffffef000, size 0x11000 using
  2 TLB entries, basing it at 0x****f000, instead of 0x***00000.

MFC after: 2 weeks

6 years agoDeal with src.conf for top-level MAKEOBJDIRPREFIX guard.
bdrewery [Fri, 10 Nov 2017 02:09:37 +0000 (02:09 +0000)]
Deal with src.conf for top-level MAKEOBJDIRPREFIX guard.

- Don't discard SRCCONF value since it may incorrectly have MAKEOBJDIRPREFIX
  in it.
- Add note about src.conf not being a suitable place for MAKEOBJDIRPREFIX.

Sponsored by: Dell EMC Isilon

6 years agoHandle some .OBJDIR == .CURDIR cases.
bdrewery [Fri, 10 Nov 2017 02:09:33 +0000 (02:09 +0000)]
Handle some .OBJDIR == .CURDIR cases.

- If OBJROOT is SRCTOP then don't add on TARGET.TARGET_ARCH.  This
  only happens at the top-level, and for sub-directories when the
  user is clever with MAKEOBJDIRPREFIX=/.
- Don't bother checking 'test -w' on .CURDIR.
- Properly set OBJTOP/OBJROOT to SRCTOP in various needed cases.
- Check if the OBJDIR is writable even for *clean* targets since it
  determines which .OBJDIR the user gets;  If they cannot write to an
  existing eligible .OBJDIR then it needs to clean in .CURDIR instead.
- Add guard to cleanworld/cleanuniverse from removing SRCTOP.
- Ensure OBJTOP is proper for .OBJDIR=.CURDIR which fixes finding
  libraries since src.libnames.mk is based on OBJTOP.
- Avoid some chdir(2) for modifying .OBJDIR

Sponsored by: Dell EMC Isilon

6 years agosystm.h: Include cdefs.h first
cem [Fri, 10 Nov 2017 02:00:40 +0000 (02:00 +0000)]
systm.h: Include cdefs.h first

Ever since r143063, machine/atomic.h requires cdefs.h.  So, include it
first.  Weak support: style(9) tells us to include cdefs.h first.

Argument against: since code that includes systm.h still compiles,
compilation units that include systm.h must already include cdefs.h.  So, an
argument could be made that the cdefs.h include could just be removed
entirely.  That is maybe a bigger change and not one I am interested in
bikeshedding.

Universe compiles.

Sponsored by: Dell EMC Isilon

6 years agoSome fixups to the CFI directives for PLT stub entry points.
jhb [Fri, 10 Nov 2017 01:17:26 +0000 (01:17 +0000)]
Some fixups to the CFI directives for PLT stub entry points.

The directives I added in r323466 and r323501 did not define a valid
CFA until several instructions into the associated functions.  This
triggers an assertion in GDB when generating a stack trace while
stopped at the first instruction of PLT stub entry point since there
is no valid CFA rule for the first instruction.

This is probably just wrong on my part as the non-simple .cfi_startproc
would have defined a valid CFA.  Instead, define a valid CFA as sp + 0
at the start of the functions and then use .cfa_def_offset to change the
offset when sp is adjusted later in the function.

Sponsored by: DARPA / AFRL

6 years agoUse NESTED() instead of LEAF() for rtld_start.
jhb [Fri, 10 Nov 2017 01:13:45 +0000 (01:13 +0000)]
Use NESTED() instead of LEAF() for rtld_start.

This is only cosmetic, but the entry point for rtld is not a leaf function,
and this avoids two .frame directives for rtld_start.

Sponsored by: DARPA / AFRL

6 years agoCorrect mistake in manpage.
mjoras [Thu, 9 Nov 2017 23:36:10 +0000 (23:36 +0000)]
Correct mistake in manpage.

Reported by: pluknet
Approved by: rstone (mentor)
MFC with: r325621
Pointy hat to:  mjoras

6 years agoIntroduce EVENTHANDLER_LIST and some users.
mjoras [Thu, 9 Nov 2017 22:51:48 +0000 (22:51 +0000)]
Introduce EVENTHANDLER_LIST and some users.

This introduces a facility to EVENTHANDLER(9) for explicitly defining a
reference to an event handler list. This is useful since previously all
invokers of events had to do a locked traversal of the global list of
event handler lists in order to find the appropriate event handler list.
By keeping a pointer to the appropriate list an invoker can avoid this
traversal completely. The pointer is initialized with SYSINIT(9) during
the eventhandler stage. Users registering interest in events do not need
to know if the event is backed by such a list, since the list is added
to the global list of lists. As with lists that are not pre-defined it
is safe to register for the events before the list has been created.

This converts the process_* and thread_* events to using the new
facility, as these are events whose locked traversals end up showing up
significantly in ports build workflows (and presumably other workflows
with many short lived threads/procs). It may be advantageous to convert
other events to using the new facility.

The el_flags field is now unused, but leave it be so that this revision
can be MFC'd.

Reviewed by: bdrewery, markj, mjg
Approved by: rstone (mentor)
In collaboration with:  ian
MFC after:      4 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12814

6 years agoFix issue with VXLAN-ecapsulated rx h/w checksumming.
sbruno [Thu, 9 Nov 2017 22:26:49 +0000 (22:26 +0000)]
Fix issue with VXLAN-ecapsulated rx h/w checksumming.

Submitted by: grehan
Reviewed by: bhargava.marreddy@broadcom.com
Differential Revision: https://reviews.freebsd.org/D12976

6 years agoMark targets .PHONY.
bdrewery [Thu, 9 Nov 2017 22:08:07 +0000 (22:08 +0000)]
Mark targets .PHONY.

This avoids the obvious of not running the target when expected, but
also avoids META_MODE from showing 'Building'.  This is mostly only
a problem when directly including bsd.obj.mk as many of these targets
were already .PHONY via bsd.sys.mk.

Sponsored by: Dell EMC Isilon

6 years agoMake sure sin_zero is zero in ibcore. Else socket address maching using
hselasky [Thu, 9 Nov 2017 19:30:10 +0000 (19:30 +0000)]
Make sure sin_zero is zero in ibcore. Else socket address maching using
bcmp() might fail.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoMake sure the IPv6 scope ID gets zeroed when exchanging CMA messages in ibcore.
hselasky [Thu, 9 Nov 2017 19:27:29 +0000 (19:27 +0000)]
Make sure the IPv6 scope ID gets zeroed when exchanging CMA messages in ibcore.
Else the IPv6 address matching might fail. This change adds support for both
embedded and non-embedded IPv6 scope IDs when passing a IPv6 link-local socket
address to RDMA. Prior to this change only global IPv6 addresses would work
with RDMA.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoMultiple fixes for using IPv6 link-local addresses with RDMA in ibcore.
hselasky [Thu, 9 Nov 2017 19:22:43 +0000 (19:22 +0000)]
Multiple fixes for using IPv6 link-local addresses with RDMA in ibcore.

1) Fail to resolve RDMA address if rtalloc1() returns the loopback
device, lo0, as the gateway interface. Currently RDMA loopback is
not supported.

2) Use ip_dev_find() and ip6_dev_find() to lookup network interfaces
with matching IPv4 and IPv6 addresses, respectivly.

3) In addr_resolve() make sure the "ifa" pointer is always set, also when
the "ifp" is NULL. Else a NULL pointer access might happen trying to
read from the "ifa" pointer later on.

4) In rdma_addr_find_dmac_by_grh() make sure the "bound_dev_if" field
gets set properly instead of passing the scope ID through the IPv6
socket address structure. This is more in line with upstream OFED
in Linux.

5) In rdma_addr_find_smac_by_sgid() there is no need to pass the
scope ID for IPv6. Either it is stored in the "bound_dev_if" field
or ip6_dev_find() will find the correct network device regardless
of the scope ID.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoMFV r325609: 7531 Assign correct flags to prefetched buffers
avg [Thu, 9 Nov 2017 18:22:42 +0000 (18:22 +0000)]
MFV r325609: 7531 Assign correct flags to prefetched buffers

illumos/illumos-gate@272952165423c254ad7708f1b3fe2ff0a6ce408b
https://github.com/illumos/illumos-gate/commit/272952165423c254ad7708f1b3fe2ff0a6ce408b

https://www.illumos.org/issues/7531
  I found that some buffers that could be L2ARC eligible are not flagged
  such, leading to some performance impact.  As a test I ran the same IO
  workload 10 times in a raw.  It is a metadata only workload (files
  listing).  l2arc_noprefetch=0.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: benrubson <ben.rubson@gmail.com>

MFC after: 8 days

6 years agoMFV r325607: 8607 zfs: variable set but not used
avg [Thu, 9 Nov 2017 18:14:42 +0000 (18:14 +0000)]
MFV r325607: 8607 zfs: variable set but not used

illumos/illumos-gate@b852c2f54326f8ac1daa372a88bfe951dd7e20ed
https://github.com/illumos/illumos-gate/commit/b852c2f54326f8ac1daa372a88bfe951dd7e20ed

https://www.illumos.org/issues/8607

Reviewed by: Yuri Pankov <yuripv@gmx.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Toomas Soome <tsoome@me.com>

MFC after: 1 week

6 years agoMFV r325605: 8713 Buffer overflow in dsl_dataset_name()
avg [Thu, 9 Nov 2017 18:12:21 +0000 (18:12 +0000)]
MFV r325605: 8713 Buffer overflow in dsl_dataset_name()

illumos/illumos-gate@f37ae9a714b97eca91c74c680c20c750c7cf5c02
https://github.com/illumos/illumos-gate/commit/f37ae9a714b97eca91c74c680c20c750c7cf5c02

https://www.illumos.org/issues/8713
  If we're creating a pool with version >= SPA_VERSION_DSL_SCRUB (v11) we need to
  account for additional space needed by the origin dataset which will also be
  snapshotted: "poolname"+"/"+"$ORIGIN"+"@"+"$ORIGIN".
  Enforce this limit in pool_namecheck().

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: loli10K <ezomori.nozomu@gmail.com>

MFC after: 1 week

6 years agoimport zstd 1.3.2
bapt [Thu, 9 Nov 2017 15:38:02 +0000 (15:38 +0000)]
import zstd 1.3.2

6 years agocxgbe(4): Do not request settings not supported by the port.
np [Thu, 9 Nov 2017 15:35:51 +0000 (15:35 +0000)]
cxgbe(4): Do not request settings not supported by the port.

MFC after: 1 week
Sponsored by: Chelsio Communications

6 years agoRemove useless .if. The whole point of SUBDIR.yes was so that we
imp [Thu, 9 Nov 2017 14:31:25 +0000 (14:31 +0000)]
Remove useless .if. The whole point of SUBDIR.yes was so that we
didn't need this construct.

Sponsored by: Netflix

6 years agoPoint people towards our https web site for documentation, http accesses are
gavin [Thu, 9 Nov 2017 13:38:24 +0000 (13:38 +0000)]
Point people towards our https web site for documentation, http accesses are
just redirected anyway.

MFC after: 1 week

6 years agoFix setting AENQ group in ENA driver
mw [Thu, 9 Nov 2017 13:38:17 +0000 (13:38 +0000)]
Fix setting AENQ group in ENA driver

With the current state of the AENQ handlers in the ENA driver, only
implemented handlers should be indicated.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12872

6 years agoAllow usage of more RX descriptors than 1 in ENA driver
mw [Thu, 9 Nov 2017 13:36:42 +0000 (13:36 +0000)]
Allow usage of more RX descriptors than 1 in ENA driver

Using only 1 descriptor on RX could be an issue, if system would be low
on resources and could not provide driver with large chunks of
contiguous memory.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12871

6 years agoRead max MTU from the ENA device
mw [Thu, 9 Nov 2017 13:35:07 +0000 (13:35 +0000)]
Read max MTU from the ENA device

The device now provides driver with max available MTU value it
can handle.

The function setting MTU for the interface was simplified and reworked
to follow up this changes.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12870

6 years agoFix calculating io queues number in ENA driver
mw [Thu, 9 Nov 2017 13:33:02 +0000 (13:33 +0000)]
Fix calculating io queues number in ENA driver

The maximum number of io_cq was the same number as maximum io_sq
indicated by the device working in normal mode (without LLQ).
It is not always true, especially when LLQ is being enabled.
Fix it.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12869

6 years agoRework printouts and logging level in ENA driver
mw [Thu, 9 Nov 2017 13:30:39 +0000 (13:30 +0000)]
Rework printouts and logging level in ENA driver

The driver was printing out a lot of information upon failure, which
does not have to be interested for the user.
Changing logging level required to rebuild driver with proper flags. The
proper sysctl was added, so the level now can be changed dynamically
using bitmask.

Levels of printouts were adjusted to keep on mind end user instead of
debugging purposes.

More verbose messages were added to align the driver with the Linux.

Fix building error introduced by the r325506 by casting csum_flags to
uint64_t.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12868

6 years agoCorrect operators precedence.
kib [Thu, 9 Nov 2017 13:09:07 +0000 (13:09 +0000)]
Correct operators precedence.
Also keep the calculated vm_page_alloc_contig() flags in the variable
to not re-evaluate it on the loop iteration.

Noted by: alc
Sponsored by: The FreeBSD Foundation

6 years agoFix comparing L3 type with L4 enum on RX hash in ENA driver
mw [Thu, 9 Nov 2017 12:39:26 +0000 (12:39 +0000)]
Fix comparing L3 type with L4 enum on RX hash in ENA driver

This bug wasn't impacting anything, because both enums are indicating
the same value, but it could cause a problem on API change.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12867

6 years agoFix compilation warnings when building ENA driver with gcc compiler
mw [Thu, 9 Nov 2017 12:37:19 +0000 (12:37 +0000)]
Fix compilation warnings when building ENA driver with gcc compiler

The gcc compiler is more sensitive when variable is having an value
assigned, but it is not used anywhere further.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: rlibby
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12866

6 years agoFix checking if the DF flag was set in ENA driver
mw [Thu, 9 Nov 2017 12:32:10 +0000 (12:32 +0000)]
Fix checking if the DF flag was set in ENA driver

The previous way of checking for DF was not valid.
When DF is enabled, the DF bit should be 1.

The original way of checking it was wrong in 2 ways: first of all, it
was not checking for single bit, secondly, it was checking for 0.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12865

6 years agoCleanup of the ENA driver header file
mw [Thu, 9 Nov 2017 12:07:02 +0000 (12:07 +0000)]
Cleanup of the ENA driver header file

Remove unused macros and fields - some of them were only initialized,
without further usage.

Implement minor style fixes and add required comments.

On the occasion add missing TX completion counter, which was existing,
but mistakenly remained unused.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12864

6 years agoAllow partial MSI-x allocation in ENA driver
mw [Thu, 9 Nov 2017 12:03:06 +0000 (12:03 +0000)]
Allow partial MSI-x allocation in ENA driver

The situation, where part of the MSI-x was not configured properly, was
not properly handled. Now, the driver reduces number of queues to
reflect number of existing and properly configured MSI-x vectors.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12863

6 years agoRemove deprecated and unused counters in ENA driver
mw [Thu, 9 Nov 2017 12:01:46 +0000 (12:01 +0000)]
Remove deprecated and unused counters in ENA driver

Few counters were imported from the Linux driver and never used,
because of differences between the Linux and FreeBSD APIs.

Queue stops and resumes are no longer supported by the driver and
counters were incremented indicating false events.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: rlibby
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12862

6 years agoCover ENA driver code with branch predictioning statements
mw [Thu, 9 Nov 2017 11:59:21 +0000 (11:59 +0000)]
Cover ENA driver code with branch predictioning statements

The driver was using it in only few places, so the rest of the code
was covered with those statement.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: rlibby
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12861