]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoZero etherswitch_vlangroup structure before doing partial assignments.
loos [Sun, 20 Nov 2016 17:03:52 +0000 (17:03 +0000)]
Zero etherswitch_vlangroup structure before doing partial assignments.

Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoMFC r308617:
kib [Sun, 20 Nov 2016 09:11:21 +0000 (09:11 +0000)]
MFC r308617:
Move common cleanup code into helper.

7 years agoMFC r307755: swapoff: Remove only late devices with -aL.
jilles [Sat, 19 Nov 2016 20:02:49 +0000 (20:02 +0000)]
MFC r307755: swapoff: Remove only late devices with -aL.

Currently, '/etc/rc.d/swaplate stop' removes all swap devices. This can be
very slow and may not even be possible if there is a lot of swap space in
use. However, removing swap devices is only needed for late swap devices
that may depend on daemons that subsequent shutdown steps stop. Normal swap
devices such as hard disk partitions will remain available throughout the
shutdown process and need not be removed.

In swapoff, interpret -aL to remove late swap devices only, and use this in
etc/rc.d/swaplate. The meaning of -aL in swapon remains unchanged (add all
swap devices, both normal and late).

PR: 187081

7 years agoMFC r306585: swapon(8): Update to reality: swapoff ignores -L and the late
jilles [Sat, 19 Nov 2016 19:25:38 +0000 (19:25 +0000)]
MFC r306585: swapon(8): Update to reality: swapoff ignores -L and the late
option in fstab.

7 years agoMFC r307752
asomers [Fri, 18 Nov 2016 22:28:57 +0000 (22:28 +0000)]
MFC r307752

Close some file descriptor leaks in pw

7 years agoMFC r308538:
kib [Fri, 18 Nov 2016 09:01:44 +0000 (09:01 +0000)]
MFC r308538:
Increase the max allowed size of the microcode update blob for x86.

7 years agoMFC r308288:
kib [Fri, 18 Nov 2016 08:59:47 +0000 (08:59 +0000)]
MFC r308288:
Do not sleep in vm_wait() if pagedaemon did not yet started.  Panic instead.

7 years agoMFC r308247: MFV r308222: 6051 lzc_receive: allow the caller to read the
avg [Thu, 17 Nov 2016 15:19:27 +0000 (15:19 +0000)]
MFC r308247: MFV r308222: 6051 lzc_receive: allow the caller to read the
begin record

7 years agoMFC r308218: Add support for microcode update on newer AMD CPUs (10h+)
avg [Thu, 17 Nov 2016 15:16:52 +0000 (15:16 +0000)]
MFC r308218: Add support for microcode update on newer AMD CPUs (10h+)

7 years agoMFC r308101: hwpmc: fix a race between amd_stop_pmc and amd_intr
avg [Thu, 17 Nov 2016 15:14:54 +0000 (15:14 +0000)]
MFC r308101: hwpmc: fix a race between amd_stop_pmc and amd_intr

7 years agoMFC r307195: convert iicsmb to use iicbus_transfer for all operations
avg [Thu, 17 Nov 2016 15:13:16 +0000 (15:13 +0000)]
MFC r307195: convert iicsmb to use iicbus_transfer for all operations

7 years agoMFC r308040,308479: nap time between pats is forced to be at most half
avg [Thu, 17 Nov 2016 15:10:52 +0000 (15:10 +0000)]
MFC r308040,308479: nap time between pats is forced to be at most half
of the timeout

7 years agoMFC r308237:
loos [Thu, 17 Nov 2016 14:32:23 +0000 (14:32 +0000)]
MFC r308237:

Remove the mbuf tag after use (for reinjected packets).

Fixes the packet processing in dummynet l2 rules.

Obtained from: pfSense
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoMFC r308464, r308471: Add some device IDs found in my new laptop.
mav [Wed, 16 Nov 2016 18:38:40 +0000 (18:38 +0000)]
MFC r308464, r308471: Add some device IDs found in my new laptop.

7 years agoMFC r308212:
kib [Wed, 16 Nov 2016 16:14:01 +0000 (16:14 +0000)]
MFC r308212:
Allow some dotdot lookups in capability mode.

7 years agoMFC r308477:
bapt [Wed, 16 Nov 2016 07:05:42 +0000 (07:05 +0000)]
MFC r308477:

make pxeboot consistent with common/dev_net.c

Always define boot.netif.server in kenv in pxeboot
Add "boot.tftproot.server" to kenv when pxeboot uses tftpfs
Change the code order when setting env for TFTP or NFS to be the same as
common/dev_net.c

Reported by: tsoome

7 years agoMFC r308160:
bapt [Wed, 16 Nov 2016 07:04:49 +0000 (07:04 +0000)]
MFC r308160:

syslogd(8): add an 'include' keyword

All the '.conf' files not beginning with a '.' contained int he directory
following the keyword will be included.

This keyword can only be used in the first level configuration files.

Modify the default syslogd.conf to 'include' /etc/syslog.d and
/usr/local/etc/syslog.d

It simplify a lot handling of syslog from automation tools.

