]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoUpdate leap-seconds to leap-seconds.3757622400.
delphij [Sat, 11 May 2019 14:22:21 +0000 (14:22 +0000)]
Update leap-seconds to leap-seconds.3757622400.

As per https://datacenter.iers.org/data/latestVersion/16_BULLETIN_C16.txt:

     INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS)

SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE REFERENCE

SERVICE DE LA ROTATION TERRESTRE DE L'IERS
OBSERVATOIRE DE PARIS
61, Av. de l'Observatoire 75014 PARIS (France)
Tel.      : +33 1 40 51 23 35
e-mail    : services.iers@obspm.fr
http://hpiers.obspm.fr/eop-pc

                                              Paris, 07 January 2019

                                              Bulletin C 57

                                              To authorities responsible
                                              for the measurement and
                                              distribution of time

                          INFORMATION ON UTC - TAI

 NO leap second will be introduced at the end of June 2019.
 The difference between Coordinated Universal Time UTC and the
 International Atomic Time TAI is :

     from 2017 January 1, 0h UTC, until further notice : UTC-TAI = -37 s

 Leap seconds can be introduced in UTC at the end of the months of December
 or June,  depending on the evolution of UT1-TAI. Bulletin C is mailed every
 six months, either to announce a time step in UTC, or to confirm that there
 will be no time step at the next possible date.

                                            Christian BIZOUARD
                                            Director
                                            Earth Orientation Center of IERS
    Observatoire de Paris, France

Requested by: rgrimes
Obtained from: ftp://tycho.usno.navy.mil/pub/ntp/leap-seconds.3757622400
MFC after: 3 days

5 years agoCallers of swp_pager_getswapspace get either as many blocks as they
dougm [Sat, 11 May 2019 10:16:43 +0000 (10:16 +0000)]
Callers of swp_pager_getswapspace get either as many blocks as they
requested, or none, and in the latter case it is up to them to pick a
smaller request to make - which they always do by halving the failed
request. This change to swp_pager_getswapspace leaves the task of
downsizing the request to the function and not its caller. It still
does so by halving the original request.

Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D20228

5 years agoWhen bitpos can't be implemented with an inline ffs* instruction,
dougm [Sat, 11 May 2019 09:09:10 +0000 (09:09 +0000)]
When bitpos can't be implemented with an inline ffs* instruction,
change the binary search so that it does not depend on a single bit
only being set in the bitmask. Use bitpos more generally, and avoid
some clearing of bits to accommodate its current behavior.

Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D20237

5 years agotuntap: Improve style
kevans [Sat, 11 May 2019 04:18:06 +0000 (04:18 +0000)]
tuntap: Improve style

No functional change.

tun_flags of the tuntap_driver was renamed to ident_flags to reflect the
fact that it's a subset of the tun_flags that identifies a tuntap device.
This maps more easily (visually) to the TUN_DRIVER_IDENT_MASK that masks off
the bits of tun_flags that are applicable to tuntap driver ident. This is a
purely cosmetic change.

5 years agoRevert r347469.
dougm [Sat, 11 May 2019 02:13:52 +0000 (02:13 +0000)]
Revert r347469.

Approved by: kib (mentor)

5 years agoFactor out some exportlist list operations into separate functions.
rmacklem [Fri, 10 May 2019 23:52:17 +0000 (23:52 +0000)]
Factor out some exportlist list operations into separate functions.

This patch moves the code that removes and frees all exportlist elements
out into a separate function called free_exports().
It does the same for the insertion of a new exportlist entry into a list.
It also adds a second argument to ex_search() for the list to use.
None of these changes have any semantic effect. They are being done to
prepare the code for future patches that convert the single linked list
for the exportlist to a hash table of lists and a patch that will do
incremental changes of exports in the kernel.
And it fixes the argument for SLIST_HEAD_INITIALIZER() to be a pointer,
which doesn't really matter, since SLIST_HEAD_INITIALIZER() doesn't use
the argument.

MFC after: 1 month

5 years agonetdump: Ref the interface we're attached to
cem [Fri, 10 May 2019 23:12:59 +0000 (23:12 +0000)]
netdump: Ref the interface we're attached to

Serialize netdump configuration / deconfiguration, and discard our
configuration when the affiliated interface goes away by monitoring
ifnet_departure_event.

Reviewed by: markj, with input from vangyzen@ (earlier version)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20206

5 years agoDon't use _Generic, as many systems don't know about it. Go back to a lo-tech switch...
dougm [Fri, 10 May 2019 23:12:37 +0000 (23:12 +0000)]
Don't use _Generic, as many systems don't know about it.  Go back to a lo-tech switch statement.

Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D20235

5 years agonetdump: Fix boot-time configuration typo
cem [Fri, 10 May 2019 23:10:22 +0000 (23:10 +0000)]
netdump: Fix boot-time configuration typo

Boot-time netdump configuration is much more useful if one can configure the
client and gateway addresses.  Fix trivial typo.

(Long-standing bug, I believe it dates to the original netdump commit.)

Spotted by: one of vangyzen@ or markj@
Sponsored by: Dell EMC Isilon

5 years agoImplement linux_pci_unregister_drm_driver in linuxkpi so that drm drivers
johalun [Fri, 10 May 2019 23:10:22 +0000 (23:10 +0000)]
Implement linux_pci_unregister_drm_driver in linuxkpi so that drm drivers
can be unloaded.

