]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoDo not limit the mbuf queue length for keepalive packets.
ae [Tue, 27 Nov 2018 16:51:01 +0000 (16:51 +0000)]
Do not limit the mbuf queue length for keepalive packets.

It was unlimited before overhaul, and one user reported that this limit
can be reached easily.

PR: 233562
MFC after: 1 week

5 years agoWhen deciding whether to send the complete URL or just the document part,
des [Tue, 27 Nov 2018 16:23:17 +0000 (16:23 +0000)]
When deciding whether to send the complete URL or just the document part,
we were looking at the original URL rather than the one we were currently
processing.  This meant that if we were trying to retrieve an HTTP URL but
were redirected to an HTTPS URL, and HTTPS proxying was enabled, we would
send an invalid request and most likely get garbage back.

MFC after: 3 days

5 years agoRestore the ability to override the disk unit/partition at the boot: prompt
ian [Tue, 27 Nov 2018 16:16:38 +0000 (16:16 +0000)]
Restore the ability to override the disk unit/partition at the boot: prompt
in gptboot.

When arch-independent geli support was added, a new static 'gdsk' struct
was added, but there was still a static 'dsk' struct, and when you typed
in an alternate disk/partition, the string was parsed into that struct,
which was then never used for anything.  Now the string gets parsed into
gdsk.dsk, the struct that's actually used.

X-MFC after: 3 days

5 years agoMake whitespace more consistent in libkqueue tests.
dab [Tue, 27 Nov 2018 15:12:34 +0000 (15:12 +0000)]
Make whitespace more consistent in libkqueue tests.

After r337820, which "corrected" some spaces-instead-of-tab whitespace
issues in the libkqueue tests, jmg@ pointed out that these files were
originally space-based, not tab-spaced, and so the correction should
have been to get rid of the tabs that had been introduced in previous
changes, not the spaces. This change does that. This is a whitespace
only change; no functional change is intended.

Reported by: jmg@
MFC after: 3 days
Sponsored by: Dell EMC Isilon

5 years agoAdd a “skip_dsn” option to g_part's bootcode verb to prevent g_part_mbr
des [Tue, 27 Nov 2018 14:58:19 +0000 (14:58 +0000)]
Add a “skip_dsn” option to g_part's bootcode verb to prevent g_part_mbr
from setting the volume serial number.  This unbreaks older boot blocks
that don't support serial numbers, and allows boot0cfg to set the serial
number itself if requested by the user.

Submitted by: lev@, yuripv@
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D17386

5 years agosfxge(4): remove MAC stats size define
arybchik [Tue, 27 Nov 2018 14:16:14 +0000 (14:16 +0000)]
sfxge(4): remove MAC stats size define

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

5 years agosfxge(4): resolve code analysis warnings
arybchik [Tue, 27 Nov 2018 14:16:03 +0000 (14:16 +0000)]
sfxge(4): resolve code analysis warnings

Minimal changes adding buffer size checks and simplifying checksum
processing.

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

5 years agosfxge(4): decode Medford2 FEC stats if available
arybchik [Tue, 27 Nov 2018 14:15:52 +0000 (14:15 +0000)]
sfxge(4): decode Medford2 FEC stats if available

Decode Medford2 FEC stats if available in MAC stats DMA buffer.

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

5 years agosfxge(4): run mkconfig.py to add FEC MAC stats
arybchik [Tue, 27 Nov 2018 14:15:41 +0000 (14:15 +0000)]
sfxge(4): run mkconfig.py to add FEC MAC stats

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

5 years agosfxge(4): use MAC stats DMA buffer size when decoding
arybchik [Tue, 27 Nov 2018 14:15:30 +0000 (14:15 +0000)]
sfxge(4): use MAC stats DMA buffer size when decoding

On Medford2 and later the MAC stats buffer has been enlarged.
Use the MAC stats DMA buffer size to ensure that the stats END
generation count is read from the correct location, and that
over-reading of the DMA buffer is prevented.

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

5 years agosfxge(4): use MAC stats DMA buffer size from caps
arybchik [Tue, 27 Nov 2018 14:15:19 +0000 (14:15 +0000)]
sfxge(4): use MAC stats DMA buffer size from caps

For Medford2 the DMA buffer used for one-shot or periodic MAC stats
has been extended. Ensure the MAC stats DMA buffer size is large
enough to hold the number of stats counters supported by firmware.

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

5 years agosfxge(4): improve robustness of MAC stats get via MCDI
arybchik [Tue, 27 Nov 2018 14:15:08 +0000 (14:15 +0000)]
sfxge(4): improve robustness of MAC stats get via MCDI