Reviewed by: markj, kib (via irc)
Approved by: markj
MFC after: 2 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D8402

7 years agoMFC r308139, r308157-r308158
bapt [Wed, 16 Nov 2016 07:03:24 +0000 (07:03 +0000)]
MFC r308139, r308157-r308158

r308139:
cron(8): add support for /etc/cron.d and /usr/local/etc/cron.d

For automation tools it is way easier to maintain files in directories rather
than modifying /etc/crontab.

The files in those directories are in the same format as /etc/crontab

Reviewed by: adrian
MFC after: 2 weeks
Relnotes: yes
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D8400

r308157:
Fix typo in cron(8) date

Reported by: jilles

r308158:
Allow symlinks to be followed in cron.d directories and fix detection of
regular files on NFS

Reported by: jilles

7 years agoMFC r307238:
bapt [Wed, 16 Nov 2016 07:01:52 +0000 (07:01 +0000)]
MFC r307238:

Stop closing the network device when netbooting for loaders using the common
dev_net.c code.

The NETIF_OPEN_CLOSE_ONCE flag was added in r201932 to prevent that behaviour
on some architectures (sparc64 and powerpc64) the default was left to always
open and close the device for each open and close of a file by the loader
because it was necessary for u-boot on arm.

Since it has been added, the flag was turned on for every arches including the
u-boot loader for arm.

This also fixes netbooting on RPi3 (tested by gonzo@)

For the loader.efi it greatly speeds up netbooting

Reviewed by: emaste, gonzo, tsoome
Approved by: gonzo
MFC after: 1 month
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D8230

7 years agoMFC r308348:
hrs [Wed, 16 Nov 2016 03:54:30 +0000 (03:54 +0000)]
MFC r308348:

  Add link-layer address option in RA even for IFT_L2VLAN and IFT_BRIDGE.

  Reported by:  philip

7 years agoMFC r308347:
hrs [Wed, 16 Nov 2016 03:51:05 +0000 (03:51 +0000)]
MFC r308347:

  Fix an infinite loop at an non-responding hop when other echo replies
  are kept arriving in the waittime time window.

  Submitted by: Denny Page
  PR:           210286

7 years agoMFC r307978:
mckusick [Wed, 16 Nov 2016 01:03:42 +0000 (01:03 +0000)]
MFC r307978:
Bug 180894 reports that rm -rf on a directory causes kernel panic and reboot.
Return EINVAL rather than panic for low directory link count.

PR: 180894

7 years agoMFC r308567: Fix build when WITHOUT_BLACKLIST=yes is specified
lidl [Tue, 15 Nov 2016 23:03:57 +0000 (23:03 +0000)]
MFC r308567: Fix build when WITHOUT_BLACKLIST=yes is specified

Sponsored by: The FreeBSD Foundation

7 years agoMFC r302474 (By gnn)
hiren [Tue, 15 Nov 2016 22:18:52 +0000 (22:18 +0000)]
MFC r302474 (By gnn)

On FreeBSD there is a setsockopt option SO_USER_COOKIE which allows
setting a 32 bit value on each socket. This can be used by applications
and DTrace as a rendezvous point so that an applicaton's data can
more easily be captured at run time. Expose the user cookie via
DTrace by updating the translator in tcp.d and add a quick test
program, a TCP server, that sets the cookie on each connection
accepted.

Sponsored by:     Limelight Networks

7 years agoMFC r308416:
hselasky [Tue, 15 Nov 2016 08:54:03 +0000 (08:54 +0000)]
MFC r308416:
Add timer to watch the RQ when we are out of mbufs.

The firmware/hardware does not generate additional completion
events unless we post new buffers. Use a timer to try to post
more buffers in case we are temporarily out of mbufs. Else
the receive schedule completely stops.

Sponsored by: Mellanox Technologies

7 years agoMFC r308414:
hselasky [Tue, 15 Nov 2016 08:53:25 +0000 (08:53 +0000)]
MFC r308414:
Add more firmware related structures and update existing ones in the
MLX5 core module. Update the set and query diagnostics counter API.

Sponsored by: Mellanox Technologies

7 years agoMFC r308413:
hselasky [Tue, 15 Nov 2016 08:52:45 +0000 (08:52 +0000)]
MFC r308413:
Query flow table capabilities according to the correct capability bit
for infiniband.

Sponsored by: Mellanox Technologies

7 years agoMFC r308412:
hselasky [Tue, 15 Nov 2016 08:52:06 +0000 (08:52 +0000)]
MFC r308412:
Correct checksum fields in the "mlx5_mini_cqe8" structure. The fields
in question are currently not used.

Sponsored by: Mellanox Technologies

7 years agoMFC r308411:
hselasky [Tue, 15 Nov 2016 08:51:29 +0000 (08:51 +0000)]
MFC r308411:
Ensure the firmware is notified of any host memory allocation
failures. Else firmware commands may time out waiting for host
memory.

Sponsored by: Mellanox Technologies

