]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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

5 years agoMove trim(1) from usr.bin to usr.sbin to become trim(8).
eugen [Thu, 29 Nov 2018 16:08:16 +0000 (16:08 +0000)]
Move trim(1) from usr.bin to usr.sbin to become trim(8).

Requested by: se
MFC after: 1 month

5 years agotrim(1): unbreak build after r341232 for platforms using gcc and not clang
eugen [Thu, 29 Nov 2018 14:49:33 +0000 (14:49 +0000)]
trim(1): unbreak build after r341232 for platforms using gcc and not clang

MFC after: 1 month

5 years agoAdd new small tool trim(1) to delete contents for blocks on flash
eugen [Thu, 29 Nov 2018 14:21:26 +0000 (14:21 +0000)]
Add new small tool trim(1) to delete contents for blocks on flash
based storage devices that use wear-leveling algorithms.

Reviewed by: hackers@
MFC after: 1 month

5 years agoloader: command_bcache() should print unsigned values
tsoome [Thu, 29 Nov 2018 14:21:01 +0000 (14:21 +0000)]
loader: command_bcache() should print unsigned values

All bcache counters are unsigned.

5 years agovfs: fix i386 build after r341220
mjg [Thu, 29 Nov 2018 09:54:27 +0000 (09:54 +0000)]
vfs: fix i386 build after r341220

5 years agocache: retire cache_enter compat schim
mjg [Thu, 29 Nov 2018 09:32:59 +0000 (09:32 +0000)]
cache: retire cache_enter compat schim

It was added over 6 years ago for binary compat. cache_enter macro remains
as it expands to cache_enter_time.

Sponsored by: The FreeBSD Foundation

5 years agoaudit: predict AUDITING_TD as false
mjg [Thu, 29 Nov 2018 09:19:48 +0000 (09:19 +0000)]
audit: predict AUDITING_TD as false

By default it is compiled in and disabled.

Sponsored by: The FreeBSD Foundation

5 years agovfs: drop spurious memcpy in stat
mjg [Thu, 29 Nov 2018 09:04:10 +0000 (09:04 +0000)]
vfs: drop spurious memcpy in stat

Sponsored by: The FreeBSD Foundation

5 years agofd: unify fd range check across the routines
mjg [Thu, 29 Nov 2018 08:53:39 +0000 (08:53 +0000)]
fd: unify fd range check across the routines

While here annotate out of range as unlikely.

Sponsored by: The FreeBSD Foundation

5 years agoaudit: change audit_syscalls_enabled type to bool
mjg [Thu, 29 Nov 2018 08:37:33 +0000 (08:37 +0000)]
audit: change audit_syscalls_enabled type to bool

So that it fits better in __read_frequently.

Sponsored by: The FreeBSD Foundation

5 years agosfxge(4): add more definitions of partitions
arybchik [Thu, 29 Nov 2018 06:47:41 +0000 (06:47 +0000)]
sfxge(4): add more definitions of partitions

Add definitions of dynamic config and expansion ROM backup
partitions.

Submitted by:   Paul Fox <pfox at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18247

5 years agosfxge(4): fix build because of no declaration
arybchik [Thu, 29 Nov 2018 06:47:30 +0000 (06:47 +0000)]
sfxge(4): fix build because of no declaration

Functions declared in mcdi_mon.h are implemented in mcdi_mon.c.
The build fails if compiler options require declaration before definition.

Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18246

5 years agosfxge(4): fix SAL annotation for input buffers
arybchik [Thu, 29 Nov 2018 06:47:19 +0000 (06:47 +0000)]
sfxge(4): fix SAL annotation for input buffers

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

5 years agosfxge(4): fix PreFAST warnings because of unused return
arybchik [Thu, 29 Nov 2018 06:47:06 +0000 (06:47 +0000)]
sfxge(4): fix PreFAST warnings because of unused return

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

5 years agosfxge(4): add Medford2 head-of-line blocking stats
arybchik [Thu, 29 Nov 2018 06:46:55 +0000 (06:46 +0000)]
sfxge(4): add Medford2 head-of-line blocking stats

These stats are availble on Medford2 DPDK firmware variant
which support equal stride super-buffer Rx mode. RXDP_HLB_IDLE
capability bit is set when the stats are available.

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