This patch is a part of D19565.

Reviewed by: hps
Approved by: imp (mentor), hps
MFC after: 1 week

5 years agoWhen bitpos can't be implemented with an inline ffs* instruction,
dougm [Fri, 10 May 2019 22:49:01 +0000 (22:49 +0000)]
When bitpos can't be implemented with an inline ffs* instruction,
change the binary search so that it does not depend on a single bit
only being set in the bitmask. Use bitpos more generally, and avoid
some clearing of bits to accommodate its current behavior.

Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D20232

5 years agoAdd a (q)uit option to the subr_blist test program.
dougm [Fri, 10 May 2019 22:02:29 +0000 (22:02 +0000)]
Add a (q)uit option to the subr_blist test program.

Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D20234

5 years agonetdump: Don't store sensitive key data we don't need
cem [Fri, 10 May 2019 21:55:11 +0000 (21:55 +0000)]
netdump: Don't store sensitive key data we don't need

Prior to this revision, struct diocskerneldump_arg (and struct netdump_conf
with embedded diocskerneldump_arg before r347192), were copied in their
entirety to the global 'nd_conf' variable.  Also prior to this revision,
de-configuring netdump would *not* remove the the key material from global
nd_conf.

As part of Encrypted Kernel Crash Dumps (EKCD), which was developed
contemporaneously with netdump but happened to land first, the
diocskerneldump_arg structure will contain sensitive key material
(kda_key[]) when encrypted dumps are configured.

Netdump doesn't have any use for the key data -- encryption is handled in
the core dumper code -- so in this revision, we no longer store it.

Unfortunately, I think this leak dates to the initial import of netdump in
r333283; so it's present in FreeBSD 12.0.

Fortunately, the impact *seems* relatively minor.  Any new *netdump*
configuration would overwrite the key material; for active encrypted netdump
configurations, the key data stored was just a duplicate of the key material
already in the core dumper code; and no user interface (other than
/dev/kmem) actually exposed the leaked material to userspace.