7 years agoMFC r308409:
hselasky [Tue, 15 Nov 2016 08:50:42 +0000 (08:50 +0000)]
MFC r308409:
When a firmware command times out do not free the command structure to
avoid use after free.

Sponsored by: Mellanox Technologies

7 years agoMFC r308295:
gonzo [Tue, 15 Nov 2016 03:40:22 +0000 (03:40 +0000)]
MFC r308295:

[gpio] Add GPIO driver for Intel Bay Trail SoC

Bay Trail has three banks of GPIOs exposed to userland as /dev/gpiocN,
where N is 1, 2, and 3. Pins in each bank are pre-named to match names
on boards schematics: GPIO_S0_SCnn, GPIO_S0_NCnn, and GPIO_S5_nn.

Controller supports edge-triggered and level-triggered interrupts but
current version of the driver does not have interrupts support

7 years agoStop abusing from struct ifnet presence to determine the packet direction
loos [Tue, 15 Nov 2016 01:20:36 +0000 (01:20 +0000)]
Stop abusing from struct ifnet presence to determine the packet direction
for dummynet, use the correct argument for that, remove the false coment
about the presence of struct ifnet.

Fixes the input match of dummynet l2 rules.

Obtained from: pfSense
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoMFC r308428:
gonzo [Tue, 15 Nov 2016 00:28:07 +0000 (00:28 +0000)]
MFC r308428:

Refactor FDT part of gpioled driver

- Split driver in two parts: FDT and non-FDT
- Instead of reattach gpioled nodes to GPIO bus use
    gpio_pin_get_by_ofw_idx and add ofwbus and simplebus as parrent buses

Reviewed by: loos
Differential Revision: https://reviews.freebsd.org/D8233

7 years agoMFC r308581:
gonzo [Mon, 14 Nov 2016 22:39:33 +0000 (22:39 +0000)]
MFC r308581:

[rpi_ft5406] Add missing dependency on mbox_if.h

Submitted by: hselasky

7 years agoMFC r308240:
gonzo [Mon, 14 Nov 2016 22:33:57 +0000 (22:33 +0000)]
MFC r308240:

[evdev] Add evdev support to atkbd(4) driver

To enable event sourcing from atkbd kern.evdev.rcpt_mask value
should have bit 3 set.

Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D8381

7 years agoMFC r308189:
gonzo [Mon, 14 Nov 2016 21:27:18 +0000 (21:27 +0000)]
MFC r308189:

[psm] Fix choosing wrong mode for synaptic device + trackpoint

With guest trackpoint present trackpoint probing switched synaptics
device to absolute mode with different protocol instead of keeping it
in relative mode.

PR: 213757
Submitted by: Vladimir Kondratyev <wulf@cicgroup.ru>
MFC after: 1 week

7 years agoMFC r308559:
dim [Mon, 14 Nov 2016 18:57:21 +0000 (18:57 +0000)]
MFC r308559:

Pull in r263169 from upstream llvm trunk (by Tim Northover):

  AArch64: only try to use scaled fcvt ops on legal vector types.

  Before we ended up calling getSimpleVectorType on a <3 x float>, which
  asserted.

This fixes an assertion when building the print/ghostscript9-agpl-base
port for AArch64.

PR: 213865

7 years agoMFC r308487:
dim [Mon, 14 Nov 2016 18:54:31 +0000 (18:54 +0000)]
MFC r308487:

Pull in r263301 from upstream llvm trunk (by Ahmed Bougacha):

  [AArch64] Don't blindly lower f16/f128 FCCMPs.

  Instead, extend f16 (like we do when lowering a standalone SETCC),
  and let f128 be legalized to the RT calls.

  Fixes PR26803.

This fixes a fatal "Cannot select" backend error when building the
net/freerdp port for AArch64.

PR: 214380

7 years agoMFC r308133, r308134: Fix wrong copy/paste in error message.
mav [Mon, 14 Nov 2016 18:41:34 +0000 (18:41 +0000)]
MFC r308133, r308134: Fix wrong copy/paste in error message.

7 years agoMFC 308201
sephe [Mon, 14 Nov 2016 06:37:04 +0000 (06:37 +0000)]
MFC 308201

    hyperv/kvp: Don't mix message status codes and function return values.

    While I'm here, move message status codes to hv_utilreg.h, since they
    will be used by the upcoming VSS stuffs.

    Submitted by:   Hongjiang Zhang <honzhan microsoft com>
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8391

7 years agoMFC 308194
sephe [Mon, 14 Nov 2016 06:31:01 +0000 (06:31 +0000)]
MFC 308194

    hyperv: GC unused functions.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8406

7 years agoMFC 308168
sephe [Mon, 14 Nov 2016 06:28:29 +0000 (06:28 +0000)]
MFC 308168

    hyperv/vmbus: Avoid extra header copy.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8395

7 years agoMFC 308166,308167
sephe [Mon, 14 Nov 2016 06:25:22 +0000 (06:25 +0000)]
MFC 308166,308167

308166
    hyperv/hn: Move TSO packet fixup to an earlier place for if_transmit.

    While TSO packet header may be still cache-hot.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8393