5 years agosfxge(4): support RxDP scatter disabled truncate counter
arybchik [Thu, 29 Nov 2018 06:46:44 +0000 (06:46 +0000)]
sfxge(4): support RxDP scatter disabled truncate counter

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

5 years agosfxge(4): generate Medford2 RxDP stats
arybchik [Thu, 29 Nov 2018 06:46:33 +0000 (06:46 +0000)]
sfxge(4): generate Medford2 RxDP stats

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

5 years agosfxge(4): get max supported value for action MARK
arybchik [Thu, 29 Nov 2018 06:46:21 +0000 (06:46 +0000)]
sfxge(4): get max supported value for action MARK

The mark value for MATCH_ACTION_MARK has a maximum value.
Requesting a value larger than the maximum will cause the
filter insertion to fail with EINVAL. This patch allows the
driver to check the value at the filter validation.

Submitted by:   Roman Zhukov <roman.zhukov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18240

5 years agosfxge(4): support MARK and FLAG actions in filters
arybchik [Thu, 29 Nov 2018 06:46:10 +0000 (06:46 +0000)]
sfxge(4): support MARK and FLAG actions in filters

This patch adds support for DPDK rte_flow "MARK" and "FLAG" filter
actions to filters on EF10 family NICs.

Submitted by:   Roman Zhukov <roman.zhukov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18239

5 years agosfxge(4): get actions MARK and FLAG support
arybchik [Thu, 29 Nov 2018 06:46:01 +0000 (06:46 +0000)]
sfxge(4): get actions MARK and FLAG support

Filter actions MARK and FLAG are supported on Medford2 by DPDK
firmware variant.

Submitted by:   Roman Zhukov <roman.zhukov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18238

5 years agosfxge(4): add equal stride super-buffer prefix layout
arybchik [Thu, 29 Nov 2018 06:45:50 +0000 (06:45 +0000)]
sfxge(4): add equal stride super-buffer prefix layout

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

5 years agosfxge(4): support equal stride super-buffer Rx mode
arybchik [Thu, 29 Nov 2018 06:45:38 +0000 (06:45 +0000)]
sfxge(4): support equal stride super-buffer Rx mode

Equal stride super-buffer Rx mode is supported by DPDK firmware
variant. One Rx descriptor provides many Rx buffers to firmware.
Rx buffers follow each other with specified stride.
Also it supports head of line blocking with timeout to address
drops when no Rx descriptors are available. So it gives extra time
to the driver to provide Rx descriptors before drop.

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

5 years agosfxge(4): detect equal stride super-buffer support
arybchik [Thu, 29 Nov 2018 06:45:26 +0000 (06:45 +0000)]
sfxge(4): detect equal stride super-buffer support

Equal stride super-buffer Rx mode is supported on Medford2 by
DPDK firmware variant.

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

5 years agosfxge(4): make RxQ type data an union
arybchik [Thu, 29 Nov 2018 06:45:15 +0000 (06:45 +0000)]
sfxge(4): make RxQ type data an union

The type is an internal interface. Single integer is insufficient
to carry RxQ type-specific information in the case of equal stride
super-buffer Rx mode (packet buffers per bucket, maximum DMA length,
packet stride, head of line block timeout).

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

5 years agosfxge(4): update autogenerated MCDI and TLV headers
arybchik [Thu, 29 Nov 2018 06:45:04 +0000 (06:45 +0000)]
sfxge(4): update autogenerated MCDI and TLV headers

Equal stride super-buffer is a new name instead of deprecated equal
stride packed stream to avoid confusion with previous packed stream.

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

5 years agosfxge(4): honour packed stream RSS restriction
arybchik [Thu, 29 Nov 2018 06:44:51 +0000 (06:44 +0000)]
sfxge(4): honour packed stream RSS restriction

Packed stream firmware variant on EF10 adapters has a
number of properties which must be taken into account:

 - Only one exclusive RSS context is available per port.
 - Only IP addresses can contribute to the hash value.

Huntington and Medford have one more limitation which
is important for the drivers capable of packed stream:

 - Hash algorithm is non-standard (i.e. non-Toeplitz).
   This implies XORing together source + destination
   IP addresses (or last four bytes in the case of IPv6)
   and using the result as the input to a Toeplitz hash.

This patch provides a number of improvements in order
to treat the mentioned limitations in the common code.