Previously the code relied on the callers of efx_mcdi_mac_stats
to provide a DMA buffer or NULL depending on the action. Fix
this so that the DMA buffer is only passed in the request when
needed, and that an error is reported for a missing DMA buffer.

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

5 years agosfxge(4): retrieve number of MAC stats from NIC
arybchik [Tue, 27 Nov 2018 14:14:57 +0000 (14:14 +0000)]
sfxge(4): retrieve number of MAC stats from NIC

This reports the number of stats (and hence the DMA buffer size)
for MAC stats. If MC_GET_CAPABABILITIES_V4 is not supported then
use the legacy Siena-compatible MC_CMD_MAC_NSTATS value.

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

5 years agosfxge(4): refactor EF10 get datapath capabilities
arybchik [Tue, 27 Nov 2018 14:14:45 +0000 (14:14 +0000)]
sfxge(4): refactor EF10 get datapath capabilities

Inline efx_mcdi_get_capabilities() to prepare for reading
newer capabilities response versions.

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

5 years agollvm-objdump.1: remove more unintentional options
emaste [Tue, 27 Nov 2018 13:52:51 +0000 (13:52 +0000)]
llvm-objdump.1: remove more unintentional options

Some options come from static constructors in LLVM libraries and are
automatically added to llvm's usage output.  They're not really supposed
to be llvm-objdump options.

Reported by: Fangrui Song in LLVM review D54864
Sponsored by: The FreeBSD Foundation

5 years agosfxge(4): handle new speeds in link events
arybchik [Tue, 27 Nov 2018 13:00:51 +0000 (13:00 +0000)]
sfxge(4): handle new speeds in link events

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

5 years agosfxge(4): add efsys macro to get memory region size
arybchik [Tue, 27 Nov 2018 13:00:39 +0000 (13:00 +0000)]
sfxge(4): add efsys macro to get memory region size

EFSYS_MEM_SIZE() reports the DMA mapped size of an efsys_mem_t
allocated region (the allocation size may be different due to
memory allocator and DMA alignment restrictions).

This ensures that common code internals have explicit knowledge
of the usable size of DMA mapped memory regions.

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

5 years agosfxge(4): add new loopback modes
arybchik [Tue, 27 Nov 2018 13:00:28 +0000 (13:00 +0000)]
sfxge(4): add new loopback modes

Report supported loopback modes for new Medford2 link speeds.

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

5 years agosfxge(4): support new link modes
arybchik [Tue, 27 Nov 2018 13:00:17 +0000 (13:00 +0000)]
sfxge(4): support new link modes

Add basic support for new link modes for Medford2.

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

5 years agosfxge(4): removing unneeded assert
arybchik [Tue, 27 Nov 2018 13:00:06 +0000 (13:00 +0000)]
sfxge(4): removing unneeded assert

Remove ASSERT() from sfxge_link_mode_to_phy_cap() which causes an
unnecessary panic, even though the callers have proper error handling.

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

5 years agosfxge(4): simplify loopback type checking
arybchik [Tue, 27 Nov 2018 12:59:55 +0000 (12:59 +0000)]
sfxge(4): simplify loopback type checking

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

5 years agosfxge(4): report memory BAR number
arybchik [Tue, 27 Nov 2018 12:59:43 +0000 (12:59 +0000)]
sfxge(4): report memory BAR number

Remove EFX_MEM_BAR define as it it is not correct on all platforms.

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

5 years agosfxge(4): update notes on interrupt testing on VFs
arybchik [Tue, 27 Nov 2018 12:59:32 +0000 (12:59 +0000)]
sfxge(4): update notes on interrupt testing on VFs

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

5 years agosfxge(4): fix ICC warning because of non-enum value usage
arybchik [Tue, 27 Nov 2018 12:59:21 +0000 (12:59 +0000)]
sfxge(4): fix ICC warning because of non-enum value usage

Fix ICC warning because of non-enum value asignment to enum variable.

Found by upstreaming to DPDK.

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

5 years agosfxge(4): refactoring eliminating code analysis warnings
arybchik [Tue, 27 Nov 2018 12:59:09 +0000 (12:59 +0000)]
sfxge(4): refactoring eliminating code analysis warnings

Addresses most of the warnings reported by the sfn windows driver.

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

5 years agosfxge(4): update hardware headers for Medford2
arybchik [Tue, 27 Nov 2018 12:58:52 +0000 (12:58 +0000)]
sfxge(4): update hardware headers for Medford2