308167
    hyperv/hn: Directly fill chimney sending buffer for small packets.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8394

7 years agoMFC 308164
sephe [Mon, 14 Nov 2016 06:03:29 +0000 (06:03 +0000)]
MFC 308164

    hyperv/hn: Regroup if_start related functions.

    And put them under HN_IFSTART_SUPPORT, which is by default on until
    we whack the if_start related bits from base system.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8392

7 years agoMFC 308163
sephe [Mon, 14 Nov 2016 06:00:30 +0000 (06:00 +0000)]
MFC 308163

    hyperv/hn: Rename cleaned up file.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8390

7 years agoMFC 308162
sephe [Mon, 14 Nov 2016 05:41:37 +0000 (05:41 +0000)]
MFC 308162

    hyperv/hn: Cosmetic cleanup; no functional changes.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8389

7 years agoMFC 308117-308120
sephe [Mon, 14 Nov 2016 05:37:34 +0000 (05:37 +0000)]
MFC 308117-308120

308117
    hyperv/hn: Rework temporary channel packet buffer expanding.

    And use large default temporary channel packer buffer; we really
    don't want it to be expanded at run time.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8367

308118
    hyperv/hn: Cleanup RXBUF ack processing.

    - Increase the # of retries.
    - Add comment.
    - Log error, if RXBUF ack fails.
    - Add stat for RXBUF ack failures.

    RXBUF ack really should _not_ fail...

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8368

308119
    hyperv/hn: Reset do_lro, if the hash types are not TCP related.

    Mainly because the host side only set TCPCS and IPCS even for
    UDP datagrams.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8369

308120
    hyperv/hn: Don't start shared TX taskq, if the hypervisor is not Hyper-V.

    - Move the SYSINIT to DRIVER/SECOND, i.e. after the vm_guest becomes
      determistic.
    - Minor style changes.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8370

7 years agoMFC 308018,308116
sephe [Mon, 14 Nov 2016 05:24:05 +0000 (05:24 +0000)]
MFC 308018,308116

308018
    hyeprv/hn: Rename cleaned up RNDIS header file.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8360

308116
    hyperv/hn: Rename cleaned up RNDIS source file.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8361

7 years agoMFC 308013-308017
sephe [Mon, 14 Nov 2016 03:49:28 +0000 (03:49 +0000)]
MFC 308013-308017

308013
    hyperv/hn: Nuke unnecessary indirection.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8355

308014
    hyperv/hn: Reorganize RX path; mainly pull non-control code path up

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8356

308015
    hyperv/hn: Pull data path code up.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8357

308016
    hyperv/hn: Cleanup RNDIS related files.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8358

308017
    hyperv/hn: Change header guardian; in preparation for the upcoming rename.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8359

7 years agoMFC 308011,308012
sephe [Mon, 14 Nov 2016 03:36:59 +0000 (03:36 +0000)]
MFC 308011,308012

308011
    hyperv/hn: Rename cleaned up NVS header file.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8353

308012
    hyperv/hn: Rename cleaned up NVS source file.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8354

7 years agoMFC 307989-307991,308010
sephe [Mon, 14 Nov 2016 03:19:17 +0000 (03:19 +0000)]
MFC 307989-307991,308010

307989
    hyperv/hn: Move hn_softc to if_hnvar.h

    While I'm here, use consistent macro names.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8345

307990
    hyperv/hn: Move send context to NVS domain.

    Since all sends are encapsulated in NVS messages.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8346

307991
    hyperv/hn: NVS inclusion cleanup and forward declare functions.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8347

308010
    hyperv/hn: Change header guardian; in preparation for the upcoming rename.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8352

7 years agoMFC 307985-307988
sephe [Mon, 14 Nov 2016 03:14:43 +0000 (03:14 +0000)]
MFC 307985-307988

307985
    hyperv/hn: Nuke unnecessary M_NETVSC

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8340

307986
    hyperv/hn: Move %b format string for capabilities near their definition.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8341

307987
    hyperv/hn: Define empty packet filter.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8342

307988
    hyperv/hn: Shuffle chimney sending buffer alloc/free around.

    This paves way for more chimney sending buffer reorganization.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8343

7 years agoMFC 307983
sephe [Mon, 14 Nov 2016 03:07:48 +0000 (03:07 +0000)]
MFC 307983

    hyperv/hn: Properly configure RSS according to RSS capabilities

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8338

7 years agoMFC 307952,307953,308278
sephe [Mon, 14 Nov 2016 03:04:54 +0000 (03:04 +0000)]
MFC 307952,307953,308278

307952
    hyperv/vmbus: Add missing white space.

    Submitted by:   QianYue You <t-youqi microsoft com>
    Sponsored by:   Microsoft

307953
    hyperv/vmbus: Implement vmbus_chan_printf.

    And use it for vmbus channel logging, which can log the channel
    owner's name properly, instead of vmbus0.

    Submitted by:   QianYue You <t-youqi microsoft com>
    Sponsored by:   Microsoft