Reviewed by: markj, rpokala (earlier commit message)
MFC after: 2 weeks
Security: yes (minor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20233

5 years agoFix regression from r347375: do not panic when sending an IP multicast
glebius [Fri, 10 May 2019 21:51:17 +0000 (21:51 +0000)]
Fix regression from r347375: do not panic when sending an IP multicast
packet from an interface that doesn't have IPv4 address.

Reported by: Michael Butler <imb protected-networks.net>

5 years agoApply r280991 to ip6_fragment.
jhb [Fri, 10 May 2019 20:15:40 +0000 (20:15 +0000)]
Apply r280991 to ip6_fragment.

This uses m_dup_pkthdr() to copy all of the metadata about a packet to
each of its fragments including VLAN tags, mbuf tags, etc. instead of
hand-copying a few fields.

Reviewed by: bz
MFC after: 1 month
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20117

5 years agoReplace the expression "-mask & ~mask" with a function call that does
dougm [Fri, 10 May 2019 19:55:29 +0000 (19:55 +0000)]
Replace the expression "-mask & ~mask" with a function call that does
the same thing, but is commented so that it might be better
understood.

Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D20231

5 years agopowerpc: Initialize the Hardware Interrupt Offset Register (HIOR) earlier for ppc970
jhibbits [Fri, 10 May 2019 19:36:14 +0000 (19:36 +0000)]
powerpc: Initialize the Hardware Interrupt Offset Register (HIOR) earlier for ppc970

Since we now have a much larger KVA on powerpc64, it's possible to get SLB
traps earlier in boot, possibly even before the HIOR is properly configured
for us.  Move the HIOR setup to immediately after reset, so that we use our
exception handlers instead of Open Firmware's.

PR: 233863
Submitted by: Mark Millard (partial)
Reported by: Mark Millard
MFC after: 2 weeks

5 years agoblist_next_leaf_alloc walks over all the meta-nodes between one leaf
dougm [Fri, 10 May 2019 18:25:06 +0000 (18:25 +0000)]
blist_next_leaf_alloc walks over all the meta-nodes between one leaf
and the next one, and if blocks are allocated from the next leaf, it
walks back toward where it started, as long as there are interleaving
meta-nodes to be updated on account of the last free blocks under
those meta-nodes being allocated. Only if the walk goes all the way
back to the starting point must we calculate the position of the
meta-node that is the least-comment parent of one leaf and the next,
and update a bit in that meta-node to indicate the allocation of its
last free block.

There's no need to start calculating the position of that least-common
parent until the walk back reaches the original starting point, and
there's no need for a calculation that updates 'radius' to tell us
when we've walked back to the beginning, since comparing scan to next
suffices for that.

Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D20229

5 years agoReplace panic() with KASSERT() and provide more useful information when failure happens.
dougm [Fri, 10 May 2019 18:22:40 +0000 (18:22 +0000)]
Replace panic() with KASSERT() and provide more useful information when failure happens.

Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D20226

5 years agoFix build race with machine links and genoffset.o.
bdrewery [Fri, 10 May 2019 18:09:27 +0000 (18:09 +0000)]
Fix build race with machine links and genoffset.o.

Generate the ilinks for all dependency objects not just the ones
in the CLEAN list.

Possibly related to r345351

Reported by: kmoore
MFC after: 2 weeks
X-MFC-with: r345351
Sponsored by: Dell EMC Isilon

5 years agoFix build issue with clang 8.0.1
luporl [Fri, 10 May 2019 17:05:40 +0000 (17:05 +0000)]
Fix build issue with clang 8.0.1

The algorithm header is needed to use std::remove_if

5 years agoarm64: rockchip: Don't always put PLL to normal mode
manu [Fri, 10 May 2019 16:45:17 +0000 (16:45 +0000)]
arm64: rockchip: Don't always put PLL to normal mode

We used to put every PLL in normal mode (meaning that the output would
be the result of the PLL configuration) instead of slow mode (the output
is equal to the external oscillator frequency, 24-26Mhz) but this doesn't
work for most of the PLLs as when we put them into normal mode the registers
configuring the output frequency haven't been set.
Add a normal_mode member in clk_pll_def/clk_pll_sc struct and if it's true
we then set the PLL to normal mode.
For now only set it to the LPLL and BPLL (Little cluster PLL and Big cluster
PLL respectively).

Reviewed by: ganbold
Differential Revision: https://reviews.freebsd.org/D20174

5 years agoefibootmgr: Do not add the new boot entry in dry-run is specified
manu [Fri, 10 May 2019 16:44:35 +0000 (16:44 +0000)]
efibootmgr: Do not add the new boot entry in dry-run is specified

While here fix a typo.

Sponsored-by: Ampere Computing, LLC
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D20212

5 years agoahci: Check if bus is cache-coherent
manu [Fri, 10 May 2019 16:43:53 +0000 (16:43 +0000)]
ahci: Check if bus is cache-coherent

We do this for FDT systems but not for ACPI ones.
Check the presence of the _CCA attribute.

Sponsored by: Ampere Computing, LLC
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D20144

5 years agoAtomically update the global gMsgId in libnetgraph.
markj [Fri, 10 May 2019 16:43:47 +0000 (16:43 +0000)]
Atomically update the global gMsgId in libnetgraph.

Otherwise concurrently running threads may inadvertently use the same
token for different messages.

Preserve the behaviour of disallowing negative message tokens, but allow
a message token value of zero since this simplifies the code a bit and
tokens are documented to be non-negative.

PR: 234442
Reported and tested by: eugen
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

5 years agoA major change to subr_blist.c failed to update all the comments about
dougm [Fri, 10 May 2019 16:01:25 +0000 (16:01 +0000)]
A major change to subr_blist.c failed to update all the comments about
changes to struct fields. Update those now.

Approved by: markj (mentor)
Differential Revision: https://reviews.freebsd.org/D20227

5 years agoBind TCP HPTS (pacer) threads to NUMA domains
gallatin [Fri, 10 May 2019 13:41:19 +0000 (13:41 +0000)]
Bind TCP HPTS (pacer) threads to NUMA domains

Bind the TCP pacer threads to NUMA domains and build per-domain
pacer-thread lookup tables. These tables allow us to use the
inpcb's NUMA domain information to match an inpcb with a pacer
thread on the same domain.

The motivation for this is to keep the TCP connection local to a
NUMA domain as much as possible.

Thanks to jhb for pre-reviewing an earlier version of the patch.

Reviewed by: rrs
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20134

5 years agoifconfig(8): Add kld mappings for ipsec/enc
kevans [Fri, 10 May 2019 13:18:22 +0000 (13:18 +0000)]
ifconfig(8): Add kld mappings for ipsec/enc

Additionally, providing mappings makes the comparison for already loaded
modules a little more strict. This should have been done at initial
introduction, but there was no real reason- however, it proves necessary for
enc which has a standard enc -> if_enc mapping but there also exists an
'enc' module that's actually CAM. The mapping lets us unambiguously
determine the correct module.

Discussed with: ae
MFC after: 4 days

5 years agoRISC-V ISA does not specify how to manage physical memory attributes (PMA).
br [Fri, 10 May 2019 11:21:57 +0000 (11:21 +0000)]
RISC-V ISA does not specify how to manage physical memory attributes (PMA).
So do nothing in pmap_page_set_memattr() and don't panic.

Reviewed by: markj
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D20209

5 years agoTry to unbreak the build after r347425.
trasz [Fri, 10 May 2019 08:16:29 +0000 (08:16 +0000)]
Try to unbreak the build after r347425.

MFC after: 2 weeks

5 years agoAdd simple regression tests for tree(3). Those are ATF-ified versions
trasz [Fri, 10 May 2019 07:46:14 +0000 (07:46 +0000)]
Add simple regression tests for tree(3).  Those are ATF-ified versions
of OpenBSD's regress/sys/sys/tree/.

Reviewed by: ngie
MFC after: 2 weeks
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D20186

5 years agoAvoid returning a NULL pointer from the Intel hw PRNG ifunc resolver.
markj [Fri, 10 May 2019 04:28:17 +0000 (04:28 +0000)]
Avoid returning a NULL pointer from the Intel hw PRNG ifunc resolver.

DTrace expects kernel function symbols of a non-zero size to have an
implementation, which is a reasonable invariant to preserve.

Reported and tested by: ler
Reviewed by: cem, kib
Approved by: so (delphij)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20218

5 years agoAllow dcons(4) to be unloaded when loaded as a module.
ian [Fri, 10 May 2019 02:30:16 +0000 (02:30 +0000)]
Allow dcons(4) to be unloaded when loaded as a module.

When the module is unloaded, the tty devices are destroyed.  That requires
implementing the tsw_free callback to avoid a panic.  This driver requires
no particular cleanup to be done from the callback, but the module itself
must remain in memory until the deferred tsw_free callbacks are invoked.
These changes implement that by incrementing a reference count variable in
the detach routine, and decrementing it in the tsw_free callback.  The
MOD_UNLOAD event handler doesn't return until the count drops to zero.

PR: 237758

5 years agoiflib: use default ntxd and nrxd when user value is not power of 2
erj [Fri, 10 May 2019 00:41:42 +0000 (00:41 +0000)]
iflib: use default ntxd and nrxd when user value is not power of 2

From Jake:
A user may set a sysctl to override the default number of Tx or Rx
descriptors. However, certain calculations in the iflib core expect the
number of descriptors to be a power of 2.

Update _iflib_assert to verify that all of the shared context parameters
for the number of descriptors are powers of 2.

Modify iflib_reset_qvalues to check that the provided isc_nrxd value is
a power of 2. If it's not, print a warning message and then use the
default value.

An alternative might be to try rounding the number down instead.
However, this creates problems in case the rounded down value is below
the minimum value that the driver would support.

Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed by: marius@
MFC after: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D19880

5 years agoRefactor tests/sys/opencrypto/runtests
ngie [Fri, 10 May 2019 00:03:32 +0000 (00:03 +0000)]
Refactor tests/sys/opencrypto/runtests

* Convert from plain to TAP for slightly improved introspection when skipping
  the tests due to requirements not being met.
* Test for the net/py-dpkt (origin) package being required when running the
  tests, instead of relying on a copy of the dpkt.py module from 2014. This
  enables the tests to work with py3. Subsequently, remove
  `tests/sys/opencrypto/dpkt.py(c)?` via `make delete-old`.
* Parameterize out `python2` as `$PYTHON`.

PR: 237403
MFC after: 1 week

5 years agoMFV: r347413
jkim [Thu, 9 May 2019 23:03:10 +0000 (23:03 +0000)]
MFV: r347413

Import ACPICA 20190509.

5 years agoRemove IPSEC from GENERIC due to performance issues
gallatin [Thu, 9 May 2019 22:38:15 +0000 (22:38 +0000)]
Remove IPSEC from GENERIC due to performance issues

Having IPSEC compiled into the kernel imposes a non-trivial
performance penalty on multi-threaded workloads due to IPSEC
refcounting. In my benchmarks of multi-threaded UDP
transmit (connected sockets), I've seen a roughly 20% performance
penalty when the IPSEC option is included in the kernel (16.8Mpps
vs 13.8Mpps with 32 senders on a 14 core / 28 HTT Xeon
2697v3)). This is largely due to key_addref() incrementing and
decrementing an atomic reference count on the default
policy. This cause all CPUs to stall on the same cacheline, as it
bounces between different CPUs.