The changes to efx_regs_ef10.h are auto-generated and include:

 - Updated event RX_L4_CLASS which is now 2 bits (was 3).
   The encoding of TCP, UDP and UNKNOWN are unchanged so
   the narrower Medford2 field definition is compatible with
   all controllers.

 - Fix definition of FATSOv2 option descriptors. These were
   added manually and differ from the auto-generated values
   in some fields (not yet used in common code). The field
   definitions have been corrected to agree with the Linux net
   driver headers and SF-108452-SW.

The remaining changes adapt the common code to use the updated
headers.

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

5 years agoImport CK as of 21d3e319407d19dece16ee317c757ffc54a452bc, which makes its
marius [Tue, 27 Nov 2018 12:35:51 +0000 (12:35 +0000)]
Import CK as of 21d3e319407d19dece16ee317c757ffc54a452bc, which makes its
sparcv9 atomics compatible with the FreeBSD kernel by using instructions
which access the appropriate address space.
Atomic operations within the kernel must access the nucleus address space
instead of the default primary one. Without this change but the increased
use of CK in the kernel, machines started to panic after some minutes of
uptime due to an unresolvable fault in ck_pr_cas_64_value().

5 years agosfxge(4): add method to make checksum option descriptors
arybchik [Tue, 27 Nov 2018 12:23:01 +0000 (12:23 +0000)]
sfxge(4): add method to make checksum option descriptors

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

5 years agosfxge(4): improve comments for EF10 ext port mapping
arybchik [Tue, 27 Nov 2018 12:22:50 +0000 (12:22 +0000)]
sfxge(4): improve comments for EF10 ext port mapping

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

5 years agosfxge(4): support runtime VI window size
arybchik [Tue, 27 Nov 2018 12:22:37 +0000 (12:22 +0000)]
sfxge(4): support runtime VI window size

Medford2 uses a configurable VI window size, and requires
updates to register accesses to use a runtime VI window size
rather than the *_STEP register constants used for earlier
controllers.

Update the common code to query the VI window size via MCDI,
and add new EFX_BAR_VI_* accessor macros for per-VI registers.

The existing EFX_BAR_TBL_* macros can be used for non-VI
register tables (and for code that can never be called for
a Medford2 controller e.g. Siena-only code).

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

5 years agosfxge(4): add Medford2 support to MON module
arybchik [Tue, 27 Nov 2018 12:22:25 +0000 (12:22 +0000)]
sfxge(4): add Medford2 support to MON module

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

5 years agosfxge(4): add Medford2 support to VPD module
arybchik [Tue, 27 Nov 2018 12:22:14 +0000 (12:22 +0000)]
sfxge(4): add Medford2 support to VPD module

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

5 years agosfxge(4): add Medford2 support to BOOTCFG module
arybchik [Tue, 27 Nov 2018 12:22:03 +0000 (12:22 +0000)]
sfxge(4): add Medford2 support to BOOTCFG module

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

5 years agosfxge(4): add Medford2 support to SRAM module
arybchik [Tue, 27 Nov 2018 12:21:53 +0000 (12:21 +0000)]
sfxge(4): add Medford2 support to SRAM module

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

5 years agosfxge(4): add Medford2 support to NVRAM module
arybchik [Tue, 27 Nov 2018 12:21:41 +0000 (12:21 +0000)]
sfxge(4): add Medford2 support to NVRAM module

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

5 years agosfxge(4): add Medford2 support to Tx module
arybchik [Tue, 27 Nov 2018 12:21:30 +0000 (12:21 +0000)]
sfxge(4): add Medford2 support to Tx module

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

5 years agosfxge(4): add Medford2 support to Rx module
arybchik [Tue, 27 Nov 2018 12:21:19 +0000 (12:21 +0000)]
sfxge(4): add Medford2 support to Rx module

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

5 years agosfxge(4): add Medford2 support to PHY module
arybchik [Tue, 27 Nov 2018 12:21:08 +0000 (12:21 +0000)]
sfxge(4): add Medford2 support to PHY module

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

5 years agosfxge(4): add Medford2 support to MCDI module
arybchik [Tue, 27 Nov 2018 12:20:57 +0000 (12:20 +0000)]
sfxge(4): add Medford2 support to MCDI module

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

5 years agosfxge(4): add Medford2 support to MAC module
arybchik [Tue, 27 Nov 2018 12:20:46 +0000 (12:20 +0000)]
sfxge(4): add Medford2 support to MAC module

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

5 years agosfxge(4): add Medford2 support to INTR module
arybchik [Tue, 27 Nov 2018 12:20:35 +0000 (12:20 +0000)]
sfxge(4): add Medford2 support to INTR module

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