308278
    hyperv/vmbus: Reset ch_dev, once the child is deleted.

    So it will not be mis-used later on, e.g. in vmbus_chan_printf().

    Submitted by:   dexuan
    Reported by:    dexuan
    Sponsored by:   Microsoft

7 years agoMFC 307893
sephe [Mon, 14 Nov 2016 03:01:30 +0000 (03:01 +0000)]
MFC 307893

    hyperv/hn: Set baudrate properly

    PR:             208931
    Submitted by:   Eugene Grosbein <ports grosbein net>
    Reported by:    Eugene Grosbein <ports grosbein net>
    Sponsored by:   Microsoft

7 years agoMFC r308358:
ae [Sun, 13 Nov 2016 16:20:06 +0000 (16:20 +0000)]
MFC r308358:
  Initialize ip6 pointer before use.

  PR: 214169

7 years agoMFC r308173:
mav [Sat, 12 Nov 2016 23:53:37 +0000 (23:53 +0000)]
MFC r308173:
Fix ZIL records ordering when ZVOL opened both with and without FSYNC.

Before this an earlier writes to a ZVOL opened without FSYNC could get to
ZIL after later writes to the same ZVOL opened with FSYNC.  Fix this by
replicating functionality of ZPL (zv_sync_cnt equivalent to z_sync_cnt),
marking all log records sync if anybody opened the ZVOL with FSYNC.

7 years agoMFC r308169:
mav [Sat, 12 Nov 2016 23:50:48 +0000 (23:50 +0000)]
MFC r308169:
Pass to zvol_log_truncate() same sync values as to zvol_log_write().

Surplus marking of TX_TRUNCATE records as sync could result in putting them
into ZIL before previous writes if ones were async.

7 years agoMFC r308055: Add vdev_reopening support to vdev_geom.
mav [Sat, 12 Nov 2016 23:39:08 +0000 (23:39 +0000)]
MFC r308055: Add vdev_reopening support to vdev_geom.

It allows to avoid extra GEOM providers flapping without significant need.
Since GEOM got resize support, we don't need to reopen provider to get new
size.  If provider was orphaned and no longer valid, ZFS should already
know that, and in such case reopen should be done in full as expected.

7 years agoMFC r308051: Matching GUIDs, handle possible race on vdev detach.
mav [Sat, 12 Nov 2016 23:37:26 +0000 (23:37 +0000)]
MFC r308051: Matching GUIDs, handle possible race on vdev detach.

In case of vdev detach, causing top level mirror vdev destruction, leaf
vdev changes its GUID to one of the destroyed mirror, that creates race
condition when GUID in vdev label may not match one in the pool config.

This change replicates logic nuance of vdev_validate() by adding special
exception, matching the vdev GUID against the top level vdev GUID.
Since this exception is not completely reliable (may give false positives
if we fail to erase label on detached vdev), use it only as last resort.

Quick way to reproduce this scenario now is detach vdev from a pool with
enabled autoextend.  During vdev detach autoextend logic tries to reopen
remaining vdev, that always fails now since in-memory configuration is
already updated, while on-disk labels are not yet.

7 years agoMFC r308049: Improve few debugging log messages.
mav [Sat, 12 Nov 2016 23:35:40 +0000 (23:35 +0000)]
MFC r308049: Improve few debugging log messages.

7 years agoMFC r307318: MFV r307314:
mav [Sat, 12 Nov 2016 23:29:09 +0000 (23:29 +0000)]
MFC r307318: MFV r307314:
6988 spa_sync() spends half its time in dmu_objset_do_userquota_updates

Using a benchmark which creates 2 million files in one TXG, I observe
that the thread running spa_sync() is on CPU almost the entire time we
are syncing, and therefore can be a performance bottleneck. About 50% of
the time in spa_sync() is in dmu_objset_do_userquota_updates().

The problem is that dmu_objset_do_userquota_updates() calls
zap_increment_int(DMU_USERUSED_OBJECT) once for every file that was
modified (or created). In this benchmark, all the files are owned by the
same user/group, so all 2 million calls to zap_increment_int() are
modifying the same entry in the zap. The same issue exists for the
DMU_GROUPUSED_OBJECT.

We should keep an in-memory map from user to space delta while we are
syncing, and when we finish, iterate over the in-memory map and modify
the ZAP once per entry. This reduces the number of calls to
zap_increment_int() from "number of objects modified" to "number of
owners/groups of modified files".

This reduced the time spent in spa_sync() in the file create benchmark
by ~33%, from 11 seconds to 7 seconds.

Closes #107

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: Ned Bass <bass6@llnl.gov>
Reviewed by: Jinshan Xiong <jinshan.xiong@intel.com>
Author: Matthew Ahrens <mahrens@delphix.com>

openzfs/openzfs@5fc46359c569369d87728ca09f8705cdff6cc8e2

7 years agoFix relnotes build.
gjb [Sat, 12 Nov 2016 18:49:46 +0000 (18:49 +0000)]
Fix relnotes build.

Sponsored by: The FreeBSD Foundation

