]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
7 years agoMFC r314450,r313439:
ngie [Tue, 7 Mar 2017 01:52:50 +0000 (01:52 +0000)]
MFC r314450,r313439:

r314450:

Add additional __FreeBSD_version guards around the hsearch_r testcases

The reasoning for this is the same as r276046: to ease MFCing the tests
to ^/stable/10 .

This was accidentally missed in r313439

r313439 | ngie | 2017-02-08 01:46:15 -0800 (Wed, 08 Feb 2017) | 25 lines

Merge content from ^/projects/netbsd-tests-upstream-01-2017 into ^/head

The primary end-goal of this drop is ease future merges with NetBSD and
collaborate further with the NetBSD project.

The goal was (largely, not completely as some items are still oustanding
in the NetBSD GNATS system) achieved by doing the following:
- Pushing as many changes required to port contrib/netbsd-tests
  back to NetBSD as possible, then pull the upstream applied changes
  back in to FreeBSD.
- Diff reduce with upstream where possible by:
-- Improving libnetbsd header, etc compat glue.
-- Using _SED variables to modify test scripts on the fly for items
   that could not be upstreamed to NetBSD.

As a bonus for this work, this change also introduces testcases for
uniq(1).

Many thanks to Christos for working with me to get many of the changes
back into the NetBSD project.

In collaboration with: Christos Zoulas <christos@netbsd.org>

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

7 years agoMFC r314062
davidcs [Mon, 6 Mar 2017 20:35:03 +0000 (20:35 +0000)]
MFC r314062
add bus_dmamap_unload in ql_free_dmabuf()

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

7 years agoMFC r314509 and r314578.
np [Mon, 6 Mar 2017 15:16:15 +0000 (15:16 +0000)]
MFC r314509 and r314578.

r314509:
cxgbe/iw_cxgbe: Do not check the size of the memory region being
registered.  T4/5/6 have no internal limit on this size.  This is
probably a copy paste from the T3 iw_cxgb driver.

r314578:
cxgbe/iw_cxgbe: Implement sq/rq drain operation.

ULPs can set a qp's state to ERROR and then post a work request on the
sq and/or rq.  When the reply for that work request comes back it is
guaranteed that all previous work requests posted on that queue have
been drained.

Sponsored by: Chelsio Communications

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

7 years agoMFC r314338: Polish handling of different reset flavours.
mav [Mon, 6 Mar 2017 06:47:05 +0000 (06:47 +0000)]
MFC r314338: Polish handling of different reset flavours.

The biggest change is that ctl_remove_initiator() now generates I_T NEXUS
LOSS event, cleaning part of LUs state related to the initiator.

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

7 years agoMFC r314326: Send TERMINATE to firmware when aborting active ATIO.
mav [Mon, 6 Mar 2017 06:45:35 +0000 (06:45 +0000)]
MFC r314326: Send TERMINATE to firmware when aborting active ATIO.

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

7 years agoMFC r314496: Add check missed in r314257.
mav [Mon, 6 Mar 2017 06:43:17 +0000 (06:43 +0000)]
MFC r314496: Add check missed in r314257.

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

7 years agoMFC r314387: Make ctl_queue_sense() not sleep.
mav [Mon, 6 Mar 2017 06:41:06 +0000 (06:41 +0000)]
MFC r314387: Make ctl_queue_sense() not sleep.

It may be called in non-sleepable frontend context.

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

7 years agoMFC r314302: Return better error code in case of too long CDB.
mav [Mon, 6 Mar 2017 06:39:42 +0000 (06:39 +0000)]
MFC r314302: Return better error code in case of too long CDB.

Its more important for SPI HBAs, as they don't support CDBs above 12 bytes.
The new error code makes CAM to fall back to alternative commands.

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

7 years agoMFC r314299, r314300: Fix residual length reporting in target mode.
mav [Mon, 6 Mar 2017 06:38:26 +0000 (06:38 +0000)]
MFC r314299, r314300: Fix residual length reporting in target mode.

This allows to properly handle cases when target wants to receive or send
more data then initiator wants to send or receive.  Previously in such
cases isp(4) returned CAM_DATA_RUN_ERR, while now it returns resid > 0.

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

7 years agoMFC r314257: Add reporting SAS protocol, in case we ever have one.
mav [Mon, 6 Mar 2017 06:36:45 +0000 (06:36 +0000)]
MFC r314257: Add reporting SAS protocol, in case we ever have one.

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

7 years agoMFC r314255: Reenable CTL_WITH_CA, optimizing it for lower memory usage.
mav [Mon, 6 Mar 2017 06:35:32 +0000 (06:35 +0000)]
MFC r314255: Reenable CTL_WITH_CA, optimizing it for lower memory usage.

This code was disabled due to its high memory usage.  But now we need this
functionality for cfumass(4) frontend, since USB MS BBB transport does not
support autosense.

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

7 years agoMFC r314247: Axe out some forever disabled questionable functionality.
mav [Mon, 6 Mar 2017 06:33:18 +0000 (06:33 +0000)]
MFC r314247: Axe out some forever disabled questionable functionality.

This code is complicated enough even in its base shape.

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

7 years agoMFC r314246: Improve CAM target frontend reference counting.
mav [Mon, 6 Mar 2017 06:32:14 +0000 (06:32 +0000)]
MFC r314246: Improve CAM target frontend reference counting.

Before this change it was possible to trigger some use-after-free panics
by disabling LUNs/ports under heavy load.

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

7 years agoMFC r314208: Respecting r314204 tighten ATIO cleanup requirements.
mav [Mon, 6 Mar 2017 06:30:55 +0000 (06:30 +0000)]
MFC r314208: Respecting r314204 tighten ATIO cleanup requirements.

