]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
7 years agoMFC r306719:
sevan [Sun, 16 Oct 2016 23:12:07 +0000 (23:12 +0000)]
MFC r306719:
Document origins of expr & authors
http://minnie.tuhs.org/cgi-bin/utree.pl?file=PWB1/usr/man/man1/expr.1

PR:             173979
Approved by:    bcr (mentor)
Differential Revision:  https://reviews.freebsd.org/D8104

git-svn-id: svn://svn.freebsd.org/base/stable/10@307418 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r306718:
sevan [Sun, 16 Oct 2016 23:09:04 +0000 (23:09 +0000)]
MFC r306718:
Add history section for echo(1)
Sourced using the draft copy of the second edition manual
http://www.tuhs.org/Archive/PDP-11/Distributions/research/1972_stuff/unix_2nd_edition_manual.pdf

PR: 211785
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D8104

git-svn-id: svn://svn.freebsd.org/base/stable/10@307415 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r306615:
sevan [Sun, 16 Oct 2016 22:52:05 +0000 (22:52 +0000)]
MFC r306615:
sconfig appeared in FreeBSD 5.2.

PR:             212550
Approved by:    bcr (mentor)
Differential Revision:  https://reviews.freebsd.org/D8105

git-svn-id: svn://svn.freebsd.org/base/stable/10@307412 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r306614:
sevan [Sun, 16 Oct 2016 22:33:03 +0000 (22:33 +0000)]
MFC r306614:
Note the version PF first appeared in FreeBSD & from which version it was ported from.
Address the contractions raised by igor.

PR: 212574
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D8105

git-svn-id: svn://svn.freebsd.org/base/stable/10@307409 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r306613:
sevan [Sun, 16 Oct 2016 22:31:51 +0000 (22:31 +0000)]
MFC r306613:
Note the change of name in FreeBSD 5.0.

PR:             212542
Approved by:    bcr (mentor)
Differential Revision:  https://reviews.freebsd.org/D8105

git-svn-id: svn://svn.freebsd.org/base/stable/10@307408 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r306612:
sevan [Sun, 16 Oct 2016 22:27:16 +0000 (22:27 +0000)]
MFC r306612:
Note the name change from mount_null to mount_nullfs in FreeBSD 5.0.

PR:             212541
Approved by:    bcr (mentor)
Differential Revision:  https://reviews.freebsd.org/D8105

git-svn-id: svn://svn.freebsd.org/base/stable/10@307406 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r306611:
sevan [Sun, 16 Oct 2016 22:22:46 +0000 (22:22 +0000)]
MFC r306611:
Amend history to mention predecessor originated from 386BSD[1] & current implementation from NetBSD[2].
Reword history since the utility was renamed once more in FreeBSD 5.0.
Separate out author & historical information regarding character code conversion.
Add AUTHORS section.

[1] https://groups.google.com/forum/#!search/mount_pcfs.c/comp.unix.bsd/9qhH0v1tZm0/inlPnXZj_2sJ
[2] http://cvsweb.netbsd.org/bsdweb.cgi/src/sbin/mount_msdos/mount_msdos.c?rev=1.6&content-type=text/x-cvsweb-markup

PR: 212536
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D8105

git-svn-id: svn://svn.freebsd.org/base/stable/10@307404 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r267667:
sevan [Sun, 16 Oct 2016 22:02:50 +0000 (22:02 +0000)]
MFC r267667:
use .Mt to mark up email addresses consistently (part1)

PR: 191174
Submitted by: Franco Fichtner  <franco at lastsummer.de>

git-svn-id: svn://svn.freebsd.org/base/stable/10@307403 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r282970: Close some potential races around socket start/close.
mav [Sat, 15 Oct 2016 17:39:40 +0000 (17:39 +0000)]
MFC r282970: Close some potential races around socket start/close.

There are some reports about panics on ic->ic_socket NULL derefence.
This kind of races is the only way I can imagine it to happen.

git-svn-id: svn://svn.freebsd.org/base/stable/10@307378 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r307038
arybchik [Sat, 15 Oct 2016 13:45:12 +0000 (13:45 +0000)]
MFC r307038

sfxge(4): update external port mapping for Medford

Extend the mapping table for external port numbering to support port modes
which output to the second external port only. Where supported, map from
the current port mode rather than inferring from all the available modes.
Updated comments for clarity.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@307373 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r306944
arybchik [Sat, 15 Oct 2016 13:44:13 +0000 (13:44 +0000)]
MFC r306944

sfxge(4): sync tlv_layout.h with firmwaresrc and update port-mode
definition use

It fixes driver attach issue to a new firmware which reports a new
port-modes.

Submitted by:   Tom Millington <tmillington at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@307371 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r306853
bapt [Sat, 15 Oct 2016 12:41:41 +0000 (12:41 +0000)]
MFC r306853

Import tzdata 2016g

git-svn-id: svn://svn.freebsd.org/base/stable/10@307362 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r306852
bapt [Sat, 15 Oct 2016 12:38:21 +0000 (12:38 +0000)]
MFC r306852

Incorporate a change from OpenBSD by millert@OpenBSD.org

Don't warn about valid time zone abbreviations.  POSIX
through 2000 says that an abbreviation cannot start with ':', and
cannot contain ',', '-', '+', NUL, or a digit.  POSIX from 2001
on changes this rule to say that an abbreviation can contain only
'-', '+', and alphanumeric characters from the portable character
set in the current locale.  To be portable to both sets of rules,
an abbreviation must therefore use only ASCII letters."  Adapted
from tzcode2015f.

This is needed to be able to update tzdata to a newer version

git-svn-id: svn://svn.freebsd.org/base/stable/10@307359 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r297289, r300542, r306854
bapt [Sat, 15 Oct 2016 12:28:14 +0000 (12:28 +0000)]
MFC r297289, r300542, r306854

Update pci_vendors to 2016-10-03

git-svn-id: svn://svn.freebsd.org/base/stable/10@307355 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoBump __FreeBSD_version for todays ZFS merges.
mav [Fri, 14 Oct 2016 18:43:17 +0000 (18:43 +0000)]
Bump __FreeBSD_version for todays ZFS merges.

git-svn-id: svn://svn.freebsd.org/base/stable/10@307331 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305563: MFV r305562: 7259 DS_FIELD_LARGE_BLOCKS is unused
mav [Fri, 14 Oct 2016 07:47:07 +0000 (07:47 +0000)]
MFC r305563: MFV r305562: 7259 DS_FIELD_LARGE_BLOCKS is unused

The DS_FIELD_LARGE_BLOCKS macro has been unused since the integration of
this patch:

    commit ca0cc3918a1789fa839194af2a9245f801a06b1a
    Author: Matthew Ahrens <mahrens@delphix.com>
    Date:   Fri Jul 24 09:53:55 2015 -0700

        5959 clean up per-dataset feature count code
        Reviewed by: Toomas Soome <tsoome@me.com>
        Reviewed by: George Wilson <george@delphix.com>
        Reviewed by: Alex Reece <alex@delphix.com>
        Approved by: Richard Lowe <richlowe@richlowe.net>

This patch simply removes this macro from dsl_dataset.h.

Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Author: Matthew Ahrens <mahrens@delphix.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@307300 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305561: MFV r305560:
mav [Fri, 14 Oct 2016 07:45:10 +0000 (07:45 +0000)]
MFC r305561: MFV r305560:
7278 tuning zfs_arc_max does not impact arc_c_min

When changing zfs_arc_max (e.g. as zdb does), it may be set to less
than the default arc_c_min. arc_c_min should decrease to not be more than
arc_c_max, but it doesn't; therefore tuning of arc_c_max is ineffective.

Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Paul Dagnelie <paul.dagnelie@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Author: Matthew Ahrens <mahrens@delphix.com>

openzfs/openzfs@608764beadaf4bb71c5d8fe1818e8392ac66a61b

git-svn-id: svn://svn.freebsd.org/base/stable/10@307298 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305456 (by avg): fix zfs pool creation accidentally broken by r305331
mav [Fri, 14 Oct 2016 07:43:28 +0000 (07:43 +0000)]
MFC r305456 (by avg): fix zfs pool creation accidentally broken by r305331