Given that relatively few users use ipsec, and that it can be
loaded as a module, it seems reasonable to ask those users to
load the ipsec module so as to avoid imposing this penalty on the
GENERIC kernel. Its my hope that this will make FreeBSD look
better in "out of the box" benchmark comparisons with other
operating systems.

Many thanks to ae for fixing auto-loading of ipsec.ko when
ifconfig tries to configure ipsec, and to cy for volunteering
to ensure the the racoon ports will load the ipsec.ko module

Reviewed by: cem, cy, delphij, gnn, jhb, jpaetzel
Differential Revision: https://reviews.freebsd.org/D20163

5 years agolibsecureboot: make it easier to customize trust anchors
sjg [Thu, 9 May 2019 22:25:12 +0000 (22:25 +0000)]
libsecureboot: make it easier to customize trust anchors

Avoid making hash self-tests depend on X.509 certs.
Include OpenPGP keys in trust store count.

Reviewed by: stevek
MFC after: 1 week
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org/D20208

5 years agoDon't use C++ style comments.
tuexen [Thu, 9 May 2019 21:00:15 +0000 (21:00 +0000)]
Don't use C++ style comments.

These where introduced in r347382.
Reported by: ngie@

5 years agonfsd.8: Fix mandoc -Tlint and igor warnings
0mp [Thu, 9 May 2019 19:03:52 +0000 (19:03 +0000)]
nfsd.8: Fix mandoc -Tlint and igor warnings

- Remove Tn macros
- Refernce sysctl(8) instead of sysctl(1)
- Start new sentences on new lines
- Capitalize NFS where needed
- Use Fx for FreeBSD
- Remove a list block (Bl) that was added to the manual page
  by accident in r335174

Reviewed by: bcr
Approved by: doc (bcr)
Differential Revision: https://reviews.freebsd.org/D20215

5 years agotuntap: Don't down tap interfaces if LINK0 is set
kevans [Thu, 9 May 2019 18:54:29 +0000 (18:54 +0000)]
tuntap: Don't down tap interfaces if LINK0 is set

5 years agoAdd if_ipsec.ko symlink to ipsec.ko kernel module.
ae [Thu, 9 May 2019 18:06:11 +0000 (18:06 +0000)]
Add if_ipsec.ko symlink to ipsec.ko kernel module.