Every ATIO must complete with either successfully sent status or XPT_ABORT.

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

7 years agoMFC r314204: Explicitly abort ATIO if CTIO sending status has failed.
mav [Mon, 6 Mar 2017 06:29:42 +0000 (06:29 +0000)]
MFC r314204: Explicitly abort ATIO if CTIO sending status has failed.

This helps SIM to free related resources in questionable cases.

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

7 years agoMFC r314203: Fix missing xpt_done() for ATIO/INOT on missing LUN.
mav [Mon, 6 Mar 2017 06:28:30 +0000 (06:28 +0000)]
MFC r314203: Fix missing xpt_done() for ATIO/INOT on missing LUN.

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

7 years agoMFC r314200: We can't access periph after ctlfe_free_ccb().
mav [Mon, 6 Mar 2017 06:26:43 +0000 (06:26 +0000)]
MFC r314200: We can't access periph after ctlfe_free_ccb().

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

7 years agoMFC r314196: Unify ATIO/INOT CCBs requeuing.
mav [Mon, 6 Mar 2017 06:26:02 +0000 (06:26 +0000)]
MFC r314196: Unify ATIO/INOT CCBs requeuing.

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

7 years agoMFC r314193: Some code cleanup.
mav [Mon, 6 Mar 2017 06:24:53 +0000 (06:24 +0000)]
MFC r314193: Some code cleanup.

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

7 years agoMFC r314088: Slightly polish isp_dump_atpd().
mav [Mon, 6 Mar 2017 06:23:45 +0000 (06:23 +0000)]
MFC r314088: Slightly polish isp_dump_atpd().

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

7 years agoMFC r314086: Fix multiple problems around LUN disable under load.
mav [Mon, 6 Mar 2017 06:22:37 +0000 (06:22 +0000)]
MFC r314086: Fix multiple problems around LUN disable under load.

 - Move private data about ATIOs/INOTs from per-LUN to per-channel data.
This allows active commands to continue operation after LUN destruction.
This also simplifies lookup of the data by tag in some situations.
 - Unify three restart_queue processing implementations.
 - Complete all ATIOs from restart_queue on LUN disable.
 - Delete ATIO private data when command completed or aborted, not depending
on the ATIO being requeued, that was ugly hack and could never happen.  CAM
should always call ether XPT_CONT_TARGET_IO with status or XPT_ABORT.
 - Implement XPT_ABORT for queued ATIOs/INOTs to allow CAM do graceful
shutdown, not depending on LUN disable, as it is done in ahd(4)/targ(4).
 - Unify isp_endcmd() arguments to make it more usable in generic code.
 - Remove never really used LUN state reference counter.

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

7 years agoMFC r314045: Remove duplicate INOT allocation.
mav [Mon, 6 Mar 2017 06:21:26 +0000 (06:21 +0000)]
MFC r314045: Remove duplicate INOT allocation.

For some reason isp_handle_platform_notify_fc() allocated INOT just
before calling isp_handle_platform_target_tmf(), which also allocates
INOT.  It seems to be a braino introduced in r196008.

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

7 years agoMFC r314038: Remove ancient __FreeBSD_version checks.
mav [Mon, 6 Mar 2017 06:20:14 +0000 (06:20 +0000)]
MFC r314038: Remove ancient __FreeBSD_version checks.

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

7 years agoMFC r314027: Do not blindly free completed ATIOs/INOTs on invalidation.
mav [Mon, 6 Mar 2017 06:19:02 +0000 (06:19 +0000)]
MFC r314027: Do not blindly free completed ATIOs/INOTs on invalidation.

When LUN is disabled, SIM starts returning queued ATIOs/INOTs.  But at the
same time there can be some ATIOs/INOTs still carrying real new requests.
If we free those, SIM may leak some resources, forever expecting for any
response from us.  So try to be careful, separating ATIOs/INOTs carrying
requests which still must be processed, from ATIOs/INOTs completed with
errors which can be freed.

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

7 years agoMFC r314358: Announce that sbp_targ(4) does not support initiator mode.
mav [Mon, 6 Mar 2017 06:09:33 +0000 (06:09 +0000)]
MFC r314358: Announce that sbp_targ(4) does not support initiator mode.

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

7 years agoMFC r314572:
mm [Sun, 5 Mar 2017 21:42:03 +0000 (21:42 +0000)]
MFC r314572:

Fix null pointer dereference in zfs_freebsd_setacl().

Prevents unprivileged users from panicking the kernel by calling
__acl_delete_*() on files or directories inside a ZFS mount.

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

7 years agoMFC r313936, r313937: Move CTIO waitq from per-LUN to per-channel.
mav [Sun, 5 Mar 2017 05:17:36 +0000 (05:17 +0000)]
MFC r313936, r313937: Move CTIO waitq from per-LUN to per-channel.

All resources lack of which may put CTIO into the queue are either
per-channel or potentially per-queue, but none of them are per-LUN.

This is a first step to fix live LUN disabling.  Before this change
any CTIOs held in a queue in time of disabling were just leaked.

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

7 years agoMFC r313945: Remove broken remnants of obsolete INOT API.
mav [Sun, 5 Mar 2017 05:15:35 +0000 (05:15 +0000)]
MFC r313945: Remove broken remnants of obsolete INOT API.

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

7 years agoMFC r314562:
kib [Sun, 5 Mar 2017 00:37:23 +0000 (00:37 +0000)]
MFC r314562:
Style.

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

7 years agoMFC r313909:
bdrewery [Sat, 4 Mar 2017 18:11:59 +0000 (18:11 +0000)]
MFC r313909:

  Fix panic with unlocked vnode to vrecycle().

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

