]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFV 316900
Josh Paetzel [Thu, 27 Apr 2017 23:31:38 +0000 (23:31 +0000)]
MFV 316900

7743 per-vdev-zaps have no initialize path on upgrade

illumos/illumos-gate@555da5111b0f2552c42d057b211aba89c9c79f6c
https://github.com/illumos/illumos-gate/commit/555da5111b0f2552c42d057b211aba89c9c79f6c

https://www.illumos.org/issues/7743
  When loading a pool that had been created before the existance of
  per-vdev zaps, on a system that knows about per-vdev zaps, the
  per-vdev zaps will not be allocated and initialized.
  This appears to be because the logic that would have done so, in
  spa_sync_config_object(), is not reached under normal operation. It is
  only reached if spa_config_dirty_list is non-empty.
  The fix is to add another `AVZ_ACTION_` enum that will allow this code
  to be reached when we detect that we're loading an old pool, even when
  there are no dirty configs.

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Don Brady <don.brady@intel.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Paul Dagnelie <pcd@delphix.com>

7 years agoUse unconditional jr (jump register) so cerror relocation offset fits.
Ruslan Bukin [Thu, 27 Apr 2017 22:40:39 +0000 (22:40 +0000)]
Use unconditional jr (jump register) so cerror relocation offset fits.

This fixes libc build on riscv64sf.

Reviewed by: jhb
Sponsored by: DARPA, AFRL

7 years agoMFV 316898
Josh Paetzel [Thu, 27 Apr 2017 22:00:03 +0000 (22:00 +0000)]
MFV 316898

7613 ms_freetree[4] is only used in syncing context

illumos/illumos-gate@5f145778012b555e084eacc858ead9e1e42bd149
https://github.com/illumos/illumos-gate/commit/5f145778012b555e084eacc858ead9e1e42bd149

https://www.illumos.org/issues/7613
  metaslab_t:ms_freetree[TXG_SIZE] is only used in syncing context. We should
  replace it with two trees: the freeing tree (ranges that we are freeing this
  syncing txg) and the freed tree (ranges which have been freed this txg).

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>

7 years agoAdd asserts to verify stability of struct proc and struct thread layouts.
Konstantin Belousov [Thu, 27 Apr 2017 21:24:50 +0000 (21:24 +0000)]
Add asserts to verify stability of struct proc and struct thread layouts.

Some notes:
- Only i386 and amd64 layouts are checked, other Tier-1 (or close to
  it) architectures would benefit from the same check.
- Unconditional enabling of the asserts depend on the stability of locks
  memory layout.  If locks are optimized to avoid bloat when some debugging
  or profiling features turned off, it makes sense to only assert layout
  for production configs.

Reviewed by: badger, emaste, jhb, vangyzen
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D10526

7 years agoMFV 316897
Josh Paetzel [Thu, 27 Apr 2017 21:11:57 +0000 (21:11 +0000)]
MFV 316897

7586 remove #ifdef __lint hack from dmu.h

illumos/illumos-gate@4ba5b9616327ef64e8abc737d29b3faabc6ae68c
https://github.com/illumos/illumos-gate/commit/4ba5b9616327ef64e8abc737d29b3faabc6ae68c

https://www.illumos.org/issues/7586
  The #ifdef __lint in dmu.h is ugly, and it would be nice not to duplicate it if
  we add other inline functions into header files in ZFS, especially since it is
  difficult to make any other solution work across all compilation targets. We
  should switch to disabling the lint flags that are failing instead.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Dan Kimmel <dan.kimmel@delphix.com>

7 years agoImport Amazon Elastic Network Adapter (ENA) HAL to sys/contrib/
Zbigniew Bodek [Thu, 27 Apr 2017 19:57:18 +0000 (19:57 +0000)]
Import Amazon Elastic Network Adapter (ENA) HAL to sys/contrib/

Import from vendor-sys/ena-com/1.1.4.1
SVN rev.: 317516
Version: 1.1.4.1

Obtained from: Amazon.com, Inc.

7 years agoAdvertise kldxref(8) a little better.
Edward Tomasz Napierala [Thu, 27 Apr 2017 19:48:00 +0000 (19:48 +0000)]
Advertise kldxref(8) a little better.

MFC after: 2 weeks

7 years agoIntroduce HAL for Amazon Elastic Network Adapter (ENA)
Zbigniew Bodek [Thu, 27 Apr 2017 19:40:53 +0000 (19:40 +0000)]
Introduce HAL for Amazon Elastic Network Adapter (ENA)

This commit adds HAL (Hardware Abstraction Layer) code
for Amazon Elastic Network Adapter (ENA).

Version: 1.1.4.1

Obtained from: Amazon.com, Inc.

7 years agoFix withered handling of r280687, broken by r286719.
Alexander Motin [Thu, 27 Apr 2017 19:03:08 +0000 (19:03 +0000)]
Fix withered handling of r280687, broken by r286719.

MFC after: 1 week.

7 years agosh: Add some tests for command substitution final newline stripping.
Jilles Tjoelker [Thu, 27 Apr 2017 18:52:18 +0000 (18:52 +0000)]
sh: Add some tests for command substitution final newline stripping.

7 years agoarmv8 has support for optional CRC32C instructions. This patch checks if they are
Michael Tuexen [Thu, 27 Apr 2017 17:53:05 +0000 (17:53 +0000)]
armv8 has support for optional CRC32C instructions. This patch checks if they are
available and if that is true make use of them.
Thank you very much to Andrew Turner for providing help and review the patch!
Reviewed by: andrew
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D10499

