]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoarm64: rockchip: rk805: Add basic support for RK808 PMIC
manu [Sat, 1 Dec 2018 20:31:05 +0000 (20:31 +0000)]
arm64: rockchip: rk805: Add basic support for RK808 PMIC

RK808 PMIC is the companion chip for RK3399 SoC.
Add basic regulator support in RK805 since they are similar.

MFC after: 1 month

5 years agoRemove IFF_DRVRLOCK as it is used in IRIX only (and we all know IRIX
cy [Sat, 1 Dec 2018 20:30:18 +0000 (20:30 +0000)]
Remove IFF_DRVRLOCK as it is used in IRIX only (and we all know IRIX
is dead). This includes collaterally removing code shared by HP/UX,
SGI, and Linux, where IP Filter will in all likelihood for various
reasons never run again.

MFC after: 1 week

5 years agoarm64: rockchip: rk_i2c: Use correct clock
manu [Sat, 1 Dec 2018 20:29:42 +0000 (20:29 +0000)]
arm64: rockchip: rk_i2c: Use correct clock

While here add RK3399 support and call clk_set_assigned to set the correct
clock set in the DTS.

MFC after: 1 month

5 years agoarm64/rockchip: add RK3399 support
manu [Sat, 1 Dec 2018 20:28:16 +0000 (20:28 +0000)]
arm64/rockchip: add RK3399 support

Add CRU (Clock and Reset Unit) driver for RK3399.
Add support in rk_pinctrl driver.

Submitted by:  Greg V <greg@unrelenting.technology> (Original version)
Differential Revision: https://reviews.freebsd.org/D16732

MFC after: 1 month

5 years agoarm64: rockchip: Add RK3399_CLK_PLL
manu [Sat, 1 Dec 2018 20:26:59 +0000 (20:26 +0000)]
arm64: rockchip: Add RK3399_CLK_PLL

PLLs on the RK3399 are different than the ones on the RK3328.
Add a new type and some dedicated recalc and set_freq functions.
Rename the RK3328 dedicated rk_clk_pll function with rk3328_ prefix.

MFC after: 1 month

5 years agoRestore handling of PMTU discovery, removed through an unifdef(1)
cy [Sat, 1 Dec 2018 17:59:41 +0000 (17:59 +0000)]
Restore handling of PMTU discovery, removed through an unifdef(1)
following the MFV of r254219 into r255332. In addition the 'FreeBSD'
macro was never defined in ipfilter 5.1.2 thus it never would have
been enabled in the first place.

This work is prompted by a general cleanup of the IP Filter code
prompted by working to resolve a PR. More to follow.

MFC after: 1 week

5 years agoAllow to create swap zone larger than v_page_count / 2.
kib [Sat, 1 Dec 2018 16:50:12 +0000 (16:50 +0000)]
Allow to create swap zone larger than v_page_count / 2.

If user configured the maxswapzone tunable, just take the literal
value for the initial zone sizing attempt.  Before, it was only
possible to reduce the zone by the tunable.

While there, correct the message which was not correct when zone
creation rounded the size up.

Reported by: jmg
Reviewed by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D18381

5 years agoCorrect the tunable name in the message.
kib [Sat, 1 Dec 2018 16:43:18 +0000 (16:43 +0000)]
Correct the tunable name in the message.

Submitted by:  Andre Albsmeier <mail@fbsd.e4m.org>
PR: 231577
MFC after: 1 week

5 years agoamd64: align target memmove buffer to 16 bytes before using rep movs
mjg [Sat, 1 Dec 2018 14:20:32 +0000 (14:20 +0000)]
amd64: align target memmove buffer to 16 bytes before using rep movs

See the review for sample test results.

Reviewed by: kib (kernel part)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18401

5 years agopf tests: Test name handling
kp [Sat, 1 Dec 2018 09:59:32 +0000 (09:59 +0000)]
pf tests: Test name handling

Provoke a situation where two interfaces have the same name, and verify
pf's reaction to this.

5 years agopf: Fix panic on overlapping interface names
kp [Sat, 1 Dec 2018 09:58:21 +0000 (09:58 +0000)]
pf: Fix panic on overlapping interface names

In rare situations[*] it's possible for two different interfaces to have
the same name. This confuses pf, because kifs are indexed by name (which
is assumed to be unique). As a result we can end up trying to
if_rele(NULL), which panics.

Explicitly checking the ifp pointer before if_rele() prevents the panic.
Note pf will likely behave in unexpected ways on the the overlapping
interfaces.

[*] Insert an interface in a vnet jail. Rename it to an interface which
exists on the host. Remove the jail. There are now two interfaces with
the same name in the host.

5 years agopf tests: Make pass_block:noalias more robust
kp [Sat, 1 Dec 2018 09:57:29 +0000 (09:57 +0000)]
pf tests: Make pass_block:noalias more robust

Send several ICMPv6 echo requests. We've seen occasional failures with a
single request.

5 years agoClarify that patterns are extended regular expressions in pkill(1) manual page.
ygy [Sat, 1 Dec 2018 05:58:33 +0000 (05:58 +0000)]
Clarify that patterns are extended regular expressions in pkill(1) manual page.

PR: 231060
Submitted by: naddy
MFC after: 3 days

5 years agoRemove trim(8) by multiple demands.
eugen [Sat, 1 Dec 2018 03:20:10 +0000 (03:20 +0000)]
Remove trim(8) by multiple demands.

5 years agoMaybe make gcc happy
vangyzen [Fri, 30 Nov 2018 23:47:57 +0000 (23:47 +0000)]
Maybe make gcc happy

According to Jenkins, the GCC architectures were unhappy because:

    sigaltstack.c:82: warning: missing initializer
    sigaltstack.c:82: warning: (near initialization for 'oss.ss_size')

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

5 years agoFix reporting of SS_ONSTACK
vangyzen [Fri, 30 Nov 2018 22:44:33 +0000 (22:44 +0000)]
Fix reporting of SS_ONSTACK

Fix reporting of SS_ONSTACK in nested signal delivery when sigaltstack()
is used on some architectures.

Add a unit test for this.  I tested the test by introducing the bug
on amd64.  I did not test it on other architectures.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D18347

5 years agotrim(8): serveral style fixes
eugen [Fri, 30 Nov 2018 21:57:02 +0000 (21:57 +0000)]
trim(8): serveral style fixes

Submitted by: imp
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D18380

5 years agoamd64: handle small memmove buffers with overlapping stores
mjg [Fri, 30 Nov 2018 20:58:08 +0000 (20:58 +0000)]
amd64: handle small memmove buffers with overlapping stores

Handling sizes of > 32 backwards will be updated later.

Reviewed by: kib (kernel part)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18387

5 years agoiscsi: simplify the capsicumization
oshogbo [Fri, 30 Nov 2018 19:40:16 +0000 (19:40 +0000)]
iscsi: simplify the capsicumization

Approved by: trasz
Differential Revision: https://reviews.freebsd.org/D17962

5 years agolibcasper: do not fail if Capsicum is not avilable
oshogbo [Fri, 30 Nov 2018 19:27:14 +0000 (19:27 +0000)]
libcasper: do not fail if Capsicum is not avilable

Casper service can be also used on the kernels without Capsicum support.

Reported by: sbruno
Tested by: sbruno

5 years agoAdd missing display messages when toggling modes.
markj [Fri, 30 Nov 2018 18:02:59 +0000 (18:02 +0000)]
Add missing display messages when toggling modes.

PR: 233667
Submitted by: James Wright <james.wright@jigsawdesign.com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D18331

5 years agoSilence down the example builds a bit.
trasz [Fri, 30 Nov 2018 16:02:27 +0000 (16:02 +0000)]
Silence down the example builds a bit.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoAdd an example of quick kernel rebuild.
trasz [Fri, 30 Nov 2018 16:01:43 +0000 (16:01 +0000)]
Add an example of quick kernel rebuild.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoAdd an example of rebuilding a single piece of userspace.
trasz [Fri, 30 Nov 2018 15:56:14 +0000 (15:56 +0000)]
Add an example of rebuilding a single piece of userspace.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoRevert r341337; according to imp@ we still support these.
trasz [Fri, 30 Nov 2018 15:52:03 +0000 (15:52 +0000)]
Revert r341337; according to imp@ we still support these.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoUse .Va for sysctls, not .Dv.
trasz [Fri, 30 Nov 2018 12:17:35 +0000 (12:17 +0000)]
Use .Va for sysctls, not .Dv.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoUse .Va for sysctls, not .Dv.
trasz [Fri, 30 Nov 2018 11:50:41 +0000 (11:50 +0000)]
Use .Va for sysctls, not .Dv.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoRemove duplicated word.
trasz [Fri, 30 Nov 2018 11:44:43 +0000 (11:44 +0000)]
Remove duplicated word.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoSay in plain text what the 'debug' keymap action usually is.
trasz [Fri, 30 Nov 2018 11:44:16 +0000 (11:44 +0000)]
Say in plain text what the 'debug' keymap action usually is.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoRemove the hint for ISA buses; we don't support them anymore.
trasz [Fri, 30 Nov 2018 11:42:19 +0000 (11:42 +0000)]
Remove the hint for ISA buses; we don't support them anymore.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoLimit option_len for the TCP_CCALGOOPT.
tuexen [Fri, 30 Nov 2018 10:50:07 +0000 (10:50 +0000)]
Limit option_len for the TCP_CCALGOOPT.

Limiting the length to 2048 bytes seems to be acceptable, since
the values used right now are using 8 bytes.

Reviewed by: glebius, bz, rrs
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D18366

5 years agoAdapt the fix in r341008 to correctly work with EBR.
ae [Fri, 30 Nov 2018 10:36:14 +0000 (10:36 +0000)]
Adapt the fix in r341008 to correctly work with EBR.

IFNET_RLOCK_NOSLEEP() is epoch_enter_preempt() in FreeBSD 12+. Holding
it in sysctl_rtsock() doesn't protect us from ifnet unlinking, because
unlinking occurs with IFNET_WLOCK(), that is rw_wlock+sx_xlock, and it
doesn check that concurrent code is running in epoch section. But while
we are in epoch section, we should be able to do access to ifnet's
fields, even it was unlinked. Thus do not change if_addr and if_hw_addr
fields in ifnet_detach_internal() to NULL, since rtsock code can do
access to these fields and this is allowed while it is running in epoch
section.

This should fix the race, when ifnet_detach_internal() unlinks ifnet
after we checked it for IFF_DYING in sysctl_dumpentry.

Move free(ifp->if_hw_addr) into ifnet_free_internal(). Also remove the
NULL check for ifp->if_description, since free(9) can correctly handle
NULL pointer.

MFC after: 1 week

5 years agoarm64: allwinner: Add 792Mhz frequency to sun50i-a64-opp
manu [Fri, 30 Nov 2018 10:31:30 +0000 (10:31 +0000)]
arm64: allwinner: Add 792Mhz frequency to sun50i-a64-opp

This is the frequency of the cpu on the Pinebook so add it to make
cpufreq find the current setting.
Note that this dtbo on the Pinebook doesn't work right now as u-boot
dtb doesn't have symbols and so it fails to apply. Linux 4.20 have
the dts and will be imported once taggued.

MFC after: 1 month
X-MFC with: r341268

5 years agoloader.efi: fix EFI getchar() for multiple consoles
tsoome [Fri, 30 Nov 2018 08:42:14 +0000 (08:42 +0000)]
loader.efi: fix EFI getchar() for multiple consoles

This fix is ported from illumos (issue #9970), the analysis and initial
implementation was done by John Levon.

See also: https://www.illumos.org/issues/9970

Currently, efi_cons_getchar() will wait for a key. While this seems to make
sense, the implementation of getchar() in common/console.c will loop across
getchar() for all consoles without doing ischar() first.

This means that if we've configured multiple consoles, we can't input into
the serial, as getchar() will be sat waiting for input only from efi_console.c

This patch does implement a bit more generic key buffer to support
translation of input keys, and we use generic efi_readkey() to reduce
duplication from calls from getchar() and poll().

5 years agoloader: create separate lists for fd, cd and hd, merge bioscd with biosdisk
tsoome [Fri, 30 Nov 2018 08:01:11 +0000 (08:01 +0000)]
loader: create separate lists for fd, cd and hd, merge bioscd with biosdisk

Create unified block IO implementation in BIOS version, like it is done in UEFI
side. Implement fd, disk and cd device lists, this will split floppy devices
from disks and will allow us to have consistent, predictable device naming
(modulo BIOS issues).

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

5 years agosfxge(4): rollback last seen VLAN TCI if Tx packet is dropped
arybchik [Fri, 30 Nov 2018 07:11:05 +0000 (07:11 +0000)]
sfxge(4): rollback last seen VLAN TCI if Tx packet is dropped

Early processing of a packet on transmit may change last seen
VLAN TCI in the queue context. If such a packet is eventually
dropped, last seen VLAN TCI must be set to its previous value.

Submitted by:   Ivan Malov <Ivan.Malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18288

5 years agosfxge(4): ensure EvQ poll stops when abort is requested
arybchik [Fri, 30 Nov 2018 07:10:54 +0000 (07:10 +0000)]
sfxge(4): ensure EvQ poll stops when abort is requested

If an event handler requested an abort, only the inner loop was
guarenteed to be broken out of - the outer loop could continue
if total == batch.

Fix this by poisoning batch to ensure it is different to total.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18287

5 years agosfxge(4): support Medford2
arybchik [Fri, 30 Nov 2018 07:10:43 +0000 (07:10 +0000)]
sfxge(4): support Medford2

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18286

5 years agosfxge(4): update external port number calculation
arybchik [Fri, 30 Nov 2018 07:10:32 +0000 (07:10 +0000)]
sfxge(4): update external port number calculation

Revise the external port calculation to support all
X2 port modes. The previous algorithm could not
handle different port numbering schemes on each cage.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18285

5 years agosfxge(4): correct annotations where NULL input is OK
arybchik [Fri, 30 Nov 2018 07:10:20 +0000 (07:10 +0000)]
sfxge(4): correct annotations where NULL input is OK

Correct annotations where NULL input can be permitted

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18284

5 years agosfxge(4): support new link modes in the driver
arybchik [Fri, 30 Nov 2018 07:10:09 +0000 (07:10 +0000)]
sfxge(4): support new link modes in the driver

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18283

5 years agosfxge(4): use transceiver ID when reading info
arybchik [Fri, 30 Nov 2018 07:09:58 +0000 (07:09 +0000)]
sfxge(4): use transceiver ID when reading info

In efx_mcdi_phy_module_get_info() probe the
transceiver identification byte rather than assume
the module matches the fixed port type.  This
supports scenarios such as a SFP mounted in a QSFP
port via a QSA module.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18282

5 years agosfxge(4): add accessor to whole link status
arybchik [Fri, 30 Nov 2018 07:09:46 +0000 (07:09 +0000)]
sfxge(4): add accessor to whole link status

Add a function which makes an MCDI GET_LINK request and
packages up the results. Currently, the get-link function
is triggered from several entry points which then pass
on or store selected parts of the data. When the driver
needs to obtain the current link state, it is more
efficient to do this in a single call.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18281

5 years agosfxge(4): guard Rx scale code with corresponding option
arybchik [Fri, 30 Nov 2018 07:09:34 +0000 (07:09 +0000)]
sfxge(4): guard Rx scale code with corresponding option

Previously only some of the code was guarded by this which caused
a build error when EFSYS_OPT_RX_SCALE is 0 (e.g. in manftest).

Submitted by:   Tom Millington <tmillington at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18280

5 years agosfxge(4): infer port mode bandwidth from max link speed
arybchik [Fri, 30 Nov 2018 07:09:23 +0000 (07:09 +0000)]
sfxge(4): infer port mode bandwidth from max link speed

Limit the port mode bandwidth calculations by the maximum
reported link speed. This system detects 25G vs 10G cards,
and 100G port modes vs 40G.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18279

5 years agosfxge(4): support improvements to bandwidth calculations
arybchik [Fri, 30 Nov 2018 07:09:11 +0000 (07:09 +0000)]
sfxge(4): support improvements to bandwidth calculations

Change the interface to ef10_nic_get_port_mode_bandwidth()
so more NIC information can be used to infer bandwidth
requirements. Huntington calculations separated out
completely.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18278

5 years agosfxge(4): add X2 port modes to bandwidth calculator
arybchik [Fri, 30 Nov 2018 07:09:00 +0000 (07:09 +0000)]
sfxge(4): add X2 port modes to bandwidth calculator

Add cases for the new port modes supported by X2 NICs.
Lane bandwidth is calculated for pre-X2 cards so is an
underestimate for X2 in 25G/100G modes.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18277

5 years agosfxge(4): update to current port mode terminology
arybchik [Fri, 30 Nov 2018 07:08:50 +0000 (07:08 +0000)]
sfxge(4): update to current port mode terminology

>From Medford onwards, the newer constants enumerating
port modes should be used.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18276

5 years agosfxge(4): adjust PHY module info interface
arybchik [Fri, 30 Nov 2018 07:08:38 +0000 (07:08 +0000)]
sfxge(4): adjust PHY module info interface

Adjust data types in interface to permit the complete
module information buffer to be obtained in a single
call.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18275

5 years agosfxge(4): expose PHY module device address constants
arybchik [Fri, 30 Nov 2018 07:08:27 +0000 (07:08 +0000)]
sfxge(4): expose PHY module device address constants

Rearrange so the valid addresses are visible to the caller.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18274

5 years agosfxge(4): make last byte of module information available
arybchik [Fri, 30 Nov 2018 07:08:16 +0000 (07:08 +0000)]
sfxge(4): make last byte of module information available

Adjust bounds so the interface supports reading
the last available byte of data.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18273

5 years agosfxge(4): add helper API to make Geneve filter spec
arybchik [Fri, 30 Nov 2018 07:08:05 +0000 (07:08 +0000)]
sfxge(4): add helper API to make Geneve filter spec

Submitted by:   Vijay Srivastava <vijays at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18272

5 years agosfxge(4): fix MAC Tx stats for less or equal to 64 bytes
arybchik [Fri, 30 Nov 2018 07:07:54 +0000 (07:07 +0000)]
sfxge(4): fix MAC Tx stats for less or equal to 64 bytes

This statistic should include 64byte and smaller frames.
Fix EF10 calculation to match Siena code.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18271

5 years agosfxge(4): modify phy caps to indicate FEC request
arybchik [Fri, 30 Nov 2018 07:07:43 +0000 (07:07 +0000)]
sfxge(4): modify phy caps to indicate FEC request

The capability bits to request FEC modes are implicitly valid
when the corresponding FEC mode is a supported capability.
Drivers expect that it is only valid to advertise those
capabilities explicitly marked as supported. The capabilities
reported by firmware is modified with the implicit capabilities
to present the explicit model to drivers.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18270

5 years agosfxge(4): improve handling of legacy RSS hash flags
arybchik [Fri, 30 Nov 2018 07:07:31 +0000 (07:07 +0000)]
sfxge(4): improve handling of legacy RSS hash flags

Client drivers may use either legacy flags, for example,
EFX_RX_HASH_TCPIPV4, or generalised flags, for example,
EFX_RX_HASH(IPV4_TCP, 4TUPLE), to configure RSS hash.
The libefx is able to recognise what scheme is used.

Legacy flags may be consumed directly by a chip-specific handler to
configure the NIC, that is, on EF10, these flags can be used to fill
in legacy RSS mode field in MCDI request. Generalised flags can also
be directly used in EF10-specific handler as they are fully compatible
with additional fields of the same MCDI request.

Legacy flags undergo conversion to generalised flags before they
are consumed by a chip-specific handler. This conversion is used to
make sure that chip-specific handlers expect only generalised flags
in the input for the sake of clarity of the code.

Depending on firmware capabilities, a chip-specififc handler either
supplies the input to the NIC directly, for example,
EFX_RX_HASH(IPV4_TCP, 4TUPLE) flag will enable 4 bits in
RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV4_RSS_MODE field on EF10, or takes
the opportunity to translate the input to enable bits which don't map
to the generic flag, like setting
RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV4_EN on EF10 when the firmware
claims no support for additional modes.

However, this approach has introduced a severe problem which can be
reproduced with ultra-low-latency firmware variant. In order to enable
IP hash, EF10-specific handler requires the user to request 2-tuple
hash for IP-other, TCP and UDP traffic classes, unconditionally.
In example, IPv4 hash can be enabled using the following input:
EFX_RX_HASH(IPV4_TCP, 2TUPLE) | EFX_RX_HASH(IPV4_UDP, 2TUPLE) |
EFX_RX_HASH(IPV4, 2TUPLE).
At the same time, on ultra-low-latency firmware, the common code will
never report support for any UDP tuple to the client driver. That is,
in the same example, the driver will use EFX_RX_HASH(IPV4_TCP, 2TUPLE) |
EFX_RX_HASH(IPV4, 2TUPLE). This input will not be recognised by
EF10-specific handler, and RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV4_EN
bit will not be set in the MCDI request.

In order to solve the problem, the patch removes conversion code
from chip-specific handlers and adds appropriate code to convert
EFX_RX_HASH() flags to their legacy counterparts to the common scale
mode set function. If the firmware does not support additional modes,
the function will convert generalised flags to legacy flags correctly
without any demand for UDP flags and pass the result to a chip-specific
handler.

Submitted by:   Ivan Malov <ivan.malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18269

5 years agosfxge(4): simplify the code to parse RSS hash type
arybchik [Fri, 30 Nov 2018 07:07:20 +0000 (07:07 +0000)]
sfxge(4): simplify the code to parse RSS hash type

RSS mode bits can be accessed a lot easier in the hash
type value provided that the variable type is uint32_t.
The macro helper can be removed to enhance readability.

Submitted by:   Ivan Malov <ivan.malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18268

5 years agosfxge(4): check buffer size for hash flags
arybchik [Fri, 30 Nov 2018 07:07:09 +0000 (07:07 +0000)]
sfxge(4): check buffer size for hash flags

The efx_rx_scale_hash_flags_get interface is unsafe, as it does not
have an argument for the size of the output buffer used to return
the flags. While the only caller currently supplies a sufficiently
large buffer, this should be checked at runtime to avoid writing
past the end of the buffer.

Submitted by:   Ivan Malov <ivan.malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18267

5 years agosfxge(4): use simpler code to check hash algorithm type
arybchik [Fri, 30 Nov 2018 07:06:58 +0000 (07:06 +0000)]
sfxge(4): use simpler code to check hash algorithm type

The API which is used to list supported hash flags verifies
hash algorithm choice before writing the output. This check
is based on a switch() statement which has only two options
and no distinctive actions to be conducted for each of them.
Use simpler code instead of switch() to improve readability.

Submitted by:   Ivan Malov <ivan.malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18266

5 years agosfxge(4): add support to get active FEC type
arybchik [Fri, 30 Nov 2018 07:06:46 +0000 (07:06 +0000)]
sfxge(4): add support to get active FEC type

Submitted by:   Vijay Srivastava <vijays at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18265

5 years agosfxge(4): fix a typo in unicast filter insertion comment
arybchik [Fri, 30 Nov 2018 07:06:35 +0000 (07:06 +0000)]
sfxge(4): fix a typo in unicast filter insertion comment

Submitted by:   Ivan Malov <ivan.malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18264

5 years agosfxge(4): prevent access to the NIC config before probe
arybchik [Fri, 30 Nov 2018 07:06:24 +0000 (07:06 +0000)]
sfxge(4): prevent access to the NIC config before probe

NIC config is initialized during NIC probe.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18263

5 years agosfxge(4): fix ID retrieval in v3 licensing
arybchik [Fri, 30 Nov 2018 07:06:13 +0000 (07:06 +0000)]
sfxge(4): fix ID retrieval in v3 licensing

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18262

5 years agosfxge(4): add API to inform libefx of hardware removal
arybchik [Fri, 30 Nov 2018 07:06:01 +0000 (07:06 +0000)]
sfxge(4): add API to inform libefx of hardware removal

The efx_nic_hw_unavailable() checks ensure that if the NIC hardware
has failed or has been physically removed then libefx will stop
further attempts to access the hardware.

Add an interface for libefx clients to force unavailability, so the
hardware is treated as dead or removed even if still physically present.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18261

5 years agosfxge(4): add routine to check for hardware presence
arybchik [Fri, 30 Nov 2018 07:05:49 +0000 (07:05 +0000)]
sfxge(4): add routine to check for hardware presence

Add efx_nic_hw_unavailable() routine to check for hardware presence
before continuing with NIC operations.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18260

5 years agosfxge(4): fix out of bounds read when dereferencing sdup
arybchik [Fri, 30 Nov 2018 07:05:36 +0000 (07:05 +0000)]
sfxge(4): fix out of bounds read when dereferencing sdup

Introduce and use macro to make sure that MCDI buffers allocated
on stack are rounded up properly.

Submitted by:   Gautam Dawar <gdawar at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18259

5 years agosfxge(4): add information if TSO workaround is required
arybchik [Fri, 30 Nov 2018 07:05:23 +0000 (07:05 +0000)]
sfxge(4): add information if TSO workaround is required

In SF bug 61297 it's been confirmed that the hardware does not always
calculate the TCP checksum correctly with TSO sends.

The value of the Total Length field (IPv4) or Payload Length field
(IPv6) is the critical factor. We're sufficiently confident that if
these fields are zero then the checksum will be calculated correctly.

The information may be used by the drivers to check if the workaround is
required when FATSOv2 is implemented.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18258

5 years agosfxge(4): avoid usage of too big arrays on stack
arybchik [Fri, 30 Nov 2018 07:05:12 +0000 (07:05 +0000)]
sfxge(4): avoid usage of too big arrays on stack

Found by PreFAST static analysis.

Submitted by:   Martin Harvey <mharvey at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18257

5 years agosfxge(4): generalise EF10 NVRAM buffer interface
arybchik [Fri, 30 Nov 2018 07:05:00 +0000 (07:05 +0000)]
sfxge(4): generalise EF10 NVRAM buffer interface

The SFN driver's PartitionControl WMI object requires an API to parse
and filter partition data in TLV format, particularly for the Dynamic
Config partition. The ef10_nvram_buffer functions provide this
functionality but are tied to use with license partition only.
Modify functions so they are applicable to all TLV partitions and add
functions to support in-place tag modification.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18256

5 years agosfxge(4): add accessor for default port mode
arybchik [Fri, 30 Nov 2018 07:04:48 +0000 (07:04 +0000)]
sfxge(4): add accessor for default port mode

Extend efx_mcdi_get_port_modes() to optionally pass on the default
port mode field. This provides a more direct way of handling the case
where the dynamic config does not specify the port mode than the
alternative of a lookup table indexed by MCFW subtype.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18255

5 years agosfxge(4): add buffer editing functions to boot config
arybchik [Fri, 30 Nov 2018 07:04:37 +0000 (07:04 +0000)]
sfxge(4): add buffer editing functions to boot config

Functions to process the DHCP option list format used by the expansion
ROM config buffers, to support extracting and updating of individual
options.
The initial use case is the driver presenting the global and per-PF
options as separate items, with the driver implementing the
synchronization of global options across the configuration buffers
for all PFs.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18254

5 years agosfxge(4): add API to retrieve sensor limits
arybchik [Fri, 30 Nov 2018 07:04:25 +0000 (07:04 +0000)]
sfxge(4): add API to retrieve sensor limits

Submitted by:   Martin Harvey <mharvey at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18253

5 years agosfxge(4): check size of memory to read sensors data to
arybchik [Fri, 30 Nov 2018 07:04:13 +0000 (07:04 +0000)]
sfxge(4): check size of memory to read sensors data to

Size of provided memory should be consistent with specified size.

Submitted by:   Martin Harvey <mharvey at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18252

5 years agosfxge(4): add generated description of sensors
arybchik [Fri, 30 Nov 2018 05:54:30 +0000 (05:54 +0000)]
sfxge(4): add generated description of sensors

Description of sensors is generated from firmware sources.

Submitted by:   Martin Harvey <mharvey at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18251

5 years agosfxge(4): remove probes when a Tx queue is too full
arybchik [Fri, 30 Nov 2018 05:54:19 +0000 (05:54 +0000)]
sfxge(4): remove probes when a Tx queue is too full

No need for probe messages when a TxQ is too full for a post to be done.

Existing drivers check if there is room in the queue before posting
descriptors, even though efx_tx_qdesc_post() does the check itself.

The new SFN Windows driver doesn't perform the check before calling
efx_tx_qdesc_post(), but that means these probes can get frequently
printed out. It's normal driver behaviour so there's no need to print
an error.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18250

5 years agosfxge(4): refactor monitors support
arybchik [Fri, 30 Nov 2018 05:54:07 +0000 (05:54 +0000)]
sfxge(4): refactor monitors support

Remove obsolete monitor types since Falcon SFN4000 series adapters
no longer supported by libefx.
Rename MCDI monitors to be consistent with YML.
The code may be simplified and generalized since only MCDI monitors
remain.

Submitted by:   Martin Harvey <mharvey at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18249

5 years agosfxge(4): move empty efsys definitions to EFX headers
arybchik [Fri, 30 Nov 2018 05:50:01 +0000 (05:50 +0000)]
sfxge(4): move empty efsys definitions to EFX headers

Move empty definitions for platform-specific annotations from efsys.h
to EFX headers.

Submitted by:   Martin Harvey <mharvey at solarflare.com>
Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18248

5 years agoInclude path for tmpfs objects in vm.objects sysctl
vangyzen [Fri, 30 Nov 2018 04:59:43 +0000 (04:59 +0000)]
Include path for tmpfs objects in vm.objects sysctl

This applies the fix in r283924 to the vm.objects sysctl
added by r283624 so the output will include the vnode
information (i.e. path) for tmpfs objects.

Reviewed by: kib, dab
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D2724

5 years agoAdd assertions and comment to vm_object_vnode()
vangyzen [Fri, 30 Nov 2018 04:18:31 +0000 (04:18 +0000)]
Add assertions and comment to vm_object_vnode()

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D2724

5 years agoClean up a rather useless conditional structure member definition.
cy [Fri, 30 Nov 2018 04:15:56 +0000 (04:15 +0000)]
Clean up a rather useless conditional structure member definition.

MFC after: 1 week

5 years agoClean up a redundant non-redefinition of IFNAMSIZ. IFNAMSIZ
cy [Fri, 30 Nov 2018 04:15:42 +0000 (04:15 +0000)]
Clean up a redundant non-redefinition of IFNAMSIZ. IFNAMSIZ
is defined in net/if.h, therefore the condition is never met and
confusing to those who follow.

MFC after: 1 month

5 years agoUse _thr_isthreaded() and _thr_setthreaded() wrappers
vangyzen [Fri, 30 Nov 2018 03:02:49 +0000 (03:02 +0000)]
Use _thr_isthreaded() and _thr_setthreaded() wrappers

...instead of directly using the global variable.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

5 years ago_thr_setthreaded() cannot fail; change return type to void
vangyzen [Fri, 30 Nov 2018 03:01:32 +0000 (03:01 +0000)]
_thr_setthreaded() cannot fail; change return type to void

Also remove logic to avoid unnecessary stores to the global variable.
Thread creation and destruction are heavy enough that any supposed savings
is in the noise.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

5 years agoWhen handling CMD_CRIT error set command_errmsg to NULL after we dump it out,
sobomax [Fri, 30 Nov 2018 02:14:41 +0000 (02:14 +0000)]
When handling CMD_CRIT error set command_errmsg to NULL after we dump it out,
so that it does not result in error message printed twice.

OK load doodoo
can't find 'doodoo'
can't find 'doodoo'
OK

MFC after: 2 weeks

5 years agoamd64: remove stale attribution for memmove work
mjg [Fri, 30 Nov 2018 00:47:36 +0000 (00:47 +0000)]
amd64: remove stale attribution for memmove work

While the routine started as expanded bcopy, it is now entirely rewritten.

Sponsored by: The FreeBSD Foundation

5 years agoamd64: tidy up copying backwards in memmove
mjg [Fri, 30 Nov 2018 00:45:10 +0000 (00:45 +0000)]
amd64: tidy up copying backwards in memmove

For non-ERMS case the code used handle possible trailing bytes with
movsb first and then followed it up with movsq. This also happened
to alter how calculations were done for other cases.

Handle the tail with regular movs, just like when copying forward.
Use leaq to calculate the right offset from the get go, instead of
doing separate add and sub.

This adjusts the offset for non-rep cases so that they can be used
to handle the tail.

The routine is still a work in progress.

Sponsored by: The FreeBSD Foundation

5 years agoMake most of the CLIP code conditional on #ifdef INET6.
jhb [Thu, 29 Nov 2018 23:14:54 +0000 (23:14 +0000)]
Make most of the CLIP code conditional on #ifdef INET6.

This fixes builds of kernels without INET6 such as LINT-NOINET6.

Reported by: arybchik
Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D18384

5 years agorelease: arm64: Add opp dtbo to PINE* boards
manu [Thu, 29 Nov 2018 22:36:36 +0000 (22:36 +0000)]
release: arm64: Add opp dtbo to PINE* boards

MFC after: 1 month

5 years agoarm64: allwinner: Add a dtbo to have cpu operating points
manu [Thu, 29 Nov 2018 22:35:23 +0000 (22:35 +0000)]
arm64: allwinner: Add a dtbo to have cpu operating points

This enables cpufreq on A64 boards.

MFC after: 1 month

5 years agoRemove an old comment/code and replace with a comment that
cy [Thu, 29 Nov 2018 21:20:53 +0000 (21:20 +0000)]
Remove an old comment/code and replace with a comment that
directly references a NetBSD commit.

MFC after: 1 week

5 years agoAdd helper functions to copy strings into struct image_args.
brooks [Thu, 29 Nov 2018 21:00:56 +0000 (21:00 +0000)]
Add helper functions to copy strings into struct image_args.

Given a zeroed struct image_args with an allocated buf member,
exec_args_add_fname() must be called to install a file name (or NULL).
Then zero or more calls to exec_args_add_env() followed by zero or
more calls to exec_args_add_env(). exec_args_adjust_args() may be
called after args and/or env to allow an interpreter to be prepended to
the argument list.

To allow code reuse when adding arg and env variables, begin_envv
should be accessed with the accessor exec_args_get_begin_envv()
which handles the case when no environment entries have been added.

Use these functions to simplify exec_copyin_args() and
freebsd32_exec_copyin_args().

Reviewed by: kib
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15468

5 years agoReplace hand-crafted naive byte-by-byte zero block detection routine
sobomax [Thu, 29 Nov 2018 19:28:01 +0000 (19:28 +0000)]
Replace hand-crafted naive byte-by-byte zero block detection routine
with macro based around memcmp(). The latter is expected to be some
8 times faster on a modern 64-bit architectures.

In practice, throughput of doing conv=sparse from /dev/zero to /dev/null
went up some 5-fold here from 1.9GB/sec to 9.7GB/sec with this change
(bs=128k).

MFC after: 2 weeks

5 years agoIf BENEATH is specified, always latch the topping directory vnode.
kib [Thu, 29 Nov 2018 19:13:10 +0000 (19:13 +0000)]
If BENEATH is specified, always latch the topping directory vnode.

It is possible that we started with a relative path but during the
lookup, found an absolute symlink.  In this case, BENEATH handling
code needs the latch, but it is too late to calculate it.

While there, somewhat improve the assertions.  Clear the NI_LCF_LATCH
flag when the latch vnode is released, so that asserts know the state.
Assert that there is a latch if we entered beneath+abs path mode,
after the starting point is processed.

Reported by: wulf
With more input from: pho
Sponsored by: The FreeBSD Foundation

5 years agoarm64: rockchip: armclk: Do not change parent freq if CLK_SET_DRYRUN is set
manu [Thu, 29 Nov 2018 19:11:35 +0000 (19:11 +0000)]
arm64: rockchip: armclk: Do not change parent freq if CLK_SET_DRYRUN is set

MFC after: 3 days

5 years agoextres: clk: Fix clk_set_assigned
manu [Thu, 29 Nov 2018 19:06:05 +0000 (19:06 +0000)]
extres: clk: Fix clk_set_assigned

ofw_bus_parse_xref_list_get_length doesn't returns the number of elements, fix this.
While here when setting the clock to the assigned freqeuncy, allow the clock
driver to round down or up the frequency as sometimes the exact frequency cannot
be obtain.

5 years agoThe libstand's panic() appends its own '\n' to the message, so that users of the API
sobomax [Thu, 29 Nov 2018 18:37:48 +0000 (18:37 +0000)]
The libstand's panic() appends its own '\n' to the message, so that users of the API
don't need to supply one.

MFC after: 2 weeks

5 years agoFix age_old_log() after r337468.
markj [Thu, 29 Nov 2018 16:49:56 +0000 (16:49 +0000)]
Fix age_old_log() after r337468.

We can no longer use sizeof() to get the path buffer's size.  Apply
a straightforward fix for now with the aim of MFCing soon.

PR: 233633
Submitted by: Katsuyuki Miyoshi <katsu@miyoshi.matsuyama.ehime.jp>
MFC after: 3 days

5 years agoUpdate the free page count when blacklisting pages.
markj [Thu, 29 Nov 2018 16:31:01 +0000 (16:31 +0000)]
Update the free page count when blacklisting pages.

Otherwise the free page count will not accurately reflect the physical
page allocator's state.  On 11 this can trigger panics in
vm_page_alloc() since the allocator state and free page count are
updated atomically and we expect them to stay in sync.  On 12 the
bug would manifest as threads looping in vm_page_alloc().

PR: 231296
Reported by: mav, wollman, Rainer Duffner, Josh Gitlin
Reviewed by: alc, kib, mav
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18374

5 years agotrim.8: fix contents after rename from trim.1
eugen [Thu, 29 Nov 2018 16:13:46 +0000 (16:13 +0000)]
trim.8: fix contents after rename from trim.1

MFC after: 1 month

5 years agotrim(8): fix Makefile after rename from trim(1).
eugen [Thu, 29 Nov 2018 16:10:54 +0000 (16:10 +0000)]
trim(8): fix Makefile after rename from trim(1).

MFC after: 1 month

5 years agoRename trim.1 to trim.8 too.
eugen [Thu, 29 Nov 2018 16:09:24 +0000 (16:09 +0000)]
Rename trim.1 to trim.8 too.

MFC after: 1 month