The upstream change introduced a new load state, SPA_LOAD_CREATE,
and vdev_geom code needs to be aware of it.

git-svn-id: svn://svn.freebsd.org/base/stable/10@307296 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305342: Missed FreeBSD-specific piece of r305338.
mav [Fri, 14 Oct 2016 07:41:44 +0000 (07:41 +0000)]
MFC r305342: Missed FreeBSD-specific piece of r305338.

git-svn-id: svn://svn.freebsd.org/base/stable/10@307294 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305340: MFC r305337:
mav [Fri, 14 Oct 2016 07:40:20 +0000 (07:40 +0000)]
MFC r305340: MFC r305337:
7004 dmu_tx_hold_zap() does dnode_hold() 7x on same object

Using a benchmark which has 32 threads creating 2 million files in the
same directory, on a machine with 16 CPU cores, I observed poor
performance. I noticed that dmu_tx_hold_zap() was using about 30% of
all CPU, and doing dnode_hold() 7 times on the same object (the ZAP
object that is being held).

dmu_tx_hold_zap() keeps a hold on the dnode_t the entire time it is
running, in dmu_tx_hold_t:txh_dnode, so it would be nice to use the
dnode_t that we already have in hand, rather than repeatedly calling
dnode_hold(). To do this, we need to pass the dnode_t down through
all the intermediate calls that dmu_tx_hold_zap() makes, making these
routines take the dnode_t* rather than an objset_t* and a uint64_t
object number. In particular, the following routines will need to have
analogous *_by_dnode() variants created:

dmu_buf_hold_noread()
dmu_buf_hold()
zap_lookup()
zap_lookup_norm()
zap_count_write()
zap_lockdir()
zap_count_write()

This can improve performance on the benchmark described above by 100%,
from 30,000 file creations per second to 60,000. (This improvement is on
top of that provided by working around the object allocation issue. Peak
performance of ~90,000 creations per second was observed with 8 CPUs;
adding CPUs past that decreased performance due to lock contention.) The
CPU used by dmu_tx_hold_zap() was reduced by 88%, from 340 CPU-seconds
to 40 CPU-seconds.

Sponsored by: Intel Corp.

Closes #109

Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Ned Bass <bass6@llnl.gov>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Author: Matthew Ahrens <mahrens@delphix.com>

openzfs/openzfs@d3e523d489a169ab36f9ec1b2a111a60a5563a9f

git-svn-id: svn://svn.freebsd.org/base/stable/10@307292 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305339: MFV r305336: 7247 zfs receive of deduplicated stream fails
mav [Fri, 14 Oct 2016 07:37:08 +0000 (07:37 +0000)]
MFC r305339: MFV r305336: 7247 zfs receive of deduplicated stream fails

This resolves two 'zfs recv' issues. First, when receiving into an
existing filesystem, a snapshot created during the receive process is
not added to the guid->dataset map for the stream, resulting in failed
lookups for deduped streams when a WRITE_BYREF record refers to a
snapshot received earlier in the stream. Second, the newly created
snapshot was also not set properly, referencing the snapshot before the
new receiving dataset rather than the existing filesystem.

Closes #159

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Author: Chris Williamson <chris.williamson@delphix.com>

openzfs/openzfs@b09697c8c18be68abfe538de9809938239402ae8

git-svn-id: svn://svn.freebsd.org/base/stable/10@307289 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305338: MFV r305335: 7003 zap_lockdir() should tag hold
mav [Fri, 14 Oct 2016 07:35:43 +0000 (07:35 +0000)]
MFC r305338: MFV r305335: 7003 zap_lockdir() should tag hold

zap_lockdir() / zap_unlockdir() should take a "void *tag" argument which
tags the hold on the zap. This will help diagnose programming errors
which misuse the hold on the ZAP.

Sponsored by: Intel Corp.

Closes #108

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Author: Matthew Ahrens <mahrens@delphix.com>

openzfs/openzfs@0780b3eab5a2c13e04328b39ecd2a6d0d3c4f7cb

git-svn-id: svn://svn.freebsd.org/base/stable/10@307287 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305334: MFV r304157:
mav [Fri, 14 Oct 2016 07:32:24 +0000 (07:32 +0000)]
MFC r305334: MFV r304157:
7230 add assertions to dmu_send_impl() to verify that stream includes BEGIN and
END records

illumos/illumos-gate@12b90ee2d3b10689fc45f4930d2392f5fe1d9cfa
https://github.com/illumos/illumos-gate/commit/12b90ee2d3b10689fc45f4930d2392f5f
e1d9cfa

https://www.illumos.org/issues/7230
  A test failure occurred where a send stream had only a BEGIN record. This
  should not be possible if the send returns without error. Prevented this from
  happening in the future by adding an assertion to dmu_send_impl() to verify
  that if the function returns 0 (success) both a BEGIN and END record are
  present. Did this by adding flags to dmu_sendarg_t (indicating whether BEGIN o
r
  END records sent), having dump_record() set flags appropriately, adding VERIFY
  statement to dmu_send_impl().

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matt Krantz <matt.krantz@delphix.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@307285 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305333: MFV r304156: 7235 remove unused func dsl_dataset_set_blkptr
mav [Fri, 14 Oct 2016 07:30:54 +0000 (07:30 +0000)]
MFC r305333: MFV r304156: 7235 remove unused func dsl_dataset_set_blkptr

illumos/illumos-gate@bd56f80007857b960e0981ed0797ad8ec844a96b
https://github.com/illumos/illumos-gate/commit/bd56f80007857b960e0981ed0797ad8ec
844a96b

https://www.illumos.org/issues/7235
  The function dsl_dataset_set_blkptr() is unused. We should remove it.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@307283 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305332: MFV r304159: 7277 zdb should be able to print zfs_dbgmsg's
mav [Fri, 14 Oct 2016 07:29:23 +0000 (07:29 +0000)]
MFC r305332: MFV r304159: 7277 zdb should be able to print zfs_dbgmsg's

illumos/illumos-gate@29bdd2f916366ece37c4748bca6b3d61f57a223b
https://github.com/illumos/illumos-gate/commit/29bdd2f916366ece37c4748bca6b3d61f
57a223b

https://www.illumos.org/issues/7277
  ztest always prints the debug messages (zfs_dbgmsg()) by calling
  zfs_dbgmsg_print(). We should add a flag to zdb to make it do this as well
  before exiting.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@307281 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305331: MFV r304155:
mav [Fri, 14 Oct 2016 07:27:40 +0000 (07:27 +0000)]
MFC r305331: MFV r304155:
7090 zfs should improve allocation order and throttle allocations

illumos/illumos-gate@0f7643c7376dd69a08acbfc9d1d7d548b10c846a
https://github.com/illumos/illumos-gate/commit/0f7643c7376dd69a08acbfc9d1d7d548b
10c846a

https://www.illumos.org/issues/7090
  When write I/Os are issued, they are issued in block order but the ZIO pipelin
e
  will drive them asynchronously through the allocation stage which can result i
n
  blocks being allocated out-of-order. It would be nice to preserve as much of
  the logical order as possible.
  In addition, the allocations are equally scattered across all top-level VDEVs
  but not all top-level VDEVs are created equally. The pipeline should be able t
o
  detect devices that are more capable of handling allocations and should
  allocate more blocks to those devices. This allows for dynamic allocation
  distribution when devices are imbalanced as fuller devices will tend to be
  slower than empty devices.
  The change includes a new pool-wide allocation queue which would throttle and
  order allocations in the ZIO pipeline. The queue would be ordered by issued
  time and offset and would provide an initial amount of allocation of work to
  each top-level vdev. The allocation logic utilizes a reservation system to
  reserve allocations that will be performed by the allocator. Once an allocatio