7 years agoMFV 316896
Josh Paetzel [Thu, 27 Apr 2017 16:38:28 +0000 (16:38 +0000)]
MFV 316896

7580 ztest failure in dbuf_read_impl

illumos/illumos-gate@1a01181fdc809f40c64d5c6881ae3e4521a9d9c7
https://github.com/illumos/illumos-gate/commit/1a01181fdc809f40c64d5c6881ae3e4521a9d9c7

https://www.illumos.org/issues/7580
  We need to prevent any reader whenever we're about the zero out all the
  blkptrs. To do this we need to grab the dn_struct_rwlock as writer in
  dbuf_write_children_ready and free_children just prior to calling bzero.

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: George Wilson <george.wilson@delphix.com>

7 years agoVarious fixes for PCI _OSC handling so HotPlug works again.
John Baldwin [Thu, 27 Apr 2017 16:32:42 +0000 (16:32 +0000)]
Various fixes for PCI _OSC handling so HotPlug works again.

- Rename the default implementation of 'pcib_request_feature' and add
  a pcib_request_feature() wrapper function (as is often done for
  new-bus APIs implemented via kobj) that accepts a single function.
  Previously the call to pcib_request_feature() ended up invoking the
  method on the great-great-grandparent of the bridge device instead
  of the grandparent.  For a bridge that was a direct child of pci0 on
  x86 this resulted in the method skipping over the Host-PCI bridge
  driver and being invoked against nexus0
- When invoking _OSC from a Host-PCI bridge driver, invoke
  device_get_softc() against the Host-PCI bridge device instead of the
  child bridge that is requesting HotPlug.  Using the wrong softc data
  resulted in garbage being passed for the ACPI handle causing the
  _OSC call to fail.
- While here, perform some other cleanups to _OSC handling in the ACPI
  Host-PCI bridge driver:
  - Don't invoke _OSC when requesting a control that has already been
    granted by the firmware.
  - Don't set the first word of the capability array before invoking
    _OSC.  This word is always set explicitly by acpi_EvaluateOSC()
    since it is UUID-independent.
  - Don't modify the set of granted controls unless _OSC doesn't exist
    (which is treated as always successful), or the _OSC method
    doesn't fail.
  - Don't require an _OSC status of 0 for success.  _OSC always
    returns the updated control mask even if it returns a non-zero
    status in the first word.
  - Whine if _OSC ever tries to revoke a previously-granted control.
    (It is not supposed to do that.)
- While here, add constants for the _OSC status word in acpivar.h
  (though currently unused).

Reported by: adrian
Reviewed by: imp
MFC after: 1 week
Tested on: Lenovo x220
Differential Revision: https://reviews.freebsd.org/D10520

7 years agoRevert r317446 and bring back cy(4).
John Baldwin [Thu, 27 Apr 2017 16:14:32 +0000 (16:14 +0000)]
Revert r317446 and bring back cy(4).

Requested by: bde

7 years agoMore ATM and NATM removal
Brooks Davis [Thu, 27 Apr 2017 16:05:12 +0000 (16:05 +0000)]
More ATM and NATM removal

Submitted by: ak
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D10511

7 years agoMFV 316895
Josh Paetzel [Thu, 27 Apr 2017 15:10:45 +0000 (15:10 +0000)]
MFV 316895

7606 dmu_objset_find_dp() takes a long time while importing pool

illumos/illumos-gate@7588687e6ba67c47bf7c9805086dec4a97fcac7b
https://github.com/illumos/illumos-gate/commit/7588687e6ba67c47bf7c9805086dec4a97fcac7b

https://www.illumos.org/issues/7606
  When importing a pool with a large number of filesystems within the same
  parent filesystem, we see that dmu_objset_find_dp() takes a long time.
  It is called from 3 places: spa_check_logs(), spa_ld_claim_log_blocks(),
  and spa_load_verify().
  There are several ways to improve performance here:
  1. We don't really need to do spa_check_logs() or
         spa_ld_claim_log_blocks() if the pool was closed cleanly.
  2. spa_load_verify() uses dmu_objset_find_dp() to check that no
         datasets have too long of names.
  3. dmu_objset_find_dp() is slow because it's doing
         zap_value_search() (which is O(N sibling datasets)) to determine
         the name of each dsl_dir when it's opened. In this case we
         actually know the name when we are opening it, so we can provide
         it and avoid the lookup.
  This change implements fix #3 from the above list; i.e. make
  dmu_objset_find_dp() provide the name of the dataset so that we don't
  have to search for it.

Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prashanth Sreenivasa <prashksp@gmail.com>
Approved by: Gordon Ross <gordon.w.ross@gmail.com>
Author: Matthew Ahrens <mahrens@delphix.com>

7 years agoMake cached Bluetooth LE host advertise information visible from userland.
Takanori Watanabe [Thu, 27 Apr 2017 15:03:24 +0000 (15:03 +0000)]
Make cached Bluetooth LE host advertise information visible from userland.

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

7 years agoDon't free uninitialized sysctl contexts in the mlx4en driver. This
Hans Petter Selasky [Thu, 27 Apr 2017 14:39:52 +0000 (14:39 +0000)]
Don't free uninitialized sysctl contexts in the mlx4en driver. This
can cause NULL pointer panics during failed device attach.

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

7 years agoPrefer to use real virtual address over direct map address in the
Hans Petter Selasky [Thu, 27 Apr 2017 14:29:21 +0000 (14:29 +0000)]
Prefer to use real virtual address over direct map address in the
linux_page_address() function in the LinuxKPI. This solves an issue
where the return value from linux_page_address() is passed to
kmem_free().

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoWe need CAP_MMAP_RW on memfd, since init_msix_table() may call mmap().
Gleb Smirnoff [Thu, 27 Apr 2017 05:48:52 +0000 (05:48 +0000)]
We need CAP_MMAP_RW on memfd, since init_msix_table() may call mmap().

