]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoSwitch BEAGLEBONE, CUBIEBOARD, and PANDABOARD to use the GENERIC
gjb [Mon, 9 Oct 2017 17:12:02 +0000 (17:12 +0000)]
Switch BEAGLEBONE, CUBIEBOARD, and PANDABOARD to use the GENERIC
kernel configuration.

Submitted by: andrew
Differential Revision: https://reviews.freebsd.org/D12484
Sponsored by: The FreeBSD Foundation

6 years agoFix freebsd-update(8) erroneous message and exit status when "fetch install" used.
ygy [Mon, 9 Oct 2017 16:33:37 +0000 (16:33 +0000)]
Fix freebsd-update(8) erroneous message and exit status when "fetch install" used.

PR: 190660
Reviewed by: allanjude
Approved by: emaste
Differential Revision: https://reviews.freebsd.org/D12037

6 years agoChange amd64_get_ldt() to return 'EOF' when the LDT is not yet
kib [Mon, 9 Oct 2017 16:20:39 +0000 (16:20 +0000)]
Change amd64_get_ldt() to return 'EOF' when the LDT is not yet
allocated, when requested range of descriptors does not fit into
currently allocated LDT, or trim the return if the range fits
partially.  Before, the function returned EINVAL.

Reviewed by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoChange i386_get_ldt() to return 'EOF' when the requested range of
kib [Mon, 9 Oct 2017 16:19:26 +0000 (16:19 +0000)]
Change i386_get_ldt() to return 'EOF' when the requested range of
descriptors does not fit into currently allocated LDT, or trim the
return if the range fits partially.  Before, the function returned
EINVAL.

Fix two bugs in r324366: use capped num counter for malloc size, and
do not leak allocated buffer on EINVAL (by handling EINVAL case as
normal, see above).

Reviewed by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoImprovements to set_user_ldt().
kib [Mon, 9 Oct 2017 16:07:27 +0000 (16:07 +0000)]
Improvements to set_user_ldt().

Remove mtx_owned() checks from set_user_ldt().  Split the function
into _locked() version which requires the dt_lock spinlock owned, and
make set_user_ldt() a wrapper.  Add a comment in swtch.s noting that
the call to the new set_user_ldt() cannot recurse on dt_lock.

Remove #ifdef SMP block, the addend is always zero on UP.

Fix type of set_user_ldt_rv(), making it match the type used for
smb_rendezvous() callback, and remove the cast.  Use curproc.

Reviewed by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoSee r198948
eadler [Mon, 9 Oct 2017 16:02:15 +0000 (16:02 +0000)]
See r198948

6 years agoAdd the firmware for the Intel 8265 WiFi device.
gnn [Mon, 9 Oct 2017 15:54:57 +0000 (15:54 +0000)]
Add the firmware for the Intel 8265 WiFi device.

MFC after: 1 month

6 years agoAdd support for Intel 8265 WiFi
gnn [Mon, 9 Oct 2017 15:48:56 +0000 (15:48 +0000)]
Add support for Intel 8265 WiFi

Obtained from: OpenBSD
MFC after: 1 month

6 years agoReset the fs and gs bases on exec(2).
kib [Mon, 9 Oct 2017 15:39:43 +0000 (15:39 +0000)]
Reset the fs and gs bases on exec(2).

The values from the old address space do not make sense for the new
program.  In particular, gsbase might be the TLS base for the old
program but the new program has no TLS now.

amd64 already handles this correctly.

Reported and reviewed by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoMore style.
kib [Mon, 9 Oct 2017 15:24:18 +0000 (15:24 +0000)]
More style.

Reviewed by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agopatch(1): Don't overrun line buffer in some cases
kevans [Mon, 9 Oct 2017 14:50:02 +0000 (14:50 +0000)]
patch(1): Don't overrun line buffer in some cases

Patches like file.txt attached to PR 190195 with a final line formed
like ">(EOL)" could cause a copy past the end of the current line buffer. In the
case of PR 191641, this caused a duplicate line to be copied into the resulting
file.

Instead of running past the end, treat it as if it were a blank line.

PR: 191641
Reviewed by: cem, emaste, pfg
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D12609

6 years agoUndocument "tdnam" (leaving it as an alias), and rename the column
trasz [Mon, 9 Oct 2017 13:53:41 +0000 (13:53 +0000)]
Undocument "tdnam" (leaving it as an alias), and rename the column
to TDNAME.

Suggested by: bde
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoFix long name (used by libxo) for the "tdnam" ps(1) keyword.
trasz [Mon, 9 Oct 2017 13:48:10 +0000 (13:48 +0000)]
Fix long name (used by libxo) for the "tdnam" ps(1) keyword.

Reported by: pluknet
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoDocument "tdnam" keyword to ps(1), and add "tdname" alias.
trasz [Mon, 9 Oct 2017 10:24:06 +0000 (10:24 +0000)]
Document "tdnam" keyword to ps(1), and add "tdname" alias.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoillumos mutex_init: use SX_NEW instead of bzero
avg [Mon, 9 Oct 2017 07:44:09 +0000 (07:44 +0000)]
illumos mutex_init: use SX_NEW instead of bzero

There should be no functional change, but SX_NEW seems to be more
idiomatic to the use-case.

MFC after: 2 weeks
X-MFC note: stable/11 only

6 years agoRemove CVS - we don't run that infrastructure anymore
eadler [Mon, 9 Oct 2017 05:16:34 +0000 (05:16 +0000)]
Remove CVS - we don't run that infrastructure anymore

6 years agoUpdate iso3166 codes
eadler [Mon, 9 Oct 2017 05:01:51 +0000 (05:01 +0000)]
Update iso3166 codes

Based on https://raw.githubusercontent.com/lukes/ISO-3166-Countries-with-Regional-Codes/master/all/all.csv
and hand massaged.

6 years agoAdd macOS 10.13
eadler [Mon, 9 Oct 2017 04:43:05 +0000 (04:43 +0000)]
Add macOS 10.13

6 years agoThe blst_radix_init function has two purposes - to compute the number of
alc [Sun, 8 Oct 2017 22:17:39 +0000 (22:17 +0000)]
The blst_radix_init function has two purposes - to compute the number of
nodes to allocate for the blist, and to initialize them.  The computation
can be done much more quickly by identifying the terminating node, if any,
at every level of the tree and then summing the number of nodes at each
level that precedes the topmost terminator.  The initialization can also be
done quickly, since settings at the root mark the tree as all-allocated, and
only a few terminator nodes need to be marked in the rest of the tree.
Eliminate blst_radix_init, and perform its two functions more simply in
blist_create.

The allocation of the blist takes places in two pieces, but there's no good
reason to do so, when a single allocation is sufficient, and simpler.
Allocate the blist struct, and the array of nodes associated with it, with a
single allocation.