n
  is successfully completed it's scheduled on a given top-level vdev. Each top-
  level vdev maintains a maximum number of allocations that it can handle
  (mg_alloc_queue_depth). The pool-wide reserved allocations (top-levels *
  mg_alloc_queue_depth) are distributed across the top-level vdevs metaslab
  groups and round robin across all eligible metaslab groups to distribute the
  work. As top-levels complete their work, they receive additional work from the
  pool-wide allocation queue until the allocation queue is emptied.

Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <paul.dagnelie@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: George Wilson <george.wilson@delphix.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@307279 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305328: MFV r303081: 7163 ztest failures due to excess error injection
mav [Fri, 14 Oct 2016 07:24:43 +0000 (07:24 +0000)]
MFC r305328: MFV r303081: 7163 ztest failures due to excess error injection

illumos/illumos-gate@f34284d835bc555f987c1310df46c034c3101155
https://github.com/illumos/illumos-gate/commit/f34284d835bc555f987c1310df46c034c
3101155

https://www.illumos.org/issues/7163
  Running zloop from zfs-precommit hit this assertion:
       *panicstr/s
  0xfffffd7fd7419370: assertion failed for thread 0xfffffd7fe29ed240,
  thread-id 577: parent != NULL, file ../../../uts/common/fs/zfs/dbuf.c, line
  1827
       $c
  libc.so.1`_lwp_kill+0xa()
  libc.so.1`_assfail+0x182(fffffd7ffb1c29fafffffd7ffb1cc028, 723)
  libc.so.1`assfail+0x19(fffffd7ffb1c29fafffffd7ffb1cc028, 723)
  libzpool.so.1`dbuf_dirty+0xc69(10e3bc103601700)
  libzpool.so.1`dbuf_dirty+0x61e(10c736403601700)
  libzpool.so.1`dbuf_dirty+0x61e(10e282803601700)
  libzpool.so.1`dmu_buf_will_fill+0x64(10e282803601700)
  libzpool.so.1`dmu_write+0x1b6(2c7e640, d, 400000002e000000, 200, 3717b40,
  3601700)
  ztest_replay_write+0x568(4950d0, 3717a80, 0)
  ztest_write+0x125(4950d0, d, 400000002e000000, 200, 413f000)
  ztest_io+0x1bb(4950d0, d, 400000002e000000)
  ztest_dmu_write_parallel+0xaa(4950d0, 6)
  ztest_execute+0x83(1, 420c98, 6)
  ztest_thread+0xf4(6)
  libc.so.1`_thrp_setup+0x8a(fffffd7fe29ed240)
  libc.so.1`_lwp_start()
  This is another manifestation of ECKSUM in ztest:
  The lowest level ancestor that’s in memory is the L8 (topmost). The L7
  ancestor is blkid 0x10:
       ::dbufs -O 0x2c7e640 -o d -l 7 |::dbuf
  addr object lvl blkid holds os
  600be50 d 7 4 1 ztest/ds_6
  719d880 d 7 0 4 ztest/ds_6

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@307276 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305327: MFV r303080: 6451 ztest fails due to checksum errors
mav [Fri, 14 Oct 2016 07:22:44 +0000 (07:22 +0000)]
MFC r305327: MFV r303080: 6451 ztest fails due to checksum errors

illumos/illumos-gate@f9eb9fdf196b6ed476e4ffc69cecd8b0da3cb7e7
https://github.com/illumos/illumos-gate/commit/f9eb9fdf196b6ed476e4ffc69cecd8b0d
a3cb7e7

https://www.illumos.org/issues/6451
  Sometimes ztest fails because zdb detects checksum errors. e.g.:
  Traversing all blocks to verify checksums and verify nothing leaked ...
  zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 8000160> DVA0=<0:1cc2000:
  180000> [L0 other uint64[]] sha256 uncompressed LE contiguou
  s unique single size=100000L/100000P birth=271L/271P fill=1
  cksum=c5a3e27d1ed0f894:843bca3a5473c4bf:f76a19b6830a2e4:91292591613a12bf --
  skipping
  zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 800000180> DVA0=<0:ce16800:
  180000> [L0 other uint64[]] sha256 uncompressed LE contigu
  ous unique single size=100000L/100000P birth=840L/840P fill=1
  cksum=5d018f3d061e17f3:6d1584784587bf63:2805a74a0ce37369:ba68a214806c7e75
  -- skipping
  zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 1000000360> DVA0=<0:10d37400:
  180000> [L0 other uint64[]] sha256 uncompressed LE conti
  guous unique single size=100000L/100000P birth=904L/904P fill=1
  cksum=fa1e11d4138bd14b:86c9488c444473e3:f31e43c72e72e46b:e3446472d1174d
  ba -- skipping
  zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 400000002c0> DVA0=<0:127ef400:
  180000> [L0 other uint64[]] sha256 uncompressed LE cont
  iguous dedup single size=100000L/100000P birth=549L/549P fill=1
  cksum=30e14955ebf13522:66dc2ff8067e6810:4607e750abb9d3b3:6582b8af909fcb
  58 -- skipping
  zdb_blkptr_cb: Got error 50 reading <657, 5, 0, 1c0> DVA0=<0:1a180400:180000>
  [L0 other uint64[]] fletcher4 uncompressed LE contiguou
  s unique single size=100000L/100000P birth=1091L/1091P fill=1 cksum=a6cf1e50:
  29b3bd01c57e5:36779b914035db9a:db61cdcf6bec56f0 -- skippin
  g
  The problem is that ztest_fault_inject() can inject multiple faults into the
  same block. It is designed such that it can inject errors on all leafs of a
  RAID-Z or mirror, but for a given range of offsets, it will only inject errors

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Jorgen Lundman <lundman@lundman.net>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@307274 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305326: MFV r303079:
mav [Fri, 14 Oct 2016 07:20:49 +0000 (07:20 +0000)]
MFC r305326: MFV r303079:
7147 ztest: ztest_ddt_repair fails with ztest_pattern_match assertion

illumos/illumos-gate@aab80726335c76a7cae32c7300890248d73a51e3
https://github.com/illumos/illumos-gate/commit/aab80726335c76a7cae32c7300890248d
73a51e3

https://www.illumos.org/issues/7147
  Here's the dbuf we're currently reading:
       966f200::dbuf
  addr object lvl blkid holds os
  966f200 4 0 0 1 ztest/ds_3
       966f200::print dmu_buf_t db_data
  db_data = 0x9ae0400
       0x9ae0400/10J
  0x9ae0400: c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d
  c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d
  c1c7ced932020d c1c7ced932020d
  The pattern we're expecting is actually this: a34ae10b5f2db2. If we attempt to
  read the block on disk we find that it has matches what ztest_ddt_repair()
  would have written:
       ~c1c7ced932020d=J
  ff3e383126cdfdf2
       966f200::print dmu_buf_impl_t db_blkptr | ::blkptr
  DVA0=<0:71d3c00:800>
  [L0 UINT64_OTHER] SHA256 OFF LE contiguous dedup single
  size=400L/400P birth=55L/55P fill=1
  cksum=18486450d3ce8c6d:75a72f4bbf117b0f:2d3a226314eb5650:2eb0fd68648b1af0
     1. zdb -U /rpool/tmp/zpool.cache -R ztest 0:71d3c00:800 | head
        Found vdev type: mirror
  0:71d3c00:800
  0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
  000000: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.
  000010: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.
  000020: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.
  000030: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.
  000040: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.
  000050: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: George Wilson <george.wilson@delphix.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@307272 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305325: MFV r303078:
mav [Fri, 14 Oct 2016 07:19:08 +0000 (07:19 +0000)]
MFC r305325: MFV r303078:
7086 ztest attempts dva_get_dsize_sync on an embedded blockpointer

illumos/illumos-gate@926549256b71acd595f69b236779ff6b78fa08ef
https://github.com/illumos/illumos-gate/commit/926549256b71acd595f69b236779ff6b7
8fa08ef