This add ability to automatically load ipsec kernel module, when
if_ipsec(4) virtual interface is created using ifconfig(8).

Reviewed by: gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D20169

5 years agotuntap: Properly detach tap ifp
kevans [Thu, 9 May 2019 14:06:24 +0000 (14:06 +0000)]
tuntap: Properly detach tap ifp

5 years agoloader: use DPRINTF in biosdisk.c and define safe DPRINTF
tsoome [Thu, 9 May 2019 13:12:43 +0000 (13:12 +0000)]
loader: use DPRINTF in biosdisk.c and define safe DPRINTF

r345066 did miss biosdisk.c.

Also define DPRINTF as ((void)0) for case we do not want debug printouts.

MFC after: 1 week

5 years agoifconfig(8): Partial revert of r347241
kevans [Thu, 9 May 2019 12:58:33 +0000 (12:58 +0000)]
ifconfig(8): Partial revert of r347241

r347241 introduced an ifname <-> kld mapping table, mostly so tun/tap/vmnet
can autoload the correct module on use. It also inadvertently made bogus
some previously valid uses of sizeof().

Revert back to ifkind on the stack for simplicity sake. This reduces the
diff from the previous version of ifmaybeload for easiser auditing.

5 years agoloader: no-TERM_EMU is broken now
tsoome [Thu, 9 May 2019 12:14:52 +0000 (12:14 +0000)]
loader: no-TERM_EMU is broken now

If TERM_EMU is not defined, we do not have curx variable. Use conout mode
for efi and expose get_pos() for i386.

5 years ago- Merge r338254 from cxgbe(4):
marius [Thu, 9 May 2019 11:34:46 +0000 (11:34 +0000)]
- Merge r338254 from cxgbe(4):
  Use fcmpset instead of cmpset when appropriate.
- Revert r277226 of cxgbe(4), obsolete since r334320.

5 years agoloader: ptable_print() needs two tabs sometimes
tsoome [Thu, 9 May 2019 11:04:10 +0000 (11:04 +0000)]
loader: ptable_print() needs two tabs sometimes

Since the partition/slice names do vary in length, check the length
of the fixed part of the line against 3 * 8, if the lenth is less than
3 tab stops, print out extra tab.

use snprintf() instead of sprintf.

5 years agoloader: implement proper 8 char tab stops
tsoome [Thu, 9 May 2019 10:37:57 +0000 (10:37 +0000)]
loader: implement proper 8 char tab stops

The current console code is printing out 8 spaces for tab, calculate
the amount of spaces based on tab stops.

5 years agoFix memory leak of PCI BUS structure in the LinuxKPI.
hselasky [Thu, 9 May 2019 10:23:42 +0000 (10:23 +0000)]
Fix memory leak of PCI BUS structure in the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoFix regression issue after r346645 in the LinuxKPI.
hselasky [Thu, 9 May 2019 09:45:19 +0000 (09:45 +0000)]
Fix regression issue after r346645 in the LinuxKPI.
Make sure LinuxKPI PCI devices get a default BUSDMA tag.

Found by: Thomas Laus <lausts@acm.org>
Sponsored by: Mellanox Technologies

5 years agoIn mld_v2_cancel_link_timers() check number of references and disconnect
ae [Thu, 9 May 2019 07:57:33 +0000 (07:57 +0000)]
In mld_v2_cancel_link_timers() check number of references and disconnect
inm before releasing the last reference. This fixes possible panics and
assertion.

PR: 237329
Reviewed by: mmacy
MFC after: 2 weeks

5 years agoReceiver side DSACK implemenation.
tuexen [Thu, 9 May 2019 07:34:15 +0000 (07:34 +0000)]
Receiver side DSACK implemenation.

This adds initial support for RFC 2883.

Submitted by: Richard Scheffenegger
Reviewed by: rrs@
Differential Revision: https://reviews.freebsd.org/D19334

5 years agoPrevent cwnd to collapse down to 1 MSS after exiting recovery.
tuexen [Thu, 9 May 2019 07:11:08 +0000 (07:11 +0000)]
Prevent cwnd to collapse down to 1 MSS after exiting recovery.

This is descrined in RFC 6582, which updates RFC 3782.

Submitted by: Richard Scheffenegger
Reviewed by: lstewart@
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D17614

5 years agoExistense of PCB route caching doesn't allow us to use new fast route
glebius [Wed, 8 May 2019 23:39:24 +0000 (23:39 +0000)]
Existense of PCB route caching doesn't allow us to use new fast route
lookup KPI in ip_output() like it is already used in ip_forward().
However, when there is no PCB provided we can use fast KPI, gaining
performance advantage.

Typical case when ip_output() is called without a PCB pointer is a
sendto(2) on a not connected UDP socket. In practice DNS servers do
this.

Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D19804

5 years agoetc/Makefile: Remove empty newline
manu [Wed, 8 May 2019 21:26:11 +0000 (21:26 +0000)]
etc/Makefile: Remove empty newline

This was commited accidently in r347356 and cause distribution with
NO_ROOT set to fail.

Reported by: ci, kib
MFC after: 2 weeks
X-MFC-With: r347356