If the firmware variant is packed stream, the list of
supported hash tuples will include less variants, and
the maximum number of RSS contexts will be set to one.

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

5 years agosfxge(4): support more RSS hash configurations
arybchik [Thu, 29 Nov 2018 06:44:39 +0000 (06:44 +0000)]
sfxge(4): support more RSS hash configurations

Modern firmwares on EF10 adapters have support for
more traffic classes eligible for hash computation.
Also, it has become possible to adjust hashing per
individual class and select distinct packet fields
which will be able to contribute to the hash value.

This patch adds support for the mentioned features.

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

5 years agosfxge(4): add a new means to control RSS hash
arybchik [Thu, 29 Nov 2018 06:44:28 +0000 (06:44 +0000)]
sfxge(4): add a new means to control RSS hash

Currently, libefx has no support for additional RSS modes
available with later controllers. In order to support this,
libefx should be able to list available hash configurations.

This patch provides basic infrastructure for the new interface.
The client drivers will be able to query the list of supported
hash configurations for a particular hash algorithm. Also, it
will be possible to configure hashing by means of new definitions.

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

5 years agosfxge(4): cope with clang warning on negative shift
arybchik [Thu, 29 Nov 2018 06:44:20 +0000 (06:44 +0000)]
sfxge(4): cope with clang warning on negative shift

clang 4.0.1-6 on Ubuntu generates false positive warning that shift
is negative.  It is done regardless of the fact that the branch is
not taken because of previous check.

The warning is generate in EFX_INSERT_NATIVE32 used by
EFX_INSERT_FIELD_NATIVE32. All similar cases are fixed as well.

It is undesirable to suppress the warning completely.

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

5 years agosfxge(4): fix comparison always true warning
arybchik [Thu, 29 Nov 2018 06:44:09 +0000 (06:44 +0000)]
sfxge(4): fix comparison always true warning

Loopback type used as bit index has efx_loopback_type_t type
which is enum. clang complains that it is always true when it
is compared with qword (64 bit) bits number boundary.

Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18228

5 years agosfxge(4): support FW subvariant choice
arybchik [Thu, 29 Nov 2018 06:43:57 +0000 (06:43 +0000)]
sfxge(4): support FW subvariant choice

If DPDK application or OS does not need checksumming on transmit,
it may be disabled in firmware to achieve higher packet rates.
Choice must be done before VIS allocation and is allowed if
no other non-preboot and firmware subvariant-unaware drivers are
attached.

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

5 years agosfxge(4): report no Tx checksum FW subvariant support
arybchik [Thu, 29 Nov 2018 06:43:46 +0000 (06:43 +0000)]
sfxge(4): report no Tx checksum FW subvariant support

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

5 years agosfxge(4): add firmware subvariant aware driver option
arybchik [Thu, 29 Nov 2018 06:43:34 +0000 (06:43 +0000)]
sfxge(4): add firmware subvariant aware driver option

FW subvariants allow to tweak NIC global features. For example,
if no drivers require checksumming on transmit, it may be disabled
in FW to increase packet rate.

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

5 years agosfxge(4): update MCDI headers
arybchik [Thu, 29 Nov 2018 06:43:23 +0000 (06:43 +0000)]
sfxge(4): update MCDI headers

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

5 years agosfxge(4): add values for RxDPCPU firmware id recognition
arybchik [Thu, 29 Nov 2018 06:43:12 +0000 (06:43 +0000)]
sfxge(4): add values for RxDPCPU firmware id recognition

Submitted by:   Roman Zhukov <roman.zhukov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18223

5 years agosfxge(4): support choosing firmware variant
arybchik [Thu, 29 Nov 2018 06:43:00 +0000 (06:43 +0000)]
sfxge(4): support choosing firmware variant

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

5 years agosfxge(4): support drop filters on EF10 family NICs
arybchik [Thu, 29 Nov 2018 06:42:49 +0000 (06:42 +0000)]
sfxge(4): support drop filters on EF10 family NICs

Add support for filters which drop packets when forming MCDI request
for a filter.

Submitted by:   Roman Zhukov <roman.zhukov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18221

5 years agosfxge(4): distinguish filters for encapsulated packets
arybchik [Thu, 29 Nov 2018 06:42:38 +0000 (06:42 +0000)]
sfxge(4): distinguish filters for encapsulated packets