7 years agoMFC r314273: zfs: call spa_deadman on a taskqueue thread
avg [Sat, 4 Mar 2017 13:05:04 +0000 (13:05 +0000)]
MFC r314273: zfs: call spa_deadman on a taskqueue thread

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

7 years agoMFC r283291: don't use CALLOUT_MPSAFE with callout_init()
avg [Sat, 4 Mar 2017 13:03:31 +0000 (13:03 +0000)]
MFC r283291: don't use CALLOUT_MPSAFE with callout_init()

The main purpose of this MFC is to reduce conflicts for other merges.
Parts of the original change have already "trickled down" via individual MFCs.

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

7 years agoMFC r314272: call vm_lowmem hook in uma_reclaim_worker
avg [Sat, 4 Mar 2017 12:05:50 +0000 (12:05 +0000)]
MFC r314272: call vm_lowmem hook in uma_reclaim_worker

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

7 years agoMFC r314357: edge-triggered interrupt mode is set by clearing APIC_LVT_TM
avg [Sat, 4 Mar 2017 12:04:24 +0000 (12:04 +0000)]
MFC r314357: edge-triggered interrupt mode is set by clearing APIC_LVT_TM

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

7 years agoMFC r313867,r313869,r313870,r314001:
bdrewery [Fri, 3 Mar 2017 21:41:17 +0000 (21:41 +0000)]
MFC r313867,r313869,r313870,r314001:

  r313867:
    Add history and Authors section in the manpage
  r313869:
    Also add vsevolod@ in the authors
  r313870:
    Use full name for the month
  r314001:
    Make it more clear that -k sends SIGKILL, not the -s signal.

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

7 years agoMFC r314400:
np [Fri, 3 Mar 2017 17:57:17 +0000 (17:57 +0000)]
MFC r314400:

cxgbe/iw_cxgbe: fix various double-close panics with iWARP sockets.

Sockets representing the TCP endpoints for iWARP connections are
allocated by the ibcore module.  Before this revision they were closed
either by the ibcore module or the iw_cxgbe hardware driver depending on
the state transitions during connection teardown.  This is error prone
and there were cases where both iw_cxgbe and ibcore closed the socket
leading to double-free panics.  The fix is to let ibcore close the
sockets it creates and never do it in the driver.

- Use sodisconnect instead of soclose (preceded by solinger = 0) in the
  driver to tear down an RDMA connection abruptly.  This does what's
  intended without releasing the socket's fd reference.

- Close the socket in ibcore when the iWARP iw_cm_id is destroyed.  This
  works for all kinds of sockets: clients that initiate connections,
  listeners, and sockets accepted off of listeners.

Sponsored by: Chelsio Communications

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

7 years agoMFH (r278120): add missing ssh-related files
des [Fri, 3 Mar 2017 13:32:01 +0000 (13:32 +0000)]
MFH (r278120): add missing ssh-related files

PR: 193980
Submitted by: mcdouga9@egr.msu.edu

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

7 years agomlx5 module: remove include path that doesn't exist in this branch
avg [Fri, 3 Mar 2017 12:06:33 +0000 (12:06 +0000)]
mlx5 module: remove include path that doesn't exist in this branch

This is a direct commit.
It allows the module to be compiled with the base gcc.

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

7 years agoMFC r288112,r302571: remove unused and redundant declarations and code
avg [Fri, 3 Mar 2017 12:03:50 +0000 (12:03 +0000)]
MFC r288112,r302571: remove unused and redundant declarations and code

r288112 Hide an unused in FreeBSD function behind #ifdef linux to get rid of
the compile time warning.

r302571 Remove redundant declaration for radeon_pm_acpi_event_handler(..) to fix
-Wredundant-decls warning

This allows the code to be compiled with the base gcc.

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

7 years agoMFC r314195:
kib [Fri, 3 Mar 2017 10:17:16 +0000 (10:17 +0000)]
MFC r314195:
Properly handle possible underflow in vm_fault_prefault().

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

7 years agoMFC r313852: Freeze CAM SIM when request is postponed due to MaxCmdSN.
mav [Fri, 3 Mar 2017 06:04:42 +0000 (06:04 +0000)]
MFC r313852: Freeze CAM SIM when request is postponed due to MaxCmdSN.

This allows to avoid resource allocation (especially offload) for requests
that can not be executed at this time any way.

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

7 years agoMFC r313851: Fix tight loop spinning on postponed requests.
mav [Fri, 3 Mar 2017 06:03:01 +0000 (06:03 +0000)]
MFC r313851: Fix tight loop spinning on postponed requests.

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

7 years agoMFC r309649 (oshogbo): tcpdump: allow to use BIOCROTZBUF in capability mode
emaste [Thu, 2 Mar 2017 17:17:06 +0000 (17:17 +0000)]
MFC r309649 (oshogbo): tcpdump: allow to use BIOCROTZBUF in capability mode

The libpcap library can use a BIOCROTZBUF ioctl when net.bpf.zerocopy_enable
sysctl is set.

PR: 217490

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

7 years agoFix r314332 (MFC of r300903): do not use C99 Static array indices
avg [Thu, 2 Mar 2017 09:10:39 +0000 (09:10 +0000)]
Fix r314332 (MFC of r300903): do not use C99 Static array indices

The proper conditional support for that feature has not been MFC-ed yet
and GCC is quirky about it.  See r314101.

This is a direct commit.

Reported by: gjb

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

7 years agoMFC r314101: don't use C99 static array indices with older GCC versions
avg [Wed, 1 Mar 2017 13:47:36 +0000 (13:47 +0000)]
MFC r314101: don't use C99 static array indices with older GCC versions