7 years agoFix handling of a NFSv4.1 callback reply from the session cache.
Rick Macklem [Wed, 26 Apr 2017 21:54:53 +0000 (21:54 +0000)]
Fix handling of a NFSv4.1 callback reply from the session cache.

The nfsv4_seqsession() call returns NFSERR_REPLYFROMCACHE when it has a
reply in the session, due to a requestor retry. The code erroneously
assumed a return of 0 for this case. This patch fixes this and adds
a KASSERT(). This would be an extremely rare occurrence. It was found
during code inspection during the pNFS server development.

MFC after: 2 weeks

7 years agoFix an issue with MTU calculation if an ICMP messaeg is received
Michael Tuexen [Wed, 26 Apr 2017 20:21:05 +0000 (20:21 +0000)]
Fix an issue with MTU calculation if an ICMP messaeg is received
for an SCTP/UDP packet.

MFC after: 1 week

7 years agoAdd information about device nodes to man pages for USB serial drivers.
Edward Tomasz Napierala [Wed, 26 Apr 2017 19:51:10 +0000 (19:51 +0000)]
Add information about device nodes to man pages for USB serial drivers.

MFC after: 2 weeks

7 years agoAdd some .Xrs to USB serial driver man pages.
Edward Tomasz Napierala [Wed, 26 Apr 2017 19:41:53 +0000 (19:41 +0000)]
Add some .Xrs to USB serial driver man pages.

MFC after: 2 weeks

7 years agoMake fstyp(8) recognize exFAT even without the -u option.
Edward Tomasz Napierala [Wed, 26 Apr 2017 19:34:41 +0000 (19:34 +0000)]
Make fstyp(8) recognize exFAT even without the -u option.

While it's not directly mountable with mount(8), it's something that's
mountable - differently from GELI or zpools.

MFC after: 2 weeks