7 years agoMFC r308437 and r308461:
hselasky [Sat, 12 Nov 2016 17:27:28 +0000 (17:27 +0000)]
MFC r308437 and r308461:
Range check the jitter values to avoid bogus sample rate adjustments.
The expected deviation should not be more than 1Hz per second. The USB
v2.0 specification also mandates this requirement. Refer to chapter
5.12.4.2 about feedback.

Allow higher sample rates to have more jitter than lower ones.

PR: 208791

7 years agoMFC r308029:
kib [Fri, 11 Nov 2016 20:31:23 +0000 (20:31 +0000)]
MFC r308029:
Handle pmap_enter() over an existing 4/2M page in KVA on i386.

7 years agoMFC r308028:
kib [Fri, 11 Nov 2016 20:27:00 +0000 (20:27 +0000)]
MFC r308028:
Use buffer pager for cd9660.

For now, on stable/11, default is to use generic getpages() as before.

7 years agoMFC r308027:
kib [Fri, 11 Nov 2016 20:24:54 +0000 (20:24 +0000)]
MFC r308027:
Use buffer pager for msdosfs.

For now, on stable/11, default is to use generic getpages() as before.

7 years agoMFC r308026:
kib [Fri, 11 Nov 2016 20:18:08 +0000 (20:18 +0000)]
MFC r308026:
Generalize UFS buffer pager.

MFC r308442:
Tweaks for the buffer pager.

7 years agoMFC r308025:
kib [Fri, 11 Nov 2016 19:40:34 +0000 (19:40 +0000)]
MFC r308025:
Enable vn_io_fault() deadlock avoidance for msdosfs.

7 years agoMFC r308024:
kib [Fri, 11 Nov 2016 19:37:51 +0000 (19:37 +0000)]
MFC r308024:
Ensure that cluster allocations never allocate clusters outside the
volume limits.

7 years agoMFC r308023:
kib [Fri, 11 Nov 2016 19:35:58 +0000 (19:35 +0000)]
MFC r308023:
If the fatchain() call in chainalloc() returned an error, revert
marking the cluster run as in-use.

7 years agoMFC r308022:
kib [Fri, 11 Nov 2016 19:33:26 +0000 (19:33 +0000)]
MFC r308022:
Use symbolic name for the value of fully free word in pm_inusemap.

7 years agoMFC r308021:
kib [Fri, 11 Nov 2016 19:31:06 +0000 (19:31 +0000)]
MFC r308021:
Use symbolic name for the free cluster number.

7 years agoMFC r308020:
kib [Fri, 11 Nov 2016 19:29:01 +0000 (19:29 +0000)]
MFC r308020:
Fix comment formatting.

7 years agoMFC r308019:
kib [Fri, 11 Nov 2016 19:26:41 +0000 (19:26 +0000)]
MFC r308019:
Remove useless NULL check.

7 years agoMFC 307845
sephe [Fri, 11 Nov 2016 09:03:13 +0000 (09:03 +0000)]
MFC 307845

    hyperv/ic: Rework framework/message version negotiation.

    Submitted by:   Hongjiang Zhang <honzhan microsoft com>
    Modified by:    sephe
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8280

7 years agoMFC 307844
sephe [Fri, 11 Nov 2016 09:00:29 +0000 (09:00 +0000)]
MFC 307844

    hyperv/hn: Nuke unused forward declaration.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8314

7 years agoMFC 307843
sephe [Fri, 11 Nov 2016 08:57:52 +0000 (08:57 +0000)]
MFC 307843

    hyperv/hn: Fix RX filter settings.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8313

7 years agoMFC 307840,307842
sephe [Fri, 11 Nov 2016 08:55:45 +0000 (08:55 +0000)]
MFC 307840,307842

307840
    hyperv/hn: Properly handle synthetic parts reattach failure.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8310

307842
    hyperv/hn: Start link status check, if no network changes were pending.

    Link status check is much more lightweight than network change detection.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8311

7 years agoMFC 307838,307839
sephe [Fri, 11 Nov 2016 08:52:23 +0000 (08:52 +0000)]
MFC 307838,307839

307838
    hyperv/hn: Move chimney buffer index and size to txdesc.

    All RNDIS control messages have used SG list for a while.  This makes
    the send context suitable for further refactoring.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8308

307839
    hyperv/hn: Fix chimney sending buffer leakage upon NVS sending failure.

    This will not happen in real world, since TX consumption of the vmbus
    TX bufring is limitted.  Better safe than sorry.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8309

7 years agoMFC 307710-307712,307714
sephe [Fri, 11 Nov 2016 08:49:28 +0000 (08:49 +0000)]
MFC 307710-307712,307714

307710
    hyperv/hn: Always query RSS capabilities.

    - This avoid distributing NDIS version check.
    - Only NDIS 6.20 required (earlier NDIS uses different indirect table
      format).

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8291

307711
    hyperv/hn: Check NVS version for HASHVAL pktinfo on sending path.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8293

307712
    hyperv/hn: Add network change support.

    Currently the network change is simulated by link status changes.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8295