5 years agosfxge(4): add Medford2 support to FILTER module
arybchik [Tue, 27 Nov 2018 12:20:23 +0000 (12:20 +0000)]
sfxge(4): add Medford2 support to FILTER module

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

5 years agosfxge(4): add Medford2 support to EV module
arybchik [Tue, 27 Nov 2018 12:20:12 +0000 (12:20 +0000)]
sfxge(4): add Medford2 support to EV module

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

5 years agosfxge(4): move RxDP config get to EF10 NIC code
arybchik [Tue, 27 Nov 2018 12:20:01 +0000 (12:20 +0000)]
sfxge(4): move RxDP config get to EF10 NIC code

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

5 years agosfxge(4): correct PIO buffer dimensions for Medford2
arybchik [Tue, 27 Nov 2018 12:19:49 +0000 (12:19 +0000)]
sfxge(4): correct PIO buffer dimensions for Medford2

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

5 years agosfxge(4): add Medford2 support to NIC module
arybchik [Tue, 27 Nov 2018 12:14:16 +0000 (12:14 +0000)]
sfxge(4): add Medford2 support to NIC module

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

5 years agosfxge(4): put Siena-specific code under its efsys option
arybchik [Tue, 27 Nov 2018 12:14:05 +0000 (12:14 +0000)]
sfxge(4): put Siena-specific code under its efsys option

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

5 years agosfxge(4): add efsys option for Medford2
arybchik [Tue, 27 Nov 2018 12:13:54 +0000 (12:13 +0000)]
sfxge(4): add efsys option for Medford2

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

5 years agosfxge(4): add Medford2 PCI IDs
arybchik [Tue, 27 Nov 2018 12:13:39 +0000 (12:13 +0000)]
sfxge(4): add Medford2 PCI IDs

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

5 years ago- Add a belated UPDATING entry for the ixlv(4) -> iavf(4) rename in r339338.
marius [Tue, 27 Nov 2018 12:11:16 +0000 (12:11 +0000)]
- Add a belated UPDATING entry for the ixlv(4) -> iavf(4) rename in r339338.
- Likewise, add ixlv.4.gz to OLD_FILES,
- and link if_ixlv.ko to if_iavf.ko in order to aid a bit in the transition.

5 years agoA few more cases where strcasecmp() is no longer required.
des [Tue, 27 Nov 2018 11:22:19 +0000 (11:22 +0000)]
A few more cases where strcasecmp() is no longer required.

MFC after: 1 week

5 years agoImprove URL parsing. In particular, convert scheme and host to lowercase.
des [Tue, 27 Nov 2018 10:45:14 +0000 (10:45 +0000)]
Improve URL parsing.  In particular, convert scheme and host to lowercase.

MFC after: 1 week

5 years agoCross-reference mergemaster(8) & etcupdate(8).
0mp [Tue, 27 Nov 2018 10:31:29 +0000 (10:31 +0000)]
Cross-reference mergemaster(8) & etcupdate(8).