Sponsored by: Panzura

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

7 years agoMFC r314100: fix a typo in __STDC_VERSION__ in __min_size requirements
avg [Wed, 1 Mar 2017 13:45:50 +0000 (13:45 +0000)]
MFC r314100: fix a typo in __STDC_VERSION__ in __min_size requirements

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

7 years agoMFC r313774: localtime: return NULL if time_t out of range of struct tm
emaste [Wed, 1 Mar 2017 01:44:40 +0000 (01:44 +0000)]
MFC r313774:    localtime: return NULL if time_t out of range of struct tm

Previously we would truncate tm.tm_year for any time_t corresponding to
a year that does not fit in int.  This issue was discovered because it
caused the bash-static build to fail when linking with LLD.

As reported by Rafael Espíndola:

    Configure has

    AC_FUNC_MKTIME

    which expands to a test of mktime that fails with the freebsd
    implementation. Given that, bash compiles a mktime.o file that
    defines just mktime and uses localtime. That goes in a .a file
    that is before libc.

    The freebsd libc defines mktime in localtime.o, which also defines
    localtime among other functions.

    When lld sees an undefined reference to mktime from libc, it uses
    the bash provided one and then tries to find a definition of
    localtime. It is found on libc's localtime.o, but now we have a
    duplicated error.

    The reason it works with bfd is that bash doesn't use mktime
    directly and the undefined reference from libc is resolved to the
    libc implementation. It would also fail to link if bash itself
    directly used mktime.

The bash-static configure test verifies that, for many values of t, either
localtime(t) returns NULL or mktime(localtime(t)) == t.  This test failed
when localtime returned a truncated tm_year.

This was fixed in tzcode in 2004 but has persisted in our tree since
rS2708.

Sponsored by: The FreeBSD Foundation

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

7 years agoMFC r314316:
pfg [Wed, 1 Mar 2017 01:19:41 +0000 (01:19 +0000)]
MFC r314316:
dc(1): Catch up with OpenBSD tag.

OpenBSD rev 1.12 corresponds to our SVN r275162. Update the tag to make
easier future updates. No functional change.

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

7 years agoMFC r312995:
asomers [Wed, 1 Mar 2017 00:13:58 +0000 (00:13 +0000)]
MFC r312995:

Initialize a stack variable in mprsas_get_sas_address_for_sata_disk

Thought it's difficult to reproduce, I think this variable was responsible
for a use-after-free panic when a SATA disk timed out responding to a SATA
identify command during boot.

Submitted by: slm
Reviewed by: slm
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9364

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

7 years agoMFC r312559:
asomers [Tue, 28 Feb 2017 23:56:14 +0000 (23:56 +0000)]
MFC r312559:

Fix misc Coverity defects in camdd(8)

CID 1341620 Fix a small memory leak
CID 1341630 Though this is technically a false positive, rearrange the
code for clarity.
CID 1341635 Eliminate dead code
CID 1368663 Fix a double mutex unlock in the error path

Also:
* Use sig_atomic_t for variables accessed from signal handlers
* Don't conditionalize free(3) on its argument being non-null

Reported by: Coverity
CID: 1341620 1341630 1341635 1368663
Reviewed by: ken
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9237

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

7 years agoMFC r311572, r311895, r311928, r311985, r312395, r312417
asomers [Tue, 28 Feb 2017 22:18:05 +0000 (22:18 +0000)]
MFC r311572, r311895, r311928, r311985, r312395, r312417

r311572:
Fix file descriptor leaks in cmp(1)

Also, add a few test cases

Reported by: Coverity
CID: 271624 275338
Reviewed by: ngie
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9074

r311895:
Fix memory leaks during "tail -r" of an irregular file

* Rewrite r_buf to use standard tail queues instead of a hand-rolled
  circular linked list. Free dynamic allocations when done.
* Remove an optimization for the case where the file is a multiple of 128KB
  in size and there is a scarcity of memory.
* Add ATF tests for "tail -r" and its variants.

Reported by: Valgrind
Reviewed by: ngie
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9067

r311928:
Fix build of usr.bin/tail with GCC

Submitted by: pluknet
Reported by: pluknet
MFC after: 27 days
X-MFC-with: 311895
Sponsored by: Spectra Logic Corp

r311985:
Fix uninitialized variable CIDs in route6d

The variables in question are actually return arguments, but it's still good
form to initialize them.

Reported by: Coverity
CID: 979679 979680
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

r312395:
Fix several Coverity CIDs in devd

CID 13620551362054: File descriptor leaks during shutdown
CID 1362013: Potential null-termination fail with long network device names
CID 1362097: Uncaught exception during memory pressure
CID 13620171362016: Unchecked errors, possibly resulting in weird behavior
if two devd instances start at the same time.
CID 1362015: Unchecked error that will probably never fail

Reported by: Coverity
CID: 1362055 1362054 1362013 1362097 1362017 1362016 1362015
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

r312417:
Fix build of devd with GCC 4.2

Reported by: olivier
Pointy-hat-to: asomers
MFC after: 27 days
X-MFC-with: 312395
Sponsored by: Spectra Logic Corp

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

7 years agoMFC r313734:
kib [Tue, 28 Feb 2017 15:03:34 +0000 (15:03 +0000)]
MFC r313734:
Add RLIM_SAVED_MAX and RLIM_SAVED_CUR symbols.

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

7 years agoMFC r313751: mca: fix writes to MSR_MC_CTL2 in cmci_update
avg [Tue, 28 Feb 2017 11:42:04 +0000 (11:42 +0000)]
MFC r313751: mca: fix writes to MSR_MC_CTL2 in cmci_update

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