https://www.illumos.org/issues/7086
  In dbuf_dirty(), we need to grab the dn_struct_rwlock before looking at the
  db_blkptr, to prevent it from being changed by syncing context.
  Otherwise we may see that ztest got a segfault from this stack:
  libzpool.so.1`dva_get_dsize_sync+0x98(872f000b32b240fed7811b, 0, b4cda20,
0)
  libzpool.so.1`bp_get_dsize+0x60(872f000b32b240, 0, 97cb7809d4c1a8, 0)
  libzpool.so.1`dbuf_dirty+0x9b3(ce0a10097cb780, 9, fecd2530)
  libzpool.so.1`dmu_buf_will_dirty+0xc3(ce0a10097cb780ea293d6c, 1)
  libzpool.so.1`zap_lockdir+0x1a0(8aaa3c0, 1, 0, 97cb780, 1, 1)
  libzpool.so.1`zap_remove_norm+0x30(8aaa3c0, 1, 0, 8728b10, 0, 97cb780)
  libzpool.so.1`zap_remove+0x29(8aaa3c0, 1, 0, 8728b1097cb780, a)
  ztest_replay_remove+0x225(ea2945888728ae8, 0, 38010000, 0, 0)
  ztest_remove+0x9f(ea294588ea293f50, 4, 3)
  ztest_object_init+0x78(ea294588ea293f50, 4e0, 1)
  ztest_dmu_object_alloc_free+0x71(ea294588, 13)
  ztest_dmu_objset_create_destroy+0x224(80cef08, 13, 0, 805d36c9017ad44, 0)
  ztest_execute+0x89(a, 807c720, 13, 0)
  ztest_thread+0xea(13, 0, 0, 0)
  libc.so.1`_thrp_setup+0x88(f0983240)
  libc.so.1`_lwp_start(f0983240, 0, 0, 0, 0, 0)
  Looking into it a bit, we see that this is an embedded blockpointer, so
  BP_GET_NDVAS should have returned 0:
       b32b240::blkptr
  EMBEDDED [L0 ZAP_OTHER] et=0 LZ4 size=200L/4aP birth=80L
  Instead, it looks like another thread is modifying this blockpointer:
       b32b240::ugrep | ::whatis
  f47a0e0c is in [ stack tid=0x19f ]
  ebd6ec40 is in [ stack tid=0x226 ]
  ea293bd0 is in [ stack tid=0x244 ]
  ea293be4 is in [ stack tid=0x244 ]

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@307270 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305324: MFV r303077:
mav [Fri, 14 Oct 2016 07:16:51 +0000 (07:16 +0000)]
MFC r305324: MFV r303077:
7072 zfs fails to expand if lun added when os is in shutdown state

illumos/illumos-gate@c39a2aae1e2c439d156021edfc20910dad7f9891
https://github.com/illumos/illumos-gate/commit/c39a2aae1e2c439d156021edfc20910da
d7f9891

https://www.illumos.org/issues/7072
  upstream:
  38733 zfs fails to expand if lun added when os is in shutdown state
  DLPX-36910 spares and caches should not display expandable space
  DLPX-39262 vdev_disk_open spam zfs_dbgmsg buffer

Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: George Wilson <george.wilson@delphix.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@307268 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305323: MFV r302991: 6950 ARC should cache compressed data
mav [Fri, 14 Oct 2016 07:14:35 +0000 (07:14 +0000)]
MFC r305323: MFV r302991: 6950 ARC should cache compressed data

illumos/illumos-gate@dcbf3bd6a1f1360fc1afcee9e22c6dcff7844bf2
https://github.com/illumos/illumos-gate/commit/dcbf3bd6a1f1360fc1afcee9e22c6dcff
7844bf2

https://www.illumos.org/issues/6950
  When reading compressed data from disk, the ARC should keep the compressed
  block cached and only decompress it when consumers access the block. The
  uncompressed data should be short-lived allowing the ARC to cache a much large
r
  amount of data. The DMU would also maintain a smaller cache of uncompressed
  blocks to minimize the impact of decompressing frequently accessed blocks.

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Don Brady <don.brady@intel.com>
Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: George Wilson <george.wilson@delphix.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@307266 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 306484,306485
sephe [Fri, 14 Oct 2016 05:05:23 +0000 (05:05 +0000)]
MFC 306484,306485

306484
    hyperv/vmbus: Add missing vmbus_if.c to module build.

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

306485
    hyperv/hn: Add stubs for OFFLOAD_CURRENT_CONFIG and NETWORK_CHANGE status

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307260 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 306482,306483
sephe [Fri, 14 Oct 2016 04:53:52 +0000 (04:53 +0000)]
MFC 306482,306483

306482
    hyperv/hn: If synthetic parts are detached, don't touch them.

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

306483
    hyperv/hn: Fix detach and attach error handling.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307259 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 306481
sephe [Fri, 14 Oct 2016 04:13:59 +0000 (04:13 +0000)]
MFC 306481

    x86/ioapic: Fix destination cpu for Hyper-V

    On Hyper-V:
    - Stick to the first cpu for all I/O APIC pins.
    - And don't allow destination cpu changes.

    Reviewed by:    jhb
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7949

git-svn-id: svn://svn.freebsd.org/base/stable/10@307258 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 306433
sephe [Fri, 14 Oct 2016 03:32:20 +0000 (03:32 +0000)]
MFC 306433

    hyperv/hn: Don't set HASHVAL pktinfo for NDIS < 6.30

    This unbreaks packet sending on WS2008R2.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307256 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 306431,306432
sephe [Fri, 14 Oct 2016 03:26:24 +0000 (03:26 +0000)]
MFC 306431,306432

306431
    hyperv/hn: Move TX tasks' draining into hn_suspend().

    This prepares to consolidate hn_stop() and netvsc_detach().

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

306432
    hyperv/hn: Consolidate hn_init() and hn_stop()

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307255 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 306426
sephe [Fri, 14 Oct 2016 03:22:19 +0000 (03:22 +0000)]
MFC 306426

    hyperv/storvsc: Fix the blkvsc disk attachment issues.

    - The original 'disengage' ATA controller model does not work properly
      for all possible disk configurations.  Use the newly added ATA disk
      veto eventhandler to fit into all possible disk configuration.
    - If the 'invalid LUN' happens on blkvsc controllers, return
      CAM_DEV_NOT_THERE so that CAM will not destroy attached disks under
      the blkvsc controllers.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307254 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 306396
sephe [Fri, 14 Oct 2016 03:11:31 +0000 (03:11 +0000)]
MFC 306396

    cam/ata: Allow drivers to veto ATA disk attachment.

    This eventhandler is mainly used by VMs, e.g. Hyper-V, whose disk
    controllers share the disks with the simulated ATA controllers.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307253 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 306393
sephe [Fri, 14 Oct 2016 02:58:31 +0000 (02:58 +0000)]
MFC 306393

    hyperv/hn: Flatten RX filter configuration.

    This paves way for more fixes.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307251 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 306390-306392
sephe [Fri, 14 Oct 2016 02:52:48 +0000 (02:52 +0000)]
MFC 306390-306392

306390
    hyperv/hn: Suspend and resume the backend properly upon MTU change.

    Suspend:
    - Prevent the backend from being touched on TX path.
    - Clear the RNDIS RX filter, and wait for RX to drain.
    - Make sure that NVS see the chimney sending buffer and RXBUF
      disconnection, before unlink these buffers from the channel.

    Resume:
    - Reconfigure the RNDIS filter.
    - Allow TX path to work on the backend.
    - Kick start the TX eof task, in case the OACTIVE is set.

    This fixes various panics, when the interface has traffic and MTU
    is being changed.

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

306391
    hyperv/hn: Reorganize the synthetic parts detach.

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

306392
    hyperv/hn: Reorder the comment a little bit.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307250 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 306360,306387,306389
sephe [Fri, 14 Oct 2016 02:42:08 +0000 (02:42 +0000)]
MFC 306360,306387,306389

306360
    hyperv/vmbus: Add dynamic device add and remove support

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

306387
    hyperv/vmbus: Add functions to test RX/TX bufring emptiness

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

306389
    hyperv/vmbus: Add function to drain channel interrupt task.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307249 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 306359
sephe [Fri, 14 Oct 2016 02:36:51 +0000 (02:36 +0000)]
MFC 306359

    pci: Clear the MEM/PORT_EN bit when updating PCI BAR

    It's unsafe to update the BAR when the related EN bit is set.

    Submitted by:   Dexuan Cui <decui microsoft com>
    Reviewed by:    jhb
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7914

git-svn-id: svn://svn.freebsd.org/base/stable/10@307248 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 306072-306074,306076
sephe [Fri, 14 Oct 2016 02:34:03 +0000 (02:34 +0000)]
MFC 306072-306074,306076

306072
    hyperv/vmbus: Allow bufrings preallocation.

    The assumption that the channel is only opened upon synthetic device
    attach time no longer holds, e.g. Hyper-V network device MTU changes.
    We have to allow device drivers to preallocate bufrings, e.g. in
    attach DEVMETHOD, to prevent bufring allocation failure once the
    system memory is fragmented after running for a while.

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

306073
    hyperv/hn: Allocate bufrings in attach DEVMETHOD.

    So that reinitialization, e.g. MTU change, will not fail when the system
    memory is excessively fragmented.

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

306074
    hyperv/vmbus: Assert that the bufring address is page aligned.

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

306076
    hyperv/hn: Put debug messages under bootverbose

    While I'm here, strip blank line.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307247 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 306013,306014
sephe [Fri, 14 Oct 2016 02:27:19 +0000 (02:27 +0000)]
MFC 306013,306014

306013
    hyperv/hn: Fix ifnet hwassist setup.

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

306014
    hyperv/hn: Let the caller of hn_nvs_doinit() do the error logging.

    So that NVS version probing failure does not look too scary.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307246 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 305962,305964-305967
sephe [Fri, 14 Oct 2016 02:19:47 +0000 (02:19 +0000)]
MFC 305962,305964-305967

305962
    hyperv/hn: Don't allow NVS and NDIS version change upon reinitailization

    NVS and NDIS version change would break too much assumption and static
    configuration.

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

305964
    hyperv/hn: Save capabilities for later use.

    And don't allow capability changes during reinitialization, which
    breaks too much static configuration.

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

305965
    hyperv/hn: Don't allow MTU change, if it is not supported by the NVS.

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

305966
    hyperv/hn: Stringent RSS sysctl checks

    - Don't change RNDIS RSS configuration for RSS key sysctl, if the
      interface is not capable of RSS yet.
    - Don't change RSS indirect table (both cached one and RNDIS RSS
      configuration), if the interface is not capable of RSS yet.

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

305967
    hyperv/hn: Allow RSS capability flipping upon attach/reinit.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307245 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 305722
sephe [Fri, 14 Oct 2016 02:03:53 +0000 (02:03 +0000)]
MFC 305722

    x86: Use sx lock for interrupt sources.

    - Certain pic_assign_cpu, e.g. msi_assign_cpu can have quite a long
      call chain.  For msi_assign_cpu, mutex makes complex PCI bridge
      drivers more tricky, e.g. sleep can note be called, etc, it will
      be pretty tricky for upcoming Hyper-V PCI bridge driver for PCI
      pass-through.
    - It is not used on any hot code path nor non-sleepable context, so
      sx should have the same effect as mutex.

    PIC list is still protected by mutex to keep suspend/resume work.

    Discussed with: jhb
    Reviewed by:    jhb
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7784

git-svn-id: svn://svn.freebsd.org/base/stable/10@307244 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r303491:
royger [Thu, 13 Oct 2016 09:37:21 +0000 (09:37 +0000)]
MFC r303491:

Revert r291022: x86/intr: allow mutex recursion in intr_remove_handler

Sponsored by: Citrix Systems R&D

git-svn-id: svn://svn.freebsd.org/base/stable/10@307213 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 305925,305926,305960
sephe [Thu, 13 Oct 2016 09:27:08 +0000 (09:27 +0000)]
MFC 305925,305926,305960

305925
    hyperv/hn: Don't mess up RSS key and indirect table after attachment.

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

305926
    hyperv/hn: Add sysctls to dynamic adjust RSS key and indirect table

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

305960
    hyperv/hn: Apply RSS indirect table fixup before configure RNDIS RSS.

    MFC after:      1 week
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7916

git-svn-id: svn://svn.freebsd.org/base/stable/10@307212 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 305801,305923,305924
sephe [Thu, 13 Oct 2016 09:18:56 +0000 (09:18 +0000)]
MFC 305801,305923,305924

305801
    hyperv/hn: Fix some ifnet settings

    - ifnet.if_mtu does not require explicit setting.
    - ifnet.if_hdrlen must be set after ether_ifattach().

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

305923
    hyperv/hn: Regroup ifnet setup code.

    While I'm here, add comment along the attach DEVMETHOD.

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

305924
    hyperv/hn: Put debug message under bootverbose

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307211 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 305794
sephe [Thu, 13 Oct 2016 09:00:44 +0000 (09:00 +0000)]
MFC 305794

    hyperv/hn: Use sx for the main lock.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307209 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 305790-305793
sephe [Thu, 13 Oct 2016 08:56:52 +0000 (08:56 +0000)]
MFC 305790-305793

305790
    hyperv/hn: Remove unused softc field

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

305791
    hyperv/hn: Deprecate hn_softc_t

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

305792
    hyperv/hn: Function renaming: hn_ifinit -> hn_init

    No functional changes.

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

305793
    hyperv/hn: Cleanup hn_ioctl.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307208 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 305789
sephe [Thu, 13 Oct 2016 08:50:18 +0000 (08:50 +0000)]
MFC 305789

    hyperv/vmbus: Make sure that the sub-channel count is valid.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307207 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 305724,305725,305727-305730,305760,305761,305763,305788
sephe [Thu, 13 Oct 2016 08:47:51 +0000 (08:47 +0000)]
MFC 305724,305725,305727-305730,305760,305761,305763,305788

305724
    hyperv/hn: Rename RXBUF connect/disconnect functions.

    Minor cleanup and wording in error messages.

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

305725
    hyperv/hn: Rename chimney sending buffer connect/disconnect functions.

    Minor cleanup and wording in error messages.

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

305727
    hyperv/hn: Function rename.

    - Minor style changes.
    - Nuke unnecessary indirection.
    - Nuke unapplied comment.

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

305728
    hyperv/hn: Reorganize sub-channel allocation.

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

305729
    hyperv/hn: Reorganize RNDIS attach

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

305730
    hyperv/hn: Pull ether address and link status extraction up.

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

305760
    hyperv/hn: Reorganize channel attach/detach code.

    This paves the way for further attach/detach code reorganization.

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

305761
    hyperv/hn: Regroup synthetic parts attach code.

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

305763
    hyperv/hn: Reorganize synthetic parts attach code.

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

305788
    hyperv/hn: Pull RSS key and indirect table setup up.

    This paves the way for the dynamic RSS key and indirect table setting.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307206 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 305588
sephe [Thu, 13 Oct 2016 08:09:40 +0000 (08:09 +0000)]
MFC 305588

    pxeboot: Add nfs.read_size tunable.

    Increase this tunable improves kernel loading speed.

    Submitted by:   Jun Su <junsu microsoft com>
    Reviewed by:    rpokala, wblock (previous version)
    Obtained from:  DragonFlyBSD
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7756

git-svn-id: svn://svn.freebsd.org/base/stable/10@307203 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 305586,305587
sephe [Thu, 13 Oct 2016 08:06:49 +0000 (08:06 +0000)]
MFC 305586,305587

305586
    hyperv/hn: Function renaming.

    While I'm here, remove obvious comment.

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

305587
    hyperv/hn: Factor out NVS NDIS initialization

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307202 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 305585
sephe [Thu, 13 Oct 2016 08:03:48 +0000 (08:03 +0000)]
MFC 305585

    hyperv/kvp: Fix IPv4/IPv6 address injection support.

    The GUID string provided by hypervisor has leading and trailing braces,
    while our GUID string does not have braces at all.  Both braces should
    be ignored, when the GUID strings are compared.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307201 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 305578-305581
sephe [Thu, 13 Oct 2016 08:01:38 +0000 (08:01 +0000)]
MFC 305578-305581

305578
    hyperv/hn: Pull vmbus channel open up.

    While I'm here, pull up the channel callback related code too.

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

305579
    hyperv/hn: Push RXBUF size adjustment down.

    It is not used in other places.

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

305580
    hyperv/hn: Factor out function to do NVS initialization.

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

305581
    hyperv/hn: Pass MTU around.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307200 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 305454,305455,305521,305524-305526
sephe [Thu, 13 Oct 2016 07:52:39 +0000 (07:52 +0000)]
MFC 305454,305455,305521,305524-305526

305454
    hyperv/hn: Fix VLAN tag setup for outgoing VLAN packets.

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

305455
    hyperv/hn: Avoid bit fields for LSOv2 setup.

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

305521
    hyperv/hn: Avoid bit fields for TXCSUM setup.

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

305524
    hyperv/hn: Cleanup RNDIS packet message encapsulation.

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

305525
    hyperv/hn: Simplify per-packet-info construction.

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

305526
    hyperv/hn: Nuke unused bits

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307199 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 305405,305407,305408,305410,305411,305453
sephe [Thu, 13 Oct 2016 07:42:44 +0000 (07:42 +0000)]
MFC 305405,305407,305408,305410,305411,305453

305405
    hyperv/vmbus: Stringent header length and total length check.

    While I'm here, minor style changes.

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

305407
    hyperv/hn: Stringent NVS notification length check.

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

305408
    hyperv/hn: Stringent NVS RNDIS packets length checks.

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

305410
    net/rndis: Define RNDIS status message, which could be sent by device.

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

305411
    hyperv/hn: Stringent RNDIS control message length check.

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

305453
    hyperv/hn: Stringent RNDIS packet message length/offset check.

    While I'm here, use definition in net/rndis.h

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307198 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 305279-305281
sephe [Thu, 13 Oct 2016 07:35:19 +0000 (07:35 +0000)]
MFC 305279-305281

305279
    hyperv/ic: Minor style fix.

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

305280
    hyperv/ic: Cleanup shutdown channel callback.

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

305281
    hyperv/ic: Cleanup timesync channel callback.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307197 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 305277,305278
sephe [Thu, 13 Oct 2016 07:22:13 +0000 (07:22 +0000)]
MFC 305277,305278

305277
    net/rndis: Add comment for rndis_comp_hdr

    Reviewed by:    hps
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7738

305278
    net/rndis: Define common message header for RNDIS messages.

    And avoid RNDIS_HEADER_OFFSET hardcoding.

    Reviewed by:    hps
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7739

git-svn-id: svn://svn.freebsd.org/base/stable/10@307194 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 305175,305176,305179,305182,305268,305270,305276
sephe [Thu, 13 Oct 2016 07:17:04 +0000 (07:17 +0000)]
MFC 305175,305176,305179,305182,305268,305270,305276

305175
    net/rndis: Define per-packet-info for RNDIS packet message

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

305176
    hyperv/hn: Stringent per-packet-info verification.

    While I'm here, minor style changes.

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

305179
    hyperv/hn: Fix VLAN tag construction.

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

305182
    net/rndis: Define types for RNDIS pktinfo rm_type field.

    They are defined by NDIS spec, so the NDIS prefix.

    Reviewed by:    hps
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7717

305268
    hyperv/hn: Rework RXCSUM related bits

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

305270
    hyperv/hn: Simplify RX hash related bits.

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

305276
    hyperv/hn: Use the per-packet-info types defined by net/rndis.h

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307193 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 305173,305174
sephe [Thu, 13 Oct 2016 06:55:51 +0000 (06:55 +0000)]
MFC 305173,305174

305173
    net/rndis: Add comment for rndis_set_parameter

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

305174
    hyperv/hn: Remove unused function

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307188 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 305111
sephe [Thu, 13 Oct 2016 06:49:00 +0000 (06:49 +0000)]
MFC 305111

    hyperv/timesync: Rework time adjustment policy

    - By default, adjust time upon SYNC request.  It can be disabled
      through hw.hvtimesync.ignore_sync_req.  SYNC request will be
      sent by hypervisor the host is resumed, rebooted, etc.
    - By default, adjust time upon SAMPLE request, if there is 100ms
      difference between VM time and hypervisor time.  This can be
      disabled through hw.hvtimesync.sample_drift.

    And nuke the unnecessary task, since channel callback is running
    in a Hyper-V taskqueue nowadays.

    Submitted by:   YanZhe Chen <t-yachen microsoft com>
    Discussed with: Dexuan Cui <decui microsoft com>, Hongjiang Zhang <honzhan microsoft com>, sephe
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7707

git-svn-id: svn://svn.freebsd.org/base/stable/10@307187 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 305052-305054,305110
sephe [Thu, 13 Oct 2016 06:47:02 +0000 (06:47 +0000)]
MFC 305052-305054,305110

305052
    hyperv/hn: Remove the useless rndis_device and related bits

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

305053
    hyperv/hn: Log packet message alignment.

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

305054
    hyperv/hn: Remove unnecessary NULL check.

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

305110
    hyperv/hn: Consolidate NVS transaction execution.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307186 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 305049,305050
sephe [Thu, 13 Oct 2016 06:39:06 +0000 (06:39 +0000)]
MFC 305049,305050

305049
    hyperv/hn: Factor out func to exec RNDIS transaction w/o checking result

    It will be used by RNDIS HALT and RESET.

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

305050
    hyperv/hn: Switch to new RNDIS transaction execution for halt.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307185 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 304973,304975,304976,304979,305044-305048
sephe [Thu, 13 Oct 2016 06:34:18 +0000 (06:34 +0000)]
MFC 304973,304975,304976,304979,305044-305048

304973
    hyperv/hn: Switch to new RNDIS query for link status extraction.

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

304975
    hyperv/hn: Switch to new RNDIS query for RSS capabilities extraction.

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

304976
    hyperv/hn: Fix # of channels setting, if RSS is not available.

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

304979
    hyperv/hn: Switch to new RNDIS set for RSS parameters.

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

305044
    hyperv/hn: Move OIDs to net/rndis.h; they are standard NDIS OIDs.

    Actually all OIDs defined in net/rndis.h are standard NDIS OIDs.
    While I'm here, use the verbose macro name as in NDIS spec.

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

305045
    hyperv/hn: Indentation and field comment fixup for ndis.h.

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

305046
    net/rndis: Packet types are defined by NDIS; not RNDIS specific.

    Reviewed by:    hps
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7681

305047
    hyperv/hn: Switch to new RNDIS set for RX filters.

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

305048
    hyperv/hn: Remove unused function

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307184 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agobhyve(8): Fix typo from r294294 that prevented bhyve from working with
np [Thu, 13 Oct 2016 06:32:21 +0000 (06:32 +0000)]
bhyve(8): Fix typo from r294294 that prevented bhyve from working with
vmnet devices.  This is a direct commit to stable/10.

git-svn-id: svn://svn.freebsd.org/base/stable/10@307183 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 304832-304834,304972
sephe [Thu, 13 Oct 2016 06:17:33 +0000 (06:17 +0000)]
MFC 304832-304834,304972

304832
    hyperv/hn: Use vmbus xact for RNDIS query.

    And switch MAC address query to use new RNDIS query function.

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

304833
    hyperv/hn: Save the adopted NDIS version for RNDIS to use later.

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

304834
    hyperv/hn: Use vmbus xact for RNDIS set.

    And use new RNDIS set to configure NDIS offloading parameters.

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

304972
    hyperv/hn: Add definition for NDIS media state.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307181 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 304790,304791
sephe [Thu, 13 Oct 2016 06:09:26 +0000 (06:09 +0000)]
MFC 304790,304791

304790
    hyperv/vmbus: Add function to calculate max # of elements in a bufring.

    Sponsored by:   Microsoft

304791
    hyperv/storvsc: Increase queue depth and rework channel selection.

    - Increasing queue depth gives ~100% performance improvement for
      randwrite fio test in Azure.
    - New channel selection, which takes LUN id and the current cpuid
      into consideration, gives additional ~20% performance improvement
      for ranwrite fio test in Azure.

    Submitted by:   Hongzhang Jiang <honzhan microsoft com>
    Modified by:    sephe
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7622

git-svn-id: svn://svn.freebsd.org/base/stable/10@307180 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 304786,304788
sephe [Thu, 13 Oct 2016 05:59:33 +0000 (05:59 +0000)]
MFC 304786,304788

304786
    hyperv/ic: Cleanup heartbeat channel callback.

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

304788
    hyperv/ic: Update total message size if negotiate message size grows.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307179 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 304783-304785
sephe [Thu, 13 Oct 2016 05:20:31 +0000 (05:20 +0000)]
MFC 304783-304785

304783
    hyperv/hn: Use definition in net/rndis.h for message type and status code.

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

304784
    hyperv/hn: Add compat code for RNDIS reorganization phase.

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

304785
    hyperv/hn: Use vmbus xact for RNDIS initialize.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307178 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 304730
sephe [Thu, 13 Oct 2016 04:32:55 +0000 (04:32 +0000)]
MFC 304730

    hyperv/ic: Redefine IC version negotiate message.

    And stringent input IC version negotiate message checks.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307177 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 304724,304728
sephe [Thu, 13 Oct 2016 04:24:34 +0000 (04:24 +0000)]
MFC 304724,304728

304724
    hyperv/hn: Remove the redundant rid setting for RNDIS HALT.

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

304728
    hyperv/hn: Log a warning for RESET_CMPLT.

    RESET is not used by the hn(4) at all, and RESET_CMPLT does not even
    have a rid to match with the pending requests.  So, let's put it
    onto an independent switch branch and log a warning about it.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307176 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 304654,304722,304723
sephe [Thu, 13 Oct 2016 03:23:43 +0000 (03:23 +0000)]
MFC 304654,304722,304723

304654
    net: Split RNDIS protocol structs/macros out of dev/usb/net/if_urndisreg.h

    So that Hyper-V can leverage them instead of rolling its own definition.

    Discussed with: hps
    Reviewed by:    hps
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7592

304722
    net/rndis: Add canonical RNDIS major/minor version as of today.

    Reviewed by:    hps
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7593

304723
    net/rndis: Fix RNDIS_STATUS_PENDING definition.

    While I'm here, sort the RNDIS status in ascending order.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307175 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 304441,304444,304446,304447,304591,304593-304595
sephe [Thu, 13 Oct 2016 03:16:15 +0000 (03:16 +0000)]
MFC 304441,304444,304446,304447,304591,304593-304595

304441
    hyperv/hn: Move NVS version to softc

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

304444
    hyperv/hn: Remove assign-only struct field

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

304446
    hyperv/hn: Remove the useless num_channel

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

304447
    hyperv/hn: Move RXBUF to hn_softc

    And don't recreate RXBUF for each primary channel open, it is now
    created in device_attach DEVMETHOD and destroyed in device_detach
    DEVMETHOD.

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

304591
    hyperv/hn: Move chimney sending buffer to hn_softc

    And don't recreate chimney sending buffer for each primary channel
    open, it is now created in device_attach DEVMETHOD and destroyed
    in device_detach DEVMETHOD.

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

304593
    hyperv/hn: Get rid of netvsc_dev

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

304594
    hyperv/hn: Factor out function to execute NVS transactions.

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

304595
    hyperv/hn: Factor out function to simplify NVS request sending

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307174 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 304331
sephe [Thu, 13 Oct 2016 03:00:56 +0000 (03:00 +0000)]
MFC 304331

    hyperv/kvp: Remove unnecessary function parameter.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307170 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 304327,304329,304330
sephe [Thu, 13 Oct 2016 02:58:53 +0000 (02:58 +0000)]
MFC 304327,304329,304330

304327
    hyperv/hn: Pass RX packet info to netvsc_recv.

    This paves to nuke netvsc_packet, which does not serves much
    purpose now.

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

304329
    hyperv/hn: Constify RNDIS messages on RX path.

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

304330
    hyperv/hn: Get rid of the useless netvsc_packet

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307169 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 304270,304273
sephe [Thu, 13 Oct 2016 02:45:08 +0000 (02:45 +0000)]
MFC 304270,304273

304270
    hyperv/util: Don't reference hn_softc in KVP

    hn_softc is private data struct.

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

304273
    hyperv/util: Factor out helper for IC device_probe DEVMETHOD

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307168 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 304204-304206,304252-304256
sephe [Thu, 13 Oct 2016 02:38:46 +0000 (02:38 +0000)]
MFC 304204-304206,304252-304256

304204
    hyperv/hn: Factor out hn_nvs_send/hn_nvs_send_sglist

    Avoid unnecessary message type setting and centralize the send context
    to transaction id cast.

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

304205
    hyperv/hn: Simplify RNDIS NVS message sending.

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

304206
    hyperv/hn: Simplify RNDIS message checks on RX path.

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

304252
    hyperv/hn: Ignore the useless TX table.

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

304253
    hyperv/hn: Simplify RNDIS RX packets acknowledgement.

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

304254
    hyperv/hn: Remove reference to nvsp_msg

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

304255
    hyperv/hn: Remove reference to nvsp_status

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

304256
    hyperv/hn: Get rid of unused bits

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307167 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r306766:
jtl [Thu, 13 Oct 2016 02:31:32 +0000 (02:31 +0000)]
MFC r306766:
  Remove declaration of un-defined function tcp_seq_subtract().

git-svn-id: svn://svn.freebsd.org/base/stable/10@307165 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 303945,303947-303949,303989,303992,303998,304001,304002,304109,304111
sephe [Thu, 13 Oct 2016 02:28:40 +0000 (02:28 +0000)]
MFC 303945,303947-303949,303989,303992,303998,304001,304002,304109,304111

303945
    hyperv/vmbus: Add macro to get channel packet data length.

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

303947
    hyperv/vmbus: Add APIs for various types of transactions.

    Reviewed by:    Jun Su <junsu microsoft com>
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7456

303948
    hyperv/hn: Switch to vmbus xact APIs for NVS initialization

    Reviewed by:    Jun Su <junsu microsoft com>
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7457

303949
    hyperv/vmbus: Use xact APIs to implement post message Hypercall APIs

    Avoid code duplication.

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

303989
    hyperv/hn: Simplify NDIS configuration.

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

303992
    hyperv/hn: Simplify NDIS initialization.

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

303998
    hyperv/hn: Switch to vmbus xact APIs for NVS RXBUF connection.

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

304001
    hyperv/hn: Switch to vmbus xact APIs for NVS chimney buffer connection.

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

304002
    hyperv/hn: Simplify RXBUF disconnection.

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

304109
    hyperv/hn: Simplify chimney sending buffer disconnection.

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

304111
    hyperv/hn: Switch to vmbus xact APIs for sub-channel alloc request.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307164 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 303944
sephe [Thu, 13 Oct 2016 01:58:49 +0000 (01:58 +0000)]
MFC 303944

    cam/da: Add quirk for I-O Data USB Flash Disk

    PR:             211716
    Submitted by:   Jun Su <junsu microsoft com>
    Reported by:    Jun Su <junsu microsoft com>
    Sponsored by:   Microsoft

git-svn-id: svn://svn.freebsd.org/base/stable/10@307162 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 303867,303901
sephe [Thu, 13 Oct 2016 01:51:49 +0000 (01:51 +0000)]
MFC 303867,303901

303867
    hyperv/hn: Move gpa array out of netvsc_packet.

    Prepare to deprecate the netvsc_packet.

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

303901
    hyperv/hn: Reorganize send done callback.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307161 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 303822-303824
sephe [Thu, 13 Oct 2016 01:43:15 +0000 (01:43 +0000)]
MFC 303822-303824

303822
    hyperv/ic: Remove never used second parameter of hv_negotiate_version()

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

303823
    hyperv/ic: Expose the receive buffer length for callers to use.

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

303824
    hyperv/ic: Pass the channel callback to hv_util_attach()

    The saved channel callback in util softc is actually never used.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307160 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305628: intro(2),_exit(2): Update for reaper
jilles [Wed, 12 Oct 2016 20:19:33 +0000 (20:19 +0000)]
MFC r305628: intro(2),_exit(2): Update for reaper
(procctl(PROC_REAP_ACQUIRE)).

git-svn-id: svn://svn.freebsd.org/base/stable/10@307155 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r306665: zfs: fix a wrong assertion for extended attributes
avg [Wed, 12 Oct 2016 11:48:47 +0000 (11:48 +0000)]
MFC r306665: zfs: fix a wrong assertion for extended attributes

PR: 213112

git-svn-id: svn://svn.freebsd.org/base/stable/10@307143 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r306670:
mm [Wed, 12 Oct 2016 10:28:54 +0000 (10:28 +0000)]
MFC r306670:
Sync libarchive with vendor including security fixes.

Important vendor bugfixes (relevant to FreeBSD):
#747: Out of bounds read in mtree parser
#761: heap-based buffer overflow in read_Header (7-zip)
#794: Invalid file on bsdtar command line results in internal errors (1)

PR: 213092 (1)

git-svn-id: svn://svn.freebsd.org/base/stable/10@307139 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 303603-303605,303764
sephe [Wed, 12 Oct 2016 09:27:39 +0000 (09:27 +0000)]
MFC 303603-303605,303764

303603
    hyperv/vmbus: Remove the artificial entry limit of SG and PRP list.

    Just make sure that the total channel packet size does not exceed 1/2
    data size of the TX bufring.

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

303604
    hyperv/storvsc: Set maxio to 128KB.

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

303605
    hyperv/storvsc: Stringent PRP list assertions

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

303764
    hyperv/vmbus: Only make sure the TX bufring will not be closed.

    KVP can write data, whose size is > 1/2 TX bufring size.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307137 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 303474
sephe [Wed, 12 Oct 2016 09:13:16 +0000 (09:13 +0000)]
MFC 303474

    hyperv/storvsc: Use busdma(9) and enable PIM_UNMAPPED by default.

    The UNMAPPED I/O greatly improves userland direct disk I/O performance
    by 35% ~ 135%.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307134 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 303421,303422,303470-303473
sephe [Wed, 12 Oct 2016 08:58:03 +0000 (08:58 +0000)]
MFC 303421,303422,303470-303473

303421
    hyperv/vmbus: Avoid unnecessary mb()

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

303422
    hyperv/vmbus: Inclusion cleanup

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

303470
    hyperv/vmbus: Reindent function declarations.

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

303471
    hyperv/vmbus: Forward declare static functions

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

303472
    hyperv/vmbus: Move driver glue to the beginning of the files

    Just as most of other drivers do.  And move sysinit function close
    to its SYSINIT.

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

303473
    hyperv/vmbus: Revoke unnecessary exposure of vmbus softc

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@307133 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 306699: Do not retry on some security sense codes.
mav [Wed, 12 Oct 2016 05:50:47 +0000 (05:50 +0000)]
MFC 306699: Do not retry on some security sense codes.

git-svn-id: svn://svn.freebsd.org/base/stable/10@307129 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305224: MFV r304158:
mav [Wed, 12 Oct 2016 05:47:06 +0000 (05:47 +0000)]
MFC r305224: MFV r304158:
7136 ESC_VDEV_REMOVE_AUX ought to always include vdev information

7115 6922 generates ESC_ZFS_VDEV_REMOVE_AUX a bit too often

illumos/illumos-gate@b72b6bb10ad55121a1b352c6f68ebdc8e20c9086
https://github.com/illumos/illumos-gate/commit/b72b6bb10ad55121a1b352c6f68ebdc8e
20c9086

https://www.illumos.org/issues/7136
  6922 added ESC_ZFS_VDEV_REMOVE_AUX and ESC_ZFS_VDEV_REMOVE_DEV sysevents
  whenever an aux device gets removed from a pool. However, those sysevents will
  be created without the vdev_guid and vdev_path fields. It would be better to
  always populate those fields.

https://www.illumos.org/issues/7115
  The addition of spa_event_notify in vdev removal code (see #6922) causes event
s
  to be generated even if the spare failed to be removed with EBUSY.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Alan Somers <asomers@gmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@307127 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305222: MFV r302993: 7104 increase indirect block size
mav [Wed, 12 Oct 2016 05:46:21 +0000 (05:46 +0000)]
MFC r305222: MFV r302993: 7104 increase indirect block size

illumos/illumos-gate@4b5c8e93cab28d3c65ba9d407fd8f46e3be1db1c
https://github.com/illumos/illumos-gate/commit/4b5c8e93cab28d3c65ba9d407fd8f46e3
be1db1c

https://www.illumos.org/issues/7104
  The current default indirect block size is 16KB. We can improve
  performance by increasing it to 128KB. This is especially helpful for
  any workload that needs to read most of the metadata, e.g.
  scrub/resilver, file deletion, filesystem deletion, and zfs send.
  We also need to fix a few space estimation errors to make the tests
  pass.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@307126 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305221: MFV r302992:
mav [Wed, 12 Oct 2016 05:45:40 +0000 (05:45 +0000)]
MFC r305221: MFV r302992:
7071 lzc_snapshot does not fill in errlist on ENOENT

illumos/illumos-gate@25f7d993adbfb3452ac4625b3791670746d35ae3
https://github.com/illumos/illumos-gate/commit/25f7d993adbfb3452ac4625b379167074
6d35ae3

https://www.illumos.org/issues/7071
  upstream
  DLPX-40482 lzc_snapshot does not fill in errlist on ENOENT

Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@307125 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305211: MFV r302662: 6447 handful of nvpair cleanups
mav [Wed, 12 Oct 2016 05:44:54 +0000 (05:44 +0000)]
MFC r305211: MFV r302662: 6447 handful of nvpair cleanups

illumos/illumos-gate@759e89be359f2af635e4122d147df56bce948773
https://github.com/illumos/illumos-gate/commit/759e89be359f2af635e4122d147df56bc
e948773

https://www.illumos.org/issues/6447
  I got a patch from someone who uses nvpair code outside of illumos. It fixes a
  couple of gcc warnings/bugs for him.
     1. silence uninitialized use warnings
     2. add parentheses around assignment used as truth value
     3. fix printf format specifier (ll is for integers only)
     4. strstr, strspn, strcspn, and strcmp are declared in string.h, not
        strings.h.
     5. avoid scanning integer into boolean variable

Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Steve Dougherty <sdougherty@barracuda.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@307124 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305210: MFV r302661:
mav [Wed, 12 Oct 2016 05:44:12 +0000 (05:44 +0000)]
MFC r305210: MFV r302661:
7082 bptree_iterate() passes wrong args to zfs_dbgmsg()

illumos/illumos-gate@10e67aa0db0823d5464aafdd681f3c966155c68e
https://github.com/illumos/illumos-gate/commit/10e67aa0db0823d5464aafdd681f3c966
155c68e

https://www.illumos.org/issues/7082
  upstream
  DLPX-40542 bptree_iterate() passes wrong args to zfs_dbgmsg()

Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@307123 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305209: MFV r302660: 6314 buffer overflow in dsl_dataset_name
mav [Wed, 12 Oct 2016 05:43:25 +0000 (05:43 +0000)]
MFC r305209: MFV r302660: 6314 buffer overflow in dsl_dataset_name

illumos/illumos-gate@9adfa60d484ce2435f5af77cc99dcd4e692b6660
https://github.com/illumos/illumos-gate/commit/9adfa60d484ce2435f5af77cc99dcd4e6
92b6660

https://www.illumos.org/issues/6314
  Callers of dsl_dataset_name pass a buffer of size ZFS_MAXNAMELEN, but
  dsl_dataset_name copies the datasets' name PLUS the snapshot name to it,
  resulting in a max of 2 * ZFS_MAXNAMELEN + '@'.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@307122 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305206: MFV r302658:
mav [Wed, 12 Oct 2016 05:42:00 +0000 (05:42 +0000)]
MFC r305206: MFV r302658:
6872 zfs libraries should not allow uninitialized variables

illumos/illumos-gate@f83b46baf98d276f5f84fa84c8b461f412ac1f5e
https://github.com/illumos/illumos-gate/commit/f83b46baf98d276f5f84fa84c8b461f41
2ac1f5e

https://www.illumos.org/issues/6872
  We compile the zfs libraries with -Wno-uninitialized. We should remove
  this. Change makefiles, fix new warnings, fix pbchk errors.

Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Paul Dagnelie <pcd@delphix.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@307121 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f