Submitted by: Doug Moore <dougm@rice.edu>
Reviewed by: markj (an earlier version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11968

6 years agoFix imx6 hdmi init after r323553, which used a config_intrhook to defer the
ian [Sun, 8 Oct 2017 18:38:22 +0000 (18:38 +0000)]
Fix imx6 hdmi init after r323553, which used a config_intrhook to defer the
attachment of i2c devices needed by hdmi.

The hdmi init also uses an intrhook callback to defer initialization, and if
the hdmi callback runs first, the i2c devices will not yet have registered
their device_t in association with their FDT phandle, which allows cross-
device references on FDT systems.

Now the hdmi deferred init checks for the i2c device registration, and if
it's not complete yet, it registers as an eventhandler watching for newbus
attach events.  When the i2c device eventually attaches, the hdmi driver
unregisters from watching further events, and continues with the hdmi init.
Because the function signatures for an intrhook callback and an event
handler callback are the same, a single function is used for both callbacks.

Reported by: Russell Haley <russ.haley@gmail.com>

6 years agoAdd eventhandler notifications for newbus device attach/detach.
ian [Sun, 8 Oct 2017 17:33:49 +0000 (17:33 +0000)]
Add eventhandler notifications for newbus device attach/detach.

The detach case is slightly complicated by the fact that some in-kernel
consumers may want to know before a device detaches (so they can release
related resources, stop using the device, etc), but the detach can fail. So
there are pre- and post-detach notifications for those consumers who need to
handle all cases.

A couple salient comments from the review, they amount to some helpful
documentation about these events, but there's currently no good place for
such documentation...

Note that in the current newbus locking model, DETACH_BEGIN and
DETACH_COMPLETE/FAILED sequence of event handler invocation might interweave
with other attach/detach events arbitrarily. The handlers should be prepared
for such situations.

Also should note that detach may be called after the parent bus knows the
hardware has left the building. In-kernel consumers have to be prepared to
cope with this race.

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

6 years agocapsicum_helpers: Add EVENT to default stdio rights set
trasz [Sun, 8 Oct 2017 17:29:43 +0000 (17:29 +0000)]
capsicum_helpers: Add EVENT to default stdio rights set

Without it, calling caph_limit_stdio(3) breaks Irssi.

Reviewed by: oshogbo
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12622

6 years agoRestore the ability to deregister an eventhandler from within the callback.
ian [Sun, 8 Oct 2017 17:21:16 +0000 (17:21 +0000)]
Restore the ability to deregister an eventhandler from within the callback.

When the EVENTHANDLER(9) subsystem was created, it was a documented feature
that an eventhandler callback function could safely deregister itself. In
r200652 that feature was inadvertantly broken by adding drain-wait logic to
eventhandler_deregister(), so that it would be safe to unload a module upon
return from deregistering its event handlers.

There are now 145 callers of EVENTHANDLER_DEREGISTER(), and it's likely many
of them are depending on the drain-wait logic that has been in place for 8
years. So instead of creating a separate eventhandler_drain() and adding it
to some or all of those 145 call sites, this creates a separate
eventhandler_drain_nowait() function for the specific purpose of
deregistering a callback from within the running callback.

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

6 years agoReplace an unnecessary call to vm_page_activate() by an assertion that
alc [Sun, 8 Oct 2017 16:54:42 +0000 (16:54 +0000)]
Replace an unnecessary call to vm_page_activate() by an assertion that
the page is already wired or queued.  Prior to the elimination of PG_CACHED
pages, vm_page_grab() might have returned a valid, previously PG_CACHED
page, in which case enqueueing the page was necessary.  Now, that can't
happen.  Moreover, activating the page is a dubious choice, since the page
is not being accessed.

Reviewed by: kib
MFC after: 1 week

6 years agoFix symlink if_igb.ko in -current such that its relative and doesn't
sbruno [Sat, 7 Oct 2017 23:33:14 +0000 (23:33 +0000)]
Fix symlink if_igb.ko in -current such that its relative and doesn't
end up with non-standard DESTDIR information in its symlink.  This
can happen very trivially if the release scripts are used.

Sponsored by: Limelight Networks

6 years agoCheck so_error early in sendfile() call. Prior to this patch, if a
sbruno [Sat, 7 Oct 2017 23:30:57 +0000 (23:30 +0000)]
Check so_error early in sendfile() call.  Prior to this patch, if a
connection was reset by the remote end, sendfile() would just report
ENOTCONN instead of ECONNRESET.

Submitted by: Jason Eggleston <jason@eggnet.com>
Reviewed by: glebius
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12575

6 years agorandom(4): Gather entropy from Pure sources
cem [Sat, 7 Oct 2017 19:02:03 +0000 (19:02 +0000)]
random(4): Gather entropy from Pure sources

At initialization, hc_source_mask only includes non-Pure sources.

The patch changes source registration to enable the registered source in the
hc_source_mask bitmask. This mask governs which sources are harvested.

This patch also disallows userspace from disabling such sources.

PR: 222807
Submitted by: W. Dean Freeman <badfilemagic AT gmail.com>
Reviewed by: jmg (earlier version), delphij
Approved by: secteam (delphij)
Obtained from: HBSD 0054e3e170e083811acc9f3b637f8be8a86c03e7
Security: yes
Differential Revision: https://reviews.freebsd.org/D12611

6 years agorandom(4): Add missing source descriptions
cem [Sat, 7 Oct 2017 18:59:29 +0000 (18:59 +0000)]
random(4): Add missing source descriptions

Add source descriptions missed in r260847, r303035.

While here, convert the array to C99 initializers.

Reviewed by: delphij
Approved by: secteam (delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12618

6 years agoUnbreak building efiboot with MK_ZFS == no
ngie [Sat, 7 Oct 2017 17:40:31 +0000 (17:40 +0000)]
Unbreak building efiboot with MK_ZFS == no

Wrap `efi_zfs_is_preferred` with `#ifdef EFI_ZFS_BOOT`.

Reported by: Guy Yur <guyyur@gmail.com>

6 years agocxgbe(4): Update T6, T5, and T4 firmwares to 1.16.63.0.
np [Sat, 7 Oct 2017 17:24:23 +0000 (17:24 +0000)]
cxgbe(4): Update T6, T5, and T4 firmwares to 1.16.63.0.

Changes since 1.16.26.0 for all three firmwares are listed below.  This
list was obtained from the Release Notes of the Chelsio Unified Wire
v3.5.05 release for Linux.

T6 Firmware
++++++++++++
================================================================================
Version : 1.16.63.0
Date    : 09/29/2017
================================================================================

Fixes
-----

BASE:
- Fixed a fw crash when configured traffic rate limit is less than 10kbps.
- Fixed traffic rate limiting for smaller traffic rate value.

ETH:
- Fixed 40G link failure when interface is toggled.
- Fixed adapter crash when interface is toggled during traffic.
- Fixed 25G link failure when PEER only supports consortium mode autoneg
  for 25G.
- Fixed 100G optics link failure when cable is plugged in after bringing up
  the interface.
- Enable RS FEC as default if speed is 100G.
- Fixed DCBX configuration refresh failure.

OFLD
- Fixed 0B iWARP ingress read failure.
- Fixed iWARP SRQ reuse failure.

FOiSCSI:
- Fixed vlan interface ping failure.
- Fixed target discovery failures.
- Fixed mutual chap login failure.

================================================================================
Version : 1.16.59.0
Date    : 09/05/2017
================================================================================

FIXES
-----

BASE:
- Fixed fw crash caused by MC parity error in SO adapters.
- Generate Timer0Int interrupt if fw crashes due to unaligned access error. Host
  driver must look into PCIE_FW register to see if any fw fatal error has
  encountered. If PCIE_FW doesn't indicate any error then driver must ignore this
  interrupt.
- Fixed receive buffer threshold settings which was resulting in error frames on
  receive side.

ETH:
- Fixed an issue in connection traffic shaping when
  FLOWC_WR->FW_FLOWC_MNEM_SCHEDCLASS is not received in first WR on the connection.
- Fixed link failure when speed is changed from 10G-1G-10G due to incorrect flag
  check.
- Fixed improper LED behaviour for blink test and when traffic is running.
- Removed storage of previous fec settings from fw. Driver needs to pass the user
  settings whenever a new module is plugged in as fw resets these when a module is
  unplugged.

OFLD
- OVS offload: TP cache is flushed periodically to get the accuate filters stats
  (hit count).

ENHANCEMENTS
------------

BASE:
- Ring backbone feature added. New FW_PARAMS_PARAM_DEV_RING_BACKBONE param type
  added to query and enable ring backbone support.
- VNI support added for filtering. New entry_type FW_VI_MAC_TYPE_EXACTMAC_VNI
  added to FW_VI_MAC_CMD.
- Added new API FW_PARAM_PARAM_DEV_MPSBGMAP to read the priority to buffer group
  mapping for the ports.
- FW_PARAMS_PARAM_DEV_TPCHMAP API added to read the port to channel mapping.
- HMA (Host memory access) support added. New FW_HMA_CMD and
  FW_PARAMS_PARAM_DEV_HMA_SIZE added to query and configure the HMA. It
  enables the memfree support (256 connections) for iwarp.
- PTP support enabled.

ETH:
- Added consortium mode 50G support.
- Added the ability to allow only selected speeds to be advertised during auto
  negotiation.
- Increased port capability from 16 to 32 bits to support more speeds.
  FW_PARAMS_PARAM_PFVF_PORT_CAPS32 added to query whether fw supports 16 or 32
  bit port capability.

OFLD:
- RDMA Write with immediate support added (iwarp 2.0 feature)
- FW_TLS_KEYCTX_TX_WR removed and security key management moved to driver.
- 256 offloaded connections support for iwarp on SO adapters.

iSCSI:
- New param FW_PARAMS_PARAM_DEV_PPOD_EDRAM added for iscsi ppod configuration
  in EDRAM (performance improvement).

FOiSCSI:
- iSCSI Command offload target support added.

FOFCoE:
- FCoE support enabled.

================================================================================
Version : 1.16.43.0
Date    : 05/05/2017
================================================================================

FIXES
-----

BASE:
- Fixed default DCB mode to AUTO.
- Fixed DCBX bugs when AUTO mode is configured in config file.
- Fixed an issue where even after removing PFC from switch, PFC wasn't getting
  reset.
- Fixed DDR3/DDR4 ECC errors.
- Fixed an FLR issue where FLR completion was going to host before FLR
  processing is finished in fw.

ETH:
- Fixed bug in writing multi-bytes using i2c interface.
- Fixed the link failure when optical cable is inserted into the QSA module
  after loading the driver.
- Fixed false link up when peer interface was brought down.
- Enabling RS FEC by default for 100Gbase-SR4 according to 802.3BJ standard.
- Fixed bugs related to negotiated fec based local/peer fec ability and request.
- Fixed auto-neg failure with few switches.
- T6 Performance improvement fixes.

OFLD
- Fixed an extra credit issue if FW_RI_TYPE_FINI is delayed in fw due to
  backpressure.
- Added a new queue type FW_IQ_TYPE_VF_CQ to handle the FW_PARAMS_PARAM_DMAQ*
  commands. queue type will be part of the FW_PARAMS_PARAM_DMAQ_IQ_INTIDX
  value. Used in guest RDMA (RDMA from VM/VF) usecase.
- T6 Crypto Coprocessor mode bug fixes.
- T6 Crypto TLS-inline mode bug fixes.

ENHANCEMENTS
------------

BASE:
- Added new API FW_PARAM_PARAM_DEV_MPSBGMAP to read the priority to buffer
  group mapping for the ports.

ETH:
- Added broadcom consortium next page support for 25G CR.
  This can be enabled using flags=an_brcm option in the t6-config.txt file.
- Added spider mode support.
- Added support for 10G-BaseT converter sfp+ module.
- Added support for additional 25G/100G cables.
- Added support to enable/disable auto-neg using ethtool.

================================================================================
Version : 1.16.33.0
Date    : 02/24/2017
================================================================================

Fixes
-----

BASE:
- Fixed DDR4 uncorrectable errors.

ETH:
- Enabled link auto negotiation (AN) by default in config file.
- Added AN and FEC control api. Host driver and application can enable/disable
  AN and FEC.

ENHANCEMENTS
------------

BASE:
- Enabled High priorty filter.
- Added T6425 adapter support.

ETH:
- Added new workrequest ETH_TX_PKTS2_WR (see fw api document for more details).

================================================================================
Version : 1.16.29.0
Date    : 01/27/2017
================================================================================

FIXES
-----

BASE:
- Set multiple fec values only if AN is enabled in config file and when module
  is connected.
- Fixed intermittent DDR3/4 ECC errors.
- max number of ethctrl queue in VF set to 2 (reverted the last change
  because it causes problem in VF drivers).

ETH:
- Made devlog more verbose by printing cable information in redable form.
- Updated AN settings to work with more 25G/100G switches.
- Added support for more SFP28/QSFP28 cables.
- Fixed an issue of link going down after few hours of idle time.

OFLD:
- Fixed an issue in TLS which was causing fw crash on running TLS traffic.

FOiSCSI:
- Fixed the failure of PXE boot OS install on an iscsi lun.

ENHANCEMENTS
------------

OFLD:
- Added filtering support for NAT. New WR FW_FILTER2_WR and
  FW_PARAMS_PARAM_DEV_FILTER2_WR added for the same.
- Added RDMA guest mode (mode 3 or RDMA from VF) support.

================================================================================

T5 Firmware
++++++++++++
================================================================================
Version : 1.16.63.0
Date    : 09/29/2017
================================================================================

Fixes
-----

BASE:
- Fixed offload memory overcommit in case of SO adapter.

ETH:
- Fixed DCBX configuration refresh failure.

OFLD
- Fixed 0B iWARP ingress read failure.

FOiSCSI:
- Fixed vlan interface ping failure.

================================================================================
Version : 1.16.59.0
Date    : 09/05/2017
================================================================================

FIXES
-----

BASE:
- Fixed an FLR issue which was causing error when VF attached VM was powered on.

ETH:
- Fixed an issue in connection traffic shaping when
  FLOWC_WR->FW_FLOWC_MNEM_SCHEDCLASS is not received in first WR on the connection.
- Fixed link failure when speed is changed from 10G-1G-10G due to incorrect flag
  check.
- Fixed T580 link failure with few switches which take more time for
  establishing link.

ENHANCEMENTS
------------

BASE:
- Ring backbone feature added. New FW_PARAMS_PARAM_DEV_RING_BACKBONE param type
  added to query and enable ring backbone support.
- Added new API FW_PARAM_PARAM_DEV_MPSBGMAP to read the priority to buffer group
  mapping for the ports.
- FW_PARAMS_PARAM_DEV_TPCHMAP API added to read the port to channel mapping.

FOiSCSI:
- iSCSI Command offload target support added.

================================================================================
Version : 1.16.43.0
Date    : 05/05/2017
================================================================================

FIXES
-----

BASE:
- Fixed default DCB mode to AUTO.
- Fixed DCBX bugs when AUTO mode is configured in config file.
- Fixed an issue where even after removing PFC from switch, PFC wasn't getting
  reset.

ETH:
- Fixed bug in writing multi-bytes using i2c interface.
- Fixed the link failure when optical cable is inserted into the QSA module
  after loading the driver.

OFLD
- Fixed an extra credit issue if FW_RI_TYPE_FINI is delayed in fw due to
  backpressure.
- Added a new queue type FW_IQ_TYPE_VF_CQ to handle the FW_PARAMS_PARAM_DMAQ*
  commands. queue type will be part of the FW_PARAMS_PARAM_DMAQ_IQ_INTIDX
  value. Used in guest RDMA (RDMA from VM/VF) usecase.

ENHANCEMENTS
------------

BASE:
- Added new API FW_PARAM_PARAM_DEV_MPSBGMAP to read the priority to buffer
  group mapping for the ports.

================================================================================
Version : 1.16.33.0
Date    : 02/24/2017
================================================================================

ENHANCEMENTS
------------

ETH:
- Added new workrequest ETH_TX_PKTS2_WR (see fw api document for more details).

================================================================================
Version : 1.16.29.0
Date    : 01/27/2017
================================================================================

FIXES
-----

BASE:
- max number of ethctrl queue in VF set to 2 (reverted the last change
  because it causes problem in VF drivers).

FOiSCSI:
- Fixed the failure of PXE boot OS install on an iscsi lun.

ENHANCEMENTS
------------

OFLD:
- Added filtering support for NAT. New WR FW_FILTER2_WR and
  FW_PARAMS_PARAM_DEV_FILTER2_WR added for the same.
- Added RDMA guest mode (mode 3 or RDMA from VF) support.

================================================================================

T4 Firmware
+++++++++++
================================================================================
Version : 1.16.63.0
Date    : 09/29/2017
================================================================================

Fixes
-----

ETH:
- Fixed DCBX configuration refresh failure.

FOiSCSI:
- Fixed vlan interface ping failure.

================================================================================
Version : 1.16.59.0
Date    : 09/05/2017
================================================================================

FIXES
-----

ETH:
- Fixed an issue in connection traffic shaping when
  FLOWC_WR->FW_FLOWC_MNEM_SCHEDCLASS is not received in first WR on the connection.

ENHANCEMENTS
------------

BASE:
- FW_PARAMS_PARAM_DEV_TPCHMAP API added to read the port to channel mapping.

================================================================================
Version : 1.16.43.0
Date    : 05/05/2017
================================================================================

FIXES
-----

BASE:
- Fixed default DCB mode to AUTO.
- Fixed DCBX bugs when AUTO mode is configured in config file.
- Fixed an issue where even after removing PFC from switch, PFC wasn't getting
  reset.

ETH:
- Fixed bug in writing multi-bytes using i2c interface.

OFLD
- Fixed an extra credit issue if FW_RI_TYPE_FINI is delayed in fw due to
  backpressure.
- Added a new queue type FW_IQ_TYPE_VF_CQ to handle the FW_PARAMS_PARAM_DMAQ*
  commands. queue type will be part of the FW_PARAMS_PARAM_DMAQ_IQ_INTIDX
  value. Used in guest RDMA (RDMA from VM/VF) usecase.

ENHANCEMENTS
------------

BASE:
- Added new API FW_PARAM_PARAM_DEV_MPSBGMAP to read the priority to buffer
  group mapping for the ports.

Obtained from: Chelsio Communications
MFC after: 2 weeks
Sponsored by: Chelsio Communications

6 years agoAllwinner: Add clock driver for ccu_sun8i_r
manu [Sat, 7 Oct 2017 16:48:42 +0000 (16:48 +0000)]
Allwinner: Add clock driver for ccu_sun8i_r

SUN8I and SUN50I (H3, H5, A83T and A64) have a second clock controller
unit. It controls the clocks for the second gpio controller, the IR
controller etc ...
Support for A83T is not supported.

Tested On: OrangePi One, Pine64

6 years agocxgbetool(8): Do not create a large file devoid of useful content when
np [Sat, 7 Oct 2017 01:20:30 +0000 (01:20 +0000)]
cxgbetool(8): Do not create a large file devoid of useful content when
the dumpstate ioctl fails.  Make the file world-readable while here.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

6 years agonamecache: factor out ~MAKEENTRY lookups from the common path
mjg [Fri, 6 Oct 2017 23:05:55 +0000 (23:05 +0000)]
namecache: factor out ~MAKEENTRY lookups from the common path

Lookups of the sort are rare compared to regular ones and succesfull ones
result in removing entries from the cache.

In the current code buckets are rlocked and a trylock dance is performed,
which can fail and cause a restart. Fixing it will require a little bit
of surgery and in order to keep the code maintaineable the 2 cases have
to split.

MFC after: 1 week

6 years agoLet stack_create(9) take a malloc flags argument.
markj [Fri, 6 Oct 2017 21:52:28 +0000 (21:52 +0000)]
Let stack_create(9) take a malloc flags argument.

Reviewed by: cem
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12614

6 years agopf: Very basic forwarding test
kp [Fri, 6 Oct 2017 20:51:32 +0000 (20:51 +0000)]
pf: Very basic forwarding test

This test illustrates the use of scapy to test pf.

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

6 years agopf: Basic automated test using VIMAGE
kp [Fri, 6 Oct 2017 20:43:14 +0000 (20:43 +0000)]
pf: Basic automated test using VIMAGE

If VIMAGE is present we can start jails with their own pf instance. This
makes it fairly easy to run tests.
For example, this basic test verifies that drop/pass and icmp
classification works. It's a basic sanity test for pf, and hopefully an
example on how to write more pf tests.

The tests are skipped if VIMAGE is not enabled.

This work is inspired by the GSoC work of Panagiotes Mousikides.

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

6 years agoDeclare pmtud_blackhole global variables in tcp_timer.h, so that
glebius [Fri, 6 Oct 2017 20:33:40 +0000 (20:33 +0000)]
Declare pmtud_blackhole global variables in tcp_timer.h, so that
alternative TCP stacks can legally use them.

6 years agoAvoid adding an extra "0x" prefix before pointer formats.
markj [Fri, 6 Oct 2017 18:29:00 +0000 (18:29 +0000)]
Avoid adding an extra "0x" prefix before pointer formats.

MFC after: 1 week

6 years agorandom(4): Discard low entropy inputs
cem [Fri, 6 Oct 2017 18:27:55 +0000 (18:27 +0000)]
random(4): Discard low entropy inputs

The later fields of the harvest_event structure are predictable and provide
little value to the entropy pool.  Only feed in the relatively high entropy
counter and explicit entropy buffer to increase measured input entropy.

See also:
https://people.freebsd.org/~jmg/vbsdcon_2017_ddfreebsdrng_slides.pdf

PR: 222807
Submitted by: W. Dean Freeman <badfilemagic AT gmail.com>
Reviewed by: jmg (earlier version), delphij
Approved by: secteam (delphij)
Obtained from: HBSD 8d809124d563937edd84c9c9d5494406e359c55c
Security: no -- low entropy marginal input has no known negative affect on pool quality
Differential Revision: https://reviews.freebsd.org/D12610

6 years agoCatch up with r324340, switching relevant arm SoCs from armv6
gjb [Fri, 6 Oct 2017 17:30:18 +0000 (17:30 +0000)]
Catch up with r324340, switching relevant arm SoCs from armv6
to armv7.

Sponsored by: The FreeBSD Foundation

6 years agoFix alignment of 'last' in autofill.
marcel [Fri, 6 Oct 2017 16:38:00 +0000 (16:38 +0000)]
Fix alignment of 'last' in autofill.

'last' is the sector number of the last usable sector. Sector
numbers start with 0. As such, 'last' is always 1 less than
the count of sectors and aligning 'last' down as-is means that
the number of free sectors is pessimized by 'alignment - 1' if
the number of usable sectors was already a multiple of the
alignment. Consequently, gpart(8) failed to create a partition
when the alignment and size were such that it would extend to
the end of the disk.

6 years agoAlso handle psci 1.0. This can be seen as a bug fix update for the 0.2
andrew [Fri, 6 Oct 2017 15:46:11 +0000 (15:46 +0000)]
Also handle psci 1.0. This can be seen as a bug fix update for the 0.2
specification we already support, with the only changes in functions we
don't currently use.

Sponsored by: DARPA, AFRL

6 years agoFix kvm_getprocs(3) error reporting in ps(1).
trasz [Fri, 6 Oct 2017 15:09:28 +0000 (15:09 +0000)]
Fix kvm_getprocs(3) error reporting in ps(1).

Previously it just didn't work at all - kvm_getprocs(3) doesn't update
the &nentries when it returns NULL.  The end result was that ps(1) showed
garbage data instead of reporting kinfo_proc size mismatch.

Reviewed by: cem
Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12414

6 years agoImprove i386_get_ldt().
kib [Fri, 6 Oct 2017 14:29:53 +0000 (14:29 +0000)]
Improve i386_get_ldt().

Provide consistent snapshot of the requested descriptors by preventing
other threads from modifying LDT while we fetch the data, lock dt_lock
around the read.  Copy the data into intermediate buffer, which is
copied out after the lock is dropped.

Comparing with the amd64 version, the read is done byte by byte, since
there is no atomic 64bit read (cmpxchg8b method is too heavy comparing
with the avoided issues).

Improve overflow checking for the descriptors range calculations and
remove unneeded casts.  Use unsigned types for sizes.

Allow zero num argument to i386_get_ldt() and i386_set_ldt().  This
case is handled naturally by the code flow.

Reviewed by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoNote about workaround for native armv7 builds using a kernel prior to
imp [Fri, 6 Oct 2017 13:48:38 +0000 (13:48 +0000)]
Note about workaround for native armv7 builds using a kernel prior to
r324363.

6 years agoftpd(8): fix user context handling.
eugen [Fri, 6 Oct 2017 13:46:05 +0000 (13:46 +0000)]
ftpd(8): fix user context handling.

Apply authenticated user context after update of wtmp(5) at start of session,
so that ftpd process is not killed by kernel with SIGXFSZ when user has
"filesize" limit lower than size of system wtmp file. Same applies
to session finalization: revert to super-user context before update of wtmp.

If ftpd hits limit while writing a file at user request,
do not get killed with SIGXFSZ instantly but apparently ignore the signal,
process error and report it to the user, and continue with the session.

PR: 143570
Approved by: avg (mentor), mav (mentor)
MFC after: 1 week

6 years agoOversight on armv7 bulk commit: Make MACHINE_ARCH be armv7 for new
imp [Fri, 6 Oct 2017 13:43:16 +0000 (13:43 +0000)]
Oversight on armv7 bulk commit: Make MACHINE_ARCH be armv7 for new
enough processors. This isn't ideal, because one could still compile
MACHINE_ARCH armv6, but with armv7 options enabled. We don't normally
do that, and it's a bit of an edge case so accept the less than ideal
solution here in the absence of something better.

Reported by: strejda@
Sponsored by: Netflix

6 years agoImport mandoc 1.14.3
bapt [Fri, 6 Oct 2017 12:31:55 +0000 (12:31 +0000)]
Import mandoc 1.14.3

MFC after: 1 week

6 years agoRevert r324358, some cruft when in with it, it will be
bapt [Fri, 6 Oct 2017 12:30:54 +0000 (12:30 +0000)]
Revert r324358, some cruft when in with it, it will be
properly reimported in another commit

6 years agoEncapsulate ZFS preferences into efi_zfs_is_preferred
imp [Fri, 6 Oct 2017 12:21:46 +0000 (12:21 +0000)]
Encapsulate  ZFS preferences into efi_zfs_is_preferred

Move the retrieval of the image information into loader's main instead
of doing it in efizfs.c

Differential Revision: https://reviews.freebsd.org/D12564
Submitted by: Eric McCorkle

6 years agoAdd efi_devpath_is_prefix
imp [Fri, 6 Oct 2017 12:20:24 +0000 (12:20 +0000)]
Add efi_devpath_is_prefix

efi_devpath_is_prefix determines if a path matches a passed-in prefix.

Differential Revision: https://reviews.freebsd.org/D12564
Submitted by: Eric McCorkle

6 years agoImport 1.14.3
bapt [Fri, 6 Oct 2017 11:48:09 +0000 (11:48 +0000)]
Import 1.14.3

MFC after: 1 week

6 years agoRemove unneeded cast.
kib [Fri, 6 Oct 2017 10:17:50 +0000 (10:17 +0000)]
Remove unneeded cast.

Reviewed by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoStyle.
kib [Fri, 6 Oct 2017 10:16:57 +0000 (10:16 +0000)]
Style.

Reviewed by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agovfs_export_lookup: Fix r324054
manu [Fri, 6 Oct 2017 09:02:36 +0000 (09:02 +0000)]
vfs_export_lookup: Fix r324054

When using the default address list nam is still valid, the code in
r324054 assumed that is was NULL.

Reported by: Guy Yur <guyyur@gmail.com>
Tested by: Guy Yur <guyyur@gmail.com>

6 years agoBump src.conf.5's Dd.
jlh [Fri, 6 Oct 2017 08:49:15 +0000 (08:49 +0000)]
Bump src.conf.5's Dd.

This file shouldn't be modified manually but well, I did it in my previous
commit.  So go down further the rabbit hole so as to at least keep some
consistency.

Reported by: bapt

6 years agoRemove rcmds.
jlh [Fri, 6 Oct 2017 08:43:14 +0000 (08:43 +0000)]
Remove rcmds.

If they are still needed, you can find them in the net/bsdrcmds port.

This was proposed June, 20th and approved by various committers [1].
They have been marked as deprecated on CURRENT in r320644 [2] on July, 4th.
Both stable/11 and release/11.1 contain the deprecation notice (thanks to
allanjude@).

Note that ruptime(1)/rwho(1)/rwhod(8) were initially thought to be part of
rcmds but this was a mistake and those are therefore NOT removed.

[1] https://lists.freebsd.org/pipermail/freebsd-arch/2017-June/018239.html
[2] https://svnweb.freebsd.org/base?view=revision&revision=320644

Reviewed by: bapt, brooks
Differential Revision: https://reviews.freebsd.org/D12573

6 years agozdb.8: replace with the slighly modified upstream version
avg [Fri, 6 Oct 2017 08:28:35 +0000 (08:28 +0000)]
zdb.8: replace with the slighly modified upstream version

The upstream has converted their manual page to the same format as we
have, so we can use the upstream version with minimal modifications.

The current modifications are:
- different zpool.cache path
- different manual sections for zdb, zfs, zpool commands

igor reports a few minor issues, it would be nice to fix them both in
FreeBSD and in the upstream.

MFC after: 3 weeks

6 years agoMFV r322235: 8067 zdb should be able to dump literal embedded block pointer
avg [Fri, 6 Oct 2017 08:21:06 +0000 (08:21 +0000)]
MFV r322235: 8067 zdb should be able to dump literal embedded block pointer

illumos/illumos-gate@4923c69fddc0887da5604a262585af3efd82ee20
https://github.com/illumos/illumos-gate/commit/4923c69fddc0887da5604a262585af3efd82ee20

FreeBSD note: the manual page is to be updated separately.

https://www.illumos.org/issues/8067
  Add an option to zdb to print a literal embedded block pointer supplied on the
  command line:
  zdb -E [-A] word0:word1:...:word15

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: Yuri Pankov <yuri.pankov@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

MFC after: 3 weeks

6 years agoMFV r316934: 7340 receive manual origin should override automatic origin
avg [Fri, 6 Oct 2017 08:17:12 +0000 (08:17 +0000)]
MFV r316934: 7340 receive manual origin should override automatic origin

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

https://www.illumos.org/issues/7340
  When -o origin=<snapshot> is specified as part of a ZFS receive, that origin
  should override the automatic detection in libzfs.

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

MFC after: 3 weeks

6 years agoMFV r316933: 5142 libzfs support raidz root pool (loader project)
avg [Fri, 6 Oct 2017 08:15:37 +0000 (08:15 +0000)]
MFV r316933: 5142 libzfs support raidz root pool (loader project)

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

https://www.illumos.org/issues/5142
  the current libzfs only allows simple disk and mirror setup for boot pool, as
  loader does support booting from raidz, this feature will remove raidz
  restriction from boot pool setup.

FreeBSD note: we have long supported this feature, this commit only
removes a small difference in libzfs.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Reviewed by: Albert Lee <trisk@omniti.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Toomas Soome <tsoome@me.com>

MFC after: 3 weeks

6 years agoMFV r316931: 6268 zfs diff confused by moving a file to another directory
avg [Fri, 6 Oct 2017 08:12:13 +0000 (08:12 +0000)]
MFV r316931: 6268 zfs diff confused by moving a file to another directory

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

https://www.illumos.org/issues/6268
  The zfs diff command presents a description of the changes that have occurred
  to files within a filesystem between two snapshots. If a file is renamed, the
  tool is capable of reporting this, e.g.:
  cd /some/zfs/dataset/subdir
  mv file0 file1
  Will result in a diff record like:
  R        /some/zfs/dataset/subdir/file0  ->  /some/zfs/dataset/subdir/file1
  Unfortunately, it seems that rename detection only uses the base filename to
  determine if a file has been renamed or simply modified. This leads to
  misreporting only the original filename, omitting the more relevant destination
  filename entirely. For example:
  cd /some/zfs/dataset/subdir
  mv file0 ../otherdir/file0
  Will result in a diff entry:
  M        /some/zfs/dataset/subdir/file0
  But it should really emit:
  R        /some/zfs/dataset/subdir/file0  ->  /some/zfs/dataset/otherdir/file0

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Justin Gibbs <gibbs@scsiguy.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Joshua M. Clulow <josh@sysmgr.org>

MFC after: 3 weeks

6 years agoMFV r316877: 7571 non-present readonly numeric ZFS props do not have default value
avg [Fri, 6 Oct 2017 08:10:54 +0000 (08:10 +0000)]
MFV r316877: 7571 non-present readonly numeric ZFS props do not have default value

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

https://www.illumos.org/issues/7571
  ZFS displays the default value for non-present readonly numeric (and index)
  properties. However, these properties default values are not meaningful.
  Instead, we should display a "-", indicating that they are not present. For
  example, on a version-12 pool, the usedby* properties are not available, but
  they show up as the incorrect value "0":
     1. zfs get all test12
        ...
        test12 usedbysnapshots 0 -
        test12 usedbydataset 0 -
        test12 usedbychildren 0 -
        test12 usedbyrefreservation 0 -
  We will be introducing more sometimes-present numeric readonly properties, so
  it would be nice to fix this.

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

MFC after: 3 weeks

6 years agoMFV r316864: 6392 zdb: introduce -V for verbatim import
avg [Fri, 6 Oct 2017 08:09:20 +0000 (08:09 +0000)]
MFV r316864: 6392 zdb: introduce -V for verbatim import

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

FreeBSD note: the manual page is to be updated separately.

https://www.illumos.org/issues/6392
  When given a pool name via -e, zdb would attempt an import. If it
  failed, then it would attempt a verbatim import. This behavior is
  not always desirable so a -V switch is added to zdb to control the
  behavior. When specified, a verbatim import is done. Otherwise,
  the behavior is as it was previously, except no verbatim import
  is done on failure.
  https://github.com/zfsonlinux/zfs/commit/a5778ea2427bd340e3b4f697d9b6e1452bd71909
  Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
  Reviewed by: Matthew Ahrens <mahrens@delphix.com>

Reviewed by: Yuri Pankov <yuri.pankov@gmail.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Richard Yao <ryao@gentoo.org>

MFC after: 3 weeks

6 years agoMFV r316862: 6410 teach zdb to perform object lookups by path
avg [Fri, 6 Oct 2017 07:52:25 +0000 (07:52 +0000)]
MFV r316862: 6410 teach zdb to perform object lookups by path

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

FreeBSD note: this commit does not update the manual page.
The original change includes conversion of the manual page from *roff format
to mandoc format.  So, it is hard to extract the content change from
that.  I am going to replace our zdb manual page, which is an earlier
independent conversion, with a slighly modified version of the upstream page.

https://www.illumos.org/issues/6410
  This is primarily intended to ease debugging & testing ZFS when one is only
  interested in things like the on-disk location of a specific object's blocks,
  but doesn't know their object id. This allows doing things like the following
  (FreeBSD-based example):
          # zpool create -f foo da0
          # dd if=/dev/zero of=/foo/1 bs=1M count=4 >/dev/null 2>&1
          # zpool export foo
          # zdb -vvvvv -o "ZFS plain file" foo /1
          Object  lvl   iblk   dblk  dsize  lsize   %full  type
               8    2    16K   128K  3.99M     4M  100.00  ZFS plain file (K=inherit) (Z=inherit)
                                              168   bonus  System attributes
          dnode flags: USED_BYTES USERUSED_ACCOUNTED
          dnode maxblkid: 31
          path    /1
          uid     0
          gid     0
          atime   Thu Apr 23 22:45:32 2015
          mtime   Thu Apr 23 22:45:32 2015
          ctime   Thu Apr 23 22:45:32 2015
          crtime  Thu Apr 23 22:45:32 2015
          gen     7
          mode    100644
          size    4194304
          parent  4
          links   1
          pflags  40800000004
          Indirect blocks:
                0 L1  DVA[0]=<0:c19200:600> DVA[1]=<0:10800019200:600> [L1 ZFS
  plain file] fletcher4 lz4 LE contiguous unique double size=4000L/200P birth=7L/

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Will Andrews <will@freebsd.org>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>

MFC after: 3 weeks

6 years agoAdd updating for armv7 and bump FreeBSD_version.
imp [Thu, 5 Oct 2017 23:05:56 +0000 (23:05 +0000)]
Add updating for armv7 and bump FreeBSD_version.

Sponsored by: Netflix

6 years agoTag all armv7 kernels as such in their machine config line.
imp [Thu, 5 Oct 2017 23:01:50 +0000 (23:01 +0000)]
Tag all armv7 kernels as such in their machine config line.

Transition all boards that support arm cortex CPUs to armv7. This
leaves two armv6 kernels in the tree. RPI-B, which uses the BCM2835
which has a ARM1176 core, and VERSATILEPB, which is a qemu board setup
around the time RPI-B went in. Copy std.armv6 to std.armv7, even
though that duplicates a lot of stuff. More work needs to be done to
sort out the duplication.

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

6 years agoSupport armv7 builds for userland
imp [Thu, 5 Oct 2017 23:01:33 +0000 (23:01 +0000)]
Support armv7 builds for userland

Make armv7 as a new MACHINE_ARCH.

Copy all the places we do armv6 and add armv7 as basically an
alias. clang appears to generate code for armv7 by default. armv7 hard
float isn't supported by the the in-tree gcc, so it hasn't been
updated to have a new default.

Support armv7 as a new valid MACHINE_ARCH (and by extension
TARGET_ARCH).

Add armv7 to the universe build.

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

6 years agoRemove release-related documentation from the base repository,
gjb [Thu, 5 Oct 2017 20:54:31 +0000 (20:54 +0000)]
Remove release-related documentation from the base repository,
moved to the doc repository (see revisions r51045:r51061).

Sponsored by: The FreeBSD Foundation

6 years agoAdd Flex File Layout support to the NFSv4.1 pNFS client.
rmacklem [Thu, 5 Oct 2017 20:10:40 +0000 (20:10 +0000)]
Add Flex File Layout support to the NFSv4.1 pNFS client.

This patch adds support for the Flexible File Layout to the pNFS client.
Although the patch is rather large, it should only affect NFS mounts
using the "pnfs" option against pNFS servers that do not support File
Layout.
There are still a couple of things missing from the Flexible File Layout
client implementation:
- The code does not yet do a LayoutReturn with I/O error stats when
  I/O error(s) occur when attempting to do I/O on a DS.
  This will be fixed in a future commit, since it is important for the
  MDS to know that I/O on a DS is failing.
- The current code does writes and commits to mirror DSs serially.
  Making them happen concurrently will be done in a future commit,
  after discussion on freebsd-current@ on the best way to do this.
- The code does not handle NFSv4.0 DSs. Since there is no extant pNFS
  server that implements NFSv4.0 DSs and NFSv4.1 DSs makes more sense
  now, I don't intend to implement this until there is a need for it.
  There is support for NFSv4.1 and NFSv3 DSs.

6 years agolocks: take the number of readers into account when waiting
mjg [Thu, 5 Oct 2017 19:18:02 +0000 (19:18 +0000)]
locks: take the number of readers into account when waiting

Previous code would always spin once before checking the lock. But a lock
with e.g. 6 readers is not going to become free in the duration of once spin
even if they start draining immediately.

Conservatively perform one for each reader.

Note that the total number of allowed spins is still extremely small and is
subject to change later.

MFC after: 1 week

6 years agoUse ANSI C declarations.
kib [Thu, 5 Oct 2017 19:11:25 +0000 (19:11 +0000)]
Use ANSI C declarations.

Reviewed by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoFix the 'reldoc' target, following doc commit r51047.
gjb [Thu, 5 Oct 2017 19:00:22 +0000 (19:00 +0000)]
Fix the 'reldoc' target, following doc commit r51047.

Sponsored by: The FreeBSD Foundation

6 years agoCorrect format specifiers in the debug code. Style.
kib [Thu, 5 Oct 2017 18:58:28 +0000 (18:58 +0000)]
Correct format specifiers in the debug code.  Style.

Requested by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoamd64: remove unused variable from pmap_delayed_invl_genp
mjg [Thu, 5 Oct 2017 18:51:48 +0000 (18:51 +0000)]
amd64: remove unused variable from pmap_delayed_invl_genp

Reported by: gcc
MFC after: 1 week

6 years agoStyle.
kib [Thu, 5 Oct 2017 18:42:13 +0000 (18:42 +0000)]
Style.

Reviewed by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agobnxt: fix intermittent VLAN issues
shurd [Thu, 5 Oct 2017 17:52:38 +0000 (17:52 +0000)]
bnxt: fix intermittent VLAN issues

bnxt_init() is invokes Function Reset (bnxt_hwrm_func_reset) and thus FW
configuration for VLANs get erased.  To fix this, in bnxt_init(), Invoking
HWRM to configure VLANs (bnxt_hwrm_cfa_l2_set_rx_mask).

Submitted by: Siva Kallam <siva.kallam@@broadcom.com>
Reviewed by: shurd, sbruno
Approved by: sbruno (mentor)
Sponsored by: Broadcom Limited
Differential Revision: https://reviews.freebsd.org/D12527

6 years agoThis README file was quite relevant for FreeBSD 3 or 4. However, the
imp [Thu, 5 Oct 2017 16:48:05 +0000 (16:48 +0000)]
This README file was quite relevant for FreeBSD 3 or 4. However, the
information in this file is now somewhat dated, or is present mostly
correct in the man pages. Retire this file rather than fix it.

Noticed by: cognet@
Sponsored by: Netflix

6 years agoAdd support for new cuse(3) error code, CUSE_ERR_NO_DEVICE.
hselasky [Thu, 5 Oct 2017 16:42:02 +0000 (16:42 +0000)]
Add support for new cuse(3) error code, CUSE_ERR_NO_DEVICE.
This error code is useful when emulating Linux input event
devices from userspace.

PR: 218626
Submitted by: jan.kokemueller@gmail.com
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoDocument KERNBUILDDIR.
imp [Thu, 5 Oct 2017 16:40:50 +0000 (16:40 +0000)]
Document KERNBUILDDIR.

Sponsored by: Netflix

6 years agoFix "taskqgroup_attach: setaffinity failed: 3" with iflib drivers
shurd [Thu, 5 Oct 2017 14:43:30 +0000 (14:43 +0000)]
Fix "taskqgroup_attach: setaffinity failed: 3" with iflib drivers

Improved logging added in r323879 exposed an error during
attach. We need the irq, not the rid to work correctly. em uses
shared irqs, so it will use the same irq for TX as RX. bnxt does
not use shared irqs, or TX irqs at all, so there's no need to set
the TX irq affinity.

Reviewed by: sbruno
Approved by: sbruno (mentor)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12496

6 years agoEnsure that the accept ABORT chunks with the T-bit set only the
tuexen [Thu, 5 Oct 2017 13:29:54 +0000 (13:29 +0000)]
Ensure that the accept ABORT chunks with the T-bit set only the
a non-zero matching peer tag is provided.

MFC after: 1 week

6 years agohyperv/hn: Fix options RSS building
sephe [Thu, 5 Oct 2017 13:22:14 +0000 (13:22 +0000)]
hyperv/hn: Fix options RSS building

Reported by: np
MFC after: 1 week
Sponsored by: Microsoft

6 years agoEnsure that after sucessfull i386_set_ldt() call, other threads can
kib [Thu, 5 Oct 2017 13:12:59 +0000 (13:12 +0000)]
Ensure that after sucessfull i386_set_ldt() call, other threads can
use LDT segments immediately.

If the i386_set_ldt() call created a first LDT descriptor (and
consequently created the LDT) for our address space, LDTR is currently
loaded only on the CPU executing the syscall.  Other CPUs executing
threads sharing the address space, would only load LDTR after context
switch.

Uncomment set_user_ldt_rv() and call it on all CPUs.  Remove critical
section inside set_user_ldt(), it is not needed in the context of call
from smp_rendezvous().

Set md_ldt after md_ldt_sd is initialized using the same code sequence
as in user_ldt_free().  Do the whole initialization in a critical
section, to not race with the context switching while we set LDT.

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

6 years agolocks: partially tidy up waiting on readers
mjg [Thu, 5 Oct 2017 13:01:18 +0000 (13:01 +0000)]
locks: partially tidy up waiting on readers

spin first instant of instantly re-readoing and don't re-read after
spinning is finished - the state is already known.

Note the code is subject to significant changes later.

MFC after: 1 week

6 years agoAvoid a race betweem freeing LDT and context switches.
kib [Thu, 5 Oct 2017 12:50:03 +0000 (12:50 +0000)]
Avoid a race betweem freeing LDT and context switches.

cpu_switch.S uses curproc->p_md.md_ldt value as the flag indicating
presence of the process LDT.  The flag is checked and then ldt segment
descriptor is copied into the CPU' GDT slot.

Disallow context switches around clearing of the curproc LDT state by
performing the cleanup in critical section.  Ensure that the md_ldt
flag is cleared before md_ldt_sd descriptor content is destroyed by
inserting fence between the operations.

We depend on the x86 memory model strong ordering guarantees, in
particular, that cpu_switch.S observes the writes to md_ldt and
md_ldt_sd in the expected order.

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

6 years agofix the misleading log facility used in devd/zfs.conf
avg [Thu, 5 Oct 2017 12:38:26 +0000 (12:38 +0000)]
fix the misleading log facility used in devd/zfs.conf

In general, the "kern" facility is reserved for the kernel use only.
If a program specifies that facility, then it is silently converted
to "user" facility.
So, using logger -p kern.xxx was both misleading and non-specific.

Thus, change the facility to local7, so that users can create
more adequate syslogd configurations.

While local0..local7 are documented as being for local use we already
have several examples in the tree where they are used because none of
the named facilities really fits.

Approved by: asomers
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12420

6 years agosysctl-s in a module should be accessible only when the module is initialized
avg [Thu, 5 Oct 2017 12:32:14 +0000 (12:32 +0000)]
sysctl-s in a module should be accessible only when the module is initialized

A sysctl can have a custom handler that may access data that is initialized
via SYSINIT(9) or via a module event handler (also invoked via SYSINIT).
Thus, it is not safe to allow access to the module's sysctl-s until
the initialization is performed.  Likewise, we should not allow access
to teh sysctl-s after the module is uninitialized.
The latter is easy to achieve by properly ordering linker_file_unregister_sysctls
and linker_file_sysuninit.
The former is not as easy for two reasons:
- the initialization may depend on tunables which get set when sysctl-s are
  registered, so we need to set the tunables before running sysinit-s
- the initialization may try to dynamically add more sysctl-s under statically
  defined sysctl nodes
So, this change splits the sysctl setup into two phases.  In the first phase
the sysctl-s are registered as before but they are disabled and hidden from
consumers.  In the second phase, done after sysinit-s, normal access to the
sysctl-s is enabled.

The change should affect only dynamic module loading and unloading after
the system boot-up.  Nothing changes for sysctl-s compiled into the kernel
and sysctl-s in preloaded modules.

Discussed with: hselasky, ian, jhb
Reviewed by: julian, kib
MFC after: 2 weeks
Sponsored by: Panzura
Differential Revision: https://reviews.freebsd.org/D12545

6 years agoImprove amd64_get_ldt().
kib [Thu, 5 Oct 2017 12:29:34 +0000 (12:29 +0000)]
Improve amd64_get_ldt().

Provide consistent snapshot of the requested descriptors by preventing
other threads from modifying LDT while we fetch the data, lock dt_lock
around the read.  Copy the data into intermediate buffer, which is
copied out after the lock is dropped.

Use guaranteed atomic (aligned volatile) reads of the descriptors to
use same-size atomic as CPU update to set A bit in the descriptor type
field.

Improve overflow checking for the descriptors range calculations and
remove unneeded casts.

Reviewed by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoremove heuristic error detection from ddi_strto*()
avg [Thu, 5 Oct 2017 12:25:18 +0000 (12:25 +0000)]
remove heuristic error detection from ddi_strto*()

Zero, <TYPE>_MIN and <TYPE>_MAX values can result from valid conversions.
They don't necessarily imply any error.
Since we do not have any reliable error signaling from libkern's strto*(),
it's better to always assume success rather than to report an error when
there is none.

Reviewed by: tsoome
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12565

6 years agoMinor style fix.
kib [Thu, 5 Oct 2017 12:19:55 +0000 (12:19 +0000)]
Minor style fix.

Requested by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoComplete r323772 on amd64.
kib [Thu, 5 Oct 2017 12:16:45 +0000 (12:16 +0000)]
Complete r323772 on amd64.

Compilers are allowed to combine plain reads into group operations,
e.g. 64bit element copies of one array into another can be
legitimately optimized back to a memcpy() call, which r323772 tried to
prevent.

Qualify accesses to LDT descriptors with volatile dereference to
ensure that each write indeed occurs.  After that, our usual claim of
native-size aligned writes being atomic applies.

This is equivalent to atomic_store(memory_order_relaxed) C11 accesses,
but our machine/atomic.h does not provide corresponding primitive.

Noted and reviewed by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoUse ANSI C declaration for amd64_get_ldt().
kib [Thu, 5 Oct 2017 12:07:38 +0000 (12:07 +0000)]
Use ANSI C declaration for amd64_get_ldt().

Reviewed by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoCorrect format specifiers in the debug code.
kib [Thu, 5 Oct 2017 12:01:39 +0000 (12:01 +0000)]
Correct format specifiers in the debug code.

Requested by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoRemove useless comments.
kib [Thu, 5 Oct 2017 11:56:04 +0000 (11:56 +0000)]
Remove useless comments.

Requested by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoOn amd64, mark the set_user_ldt() function as static.
kib [Thu, 5 Oct 2017 11:50:01 +0000 (11:50 +0000)]
On amd64, mark the set_user_ldt() function as static.

On i386, the function is used from the context switch code and needs
to be accessible externally.  Amd64 MD context switch does not lock an
LDT spinlock and inlines switching in assembly.

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

6 years agoReduce default max_ldt_segment value to 512.
kib [Thu, 5 Oct 2017 11:36:55 +0000 (11:36 +0000)]
Reduce default max_ldt_segment value to 512.

This makes the LDT to use only one page with default settings,
avoiding the need to find contigous 2 pages in KVA.  It seems that
most users are fine even with 512 segments.

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

6 years agoUpdate comment to note that we skip LDT reload for kthreads as well.
kib [Thu, 5 Oct 2017 11:34:51 +0000 (11:34 +0000)]
Update comment to note that we skip LDT reload for kthreads as well.

Noted by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

6 years agocxgbe(4): Provide knobs to set the holdoff parameters of TOE rx queues
np [Thu, 5 Oct 2017 07:18:16 +0000 (07:18 +0000)]
cxgbe(4): Provide knobs to set the holdoff parameters of TOE rx queues
separately from NIC rx queues instead of using the same parameters for
both types of queues.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

6 years agoreally unbreak kernel builds on sparc64 and powerpc64 after r324163, ZFS Channel...
avg [Thu, 5 Oct 2017 06:39:57 +0000 (06:39 +0000)]
really unbreak kernel builds on sparc64 and powerpc64 after r324163, ZFS Channel Programs

This commit also reverts r324178 that did not fix the problem on powerpc64
where char is usigned.

MFC after: 4 weeks
X-MFC with: r324163