7 years agoMFC r313744: No need to erase sense_data when sense_len is set to zero.
mav [Tue, 28 Feb 2017 06:32:01 +0000 (06:32 +0000)]
MFC r313744: No need to erase sense_data when sense_len is set to zero.

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

7 years agoMFC r314244:
ngie [Tue, 28 Feb 2017 00:58:16 +0000 (00:58 +0000)]
MFC r314244:

Remove MK_OBJC block

It is no longer represented via src.conf(5)

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

7 years agoNote: this change reintroduces r314020 after r314327, r314330, and r314332
ngie [Tue, 28 Feb 2017 00:56:33 +0000 (00:56 +0000)]
Note: this change reintroduces r314020 after r314327, r314330, and r314332

MFC r313404:

Improve libnetbsd compatibility with NetBSD

This change is being made to diff reduce/reduce duplication in
contrib/netbsd-tests and to facilitate further porting of software from
NetBSD

Add the following headers:
- sys/event.h:
-- sys/types.h is required for kqueue on FreeBSD, but not NetBSD.
- sys/types.h:
-- NBBY is defined in sys/param.h on FreeBSD, not sys/types.h like on NetBSD.
   Pull in sys/param.h to have parity with NetBSD.
- sys/wait.h:
-- Define wrusage as __wrusage for parity with NetBSD typedef.
- glob.h
-- Define __gl_stat_t as "struct stat" for parity with NetBSD typedef.
- pthread.h:
-- Pull in pthread_np.h for _np functions defined separately on FreeBSD.

Improve compatibility with NetBSD in the following headers:

- sha1.h:
-- define SHA1_CTX as SHA_CTX
-- define SHA1Final as SHA1_Final
- sha2.h:
-- #include sha384 to pick up all of the SHA 384 bit macros and definitions.
- util.h:
-- Add sys/types.h to util.h to pollute the header for types used in
   flags_to_string and string_to_flags (u_long) as NetBSD doesn't require them
   for the functions.

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

7 years agoMFC r314059: zfs: move zio_taskq_basedc under SYSDC
avg [Mon, 27 Feb 2017 17:27:42 +0000 (17:27 +0000)]
MFC r314059: zfs: move zio_taskq_basedc under SYSDC

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

7 years agoMFC r314183: add jedec_ts.4 to the list of manual pages
avg [Mon, 27 Feb 2017 17:25:56 +0000 (17:25 +0000)]
MFC r314183: add jedec_ts.4 to the list of manual pages

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

7 years agoMFC r314037: jedec_ts: fix slave address check
avg [Mon, 27 Feb 2017 17:23:42 +0000 (17:23 +0000)]
MFC r314037: jedec_ts: fix slave address check

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

7 years agoMFC r313752,r314035: mca: use time_uptime instead of ticks for CMCI throttling
avg [Mon, 27 Feb 2017 17:20:49 +0000 (17:20 +0000)]
MFC r313752,r314035: mca: use time_uptime instead of ticks for CMCI throttling

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

7 years agoMFC r313730: try to fix RACCT_RSS accounting
avg [Mon, 27 Feb 2017 17:18:07 +0000 (17:18 +0000)]
MFC r313730: try to fix RACCT_RSS accounting

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

7 years agoMFC r300966: Retune SHA2 code for improved performance on CPUs with more ILP...
avg [Mon, 27 Feb 2017 13:05:17 +0000 (13:05 +0000)]
MFC r300966: Retune SHA2 code for improved performance on CPUs with more ILP...

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

7 years agoMFC r300903: Implement SHA-512 truncated (224 and 256 bits)
avg [Mon, 27 Feb 2017 10:40:39 +0000 (10:40 +0000)]
MFC r300903: Implement SHA-512 truncated (224 and 256 bits)

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

7 years agofix up r314327 (MFC of r292782): sha2 -> sha512 in sys/modules/random
avg [Mon, 27 Feb 2017 10:22:16 +0000 (10:22 +0000)]
fix up r314327 (MFC of r292782): sha2 -> sha512 in sys/modules/random

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

7 years agoMFC r285417: Add new include path for sha256.h
avg [Mon, 27 Feb 2017 10:10:45 +0000 (10:10 +0000)]
MFC r285417: Add new include path for sha256.h

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

7 years agoMFC r292782: Replace sys/crypto/sha2/sha2.c with lib/libmd/sha512c.c
avg [Mon, 27 Feb 2017 08:27:38 +0000 (08:27 +0000)]
MFC r292782: Replace sys/crypto/sha2/sha2.c with lib/libmd/sha512c.c

cperciva's libmd implementation is 5-30% faster
The same was done for SHA256 previously in r263218

Approved by: secteam

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

7 years agoMFC r312644, r312650
bapt [Sat, 25 Feb 2017 19:28:49 +0000 (19:28 +0000)]
MFC r312644, r312650

r312644:
Readd a feature lost in pw(8) refactoring

pw usermod foo -m

It used to be able to (re)create the home directory if it didn't exists

r312650:
Really restore the old behaviour for pw usermod -m

It again reinstall missing skel files without overwriting changed one
Add a regression test about it

PR: 216224
Reported by: ae

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

7 years agoMFC r312787:
cy [Sat, 25 Feb 2017 08:07:28 +0000 (08:07 +0000)]
MFC r312787:

Currently the fragment info is placed at the top of the linked list
under a shared read lock. This patch attempts to upgrade the lock to
an exclusive write lock. If the exclusive write lock fails to be
obtained, the current fragment is not placed at the head of the list.

This portion of the patch was inspired by NetBSD ip_frag.c r1.4 (which
effectively removed the section of code that performed the reordering).