Suggested by: Daniel Ebdrup
Reviewed by: bcr
Approved by: bcr (doc), krion (mentor, implicit), mat (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D18350

5 years agoSupport proxying FTP over HTTPS, not just HTTP.
des [Tue, 27 Nov 2018 10:06:41 +0000 (10:06 +0000)]
Support proxying FTP over HTTPS, not just HTTP.

There is probably a PR for this, but I can't find this, or remember who
submitted it.  The patch got lost in the noise of another that wasn't
ready to commit.

MFC after: 3 days

5 years agoCheck that /etc/resolv.conf exists before trying to read it.
des [Tue, 27 Nov 2018 09:46:01 +0000 (09:46 +0000)]
Check that /etc/resolv.conf exists before trying to read it.
Fix whitespace nit introduced in previous commit.

MFC after: 1 week

5 years agoStyle cleanup.
des [Tue, 27 Nov 2018 09:41:47 +0000 (09:41 +0000)]
Style cleanup.

5 years agoFix possible panic during ifnet detach in rtsock.
ae [Tue, 27 Nov 2018 09:04:06 +0000 (09:04 +0000)]
Fix possible panic during ifnet detach in rtsock.

The panic can happen, when some application does dump of routing table
using sysctl interface. To prevent this, set IFF_DYING flag in
if_detach_internal() function, when ifnet under lock is removed from
the chain. In sysctl_rtsock() take IFNET_RLOCK_NOSLEEP() to prevent
ifnet detach during routes enumeration. In case, if some interface was
detached in the time before we take the lock, add the check, that ifnet
is not DYING. This prevents access to memory that could be freed after
ifnet is unlinked.

PR: 227720, 230498, 233306
Reviewed by: bz, eugen
MFC after: 1 week
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D18338

5 years agoBump the date of pxeboot(8) manual page for r340917.
ygy [Tue, 27 Nov 2018 08:51:15 +0000 (08:51 +0000)]
Bump the date of pxeboot(8) manual page for r340917.

PR: 123484
MFC after: 5 days

5 years agong_source(4): correction after the change r340617
eugen [Tue, 27 Nov 2018 04:05:38 +0000 (04:05 +0000)]
ng_source(4): correction after the change r340617

tv_usec has "long" type for all architecture in FreeBSD
and follows __LP64__. However, this is not true for tv_sec
that has "time_t" type.

Since r320347 that changed time_t from 32 to 64 bit integer
for 32 bit version of powerpc architecture, we have only single
i386 architecture having 32 bit time_t type.

Submitted by: jhb
MFC after: 1 week.

5 years agoNVME trim clocking
imp [Tue, 27 Nov 2018 00:36:35 +0000 (00:36 +0000)]
NVME trim clocking

Add the ability to set two goals for trims in the I/O scheduler. The
first goal is the number of BIO_DELETEs to accumulate
(kern.cam.XX.U.trim_goal). When non-zero, this many trims will be
accumulated before we start to transfer them to lower layers. This is
useful for devices that like to get lots of trims all at once in one
transaction (not all devices are like this, and some vary by workload).

The second is a number of ticks to defer trims. If you've set a trim
goal, then kern.cam.XX.U.trim_ticks controls how long the system will
defer those trims before timing out and sending them anyway. It has no
effect when trim_goal is 0.

In any event, a BIO_FLUSH will cause all the TRIMs to be released to
the periph drivers. This may be a minor overloading of what BIO_FLUSH
is supposed to mean, but it's useful to preserve other ordering
semantics that users of BIO_FLUSH reply on.

Sponsored by: Netflix, Inc

5 years agoBring up to date with recently added functions berase(3), getinode(3),
mckusick [Mon, 26 Nov 2018 23:09:45 +0000 (23:09 +0000)]
Bring up to date with recently added functions berase(3), getinode(3),
putinode(3), sbget(3), and sbput(3).

Sponsored by: Netflix

5 years agoMinor tweaks to the formatting
imp [Mon, 26 Nov 2018 22:50:30 +0000 (22:50 +0000)]
Minor tweaks to the formatting

Tweak the format of the trim + read bias code. Add similar debug to
the read + writes case.

Spondored by: Netflix

5 years agoAdd dependency to allow if_muge device to be only ethernet device in stripped-down...
markm [Mon, 26 Nov 2018 22:45:58 +0000 (22:45 +0000)]
Add dependency to allow if_muge device to be only ethernet device in stripped-down RPI3 kernel.

5 years agoCheck for an allocation failure before dereferencing the pointer.
markj [Mon, 26 Nov 2018 22:42:52 +0000 (22:42 +0000)]
Check for an allocation failure before dereferencing the pointer.

Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Reviewed by: np
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18310

5 years agolibarchive configuration changes
mm [Mon, 26 Nov 2018 21:45:27 +0000 (21:45 +0000)]
libarchive configuration changes
- move HAVE_BZLIB_H, HAVE_LIBLZMA and HAVE_LZMA_H to config_freebsd.h
- activate support for multi-threaded lzma encoding [1]

PR: 233543 [1]
Reported by: cem
MFC after: 1 week

5 years agoRemove superfluous bzero in getcontext/swapcontext/sendsig
vangyzen [Mon, 26 Nov 2018 20:56:05 +0000 (20:56 +0000)]
Remove superfluous bzero in getcontext/swapcontext/sendsig

We zero the whole structure; we don't need to zero the __spare__ field again.

Remove trailing whitespace.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

5 years agoPrevent kernel stack disclosure in signal delivery
vangyzen [Mon, 26 Nov 2018 20:52:53 +0000 (20:52 +0000)]
Prevent kernel stack disclosure in signal delivery

On arm64 and riscv platforms, sendsig() failed to zero the signal
frame before copying it out to userspace.  Zero it.

On arm, I believe all the contents of the frame were initialized,
so there was no disclosure.  However, explicitly zero the whole frame
because that fact could inadvertently change in the future,
it's more clear to the reader, and I could be wrong in the first place.

MFC after: 2 days
Security: similar to FreeBSD-EN-18:12.mem and CVE-2018-17155
Sponsored by: Dell EMC Isilon

5 years agoPrevent kernel stack disclosure in getcontext/swapcontext
vangyzen [Mon, 26 Nov 2018 20:50:55 +0000 (20:50 +0000)]
Prevent kernel stack disclosure in getcontext/swapcontext

Expand r338982 to cover freebsd32 interfaces on amd64, mips, and powerpc.

MFC after: 2 days
Security: FreeBSD-EN-18:12.mem
Security: CVE-2018-17155
Sponsored by: Dell EMC Isilon

5 years agoacpi/ec: Fix regression caused by r340644
bwidawsk [Mon, 26 Nov 2018 19:41:13 +0000 (19:41 +0000)]
acpi/ec: Fix regression caused by r340644

After r340644 there were two things wrong in cases where there is both
an ECDT, and an EC device exposed via acpica. The first is a rather
trivial situation where the device desc would say ECDT even when it was
not implicitly created via ECDT (not really sure why the compiler
doesn't seem to warn about this).

The other more pervasive issue is that the code is designed to
essentially not do anything for EC probe when its uid was already
created an EC based on the ECDT's uid. The issue was that probe would
still return 0 in this case, and so we'd end up with some weird
duplication. Now to be honest, I'm not actually sure what exactly broke,
but it was definitely not working as intended. To fix this, all that is
really needed is to make sure we return ENXIO when we're probing the
device already added for the ECDT entry. While here though, move the
check for this earlier to avoid wasted cycles when we know after
obtaining the uid that it's duplicative.

There remains one questionable bit here which I don't want to touch -
when doing probe for PNP0C09, if acquiring _UID for the device fails, 0
is assumed, which is a valid UID used by the implicit ECDT.

Reported by: Charlie Li, et al.
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D18311

5 years agoAdd ga_IE.UTF-8 locale.
yuripv [Mon, 26 Nov 2018 19:39:49 +0000 (19:39 +0000)]
Add ga_IE.UTF-8 locale.

PR: 228587
Submitted by: Micil <micheal.maclochlainn@oegaillimh.ie> (LC_TIME)
Reviewed by: bapt
Approved by: kib (mentor, implicit)
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D17997

5 years agostand/i386/libi386: rename .s file to .S to use Clang IAS
emaste [Mon, 26 Nov 2018 19:29:18 +0000 (19:29 +0000)]
stand/i386/libi386: rename .s file to .S to use Clang IAS

As part of the migration away from obsolete binutils we want to retire
GNU as.  Most assembly files used on amd64 have a .S extension and are
assembled with Clang's Integrated Assembler (IAS); rename pxetram.s to
.S to use IAS as well.

The generated .text is identical (the entire .o file is not, as Clang
adds debug info.)

PR: 205250, 233094
Sponsored by: The FreeBSD Foundation

5 years agobtx: rename .s files to .S to use Clang IAS
emaste [Mon, 26 Nov 2018 19:14:33 +0000 (19:14 +0000)]
btx: rename .s files to .S to use Clang IAS

As part of the migration away from obsolete binutils we want to retire
GNU as.  Most assembly files used on amd64 have a .S extension and are
assembled with Clang's integrated assembler; rename two files in
stand/i386/btx/lib to .S to use IAS as well.

The generated .text is identical (the entire .o files are not, as Clang
adds debug info).

PR: 205250, 233094
Discussed with: imp
Sponsored by: The FreeBSD Foundation

5 years agoregulator_fixed: Do not disable fixed regulator at probe
manu [Mon, 26 Nov 2018 18:46:15 +0000 (18:46 +0000)]
regulator_fixed: Do not disable fixed regulator at probe

If the regulator is unused it will be disabled by the regulator_shutdown sysinit.

Tested on pinebook where the backlight is controlled by a fixed-regulator.
The regulator doesn't have a regulator-boot-on param (I'm gonna upstream this) and so we disable it at probe.
We later enable it but this cause the screen to go black.
Linux doesn't disable regulator at boot (at least for fixed-regulator) so better match this to have the same UX.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D17978

5 years agovfs_aio.c: rename "physio" symbols to "bio".
asomers [Mon, 26 Nov 2018 18:31:00 +0000 (18:31 +0000)]
vfs_aio.c: rename "physio" symbols to "bio".

aio has two paths: an asynchronous "physio" path and a synchronous path.
Confusingly, physio(9) isn't actually used by the "physio" path, and never
has been.  In fact, it may even be called by the synchronous path!  Rename
the "physio" path to the "bio" path to reflect what it actually does:
directly compose BIOs and send them to character devices.

MFC after: 2 weeks

5 years agoarm64: Add evdev support to GENERIC
manu [Mon, 26 Nov 2018 17:59:25 +0000 (17:59 +0000)]
arm64: Add evdev support to GENERIC

5 years agoUPDATING: add note for r340984 (ld.bfd removal)
emaste [Mon, 26 Nov 2018 17:22:23 +0000 (17:22 +0000)]
UPDATING: add note for r340984 (ld.bfd removal)

Sponsored by: The FreeBSD Foundation

5 years agosrc.conf.5: regen after r340984 (and r340841)
emaste [Mon, 26 Nov 2018 17:11:50 +0000 (17:11 +0000)]
src.conf.5: regen after r340984 (and r340841)

5 years agoDo not install GNU ld if lld is /usr/bin/ld
emaste [Mon, 26 Nov 2018 17:07:35 +0000 (17:07 +0000)]
Do not install GNU ld if lld is /usr/bin/ld

GNU binutils ld.bfd 2.17.50 does not support ifuncs and produces broken
binaries when ifuncs are in use.  When LLD_IS_LD is default we have an
ifunc-capable system linker and can just avoid installing ld.bfd.

Reported by: theraven
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18340

5 years agoFix NTP query on GCE due to unresolved hostname.
gjb [Mon, 26 Nov 2018 17:00:39 +0000 (17:00 +0000)]
Fix NTP query on GCE due to unresolved hostname.

PR: 232456
Submitted by: Lucas Kanashiro
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agorelease: arm64: Add PINEBOOK config
manu [Mon, 26 Nov 2018 16:38:39 +0000 (16:38 +0000)]
release: arm64: Add PINEBOOK config

Add a configuration for PINEBOOK image.
Pinebook is a arm64 laptop based on a Pine64 board.

Since the usb trackpad need a quirk, add a common function for adding
quirk for arm board.
A default one is supplied as most board to not need quirks.

Reviewed by: gjb
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D18337

5 years agoSmall language fix after r340978.
eugen [Mon, 26 Nov 2018 16:10:20 +0000 (16:10 +0000)]
Small language fix after r340978.

MFC after: 3 days

5 years agoipfw.8: add new section to EXAMPLES:
eugen [Mon, 26 Nov 2018 16:02:17 +0000 (16:02 +0000)]
ipfw.8: add new section to EXAMPLES:

SELECTIVE MIRRORING
     If your network has network traffic analyzer connected to your host
     directly via dedicated interface or remotely via RSPAN vlan, you can
     selectively mirror some ethernet layer2 frames to the analyzer.
     ...

5 years agovi: fix UTF-8 detection.
yuripv [Mon, 26 Nov 2018 15:33:55 +0000 (15:33 +0000)]
vi: fix UTF-8 detection.

PR: 202290
Submitted by: lampa@fit.vutbr.cz
Reviewed by: bapt
Approved by: kib (mentor, implicit)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17950

5 years agollvm-objdump.1: fix igor / mandoc -Tlint warnings
emaste [Mon, 26 Nov 2018 15:12:58 +0000 (15:12 +0000)]
llvm-objdump.1: fix igor / mandoc -Tlint warnings

Accidentally omitted from r340972.

5 years agobectl: sync usage with man page, removing stray multibyte characters
yuripv [Mon, 26 Nov 2018 15:11:32 +0000 (15:11 +0000)]
bectl: sync usage with man page, removing stray multibyte characters
in the process.

PR: 233526
Submitted by: tigersharke@gmail.com (original version)
Reviewed by: kevans
Approved by: kib (mentor, implicit)
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D18335

5 years agollvm-objdump.1: remove invalid options
emaste [Mon, 26 Nov 2018 14:45:58 +0000 (14:45 +0000)]
llvm-objdump.1: remove invalid options

Some options appear in llvm-objdump's usage information as a side effect
of its option parsing implementation and are not actually llvm-objdump
options.  Reported in LLVM review https://reviews.llvm.org/D54864.

Reported by: Fangrui Song
Sponsored by: The FreeBSD Foundation

5 years agollvm-objdump: initial man page
emaste [Mon, 26 Nov 2018 14:34:30 +0000 (14:34 +0000)]
llvm-objdump: initial man page

Based on llvm-objdump's online documentation and usage information.
This serves as a starting point; additional detail and cleanup still
required.

Also being submitted upstream in LLVM review D54864.  I expect to use
this bespoke copy while we have LLVM 6.0 or 7.0 in FreeBSD; when we
update to LLVM 8.0 it should be upstream and we will switch to it.

PR: 233437
Reviewed by: bcr (man formatting)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18309

5 years agoaw_usbphy: Do not error if it's not phy 0
manu [Mon, 26 Nov 2018 14:27:13 +0000 (14:27 +0000)]
aw_usbphy: Do not error if it's not phy 0

Only phy0 can switch between host/otg, do not error if we request
host mode on phy != 0.

MFC after: 1 month
X-MFC with: r340846

5 years agorevert r340640 "libc: forcibly disable BIND_NOW"
emaste [Mon, 26 Nov 2018 13:56:19 +0000 (13:56 +0000)]
revert r340640 "libc: forcibly disable BIND_NOW"

When immediate bind mode is requested, as of r340675 rtld processes
irelocs in PLT immediately after other PLT relocs.  That addresses the
libc + BIND_NOW startup crash the workaround is no longer needed.

PR: 233333

5 years agoPlug routing sysctl leaks.
markj [Mon, 26 Nov 2018 13:42:18 +0000 (13:42 +0000)]
Plug routing sysctl leaks.

Various structures exported by sysctl_rtsock() contain padding fields
which were not being zeroed.

Reported by: Thomas Barabosch, Fraunhofer FKIE
Reviewed by: ae
MFC after: 3 days
Security: kernel memory disclosure
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18333

5 years agoMFV r340938:
mm [Mon, 26 Nov 2018 11:04:35 +0000 (11:04 +0000)]
MFV r340938:
Sync libarchive with vendor.

Relevant vendor changes:
  Issue #1096: Support extracting ACLs with in-entry comments (GNU tar)
  PR #1023: Support extracting extattrs as non-root on non-user-writeable
            files

MFC after: 1 week

5 years agolibedit: improve multibyte support
bapt [Mon, 26 Nov 2018 08:16:33 +0000 (08:16 +0000)]
libedit: improve multibyte support

Until this commit libedit only supported UTF-8 for multibyte charset
Improve it to support other multibyte charsets

Tested with eucJP and SJIS charsets.
Note that this change as been review and committed in upstream libedit
as well via christos@NetBSD

Submitted by: naito.yuichiro _at_ gmail.com
Reviewed by: bapt, pfg, yuripv, 0mp
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D17903

5 years agosfxge(4): add 3.3V and 12.0V current sensors
arybchik [Mon, 26 Nov 2018 07:42:52 +0000 (07:42 +0000)]
sfxge(4): add 3.3V and 12.0V current sensors

Automatically generated using mkconfig.py.

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

5 years agosfxge(4): fix incorrectly set svn properties
arybchik [Mon, 26 Nov 2018 07:30:47 +0000 (07:30 +0000)]
sfxge(4): fix incorrectly set svn properties

File name was used by the svn property value since
real value was lost in the command.

5 years agosfxge(4): update autogenerated headers from firmwaresrc
arybchik [Mon, 26 Nov 2018 07:23:02 +0000 (07:23 +0000)]
sfxge(4): update autogenerated headers from firmwaresrc

Pick up Medford2 interfaces.

Split AOE operations out into own header.

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

5 years agosfxge(4): regenerate files with genfwdef after ID update
arybchik [Mon, 26 Nov 2018 07:15:19 +0000 (07:15 +0000)]
sfxge(4): regenerate files with genfwdef after ID update

Add security level to image boot header.

Submitted by:   Andrew Jackson <ajackson at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18289

5 years agosfxge(4): add API to control UDP tunnel ports
arybchik [Mon, 26 Nov 2018 06:20:13 +0000 (06:20 +0000)]
sfxge(4): add API to control UDP tunnel ports

HW needs to know which UDP packets should be treated as tunnel
encapsulation to do inner packet recognition, classification and
offloads.

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

5 years agoMove the check for the filesystem having been run on a kernel that
mckusick [Mon, 26 Nov 2018 00:58:07 +0000 (00:58 +0000)]
Move the check for the filesystem having been run on a kernel that
predates metadata check hashes so that it is done before deciding
whether to compute a check-hash of the superblock.

Reported by:  Rick Macklem <rmacklem@uoguelph.ca>
Sponsored by: Netflix

5 years agoevdev: Fix pause key release event in AT keyboard set 1 to evdev xlat-or.
wulf [Sun, 25 Nov 2018 19:37:00 +0000 (19:37 +0000)]
evdev: Fix pause key release event in AT keyboard set 1 to evdev xlat-or.

MFC after: 2 weeks

5 years agoProperly recover from superblock check-hash failures. Specifically,
mckusick [Sun, 25 Nov 2018 18:09:39 +0000 (18:09 +0000)]
Properly recover from superblock check-hash failures. Specifically,
report the check-hash failure and offer to search for and use
alternate superblocks.  Prior to this fix fsck_ffs would simply
report the check-hash failure and exit.

Reported by:  Julian H. Stacey <jhs@berklix.com>
Tested by:    Peter Holm
Sponsored by: Netflix