307714
    hyperv/hn: Function renaming; consistent w/ hardware capabilities query.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8296

7 years agoMFC 307624
sephe [Fri, 11 Nov 2016 08:43:34 +0000 (08:43 +0000)]
MFC 307624

    hyperv/vmbus: Expose channel management taskqueue for driver to use.

    MFC after:      3 days
    Sponsored by:   Microsoft

7 years agoMFC r308225: dev/cpuctl: put debug output under CPUCTL_DEBUG rather than DEBUG
avg [Thu, 10 Nov 2016 11:14:46 +0000 (11:14 +0000)]
MFC r308225: dev/cpuctl: put debug output under CPUCTL_DEBUG rather than DEBUG

7 years agoMFC r308314:
pfg [Wed, 9 Nov 2016 18:00:50 +0000 (18:00 +0000)]
MFC r308314:
sed(1): add LEGACY_BSDSED_COMPAT compile-time flag.

In r297602, which included a __FreeBSD_version bump to 1100105, we changed
sed 'i' and 'a' from discarding whitespaces to conform with what GNU and
sysvish sed do.

There are arguments in favor of keeping the old behavior but the new
behavior is also useful for migration purposes. It seems important to at
least consider the case of developers depending on the previous behavior
so add a CFLAG to enable the old behavior.

PR: 213474

7 years agoMFC r308228:
kib [Wed, 9 Nov 2016 16:46:57 +0000 (16:46 +0000)]
MFC r308228:
Remove remnants of the recursive sleep support.

7 years agoMFC r308211:
kib [Wed, 9 Nov 2016 16:45:06 +0000 (16:45 +0000)]
MFC r308211:
Remove tautological casts.

7 years agoMFC r308210:
kib [Wed, 9 Nov 2016 16:42:15 +0000 (16:42 +0000)]
MFC r308210:
Style fixes.

7 years agoMFC r308375:
dim [Wed, 9 Nov 2016 08:08:02 +0000 (08:08 +0000)]
MFC r308375:

Pull in r278002 from upstream llvm trunk (by Silviu Baranga):

  [AArch64] PR28877: Don't assume we're running after legalization when
  creating vcvtfp2fxs

  Summary:
  The DAG combine transformation that was generating the
  aarch64_neon_vcvtfp2fxs node was assuming that all inputs where legal
  and wasn't accounting that the input could be a v4f64 if we're trying
  to do the transformation before legalization. We now bail out in this
  case.

  All illegal types besides v4f64 were already rejected.

  Fixes https://llvm.org/bugs/show_bug.cgi?id=28877

  Reviewers: jmolloy

  Subscribers: aemerson, rengolin, llvm-commits

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

This fixes several ports on AArch64.

Requested by: andrew

7 years agoMFC: r307891
rmacklem [Tue, 8 Nov 2016 21:15:50 +0000 (21:15 +0000)]
MFC: r307891
Fix the man page to reflect the change done by r307890 to mountd.c
so that the "-n" option uses the sysctl for the new NFS server.
This is a content change.

7 years agoMFC: r307890
rmacklem [Tue, 8 Nov 2016 21:09:48 +0000 (21:09 +0000)]
MFC: r307890
mountd(8) was erroneously setting the sysctl for the old NFS server
when the new/default NFS server was running, for the "-n" option.

This patch fixes the problem for head and stable/11. For stable/10 the
patch will need to be modified when MFC'd, since the stable/10 mountd.c
handles both old and new NFS servers.
Since the new NFS server uses vfs.nfsd.nfs_privport == 0 by default,
there wouldn't have been many users affected by the code not setting
it to 0 when the "-n" option was specified.

7 years agoMFC r307857: Fix panic after ZVOL renamed to name invalid for DEVFS.
mav [Tue, 8 Nov 2016 20:57:46 +0000 (20:57 +0000)]
MFC r307857: Fix panic after ZVOL renamed to name invalid for DEVFS.

7 years agoMFC r308175: Revisit blacklistd support in ftpd
lidl [Tue, 8 Nov 2016 20:12:13 +0000 (20:12 +0000)]
MFC r308175: Revisit blacklistd support in ftpd

Enhance blacklistd support to not log anything by default,
unless blacklistd support is enabled on the command line.
Document new flag in man page, cleanup patches to be less
intrusive in code.

Sponsored by: The FreeBSD Foundation

7 years agoMFC r307866:
kib [Tue, 8 Nov 2016 09:51:55 +0000 (09:51 +0000)]
MFC r307866:
Handle broadcast NMIs.

MFC r307880:
Follow-up to r307866.

MFC r308030:
Use correct cpu id in the banner.

7 years agoMFC r307903,307904,308039,308050: vmm/svm: iopm_bitmap and msr_bitmap
avg [Tue, 8 Nov 2016 07:18:33 +0000 (07:18 +0000)]
MFC r307903,307904,308039,308050: vmm/svm: iopm_bitmap and msr_bitmap
must be contiguous in physical memory