The patch to sys/contrib/ipfilter/netinet/ip_compat.h adds the
MUTEX_TRY_UPGRADE macro to support the patch to ip_frag.c.

The patch to contrib/ipfilter/lib/rwlock_emul.c supports this patch
by emulating the mutex in userspace when exercised by ipftest(1).

Inspired by: NetBSD ip_frag.c r1.4

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

7 years agoMFC r313910: Change XCOPY memory allocations.
mav [Sat, 25 Feb 2017 01:53:45 +0000 (01:53 +0000)]
MFC r313910: Change XCOPY memory allocations.

Before this change XCOPY code could allocate memory in chunks up to 16-32MB
(VMware does XCOPY in 4MB chunks by default), that could be difficult for
VM subsystem to do due to KVA fragmentation, that sometimes created huge
allocation delays, blocking any I/O for respective LU for that time.

This change limits allocations down to TPC_MAX_IO_SIZE, which is 1MB now.
1MB is also not a cookie, but ZFS also can do that for large blocks, so
it should be less dramatic.  As drawback this increases CPU overhead, but
it still look acceptable comparing to time consumed by ZFS read/write.

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

7 years agoMFC r313924,r313925:
ngie [Sat, 25 Feb 2017 00:42:44 +0000 (00:42 +0000)]
MFC r313924,r313925:

r313924:

Quote path to doxygen/kyua in test(1) -x check

This is a basic stopgap against ${LOCALBASE} containing spaces in it

r313925:

Include ${LOCALBASE}/bin in $PATH when running "make checkworld"

Some of the tests in devel/atf // devel/kyua rely on the tools being in $PATH,
which means that the tests fail when run via "make checkworld" because $PATH
is restricted to exclude directory elements like "${LOCALBASE}/bin".

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

7 years agoMFC r313897:
pfg [Fri, 24 Feb 2017 21:38:41 +0000 (21:38 +0000)]
MFC r313897:
ext2fs: Remove unused assignment.

The value is re-assigned a few lines later without being read.

Found by: Clang static analyzer

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

7 years agoMFC r313554:
pfg [Fri, 24 Feb 2017 21:22:13 +0000 (21:22 +0000)]
MFC r313554:
Clean redundant MIN/MAX declarations in some HighPoint drivers.

The hpt27xx(4), hptnr(4), and hptrr(4) drivers declare MIN() and MAX()
internally which match the macros from sys/param.h.

MIN() is not used, MAX is only used once and can be replaced with the
max() version in libkern.h which operates on u_ints.

MFC after: 2 weeks

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

7 years agoMFC r313893
ken [Fri, 24 Feb 2017 20:51:39 +0000 (20:51 +0000)]
MFC r313893

  ------------------------------------------------------------------------
  r313893 | ken | 2017-02-17 13:04:22 -0700 (Fri, 17 Feb 2017) | 48 lines

  Add task attribute support to camcontrol(8).

  Users can use the new generic argument, -Q task_attr, to specify a task
  attribute (simple, ordered, head of queue, aca) for the commands issued.
  The the default is simple, which works with all SCSI devices that support
  tagged queueing.

  This will mostly be useful for debugging target behavior in certain
  situations.

  You can try it out by compiling CTL with CTL_IO_DELAY turned on (in
  sys/cam/ctl/ctl_io.h) and then do something like this with one of the CTL
  LUNs:

  ctladm delay 0:0 -l done -t 10
  camcontrol tur da34 -v

  And at then before the 10 second timer is up, in another terminal:

  camcontrol inquiry da34 -Q ordered -v

  The Inquiry should complete just after the TUR completes.  Ordinarily
  it would complete first because of the delay injection, but because the
  task attribute is set to ordered in this case, CTL holds it up until the
  previous command has completed.

  sbin/camcontrol/camcontrol.c:
   Add the new generic argument, -Q, which allows the user to specify
   a SCSI task attribute.  The user can specify task attributes by
   name or numerically.

   Add a new task_attr arguments to SCSI sub-functions.

  sbin/camcontrol/attrib.c,
  sbin/camcontrol/camcontrol.h,
  sbin/camcontrol/fwdownload.c,
  sbin/camcontrol/modeedit.c,
  sbin/camcontrol/persist.c,
  sbin/camcontrol/timestamp.c,
  sbin/camcontrol/zone.c:
   Add the new task_attr argument to SCSI sub-functions.

  sbin/camcontrol/camcontrol.8:
   Document the new -Q option, and add an example.

  Sponsored by: Spectra Logic

  ------------------------------------------------------------------------

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

7 years agoMFC r313496:
kib [Fri, 24 Feb 2017 11:34:00 +0000 (11:34 +0000)]
MFC r313496:
Increase a chance of devfs_close() calling d_close cdevsw method.

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

7 years agoMFC r313800:
kib [Fri, 24 Feb 2017 11:30:28 +0000 (11:30 +0000)]
MFC r313800:
Do not access memory past the buffer end.
Do not accept and silently truncate too long hostname.

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

7 years agoMFC r313494:
kib [Fri, 24 Feb 2017 11:07:49 +0000 (11:07 +0000)]
MFC r313494:
Handle protected symbols in rtld.

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

7 years agoMFC r313493:
kib [Fri, 24 Feb 2017 09:30:51 +0000 (09:30 +0000)]
MFC r313493:
Define ELF_ST_VISIBILITY().

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

7 years agoMFC r282774: Unbreak MIPS build following r282726 (MFCed in r314144)
avg [Thu, 23 Feb 2017 22:10:37 +0000 (22:10 +0000)]
MFC r282774: Unbreak MIPS build following r282726 (MFCed in r314144)

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