Add filter match flag to distinguish filters applied only to
encapsulated packets.

Match flags set should allow to determine whether a filter
is supported or not. The problem is that if specification
has supported set outer match flags and specified
encapsulation without any inner flags, check says that it
is supported, and filter insertion is performed. However,
there is no filtering of the encapsulated traffic. A new
flag is added to solve this problem and separate the
filters for the encapsulated packets.

Submitted by:   Roman Zhukov <roman.zhukov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18220

5 years agosfxge(4): support VXLAN filter creation
arybchik [Thu, 29 Nov 2018 06:42:26 +0000 (06:42 +0000)]
sfxge(4): support VXLAN filter creation

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

5 years agosfxge(4): support VNI/VSID and inner frame local MAC
arybchik [Thu, 29 Nov 2018 06:42:15 +0000 (06:42 +0000)]
sfxge(4): support VNI/VSID and inner frame local MAC

This supports VNI/VSID and inner frame local MAC fields to
match in VXLAN, GENEVE, or NVGRE packets.

Submitted by:   Roman Zhukov <roman.zhukov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18218

5 years agosfxge(4): support filters for encapsulated packets
arybchik [Thu, 29 Nov 2018 06:42:04 +0000 (06:42 +0000)]
sfxge(4): support filters for encapsulated packets

This adds filters for encapsulated packets to the list
returned by ef10_filter_supported_filters().

Submitted by:   Roman Zhukov <roman.zhukov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18217

5 years agosfxge(4): sync MCDI headers and TLV layout
arybchik [Thu, 29 Nov 2018 06:41:53 +0000 (06:41 +0000)]
sfxge(4): sync MCDI headers and TLV layout

Regenerate MCDI and TLV layout headers from firmwaresrc to
pick up DPDK firmware variant and related Rx queue and filtering
extensions.

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

5 years agosfxge(4): add signed image layout support
arybchik [Thu, 29 Nov 2018 06:41:41 +0000 (06:41 +0000)]
sfxge(4): add signed image layout support

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

5 years agosfxge(4): add firmware image layout option
arybchik [Thu, 29 Nov 2018 06:29:24 +0000 (06:29 +0000)]
sfxge(4): add firmware image layout option

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

5 years agoConvert racct_enable to bool and annotate as __read_frequently
mjg [Thu, 29 Nov 2018 05:17:16 +0000 (05:17 +0000)]
Convert racct_enable to bool and annotate as __read_frequently

Sponsored by: The FreeBSD Foundation

5 years agoDeinline racct throttling out of syscall exit path.
mjg [Thu, 29 Nov 2018 05:08:46 +0000 (05:08 +0000)]
Deinline racct throttling out of syscall exit path.

racct is not enabled by default and even when it is enabled processes are
typically not throttled. The order of checks is left unchanged since
racct_enable will be annotated as __read_frequently, while checking for the
flag in the processes would probably require an extra fetch.

Sponsored by: The FreeBSD Foundation

5 years agoAnnotate td_cowgen check as unlikely.
mjg [Thu, 29 Nov 2018 04:48:22 +0000 (04:48 +0000)]
Annotate td_cowgen check as unlikely.

Sponsored by: The FreeBSD Foundation

5 years agoAllow truss to operate on ELFv2 processes.
jhibbits [Thu, 29 Nov 2018 03:57:06 +0000 (03:57 +0000)]
Allow truss to operate on ELFv2 processes.

Summary:
Currently, truss doesn't work on ELFv2 processes due to not recognizing the ABI.

Since there's no special handling needed here, just adding a PROCABI struct for
it is sufficient to get it working.

Submitted by: git_bdragon.rtk0.net
Differential Revision: https://reviews.freebsd.org/D18352

5 years agoTidy up hardclock.
mjg [Thu, 29 Nov 2018 03:44:02 +0000 (03:44 +0000)]
Tidy up hardclock.

- use fcmpset for updating ticks
- move (rarely used) itimer handling to a dedicated function

Sponsored by: The FreeBSD Foundation

5 years agoFix thread creation in PowerPC64 ELFv2 processes.
jhibbits [Thu, 29 Nov 2018 03:39:11 +0000 (03:39 +0000)]
Fix thread creation in PowerPC64 ELFv2 processes.

Summary:
Currently, the upcall used to create threads assumes ELFv1.

Instead, we should check which sysentvec is in use on the process and act
accordingly.