5 years agoBump EC2 AMI filesystem size up to 4000 MB.
cperciva [Wed, 8 May 2019 21:03:03 +0000 (21:03 +0000)]
Bump EC2 AMI filesystem size up to 4000 MB.

AMIs have been breaking for the past month due to insufficient disk space.

Due to the small amount of overhead in the disk image, the EC2 AMIs end
up with the same (4GB) minimum disk size.

Reported by: Michal Krawczyk

5 years agorename nvme_ctrlr_destroy_qpair to nvme_ctrlr_destroy_qpairs
imp [Wed, 8 May 2019 20:18:11 +0000 (20:18 +0000)]
rename nvme_ctrlr_destroy_qpair to nvme_ctrlr_destroy_qpairs

Maintain symmetry with nvme_ctrlr_create_qpairs, making it easier to
match init/uninit scenarios.

Signed-off-by: John Meneghini <johnm@netapp.com>
Submitted by: Michael Hordijk <hordijk@netapp.com>
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D19781

5 years agox86: Put other CPUs into tight loop when updating Intel microcode from
kib [Wed, 8 May 2019 20:01:09 +0000 (20:01 +0000)]
x86: Put other CPUs into tight loop when updating Intel microcode from
loaded OS.

This should prevent at least some theoretical issues whith code
execution on HT sibling of the core where the update is loaded.

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

5 years agodts: Import files from Linux 5.1
manu [Wed, 8 May 2019 19:27:30 +0000 (19:27 +0000)]
dts: Import files from Linux 5.1

MFC after: 2 months

5 years agoUpdate dme(4) to reflect that it will not be removed due to FCP-101.
brooks [Wed, 8 May 2019 19:05:58 +0000 (19:05 +0000)]
Update dme(4) to reflect that it will not be removed due to FCP-101.

dme(4) is the built-in NIC on a couple non-expandable mips platforms and
thus should remain.  The FCP has been updated to reflect this fact.

Discussed with: imp

5 years agoImport Linux 5.1 DTS files
manu [Wed, 8 May 2019 19:00:46 +0000 (19:00 +0000)]
Import Linux 5.1 DTS files

5 years agodtb: allwinner: Add the pinebook dtb to the build
manu [Wed, 8 May 2019 18:56:24 +0000 (18:56 +0000)]
dtb: allwinner: Add the pinebook dtb to the build

5 years agoAdd usage example to tree(3).
trasz [Wed, 8 May 2019 18:49:59 +0000 (18:49 +0000)]
Add usage example to tree(3).

Obtained from: OpenBSD
MFC after: 2 weeks
Sponsored by: Klara Inc.

5 years agoMark inline functions with __unused; prevents compiler warning
trasz [Wed, 8 May 2019 18:47:00 +0000 (18:47 +0000)]
Mark inline functions with __unused; prevents compiler warning
when they end up being unused.

Reviewed by: kib
Obtained from: OpenBSD
MFC after: 2 weeks
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D20185

5 years agoFix expected output after r347207
lwhsu [Wed, 8 May 2019 18:46:12 +0000 (18:46 +0000)]
Fix expected output after r347207

While phil is working on fixing in libxo general test parts, updating these
files to stop the test failure warnings

Approved by: phil
MFC with: r347207
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20188

5 years agoEnable sys/disk.h consumers to avoid pulling in networking headers.
mmacy [Wed, 8 May 2019 18:10:19 +0000 (18:10 +0000)]
Enable sys/disk.h consumers to avoid pulling in networking headers.

The networking headers break ZoF.

5 years agopkgbase: Deal with the last etc files
manu [Wed, 8 May 2019 17:46:59 +0000 (17:46 +0000)]
pkgbase: Deal with the last etc files

Add tags=package=runtime for password related files.
Add tags=package=sendmail for rc.sendmail
Add tags=package=ipfw for rc.firewall

Reviewed by: bapt
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20173

5 years agoReduce umtx-related work on exec and exit
mjg [Wed, 8 May 2019 16:30:38 +0000 (16:30 +0000)]
Reduce umtx-related work on exec and exit

- there is no need to take the process lock to iterate the thread
  list after single-threading is enforced
- typically there are no mutexes to clean up (testable without taking
  the global umtx lock)
- typically there is no need to adjust the priority (testable without
  taking thread lock)

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20160

5 years agopowerpc/booke: Rewrite pmap_sync_icache() a bit
jhibbits [Wed, 8 May 2019 16:15:28 +0000 (16:15 +0000)]
powerpc/booke: Rewrite pmap_sync_icache() a bit

* Make mmu_booke_sync_icache() use the DMAP on 64-bit prcoesses, no need to
  map the page into the user's address space.  This removes the
  pvh_global_lock from the equation on 64-bit.
* Don't map the page with user-readability on 32-bit.  I don't know what the
  chance of a given user process being able to access the NULL page when
  another process's page is added there, but it doesn't seem like a good
  idea to map it to NULL with user read permissions.
* Only sync as much as we need to.  There are only two significant places
  where pmap_sync_icache is used: proc_rwmem(), and the SIGILL second-chance
  for powerpc.  The SIGILL second chance is likely the most common, and only
  syncs 4 bytes, so avoid the other 127 loop iterations (4096 / 32 byte
  cacheline) in __syncicache().