7 years agofixup r314143, MFC of r285366 didn't remove files that it should have
avg [Thu, 23 Feb 2017 21:54:16 +0000 (21:54 +0000)]
fixup r314143, MFC of r285366 didn't remove files that it should have

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

7 years agoMFC r282736: Unbreak build following rev. 282726 (MFC-ed as r314144)
avg [Thu, 23 Feb 2017 18:54:33 +0000 (18:54 +0000)]
MFC r282736: Unbreak build following rev. 282726 (MFC-ed as r314144)

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

7 years agoMFC r263219: add sha256c.c to the various modules that included sha2.c...
avg [Thu, 23 Feb 2017 16:15:42 +0000 (16:15 +0000)]
MFC r263219: add sha256c.c to the various modules that included sha2.c...

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

7 years agoMFC r282726: Ensure libmd symbols do not clash with libcrypto
avg [Thu, 23 Feb 2017 16:07:45 +0000 (16:07 +0000)]
MFC r282726: Ensure libmd symbols do not clash with libcrypto

Add a prefix to all symbols in libmd to avoid incompatibilites
with same-named, but not binary compatible, symbols from libcrypto.

Also introduce Weak aliases to avoid the need to rebuild dependent
binaries and a major version bump.

PR: 199119

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

7 years agoMFC r263215,r263218,r285366: replace the kernel sha256 code
avg [Thu, 23 Feb 2017 16:05:11 +0000 (16:05 +0000)]
MFC r263215,r263218,r285366: replace the kernel sha256 code

r263215 copy these files from lib/libmd in preperation for moving these
files into the kernel...

r263218 replace the kernel's version w/ cperciva's implementation...

r285366 Complete the move that was started w/ r263218..

Note that the last change is out of order with r282726 that I am going
to merge as well.

Many thanks to cperciva for the more efficient code and to jmg for
integrating it into the kernel.

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

7 years agoMFC r312689, r312690
dexuan [Thu, 23 Feb 2017 07:07:21 +0000 (07:07 +0000)]
MFC r312689, r312690

Approved by: sephe (mentor)

r312689
    hyperv/hn: add a sysctl name for the VF interface

    This makes it easier for the userland script to find the releated
    VF interface.

    Reviewed by: sephe
    Approved by: sephe (mentor)
    Sponsored by: Microsoft
    Differential Revision: https://reviews.freebsd.org/D9101

r312690
    hyperv/hn: add devctl_notify for VF_UP/DOWN events

    Reviewed by: sephe
    Approved by: sephe (mentor)
    Sponsored by: Microsoft
    Differential Revision: https://reviews.freebsd.org/D9102

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

7 years agoMFC: r312688
dexuan [Thu, 23 Feb 2017 07:04:17 +0000 (07:04 +0000)]
MFC: r312688

Approved by: sephe (mentor)

r312688
    hyperv/hn: add the support for VF drivers (SR-IOV)

    Hyper-V's NIC SR-IOV implementation needs a Hyper-V synthetic NIC and
    a VF NIC to work together (both NICs have the same MAC address), mainly to
    support seamless live migration.

    When the VF device becomes UP (or DOWN), the synthetic NIC driver needs
    to switch the data path from the synthetic NIC to the VF (or the opposite).

    Note: multicast/broadcast packets are still received through the synthetic
    NIC and we need to inject the packets through the VF interface (if the VF is
    UP), even if the synthetic NIC is DOWN (so we need to force the rxfilter
    to be NDIS_PACKET_TYPE_PROMISCUOUS, when the VF is UP).

    Reviewed by: sephe
    Approved by: sephe (mentor)
    Sponsored by: Microsoft
    Differential Revision: https://reviews.freebsd.org/D8964

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

7 years agoMFC: r312687, r312916
dexuan [Thu, 23 Feb 2017 06:57:18 +0000 (06:57 +0000)]
MFC: r312687, r312916

Approved by: sephe (mentor)

r312687
    ifnet: introduce event handlers for ifup/ifdown events

    Hyper-V's NIC SR-IOV implementation needs a Hyper-V synthetic NIC and
    a VF NIC to work together, mainly to support seamless live migration.

    When the VF device becomes UP (or DOWN), the synthetic NIC driver needs
    to switch the data path from the synthetic NIC to the VF (or the opposite).

    So the synthetic NIC driver needs to know when a VF device is becoming
    UP or DOWN and hence the patch is made.

    Reviewed by: sephe
    Approved by: sephe (mentor)
    Sponsored by: Microsoft
    Differential Revision: https://reviews.freebsd.org/D8963

r312916
    ifnet: move the new ifnet_event EVENTHANDLER_DECLARE to net/if_var.h

    Thank glebius for pointing this out:
    "The network stuff shall not be added to sys/eventhandler.h"

    Reviewed by: David_A_Bright_DELL.com, sephe, glebius
    Approved by: sephe (mentor)
    Sponsored by: Microsoft
    Differential Revision: https://reviews.freebsd.org/D9345

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

7 years agoMFC: r312685, r312686
dexuan [Thu, 23 Feb 2017 06:49:46 +0000 (06:49 +0000)]
MFC: r312685, r312686

Approved by: sephe (mentor)

r312685
    hyperv/hn: remember the channel pointer in struct hn_rx_ring

    This will be used by the coming NIC SR-IOV patch.

    Reviewed by: sephe
    Approved by: sephe (mentor)
    Sponsored by: Microsoft
    Differential Revision: https://reviews.freebsd.org/D8909