7 years agoPull in r294458 from upstream llvm trunk (by Sanne Wouda):
Dimitry Andric [Wed, 26 Apr 2017 19:33:56 +0000 (19:33 +0000)]
Pull in r294458 from upstream llvm trunk (by Sanne Wouda):

  [Assembler] Enable nicer diagnostics for inline assembly.

  Fixed test.

  Summary:
  Enables source location in diagnostic messages from the backend.
  This is after parsing, during finalization.  This requires the
  SourceMgr, the inline assembly string buffer, and DiagInfo to still
  be alive after EmitInlineAsm returns.

  This patch creates a single SourceMgr for inline assembly inside the
  AsmPrinter.  MCContext gets a pointer to this SourceMgr.  Using one
  SourceMgr per call to EmitInlineAsm would make it difficult for
  MCContext to figure out in which SourceMgr the SMLoc is located,
  while a single SourceMgr can figure it out if it has multiple
  buffers.

  The Str argument to EmitInlineAsm is copied into a buffer and owned
  by the inline asm SourceMgr.  This ensures that DiagHandlers won't
  print garbage.  (Clang emits a "note: instantiated into assembly
  here", which refers to this string.)

  The AsmParser gets destroyed before finalization, which means that
  the DiagHandlers the AsmParser installs into the SourceMgr will be
  stale.  Restore the saved DiagHandlers.

  Since now we're using just one SourceMgr for multiple inline asm
  strings, we need to tell the AsmParser which buffer it needs to parse
  currently.  Hand a buffer id -- returned from SourceMgr::
  AddNewSourceBuffer -- to the AsmParser.

  Reviewers: rnk, grosbach, compnerd, rengolin, rovka, anemet

  Reviewed By: rnk

  Subscribers: llvm-commits

  Differential Revision: https://reviews.llvm.org/D29441

This improves error reporting for some inline assembly constructs that
clang does not approve of: instead of crashing with a "fatal backend
error", it will now show a normal error message, and point out the
location of the problematic assembly.

Reported by: mmel
MFC after: 1 week

7 years agoUse consistently uint32_t for mtu values.
Michael Tuexen [Wed, 26 Apr 2017 19:26:40 +0000 (19:26 +0000)]
Use consistently uint32_t for mtu values.

This does not change functionality, but this cleanup is need for further
improvements of ICMP handling.

MFC after: 1 week

7 years agoRemove the cy(4) driver for Cyclades serial adapters.
John Baldwin [Wed, 26 Apr 2017 18:23:09 +0000 (18:23 +0000)]
Remove the cy(4) driver for Cyclades serial adapters.

This driver has been disconnected from the build since the new tty
layer was introduced in 8.0 and was never updated for new tty.

7 years agoFix build of tools/tools/umastat.
Gleb Smirnoff [Wed, 26 Apr 2017 17:58:10 +0000 (17:58 +0000)]
Fix build of tools/tools/umastat.

PR: 218887
Submitted by: Fabian Keil <fk fabiankeil.de>
Obtained from: ElectroBSD

7 years agoUMA_ZONE_REFCNT was removed.
Gleb Smirnoff [Wed, 26 Apr 2017 17:55:43 +0000 (17:55 +0000)]
UMA_ZONE_REFCNT was removed.

PR: 209715
Submitted by: Fabian Keil <fk fabiankeil.de>
MFC after: 3 days

7 years agoRevert r317432 and add a new entry for r316527.
Bryan Drewery [Wed, 26 Apr 2017 16:50:54 +0000 (16:50 +0000)]
Revert r317432 and add a new entry for r316527.

Requested by: imp

7 years agoCheck if the device is marked as dma-coherent in the FDT, and if so, let
Olivier Houchard [Wed, 26 Apr 2017 16:13:22 +0000 (16:13 +0000)]
Check if the device is marked as dma-coherent in the FDT, and if so, let
busdma know, so that on architectures where dma isn't always coherent, we
know we don't have to write-back/invalidates cachelines on DMA operations.

Reviewed by: andrew, mav

7 years agogetpagesize(3) cannot fail.
Konstantin Belousov [Wed, 26 Apr 2017 14:28:27 +0000 (14:28 +0000)]
getpagesize(3) cannot fail.

Sponsored by: The FreeBSD Foundation

7 years agogetpagesize(3) cannot fail.
Konstantin Belousov [Wed, 26 Apr 2017 14:25:01 +0000 (14:25 +0000)]
getpagesize(3) cannot fail.

The sysctl(HW_PAGESIZE) call cannot fail on FreeBSD kernels at least.
And even if it failed for some improbable reason, PAGE_SIZE is a safe
value to return.

Discussed with: jilles
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoWhen a SYN-ACK is received in SYN-SENT state, RFC 793 requires the
Michael Tuexen [Wed, 26 Apr 2017 06:20:58 +0000 (06:20 +0000)]
When a SYN-ACK is received in SYN-SENT state, RFC 793 requires the
validation of SEG.ACK as the first step. If the ACK is not acceptable,
a RST segment should be sent and the segment should be dropped.
Up to now, the segment was partially processed.
This patch moves the check for the SEG.ACK validation up to the front
as required.
Reviewed by: hiren, gnn
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D10424

7 years ago[net80211] [wlanwds] allow logging to stderr as well as syslog.
Adrian Chadd [Wed, 26 Apr 2017 01:08:25 +0000 (01:08 +0000)]
[net80211] [wlanwds] allow logging to stderr as well as syslog.

By default this logs to syslog only, not stderr.  It makes it difficult
to debug exactly what's going on.  So allow '-e' to log to stderr so I
have a chance of actually debugging wlanwds /dynamic WDS (DWDS) issues.

7 years agoRemove entry for r304436 removed in r316527.
Bryan Drewery [Wed, 26 Apr 2017 00:41:18 +0000 (00:41 +0000)]
Remove entry for r304436 removed in r316527.

Sponsored by: Dell EMC Isilon

7 years agoFix SP refcount leak.
Andrey V. Elsukov [Wed, 26 Apr 2017 00:34:05 +0000 (00:34 +0000)]
Fix SP refcount leak.

PCB SP cache acquires extra reference, when SP is stored in the cache.
Release this reference when PCB is destroyed in ipsec_delete_pcbpolicy().
In ipsec_copy_pcbpolicy() release reference to SP in case if sp_in or
sp_out are not NULL.

Reported by: Slawa Olhovchenkov <slw at zxy spb ru>
MFC after: 1 week

7 years ago[net80211] document having to enable privacy on the dynamic plumbed VAPs.
Adrian Chadd [Wed, 26 Apr 2017 00:07:51 +0000 (00:07 +0000)]
[net80211] document having to enable privacy on the dynamic plumbed VAPs.

7 years agoIn arm_gicv2m_alloc_msi(), if we found a suitable irq range, leave the loop
Olivier Houchard [Tue, 25 Apr 2017 23:46:53 +0000 (23:46 +0000)]
In arm_gicv2m_alloc_msi(), if we found a suitable irq range, leave the loop
before we increase irq again, or we'd end up choosing an irq, and then
really using the next one, even if it's not available.
Also in the inner loop, correct the end check so that we check every irq,
even the last one.
This makes the msk(4) adapter able to use MSI on Softiron Overdrive 1000.

7 years agoRemove the source to digi(4).
John Baldwin [Tue, 25 Apr 2017 23:29:41 +0000 (23:29 +0000)]
Remove the source to digi(4).

This was forgotten when the driver was removed in r305235.

7 years agoRemove the LSOL26CALLS_SEL constant.
John Baldwin [Tue, 25 Apr 2017 23:19:27 +0000 (23:19 +0000)]
Remove the LSOL26CALLS_SEL constant.

It is no longer used after SVR4/i386 ABI support was removed.

Reported by: kib

7 years agoRemove NATM configuration bits and assorted NATM and ATM remnants.
Brooks Davis [Tue, 25 Apr 2017 21:59:34 +0000 (21:59 +0000)]
Remove NATM configuration bits and assorted NATM and ATM remnants.

Reported by: ak
Reviewed by: ngie (first version)
Differential Revision: https://reviews.freebsd.org/D10497

7 years agoRemove unnecessary check for NULL mbuf in soreceive_generic().
Patrick Kelsey [Tue, 25 Apr 2017 19:54:34 +0000 (19:54 +0000)]
Remove unnecessary check for NULL mbuf in soreceive_generic().

This check has been redundant since it was introduced in r162554.

Reviewed by: emaste, glebius
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D10322

7 years agoAdd a new GDB_LIBEXEC option to install gdb and kgdb to /usr/libexec.
John Baldwin [Tue, 25 Apr 2017 18:08:56 +0000 (18:08 +0000)]
Add a new GDB_LIBEXEC option to install gdb and kgdb to /usr/libexec.

When this option is enabled, only gdb and kgdb are installed to
/usr/libexec for use by crashinfo(8). Other bits of GDB such as
gdbserver and gdbtui are not installed. For this option to be
effective, GDB must be enabled.

Rework r317094 to re-enable GDB on all platforms but enable
GDB_LIBEXEC on platforms for which the GDB in ports is a superset of
functionality.

Reviewed by: emaste, kib
Suggested by: kib
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D10449

7 years agoRemove an incorrect MLINK for tree(3) introduced in r310728.
Glen Barber [Tue, 25 Apr 2017 18:07:48 +0000 (18:07 +0000)]
Remove an incorrect MLINK for tree(3) introduced in r310728.

Reported by: many
PR: 216476
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoMFV 316894
Josh Paetzel [Tue, 25 Apr 2017 17:57:43 +0000 (17:57 +0000)]
MFV 316894

7252 7628 compressed zfs send / receive

illumos/illumos-gate@5602294fda888d923d57a78bafdaf48ae6223dea
https://github.com/illumos/illumos-gate/commit/5602294fda888d923d57a78bafdaf48ae6223dea

https://www.illumos.org/issues/7252
  This feature includes code to allow a system with compressed ARC enabled to
  send data in its compressed form straight out of the ARC, and receive data in
  its compressed form directly into the ARC.

https://www.illumos.org/issues/7628
  We should have longer, more readable versions of the ZFS send / recv options.

7628 create long versions of ZFS send / receive options

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed by: David Quigley <dpquigl@davequigley.com>
Reviewed by: Thomas Caputi <tcaputi@datto.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Dan Kimmel <dan.kimmel@delphix.com>

7 years agoRemove info files from optional old files.
John Baldwin [Tue, 25 Apr 2017 17:46:44 +0000 (17:46 +0000)]
Remove info files from optional old files.

Info files are now all removed unconditionally after the removal of
texinfo.

MFC after: 1 week

7 years agoAdd info files for GCC 4.2 to the list of info files to remove.
John Baldwin [Tue, 25 Apr 2017 17:45:26 +0000 (17:45 +0000)]
Add info files for GCC 4.2 to the list of info files to remove.

This would only affect upgrades from older versions of non-clang
platforms.

MFC after: 1 week

7 years agoRemove directories made empty by NATM, EISA, and IEEE488 removals.
Brooks Davis [Tue, 25 Apr 2017 17:00:08 +0000 (17:00 +0000)]
Remove directories made empty by NATM, EISA, and IEEE488 removals.

Reported by: ak

7 years agocxgbe/iw_cxgbe: Pull in some updates to c4iw_wait_for_reply from the
Navdeep Parhar [Tue, 25 Apr 2017 16:54:27 +0000 (16:54 +0000)]
cxgbe/iw_cxgbe: Pull in some updates to c4iw_wait_for_reply from the
iw_cxgb4 Linux driver.

Obtained from: Chelsio Communications
MFC after: 3 days
Sponsored by: Chelsio Communications

7 years agoCherry-pick 5d3c5151c2b885aab36627bafb8539238da27b2d, it fixes use after free
Gleb Smirnoff [Tue, 25 Apr 2017 15:56:46 +0000 (15:56 +0000)]
Cherry-pick 5d3c5151c2b885aab36627bafb8539238da27b2d, it fixes use after free
if tcpdump(1) is run on non-existent interface.

Suggested by: zeising

7 years agoFix a potential problem where we might try to shift by more than 31 bits
Doug Rabson [Tue, 25 Apr 2017 10:29:08 +0000 (10:29 +0000)]
Fix a potential problem where we might try to shift by more than 31 bits

CID:    1198859

7 years agoFix VNET leakages in PF by V_irtualizing pfr_ktables and friends.
Marko Zec [Tue, 25 Apr 2017 08:34:39 +0000 (08:34 +0000)]
Fix VNET leakages in PF by V_irtualizing pfr_ktables and friends.
Apparently this resolves a PF-triggered panic when destroying VNET jails.

Submitted by: Peter Blok <peter.blok@bsd4all.org>
Reviewed by: kp

7 years agoSince curvnet is already properly set on entry to event handlers,
Marko Zec [Tue, 25 Apr 2017 08:30:28 +0000 (08:30 +0000)]
Since curvnet is already properly set on entry to event handlers,
there's no need to override it, particularly not unconditionally with
vnet0.

Submitted by: Peter Blok <peter.blok@bsd4all.org>
Reviewed by: kp

7 years agoNote r317395 as merged.
Xin LI [Tue, 25 Apr 2017 03:29:35 +0000 (03:29 +0000)]
Note r317395 as merged.

7 years agoApply r316339 to vendor area.
Xin LI [Tue, 25 Apr 2017 03:28:38 +0000 (03:28 +0000)]
Apply r316339 to vendor area.

7 years agoFlush the LRO ctrl as soon as lro_mbufs fills up. There is no need to
Navdeep Parhar [Mon, 24 Apr 2017 22:35:00 +0000 (22:35 +0000)]
Flush the LRO ctrl as soon as lro_mbufs fills up.  There is no need to
wait for the next enqueue from the driver.

Reviewed by: gnn@, hselasky@, gallatin@
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D10432

7 years agoFrames that are not considered for LRO should not be counted in LRO statistics.
Navdeep Parhar [Mon, 24 Apr 2017 22:31:56 +0000 (22:31 +0000)]
Frames that are not considered for LRO should not be counted in LRO statistics.

Reviewed by: gnn@, hselasky@, gallatin@
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D10430

7 years agoUse the approved syntax to build no man pages.
Brooks Davis [Mon, 24 Apr 2017 21:55:59 +0000 (21:55 +0000)]
Use the approved syntax to build no man pages.

MFC after: 1 week
Sponsored by: DARPA, AFRL

7 years agoClean up Makefile.
Brooks Davis [Mon, 24 Apr 2017 21:31:27 +0000 (21:31 +0000)]
Clean up Makefile.

Prefer SRCTOP vs .CURDIR relative paths.

Find libnetbsd using LIBADD infrastructure rather than manual hackery.

Reviewed by: ngie, bapt
Obtained from: CheriBSD
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D10461

7 years agoDocument the removal of NATM.
Brooks Davis [Mon, 24 Apr 2017 21:27:37 +0000 (21:27 +0000)]
Document the removal of NATM.

Relnotes: yes

7 years agoRemove the NATM framework including the en(4), fatm(4), hatm(4), and
Brooks Davis [Mon, 24 Apr 2017 21:21:49 +0000 (21:21 +0000)]
Remove the NATM framework including the en(4), fatm(4), hatm(4), and
patm(4) devices.

Maintaining an address family and framework has real costs when we make
infrastructure improvements.  In the case of NATM we support no devices
manufactured in the last 20 years and some will not even work in modern
motherboards (some newer devices that patm(4) could be updated to
support apparently exist, but we do not currently have support).

With this change, support remains for some netgraph modules that don't
require NATM support code. It is unclear if all these should remain,
though ng_atmllc certainly stands alone.

Note well: FreeBSD 11 supports NATM and will continue to do so until at
least September 30, 2021.  Improvements to the code in FreeBSD 11 are
certainly welcome.

Reviewed by: philip
Approved by: harti

7 years agoAllow use of a write open stateid for reading in the NFSv4 server.
Rick Macklem [Mon, 24 Apr 2017 20:46:19 +0000 (20:46 +0000)]
Allow use of a write open stateid for reading in the NFSv4 server.

The NFSv4 RFCs give a server the option of allowing the use of an open
stateid for write access to be used for a Read operation.
This patch enables this by default and adds a sysctl to disable it,
for anyone who does not want this capability.
Allowing this is particularily useful for a pNFS Data Server (DS), since
they are not permitted to allow the use of special stateids.
Discovered during recent testing of the pNFS server under development.

MFC after: 2 weeks

7 years agoFix the following warning from gcc 4.2 in usr.bin/diff:
Dimitry Andric [Mon, 24 Apr 2017 20:34:56 +0000 (20:34 +0000)]
Fix the following warning from gcc 4.2 in usr.bin/diff:

usr.bin/diff/diffreg.c: In function 'change':
usr.bin/diff/diffreg.c:1085: warning: 'i' may be used uninitialized in this function

This version of gcc is not smart enough to see that 'i' cannot actually
be used unitialized.  However, the variable is confusingly re-used, so
it is better to give it another name, and clearly initialize it before
attempting to use it.

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D10484

7 years agoAdd support for dumping bcma/siba EROM tables to the console via a new
Landon J. Fuller [Mon, 24 Apr 2017 18:35:25 +0000 (18:35 +0000)]
Add support for dumping bcma/siba EROM tables to the console via a new
BHND_EROM_DUMP() method.

Dump the EROM tables to the coneole on mips/broadcom devices if bootverbose
is enabled; this functionality is primarily useful when debugging SoC EROM
parsing and device matching issues during early boot.

Reviewed by: mizhka
Approved by: adrian (mentor)
Sponsored by: Plausible Labs
Differential Revision: https://reviews.freebsd.org/D10122

7 years agoDrop unused/unnecessary return statement.
Landon J. Fuller [Mon, 24 Apr 2017 18:09:52 +0000 (18:09 +0000)]
Drop unused/unnecessary return statement.

Reported by: Coverity
CID: 1373118
Approved by: adrian (mentor, implicit)

7 years agoFix the last example to really replace all occurrences of the search string
Benedict Reuschling [Mon, 24 Apr 2017 16:52:26 +0000 (16:52 +0000)]
Fix the last example to really replace all occurrences of the search string
in the file by adding the global (g) option at the end.  Without it, only the
first match is replaced, subsequent ones are ignored.  The intention of the
example is to demonstrate something else, but adding the g matches the example
to what the description says.

Discussed with:     brd (on IRC)
MFC after:     1 week

7 years agoAdd sysutils/tmux to the DVD package set
Ed Maste [Mon, 24 Apr 2017 16:37:25 +0000 (16:37 +0000)]
Add sysutils/tmux to the DVD package set

The zsh + tmux combination is commonly wanted.

Approved by: gjb
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

7 years agoscandir(3): promote arraysz to size_t to match numitems.
Pedro F. Giffuni [Mon, 24 Apr 2017 14:56:41 +0000 (14:56 +0000)]
scandir(3): promote arraysz to size_t to match numitems.

The internal array size goes through a loop and is compared with numitems
which at its limits makes can be unreachably higher than arraysz.
Prevent an hypothetical overflow by matching the types.

MFC after: 1 week

7 years agoelfcopy: allow empty symbol list files
Ed Maste [Mon, 24 Apr 2017 14:51:53 +0000 (14:51 +0000)]
elfcopy: allow empty symbol list files

Reported by: bz
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10441

7 years agoChange ctl_free_lun() locking.
Alexander Motin [Mon, 24 Apr 2017 12:52:42 +0000 (12:52 +0000)]
Change ctl_free_lun() locking.

This fixes potential callout_drain() sleep under non-sleepable lock.

PR: 218167
MFC after: 2 weeks

7 years agoSlightly compact the code.
Alexander Motin [Mon, 24 Apr 2017 12:44:04 +0000 (12:44 +0000)]
Slightly compact the code.

MFC after: 2 weeks

7 years agoCall the PSCI reset from cpu_reset on arm64. When rebooting from DDB the
Andrew Turner [Mon, 24 Apr 2017 11:06:10 +0000 (11:06 +0000)]
Call the PSCI reset from cpu_reset on arm64. When rebooting from DDB the
kernel calls this directly so the event handler is not called, meaning
the computer fails to reboot.

Tested by: cognet
MFC after: 1 week
Sponsored by: DARPA, AFRL

7 years agoSwitch isp_reset to scratchpad not requiring ISP_MBOXDMASETUP.
Alexander Motin [Mon, 24 Apr 2017 10:16:12 +0000 (10:16 +0000)]
Switch isp_reset to scratchpad not requiring ISP_MBOXDMASETUP.

MFC after: 1 week

7 years agoUse proper alignment constant for uma_zcreate().
Alexander Motin [Mon, 24 Apr 2017 08:44:51 +0000 (08:44 +0000)]
Use proper alignment constant for uma_zcreate().

Previous code panicked on KASSERT with INVARIANTS enabled.

MFC after: 2 weeks

7 years agohyperv/hn: Use channel0, i.e. TX ring0, for TCP SYN/SYN|ACK.
Sepherosa Ziehau [Mon, 24 Apr 2017 07:52:27 +0000 (07:52 +0000)]
hyperv/hn: Use channel0, i.e. TX ring0, for TCP SYN/SYN|ACK.

Hyper-V hot channel effect:
Operation latency on hot channel is only _half_ of the operation
latency on cold channels.

This commit takes the advantage of the above Hyper-V host channel
effect, and can reduce more than 75% latency and more than 50%
latency stdev, i.e. lower and more stable/predictable latency,
for various types of web server workloads.

MFC after: 3 days
Sponsored by: Microsoft

7 years agoFix the default uid/gid values in nfsuserd.c
Rick Macklem [Sun, 23 Apr 2017 23:09:02 +0000 (23:09 +0000)]
Fix the default uid/gid values in nfsuserd.c

This patch sets the default uid/gid values for "nobody" and "nogroup"
to the values in the password and group databases. Normally nfsuserd(8)
will override these with whatever is in the password/group databases,
so these values are only used when the databases entries aren't available.
It would be nice to use the definitions in sys/conf.h, but those are
in the _KERNEL section of the file.

Reported by: tez@pkgsrc.org
Submitted by: tez@pkgsrc.org
MFC after: 2 weeks

7 years agomsun: Remove trailing space in Sunsoft copyright statement.
Pedro F. Giffuni [Sun, 23 Apr 2017 22:31:12 +0000 (22:31 +0000)]
msun: Remove trailing space in Sunsoft copyright statement.

Submittedby: kargl

7 years agoMake it possible to terminate "show lockedbufs" by pressing "q".
Edward Tomasz Napierala [Sun, 23 Apr 2017 22:20:25 +0000 (22:20 +0000)]
Make it possible to terminate "show lockedbufs" by pressing "q".

MFC after: 2 weeks

7 years agosh: Add tests for NUL byte in command substitution output.
Jilles Tjoelker [Sun, 23 Apr 2017 21:58:17 +0000 (21:58 +0000)]
sh: Add tests for NUL byte in command substitution output.

7 years agoregex: unsign and constify some variables.
Pedro F. Giffuni [Sun, 23 Apr 2017 21:51:29 +0000 (21:51 +0000)]
regex: unsign and constify some variables.

Taking some hints from the regex variant in nvi(1) and higher-level
compiler warnings, update some types in our regex(3) implementation.

Joint work with: Kyle Evans
MFC after: 2 weeks

7 years agoMake the NFSv4 client to use a write open for reading if allowed by the server.
Rick Macklem [Sun, 23 Apr 2017 21:51:28 +0000 (21:51 +0000)]
Make the NFSv4 client to use a write open for reading if allowed by the server.

An NFSv4 server has the option of allowing a Read to be done using a Write
Open. If this is not allowed, the server will return NFSERR_OPENMODE.
This patch attempts the read with a write open and then disables this
if the server replies NFSERR_OPENMODE.
This change will avoid some uses of the special stateids. This will be
useful for pNFS/DS Reads, since they cannot use special stateids.
It will also be useful for any NFSv4 server that does not support reading
via the special stateids. It has been tested against both types of NFSv4 server.

MFC after: 2 weeks

7 years agoDon't set the connection-back-channel flag for DS sessions.
Rick Macklem [Sun, 23 Apr 2017 21:36:32 +0000 (21:36 +0000)]
Don't set the connection-back-channel flag for DS sessions.

The NFSv4.1/pNFS client does not use/need a backchannel for the Data Server (DS)
sessions, so the flag should only be set for MetaData Server (MDS) sessions.
This patch should have been a part of r317275.

MFC after: 2 weeks

7 years agoIn fill_ip6(), the value of the pointer av changes before it is
Marius Strobl [Sun, 23 Apr 2017 21:17:59 +0000 (21:17 +0000)]
In fill_ip6(), the value of the pointer av changes before it is
free(3)ed. Thus, introduce a new variable to track the original
value.

Submitted by: Tom Rix
Differential Revision: https://reviews.freebsd.org/D9962

7 years agoImprove BUF_TRACKING by not displaying NULL entries.
Edward Tomasz Napierala [Sun, 23 Apr 2017 17:39:31 +0000 (17:39 +0000)]
Improve BUF_TRACKING by not displaying NULL entries.

Reviewed by: cem
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10443

7 years agoReport NTB link speed to console and interface.
Alexander Motin [Sun, 23 Apr 2017 14:25:51 +0000 (14:25 +0000)]
Report NTB link speed to console and interface.

MFC after: 2 weeks

7 years agoChange the drawing method for the mouse cursor in planar mode to support
Bruce Evans [Sun, 23 Apr 2017 08:59:35 +0000 (08:59 +0000)]
Change the drawing method for the mouse cursor in planar mode to support
colors.

Colors are still hard-coded as 15 (normally lightwhite) for the interior
and 0 (normally black) for the border, but these are now values used in
2 expressions instead of built in to the algorithm.  The algorithm used
a fancy and/or method, but this gives no control over the colors except
and'ing all color planes off gives black and or'ing all color planes on
gives lightwhite.  Just draw the border and interior in separate colors
using the same method as for characters, including its complications to
optimize for VGA adaptors.  Optimization is not really needed here, but
for the VGA case it avoids being slower than the and/or method.  The
optimization is worth about 30%.

7 years agoMap Linux CLOCK_BOOTTIME to native CLOCK_UPTIME.
Dmitry Chagin [Sun, 23 Apr 2017 07:57:30 +0000 (07:57 +0000)]
Map Linux CLOCK_BOOTTIME to native CLOCK_UPTIME.

MFC after: 1 week

7 years agoAdd Evdev ioctl handler to the Linuxulator.
Dmitry Chagin [Sun, 23 Apr 2017 07:43:50 +0000 (07:43 +0000)]
Add Evdev ioctl handler to the Linuxulator.

PR: 218627
Submitted by: Jan Kokemüller
Reported by: Jan Kokemüller
MFC after: 1 week

7 years agoMinor style(9) fixups
Enji Cooper [Sun, 23 Apr 2017 03:36:03 +0000 (03:36 +0000)]
Minor style(9) fixups

Delete trailing whitespace and sort headers.

Leave libgeom.h's placement alone, per reasoning in r317289.

MFC after: 5 weeks
Sponsored by: Dell EMC Isilon

7 years agoNote that getpagesize(3) can return -1 on failure
Enji Cooper [Sun, 23 Apr 2017 03:17:32 +0000 (03:17 +0000)]
Note that getpagesize(3) can return -1 on failure

MFC after: 5 weeks
Sponsored by: Dell EMC Isilon

7 years agogctl_test.t: catch errors with the mdcfg directive
Enji Cooper [Sun, 23 Apr 2017 02:30:06 +0000 (02:30 +0000)]
gctl_test.t: catch errors with the mdcfg directive

While here, add a note about certain testcases relying on `count=1024` in
the "create" portion.

MFC after: 5 weeks
Sponsored by: Dell EMC Isilon

7 years agoFix type for `pagesize` to match the return type for getpagesize(3)
Enji Cooper [Sun, 23 Apr 2017 01:50:47 +0000 (01:50 +0000)]
Fix type for `pagesize` to match the return type for getpagesize(3)
to fix the build

MFC after: 5 weeks
X-MFC with: r317311
Pointyhat to: ngie
Sponsored by: Dell EMC Isilon

7 years agoCheck for failures from getpagesize(3)
Enji Cooper [Sun, 23 Apr 2017 01:47:51 +0000 (01:47 +0000)]
Check for failures from getpagesize(3)

Return errno on failure, similar to the open(2) call above it.

MFC after: 5 weeks
Reported by: Coverity
CID: 1193753
Sponsored by: Dell EMC Isilon

7 years agoMinor style(9) fixups
Enji Cooper [Sun, 23 Apr 2017 01:17:59 +0000 (01:17 +0000)]
Minor style(9) fixups

Delete trailing whitespace and sort headers.

Leave libgeom.h's placement alone, per reasoning in r317289.

MFC after: 5 weeks
Sponsored by: Dell EMC Isilon

7 years agogctl_test.t: improve error reporting with mdcfg and mount directives
Enji Cooper [Sat, 22 Apr 2017 23:30:02 +0000 (23:30 +0000)]
gctl_test.t: improve error reporting with mdcfg and mount directives

If the commands had failed previously, it would press on and result in a
series of cascading failures. Fail early and continue on to the next case
instead of executing additional commands after a previously failed series
of steps.

MFC after:      5 weeks
Sponsored by:   Dell EMC Isilon

7 years agogctl_test.t: more tweaks to try and update the code and get it functional (again?)
Enji Cooper [Sat, 22 Apr 2017 23:27:40 +0000 (23:27 +0000)]
gctl_test.t: more tweaks to try and update the code and get it functional (again?)

- Make the logfile for $out be built off the basename for $cmd, instead of $cmd.
  (r317292 broke this assumption).
- Rename $mntpt to $mntpt_prefix for clarity, as this variable is a prefix for
  mountpoints.
- Reindent the umount directive block while here to match the rest of the code.

MFC after: 5 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse verb=delete not verb=remove
Enji Cooper [Sat, 22 Apr 2017 23:06:53 +0000 (23:06 +0000)]
Use verb=delete not verb=remove

The `remove` verb hasn't been present in geom_part*(4) for well
over a decade, if ever. I couldn't find any references to it in
^/stable/5 at least, which is around the timeframe that this test
was written.

MFC after: 5 weeks
Sponsored by: Dell EMC Isilon

7 years agogctl_test.t: minor tweaks
Enji Cooper [Sat, 22 Apr 2017 22:40:39 +0000 (22:40 +0000)]
gctl_test.t: minor tweaks

- Declare $count with the `my` scope operator to permit `use strict`.
- Add `use strict`.
- Use `use warnings` instead of using `-w` in the shebang.
- Don't unlink $cmd when done (prevents unnecessary rebuilding).
- Improve the error message when running with insufficient permissions, e.g.,
  non-root.

MFC after: 5 weeks
Sponsored by: Dell EMC Isilon