This makes ELFv2 threaded processes work.

Submitted by: git_bdragon.rtk0.net
Differential Revision: https://reviews.freebsd.org/D18330

5 years agoproc: create a dedicated lock for zombproc to ligthen the load on allproc_lock
mjg [Thu, 29 Nov 2018 02:52:08 +0000 (02:52 +0000)]
proc: create a dedicated lock for zombproc to ligthen the load on allproc_lock

waitpid always takes proctree to evaluate the list, but only takes allproc
if it can reap. With this patch allproc is no longer taken, which helps during
poudriere -j 128.

Discussed with: kib
Sponsored by: The FreeBSD Foundation

5 years agoMove CLIP table handling out of TOM and into the base driver.
jhb [Thu, 29 Nov 2018 01:15:53 +0000 (01:15 +0000)]
Move CLIP table handling out of TOM and into the base driver.

- Store the clip table in 'struct adapter' instead of in the TOM softc.
- Init the clip table during attach and teardown during detach.
- While here, add a dev.<nexus>.<unit>.misc.clip sysctl to dump the
  CLIP table.

This does mean that we update the clip table even if TOE is not enabled,
but non-TOE things need the CLIP table anyway.

Reviewed by: np, Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D18010

5 years agosh: Fix ${param?} default error message
jilles [Wed, 28 Nov 2018 20:03:53 +0000 (20:03 +0000)]
sh: Fix ${param?} default error message

If word in ${param?word} is missing, the shell shall write a default error
message. So expanding ${param?} when param is not set should write an error
message like

sh: param: parameter not set

This was broken by r316417.

PR: 233585

5 years agoFix yet another edge case in uma_startup_count(). If zone size fits into
glebius [Wed, 28 Nov 2018 19:54:02 +0000 (19:54 +0000)]
Fix yet another edge case in uma_startup_count(). If zone size fits into
several pages, but leaves no space for struct uma_slab at the end we
miscalculate number of pages by one. Totally mimic keg_large_init() math
here to cover that problem.

Reported by: gallatin

5 years agoFor not offpage zones the slab is placed at the end of page. Keg's uk_pgoff
glebius [Wed, 28 Nov 2018 19:17:27 +0000 (19:17 +0000)]
For not offpage zones the slab is placed at the end of page. Keg's uk_pgoff
is calculated to guarantee that struct uma_slab is placed at pointer size
alignment. Calculation of real struct uma_slab size is done in keg_ctor()
and yet again in keg_large_init(), to check if we need an extra page. This
calculation can actually be performed at compile time.

- Add SIZEOF_UMA_SLAB macro to calculate size of struct uma_slab placed at
  an end of a page with alignment requirement.
- Use SIZEOF_UMA_SLAB in keg_ctor() and in keg_large_init(). This is a not
  a functional change.
- Use SIZEOF_UMA_SLAB in UMA_SLAB_SPACE definition and in keg_small_init().
  This is a potential bugfix, but in reality I don't think there are any
  systems affected, since compiler aligns struct uma_slab anyway.

5 years agoAdd comments describing the bootargs handoff between loader(8) and gptboot
ian [Wed, 28 Nov 2018 18:09:42 +0000 (18:09 +0000)]
Add comments describing the bootargs handoff between loader(8) and gptboot
or zfsboot, when loader(8) is the BTX loader.  No functional changes.

5 years agoFix first-packet completion
shurd [Wed, 28 Nov 2018 17:37:17 +0000 (17:37 +0000)]
Fix first-packet completion

The first packet after the ring is initialized was never
completed as isc_txd_credits_update() would not include it in the
count of completed packets. This caused netmap to never complete
a batch. See PR 233022 for more details.

This is the same fix as the r340310 for e1000

PR: 233607
Reported by: lev
Reviewed by: lev
MFC after: 3 days
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D18368

5 years agopowerpc: Don't include KERNBASE in genassym, it's unnecessary
jhibbits [Wed, 28 Nov 2018 16:00:52 +0000 (16:00 +0000)]
powerpc: Don't include KERNBASE in genassym, it's unnecessary

A related future change, which changes KERNBASE for Book-E for some reason
causes a "KERNBASE redefined" error with assym.inc, even though it only changed
the value of KERNBASE and nothing else.  Since machine/vmparam.h is already
included in booke/locore.S, and the requisite guards are already in place for
properly handling KERNBASE in vmparam.h, just remove it from genassym, and
include vmparam.h in the AIM locore files.