r312686
    hyperv/hn: remove the MTU and IFF_DRV_RUNNING checking in hn_rxpkt()

    It's unnecessary because the upper nework stack does the same checking.

    In the case of Hyper-V SR-IOV, we need to remove the checking because
    1) multicast/broadcast packets are still received through the synthetic
    NIC and we need to inject the packets through the VF interface;
    2) we must inject the packets even if the synthetic NIC is down, or has
    a different MTU from the VF device.

    Reviewed by: sephe
    Approved by: sephe (mentor)
    Sponsored by: Microsoft
    Differential Revision: https://reviews.freebsd.org/D8962

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

7 years agoMFC: r311979
marius [Wed, 22 Feb 2017 17:57:24 +0000 (17:57 +0000)]
MFC: r311979

Reset the EIAC register to include the LINK status bit and restore
link up/down notifications.

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

7 years agoMFC r313735: add svcpool_close to handle killed nfsd threads
avg [Tue, 21 Feb 2017 09:29:46 +0000 (09:29 +0000)]
MFC r313735: add svcpool_close to handle killed nfsd threads

PR: 204340
Reported by: Panzura
Reviewed by: rmacklem
Approved by: rmacklem

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

7 years agoMFC r313687: remove l2_padding_needed statistic from zfs arc
avg [Tue, 21 Feb 2017 09:13:38 +0000 (09:13 +0000)]
MFC r313687: remove l2_padding_needed statistic from zfs arc

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

7 years agoMFC r313686: check remaining space in zfs implementations of vptocnp
avg [Tue, 21 Feb 2017 08:57:27 +0000 (08:57 +0000)]
MFC r313686: check remaining space in zfs implementations of vptocnp

PR: 216939

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

7 years agoRevert r314020
ngie [Tue, 21 Feb 2017 07:02:51 +0000 (07:02 +0000)]
Revert r314020

The test build I ran unfortunately didn't catch the fact that the sha384.h
compat header is missing on ^/stable/10 due to some code not being MFCed

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

7 years agoMFC r313736: Fix panic on shutdown of ramdisk LU with zero capacity.
mav [Tue, 21 Feb 2017 05:13:16 +0000 (05:13 +0000)]
MFC r313736: Fix panic on shutdown of ramdisk LU with zero capacity.

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

7 years agoMFC r312213,r313713:
ngie [Tue, 21 Feb 2017 03:50:57 +0000 (03:50 +0000)]
MFC r312213,r313713:

r312213:

Turn COMPILER_VERSION/COMPILER_TYPE make check into a compile-time check
of the clang version

This works around breakage on ^/stable/10 when running installworld from
a ^/stable/10 host where the test wouldn't be compiled on the first
go-around and would be missing when make installworld is run.

PR: 208703

r313713:

Handle clang 4.x+ with the compile-time exception added in r312213

It also fails the assertions noted in bug 208703

PR: 208703
PR: 217084

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

7 years agoMFC r313404:
ngie [Tue, 21 Feb 2017 03:46:37 +0000 (03:46 +0000)]
MFC r313404:

Improve libnetbsd compatibility with NetBSD

This change is being made to diff reduce/reduce duplication in
contrib/netbsd-tests and to facilitate further porting of software from
NetBSD

Add the following headers:
- sys/event.h:
-- sys/types.h is required for kqueue on FreeBSD, but not NetBSD.
- sys/types.h:
-- NBBY is defined in sys/param.h on FreeBSD, not sys/types.h like on NetBSD.
   Pull in sys/param.h to have parity with NetBSD.
- sys/wait.h:
-- Define wrusage as __wrusage for parity with NetBSD typedef.
- glob.h
-- Define __gl_stat_t as "struct stat" for parity with NetBSD typedef.
- pthread.h:
-- Pull in pthread_np.h for _np functions defined separately on FreeBSD.

Improve compatibility with NetBSD in the following headers:

- sha1.h:
-- define SHA1_CTX as SHA_CTX
-- define SHA1Final as SHA1_Final
- sha2.h:
-- #include sha384 to pick up all of the SHA 384 bit macros and definitions.
- util.h:
-- Add sys/types.h to util.h to pollute the header for types used in
   flags_to_string and string_to_flags (u_long) as NetBSD doesn't require them
   for the functions.

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

7 years agoMFC 312250
sephe [Tue, 21 Feb 2017 03:27:59 +0000 (03:27 +0000)]
MFC 312250

    alc: Add Killer E2500 support

    Reviewed by:    jhb, yongari
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D9058

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

7 years agoMFC 311743
sephe [Tue, 21 Feb 2017 03:14:05 +0000 (03:14 +0000)]
MFC 311743

    hyperv: Add method to read 64bit Hyper-V specific time value.

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

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

7 years agoMFC 311475
sephe [Tue, 21 Feb 2017 03:00:33 +0000 (03:00 +0000)]
MFC 311475

    if: Defer the if_up until the ifnet.if_ioctl is called.

    This ensures the interface is initialized by the interface driver
    before it can be used by the rest of the system.

    Reviewed by:    jhb, karels, gnn
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8905

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

7 years agoMFC r313652:
ngie [Tue, 21 Feb 2017 02:38:14 +0000 (02:38 +0000)]
MFC r313652:

Use SRCTOP instead of .CURDIR relative paths with ".."

This simplifies pathing in make/displayed output

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

7 years agoMFC r313654:
ngie [Tue, 21 Feb 2017 02:34:59 +0000 (02:34 +0000)]
MFC r313654:

Use SRCTOP to refer to awk source in contrib/awk and remove unnecessary AWKSRC prefix
for maketab.c

The former simplifies pathing in make/displayed output, whereas the latter was just
unnecessarily superfluous since .PATH referenced the path to maketab.c earlier on in
the Makefile.

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