5 years agoConnect Xilinx AXI drivers and Cadence Ethernet MAC to the RISC-V build.
br [Wed, 8 May 2019 16:06:54 +0000 (16:06 +0000)]
Connect Xilinx AXI drivers and Cadence Ethernet MAC to the RISC-V build.

Sponsored by: DARPA, AFRL

5 years agopowerpc/booke: Do as much work outside of TLB locks as possible
jhibbits [Wed, 8 May 2019 16:05:18 +0000 (16:05 +0000)]
powerpc/booke: Do as much work outside of TLB locks as possible

Reduce the surface area of the TLB locks.  Unfortunately the same trick for
serializing the tlbie instruction on OEA64 cannot be used here to reduce the
scope of the tlbivax mutex to the tlbsync only, as the mutex also serializes
the TLB miss lock as a side effect, so contention on this lock may not be
reducible any further.

5 years agoAdd driver for the Xilinx AXI Direct Memory Access (AXI DMA) controller
br [Wed, 8 May 2019 15:43:17 +0000 (15:43 +0000)]
Add driver for the Xilinx AXI Direct Memory Access (AXI DMA) controller
found in the U.S. Government Furnished Equipment (GFE) 64-bit RISC-V cores.

Sponsored by: DARPA, AFRL

5 years agoAdd support for USB 3.0 XHCI via ACPI
manu [Wed, 8 May 2019 15:42:39 +0000 (15:42 +0000)]
Add support for USB 3.0 XHCI via ACPI

Ampere eMAG systems have XHCI just described in ACPI, not on PCI.

Submitted by: Greg V <greg@unrelenting.technology>
Reviewed by: andrew
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D19986

5 years agoAdd driver for Xilinx AXI Ethernet tri-mode (10/100/1000 Mb/s) MAC found
br [Wed, 8 May 2019 15:36:57 +0000 (15:36 +0000)]
Add driver for Xilinx AXI Ethernet tri-mode (10/100/1000 Mb/s) MAC found
in the U.S. Government Furnished Equipment (GFE) 64-bit RISC-V cores.

Sponsored by: DARPA, AFRL

5 years agoo Implement a bounce buffer based on device reserved memory.
br [Wed, 8 May 2019 15:22:27 +0000 (15:22 +0000)]
o Implement a bounce buffer based on device reserved memory.
  Grab device reserved physical memory regions from FDT using standard
  "memory-region" property and use vmem(9) to allocate buffers from it.
  The same vmem could be used by DMA engine drivers to allocate memory for
  DMA descriptors.
  This is required for platforms that provide uncached memory region
  reserved exclusively for DMA operations.
o Change sleepable sx(9) lock type to non-sleepable mutex(9) since
  network drivers usually hold mutex during DMA operations. So we don't
  take sleepable lock after non-sleepable.

Tested on U.S. Government Furnished Equipment (GFE) 64-bit RISC-V cores.

Sponsored by: DARPA, AFRL

5 years agoAdd wc(1) to native-xtools so that it can be used in qemu-user jails
antoine [Wed, 8 May 2019 15:17:36 +0000 (15:17 +0000)]
Add wc(1) to native-xtools so that it can be used in qemu-user jails

5 years agorandom(4): Don't complain noisily when an entropy source is slow
cem [Wed, 8 May 2019 14:54:32 +0000 (14:54 +0000)]
random(4): Don't complain noisily when an entropy source is slow

Mjg@ reports that RDSEED (r347239) causes a lot of logspam from this printf,
and I don't feel that it is especially useful (even ratelimited).  There are
many other quality/quantity checks we're not performing on entropy sources;
lack of high frequency availability does not disqualify a good entropy
source.

There is some discussion in the linked Differential about what logging might
be appropriate and/or polling policy for slower TRNG sources.  Please feel
free to chime in if you have opinions.

Reported by: mjg
Reviewed by: markm, delphij
Approved by: secteam(delphij)
X-MFC-With: r347239
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20195

5 years agoAvoid literal @generated tag in file-generating scripts
emaste [Wed, 8 May 2019 13:35:51 +0000 (13:35 +0000)]
Avoid literal @generated tag in file-generating scripts

We don't want the generator itself tagged as a generated file.

Reviewed by: cem
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20182

5 years agoFix LINT linking issue.
hselasky [Wed, 8 May 2019 12:28:11 +0000 (12:28 +0000)]
Fix LINT linking issue.

Add missing mlxfw symbols to LINT builds.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoFix LINT compilation issue.
hselasky [Wed, 8 May 2019 12:27:16 +0000 (12:27 +0000)]
Fix LINT compilation issue.

"mdev" is unused when building LINT targets.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoBump the Mellanox driver version numbers and the FreeBSD version number.
hselasky [Wed, 8 May 2019 11:15:07 +0000 (11:15 +0000)]
Bump the Mellanox driver version numbers and the FreeBSD version number.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoMake command workqueue persistant in mlx5core.
hselasky [Wed, 8 May 2019 11:09:08 +0000 (11:09 +0000)]
Make command workqueue persistant in mlx5core.

There is no reason to re-create the command workqueue during healthcare.
This also fixes an issue where a previous work struct may refer to a
destroyed workqueue.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoFix race between driver unload and dumping firmware in mlx5core.
hselasky [Wed, 8 May 2019 11:08:48 +0000 (11:08 +0000)]
Fix race between driver unload and dumping firmware in mlx5core.