7 years agoMFC 305836: Remove 'cpu' and 'cpu_class' on amd64.
jhb [Tue, 8 Nov 2016 06:13:22 +0000 (06:13 +0000)]
MFC 305836: Remove 'cpu' and 'cpu_class' on amd64.

The 'cpu' and 'cpu_class' variables were always set to the same value
on amd64 and are legacy holdovers from i386.  Remove them entirely on
amd64.

Requested by: kib (MFC)

7 years agoMFC r307966:
jch [Mon, 7 Nov 2016 18:29:21 +0000 (18:29 +0000)]
MFC r307966:

Remove an extraneous call to soisconnected() in syncache_socket(),
introduced with r261242.  The useful and expected soisconnected()
call is done in tcp_do_segment().

Has been found as part of unrelated PR:212920 investigation.

Improve slightly (~2%) the maximum number of TCP accept per second.

Tested by: kevin.bowling_kev009.com, jch
Approved by: gnn, hiren
MFC after: 1 week
Sponsored by: Verisign, Inc
Differential Revision: https://reviews.freebsd.org/D8072

7 years agoMerge bde improvements for ddb on x86, mostly for single-stepping and
kib [Mon, 7 Nov 2016 12:10:17 +0000 (12:10 +0000)]
Merge bde improvements for ddb on x86, mostly for single-stepping and
vm86 mode.

MFC r304085 (by bde):
Fix the variables $esp, $ds, $es, $fs, $gs and $ss in vm86 mode.  Fix
PC_REGS() so that printing of instructions works in some useful cases.

MFC r304962 (by bde):
Expand error messages: print symbol names, parentheses and shift tokens,
and negative shift counts.  Fix error messages.

MFC r305612 (by bde):
Fix single-stepping of instructions emulated by vm86.

MFC r305661 (by bde):
Give the full syntax of the 'count' arg for all commmands that support
it. Give the full syntax of the 'addr' arg for these commands and some
others.  Rename it from 'address' for the generic command. Fix
description of how 'count' is supposed to work for the 'break'
command.

Don't (mis)describe the syntax of the comma for the 'step' command.

Expand the description for the generic command.

Give the full syntax for the 'examine' command.  It was also missing
the possible values for the modifier.

MFC r305663 (by bde):
Fix stopping when the specified breakpoint count is reached.

MFC r305665 (by bde):
Pass the trap type and code down from db_trap() to db_stop_at_pc() so
that the latter can easily determine what the trap type actually is
after callers are fixed to encode the type unambigously.

MFC r305807 (by bde):
Use the MI macro TRAPF_USERMODE() instead of open-coded checks for
SEL_UPL and sometimes PSL_VM.  Fix logic errors in treating vm86
bioscall mode as kernel mode.  The main place checked all the
necessary flags, but put the necessary parentheses for the PSL_VM and
PCB_VM86CALL checks in the wrong place.

MFC r305811 (by bz):
Try to fix LINT builds after r305807.

MFC r305840 (by bde):
Abort single stepping in ddb if the trap is not for single-stepping.

MFC r305862 (by bde):
Ifdef the new dr6 variable for KDB.

MFC r305864 (by bde):
Statically initialize the run mode to the one that will become current
on first entry. Don't reset to the run mode to STEP_NONE when
stopping, and remove STEP_NONE.

MFC r305865 (by bde):
Fix decoding of tf_rsp on amd64, and move TF_HAS_STACKREGS() to the
i386-only section, and fix a comment about the amd64 kernel trapframe
not having stackregs.

MFC r305897 (by bde):
Silently ignore unexpected single-step traps.

MFC r306311 (by bde):
Determine the operand/address size of %cs in a new function
db_segsize().  Use db_segsize() to set the default operand/address
size for disassembling.

Fix db_print_loc_and_inst() to ask for the normal format and not the
alternate in normal operation. Use db_segsize() to avoid trying to
print a garbage stack trace if %cs is 16 bits.

7 years agoMFC r302797 (by markj):
kib [Mon, 7 Nov 2016 11:16:23 +0000 (11:16 +0000)]
MFC r302797 (by markj):
Document DDB's "alltrace" and "show all trace" commands.

7 years agoMFC r307518:
hselasky [Mon, 7 Nov 2016 08:36:06 +0000 (08:36 +0000)]
MFC r307518:
Fix device delete child function.

When detaching device trees parent devices must be detached prior to
detaching its children. This is because parent devices can have
pointers to the child devices in their softcs which are not
invalidated by device_delete_child(). This can cause use after free
issues and panic().

Device drivers implementing trees, must ensure its detach function
detaches or deletes all its children before returning.

While at it remove now redundant device_detach() calls before
device_delete_child() and device_delete_children(), mostly in
the USB controller drivers.

Tested by: Jan Henrik Sylvester <me@janh.de>
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D8070

7 years agoMFC r308031:
hselasky [Mon, 7 Nov 2016 08:22:44 +0000 (08:22 +0000)]
MFC r308031:
Fix indentation and remove duplicate queue stopped stats increment.

Found by: Ryan Stone <rysto32@gmail.com>
Sponsored by: Mellanox Technologies