5 years agocxgbe: revert r309725
vmaffione [Wed, 28 Nov 2018 15:29:58 +0000 (15:29 +0000)]
cxgbe: revert r309725

After the fix contained in r341144, cxgbe does not need anymore
to set the IFCAP_NETMAP flag manually.

Reviewed by: np
Approved by: gnn (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17987

5 years agonetmap: set IFCAP_NETMAP in if_capabilities
vmaffione [Wed, 28 Nov 2018 14:07:34 +0000 (14:07 +0000)]
netmap: set IFCAP_NETMAP in if_capabilities

Revision r307394 removed (by mistake) the code that sets IFCAP_NETMAP
in if_capabilities on netmap_attach. This patch reverts this change.

Reviewed by: np
Approved by: gnn (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17987

5 years agoarm64: Add rk_i2c and rk805 to GENERIC
manu [Wed, 28 Nov 2018 13:54:39 +0000 (13:54 +0000)]
arm64: Add rk_i2c and rk805 to GENERIC

MFC after: 1 month

5 years agoAdd RK805 PMIC Support
manu [Wed, 28 Nov 2018 13:53:43 +0000 (13:53 +0000)]
Add RK805 PMIC Support

RK805 is the companion PMIC for RK3328 SoC.
Add a driver for it with most of it's regulators supported.

MFC after: 1 month

5 years agork_clk_composite: Fix set_mux
manu [Wed, 28 Nov 2018 13:25:22 +0000 (13:25 +0000)]
rk_clk_composite: Fix set_mux

Pointy Hat:   manu

5 years agoAdd CAPABILITIES to the ERL kernel config so that tools that have been
sbruno [Wed, 28 Nov 2018 13:25:10 +0000 (13:25 +0000)]
Add CAPABILITIES to the ERL kernel config so that tools that have been
modified with Capsicum work on this target platform.

This came up after the conversion of wc(8).

5 years agosfxge(4): add outer IP ID parameter to TSOv2 descriptor
arybchik [Wed, 28 Nov 2018 09:25:43 +0000 (09:25 +0000)]
sfxge(4): add outer IP ID parameter to TSOv2 descriptor

Set outer_ip_id in the TX option descriptor for encapsulated packets.

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

5 years agosfxge(4): add encapsulated TSOv2 capability
arybchik [Wed, 28 Nov 2018 09:25:31 +0000 (09:25 +0000)]
sfxge(4): add encapsulated TSOv2 capability

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

5 years agosfxge(4): support CTPIO stats
arybchik [Wed, 28 Nov 2018 09:25:21 +0000 (09:25 +0000)]
sfxge(4): support CTPIO stats

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

5 years agosfxge(4): regenerate headers to pick up CTPIO stats
arybchik [Wed, 28 Nov 2018 09:25:09 +0000 (09:25 +0000)]
sfxge(4): regenerate headers to pick up CTPIO stats

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

5 years agosfxge(4): add bit to indicate CTPIO availability
arybchik [Wed, 28 Nov 2018 09:24:58 +0000 (09:24 +0000)]
sfxge(4): add bit to indicate CTPIO availability

Submitted by:   Guido Barzini <gbarzini at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18209

5 years agosfxge(4): add CTPIO statistics
arybchik [Wed, 28 Nov 2018 09:24:47 +0000 (09:24 +0000)]
sfxge(4): add CTPIO statistics

Submitted by:   Guido Barzini <gbarzini at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18208

5 years agosfxge(4): run genfwdef to update headers
arybchik [Wed, 28 Nov 2018 09:24:36 +0000 (09:24 +0000)]
sfxge(4): run genfwdef to update headers

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

5 years agosfxge(4): document the event type for CTPIO sends
arybchik [Wed, 28 Nov 2018 09:24:25 +0000 (09:24 +0000)]
sfxge(4): document the event type for CTPIO sends

Document the TX_EV_TYPE used for TX completion events corresponding
to CTPIO sends.

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

5 years agosfxge(4): add 1.3V voltage and current sensors
arybchik [Wed, 28 Nov 2018 09:24:14 +0000 (09:24 +0000)]
sfxge(4): add 1.3V voltage and current sensors

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

5 years agosfxge(4): provide a flag for controlling CTPIO mode
arybchik [Wed, 28 Nov 2018 09:24:03 +0000 (09:24 +0000)]
sfxge(4): provide a flag for controlling CTPIO mode

Either cut-through or store-and-forward mode.

Submitted by:   Guido Barzini <gbarzini at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18204

5 years agosfxge(4): add Medford2 support for tunnel encapsulations
arybchik [Wed, 28 Nov 2018 09:23:52 +0000 (09:23 +0000)]
sfxge(4): add Medford2 support for tunnel encapsulations

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

5 years agosfxge(4): add Medford2 support for licensing
arybchik [Wed, 28 Nov 2018 09:23:41 +0000 (09:23 +0000)]
sfxge(4): add Medford2 support for licensing

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

5 years agosfxge(4): add Medford2 support for external port numbers
arybchik [Wed, 28 Nov 2018 09:23:30 +0000 (09:23 +0000)]
sfxge(4): add Medford2 support for external port numbers

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

5 years agosfxge(4): group Medford external port mapping entries
arybchik [Wed, 28 Nov 2018 09:23:19 +0000 (09:23 +0000)]
sfxge(4): group Medford external port mapping entries

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

5 years agosfxge(4): clarify port mode names and masks
arybchik [Wed, 28 Nov 2018 09:23:05 +0000 (09:23 +0000)]
sfxge(4): clarify port mode names and masks

New port mode names are defined for Medford2 and later, and
the existing names are aliased to them. Add comments with the
numeric port mode to clarify the external port modes table.

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

5 years agosfxge(4): support Medford2 event timer semantics
arybchik [Wed, 28 Nov 2018 09:22:53 +0000 (09:22 +0000)]
sfxge(4): support Medford2 event timer semantics

The event timer interface has changed for Medford2 - for
details see bug66418 comment 9. Update the common code to
use the new timer semantics for Medford2.

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

5 years agosfxge(4): support FEC mode settings
arybchik [Wed, 28 Nov 2018 09:22:42 +0000 (09:22 +0000)]
sfxge(4): support FEC mode settings

Medford2 controllers support control and reporting of
FEC modes for 25G and higher links. See SF-109306-TC
for suggested usage in client code.

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

5 years agosfxge(4): remove obsolete comments
arybchik [Wed, 28 Nov 2018 06:56:34 +0000 (06:56 +0000)]
sfxge(4): remove obsolete comments

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

5 years agosfxge(4): move VI window size config to ef10 NIC board
arybchik [Wed, 28 Nov 2018 06:56:22 +0000 (06:56 +0000)]
sfxge(4): move VI window size config to ef10 NIC board

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

5 years agosfxge(4): move privilege config to ef10 NIC board config
arybchik [Wed, 28 Nov 2018 06:56:11 +0000 (06:56 +0000)]
sfxge(4): move privilege config to ef10 NIC board config

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

5 years agosfxge(4): move vector config to ef10 NIC board config
arybchik [Wed, 28 Nov 2018 06:55:59 +0000 (06:55 +0000)]
sfxge(4): move vector config to ef10 NIC board config

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

5 years agosfxge(4): move limits config to ef10 NIC board config
arybchik [Wed, 28 Nov 2018 06:55:47 +0000 (06:55 +0000)]
sfxge(4): move limits config to ef10 NIC board config

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

5 years agosfxge(4): move Tx config to ef10 NIC board config
arybchik [Wed, 28 Nov 2018 06:55:36 +0000 (06:55 +0000)]
sfxge(4): move Tx config to ef10 NIC board config

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

5 years agosfxge(4): move Rx config to ef10 NIC board config
arybchik [Wed, 28 Nov 2018 06:55:24 +0000 (06:55 +0000)]
sfxge(4): move Rx config to ef10 NIC board config

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

5 years agosfxge(4): move datapath config to ef10 NIC board cfg
arybchik [Wed, 28 Nov 2018 06:55:12 +0000 (06:55 +0000)]
sfxge(4): move datapath config to ef10 NIC board cfg

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

5 years agosfxge(4): move PHY/link config to ef10 NIC board cfg
arybchik [Wed, 28 Nov 2018 06:55:00 +0000 (06:55 +0000)]
sfxge(4): move PHY/link config to ef10 NIC board cfg

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