Present code uses lock-less accesses to the dump data to prevent top
level ioctls from blocking bottom-level call to dump.  Unfortunately, this
depends on the type stability of the dump data structure, which makes it
non-functional during driver teardown.

Switch to the mutex locking scheme where top levels use the mutex in the
bound regions, while copyouts and drain for completion utilize condvars.
The mutex lifetime is guaranteed to be strictly larger than the time
interval where driver can initiate dump, and most of the control fields
of the old struct mlx5_dump_data are directly embedded into struct
mlx5_core_dev.

Submitted by: kib@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoEnsure the flowtable rules are not freed twice in mlx5en(4).
hselasky [Wed, 8 May 2019 11:08:21 +0000 (11:08 +0000)]
Ensure the flowtable rules are not freed twice in mlx5en(4).
This can happen when re-loading the driver.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoUndo previous steps upon returning failure in mlx5en(4).
hselasky [Wed, 8 May 2019 11:08:01 +0000 (11:08 +0000)]
Undo previous steps upon returning failure in mlx5en(4).

Else flowtable resources may not be properly freed.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoMake sure the flow destination structure does not use values off the stack
hselasky [Wed, 8 May 2019 11:07:42 +0000 (11:07 +0000)]
Make sure the flow destination structure does not use values off the stack
in mlx5en(4).

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoFlush command workqueue when command completion is triggered in mlx5core.
hselasky [Wed, 8 May 2019 11:07:20 +0000 (11:07 +0000)]
Flush command workqueue when command completion is triggered in mlx5core.

Avoid race for command completion when triggering a command completions event.
Serialize operation by queueing all commands on the same work queue.
This can happen when healthcare triggers.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoMake command timeout way shorter in mlx5core.
hselasky [Wed, 8 May 2019 11:07:00 +0000 (11:07 +0000)]
Make command timeout way shorter in mlx5core.

The command timeout is terribly long, whole two hours. Make it 60s so if
things do go wrong, the user gets feedback in relatively short time, so
they can take corrective actions and/or investigate using tools and such.

Linux commit:
6b6c07bdcdc97ccac2596063bfc32a5faddfe884

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoRemove non-functional MLX5E_MAX_RX_SEGS macro in mlx5en(4).
hselasky [Wed, 8 May 2019 11:06:42 +0000 (11:06 +0000)]
Remove non-functional MLX5E_MAX_RX_SEGS macro in mlx5en(4).

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoFix for compilation warning in mlx5en(4).
hselasky [Wed, 8 May 2019 11:06:22 +0000 (11:06 +0000)]
Fix for compilation warning in mlx5en(4).

Function 'mlx5e_alloc_rx_wqe' can never be inlined because it uses alloca
(override using the always_inline attribute)

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoRename functions from mlx5_fwdump to mlx5_ctl in mlx5core.
hselasky [Wed, 8 May 2019 11:05:59 +0000 (11:05 +0000)]
Rename functions from mlx5_fwdump to mlx5_ctl in mlx5core.

Submitted by: kib@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoEnsure that only one command is specified at a time in mlx5tool(8).
hselasky [Wed, 8 May 2019 11:05:30 +0000 (11:05 +0000)]
Ensure that only one command is specified at a time in mlx5tool(8).

Submitted by: kib@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoImplement firmware reset from userspace in mlx5tool(8).
hselasky [Wed, 8 May 2019 11:05:09 +0000 (11:05 +0000)]
Implement firmware reset from userspace in mlx5tool(8).

Submitted by: kib@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoAdd Firmware Reset Level, MFRL, register accessors in mlx5core.
hselasky [Wed, 8 May 2019 11:04:40 +0000 (11:04 +0000)]
Add Firmware Reset Level, MFRL, register accessors in mlx5core.

Submitted by: kib@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoAdd ConnectX-6 DX HCA ID to libmlx5.
hselasky [Wed, 8 May 2019 11:04:09 +0000 (11:04 +0000)]
Add ConnectX-6 DX HCA ID to libmlx5.

In addition, add "ConnectX family mlx5Gen Virtual Function" device ID.
Every new HCA VF will be identified with this device ID.

Submitted by: slavash@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoExpose per-lane counters before correction mechanism in mlx5en(4).
hselasky [Wed, 8 May 2019 11:03:29 +0000 (11:03 +0000)]
Expose per-lane counters before correction mechanism in mlx5en(4).

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoAdd support for extended PCIe counters in mlx5en(4).
hselasky [Wed, 8 May 2019 11:02:36 +0000 (11:02 +0000)]
Add support for extended PCIe counters in mlx5en(4).

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoExtend the counters framework in mlx5en(4).
hselasky [Wed, 8 May 2019 10:59:16 +0000 (10:59 +0000)]
Extend the counters framework in mlx5en(4).

Allow more macro arguments and split the variable type and name into
separate arguments. This allows simple and powerful copy and extraction
of values from IFC based structures into SYSCTLs with the use of a single
macro.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoUpdate performance counter bits in mlx5core.
hselasky [Wed, 8 May 2019 10:58:41 +0000 (10:58 +0000)]
Update performance counter bits in mlx5core.

MFC after: 3 days
Sponsored by: Mellanox Technologies