Commit Graph

249005 Commits

Author SHA1 Message Date
Kristof Provost
d2568b024d pfctl: improve rule load times with thousands of interfaces
r343287 / D18759 introduced ifa_add_groups_to_map() which is now run by
ifa_load/ifa_lookup/host_if. When loading an anchor or ruleset via pfctl that
does NOT contain ifnames as hosts, host() still ends up iterating all
interfaces twice, grabbing SIOCGIFGROUP ioctl twice for each. This adds an
unnecessary amount of time on systems with thousands or tens of thousands of
interfaces.

Prioritize the IPv4/6 check over the interface name lookup, which skips loading
the iftab and iterating all interfaces when the configuration does not contain
interface names.

Submitted by:	Nick Rogers
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D24100
2020-03-19 12:54:43 +00:00
David Bright
35c5ccf66d Fix parameter reversal potentially causing buffer overrun.
Two arguments were reversed in calls to cam_strvis() in
nvme_da.c. This was found by a Coverity scan of this code within Dell
(Isilon). These are also marked in the FreeBSD Coverity scan as CIDs
1400526 & 1400531.

Submitted by:	robert.herndon@dell.com
Reviewed by:	vangyzen@, imp@
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D24117
2020-03-19 12:22:20 +00:00
Mateusz Piotrowski
1b7ae4aa5e Document my doc bit and that bcr@ was my mentor 2020-03-19 10:20:32 +00:00
Mateusz Piotrowski
9168ef5be3 Document geli(8) loader variables conventions
The geli(8) manual page has an example for preloading keyfiles during boot.
There is no detail though on how the lookup of these variables actually
works.

Let's document that the name of a device does not have to be a part
of the variable.

PR:		243261
Submitted by:	johannes@jo-t.de
Approved by:	bcr (mentor)
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D24114
2020-03-19 09:23:26 +00:00
Hans Petter Selasky
d76ca5b15c Correctly implement support for remote wakeup for USB 3.0 device.
Submitted by:	Horse Ma <Shichun.Ma@dell.com>
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-03-19 09:15:59 +00:00
Xin LI
4188ba1a3b Fix race condition in catopen(3).
The current code uses a rwlock to protect the cached list, which
in turn holds a list of catentry objects, and increments reference
count while holding only read lock.

Fix this by converting the reference counter to use atomic operations.

While I'm there, also perform some clean ups around memory operations.

PR:		202636
Reported by:	Henry Hu <henry.hu.sh@gmail.com>
Reviewed by:	markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D24095
2020-03-19 06:33:06 +00:00
Alexander Motin
d3c6ba3214 MFOpenZFS: make zil max block size tunable
We've observed that on some highly fragmented pools, most metaslab
allocations are small (~2-8KB), but there are some large, 128K
allocations.  The large allocations are for ZIL blocks.  If there is a
lot of fragmentation, the large allocations can be hard to satisfy.

The most common impact of this is that we need to check (and thus load)
lots of metaslabs from the ZIL allocation code path, causing sync writes
to wait for metaslabs to load, which can take a second or more.  In the
worst case, we may not be able to satisfy the allocation, in which case
the ZIL will resort to txg_wait_synced() to ensure the change is on
disk.

To provide a workaround for this, this change adds a tunable that can
reduce the size of ZIL blocks.

External-issue: DLPX-61719
Reviewed-by: George Wilson <george.wilson@delphix.com>
Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Closes #8865
openzfs/zfs@b8738257c2

MFC after:	2 weeks
2020-03-19 01:05:54 +00:00
Konstantin Belousov
c98cae3bf3 Add file for static compilation of mlx5.
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
2020-03-19 00:53:31 +00:00
Alexander Motin
d26ae2c1ca Add missing STAILQ_INIT() in ciss_disable_adapter().
I think it should fix reported panic after "ADAPTER HEARTBEAT FAILED".

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2020-03-19 00:19:50 +00:00
Konstantin Belousov
4ad58ea85b mlx5_core: lower the severity of message noting that no SR-IOV cap is present.
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
2020-03-18 22:47:14 +00:00
Konstantin Belousov
bbcb656af2 mlx5: Route NIC_VPORT_CHANGE events to eswitch code.
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
2020-03-18 22:44:48 +00:00
Konstantin Belousov
90959e7e37 mlx5: Read number of VF ports from the SR-IOV cap.
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
2020-03-18 22:43:39 +00:00
Konstantin Belousov
18a70fa574 mlx5: Use eswitch interface to configure VFs steering.
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
2020-03-18 22:40:26 +00:00
Konstantin Belousov
8982c8003b mlx5: Add 'follow' vport state, relevant for VFs.
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
2020-03-18 22:38:57 +00:00
Konstantin Belousov
f6ca0b216a mlx5: Integrate eswitch and mpfs management code.
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
2020-03-18 22:33:39 +00:00
Konstantin Belousov
91ad1bd953 mlx5: Restore eswitch management code from attic.
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
2020-03-18 22:30:56 +00:00
Toomas Soome
34edaae605 loader.efi: handle efi_cons_init() failure cases better
if we fail to allocate buffer, set up the TERM_EMU and continue.
On output, use TERM_EMU in case we did fail to allocate buffer.
2020-03-18 22:21:42 +00:00
Konstantin Belousov
9dfa078252 mlx5: Basic PCIe side of SR-IOV support.
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
2020-03-18 22:17:01 +00:00
Cy Schubert
b323455767 PACKAGE_STRING should be the same as PACKAGE_VERSION.
MFC after:	3 days
2020-03-18 22:14:25 +00:00
Konstantin Belousov
2928e60e55 linuxkpi: Add infrastructure to pass FreeBSD IOV method calls into
pci_driver methods.

Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
2020-03-18 22:10:49 +00:00
Konstantin Belousov
84b3c4547a Add pci_iov_if.h header as a dependency for Linuxkpi consumers.
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
2020-03-18 22:09:16 +00:00
Konstantin Belousov
e19a968f15 mlx5_core: add sysctls to report device capabilities.
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
2020-03-18 21:54:32 +00:00
Konstantin Belousov
46ed9da5fc Do not spuriously re-enable disabled io_apic pin on EOI for some configurations.
If EOI suppression is supported but reported ioapic version is so old
that it does not has EOI register (weird virtualization setup), fix
Intel trick of eoi-ing by flipping pin type (edge/level) to account
for the disabled pin.

Reported by:	Juniper
Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D23965
2020-03-18 21:34:52 +00:00
Konstantin Belousov
1314c4920f Stop (trying to) renumber io apics.
It does not serve any purpose now, the io apic id is not seen by
software, and some Intel documents claim that the register is
implemented for FUD reasons.  More, renumbering seems to not work on
new Intel machines which actually have mismatched MADT and hw IDs.

On older machines where separate APIC bus existed, unique numbering of
all APICs was required for bus arbitration to work, but it is no
longer true (that machines were SMP from pre-Pentium IV era).

When matching PCIe IOAPIC device against MADT-enumerated IOAPICs,
compare io_apic_id from BAR against io_apic_id read from the
MADT-pointed register page.

Reviewed by:	jhb
Tested by:	flo (previous version), pho
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D23965
2020-03-18 21:31:35 +00:00
Ed Maste
5236e8d427 src.opts.mk: remove remaining support for pre-C++11 C++ compilers
Delete the conditions that forcibly disabled GOOGLETEST and LLDB for
pre-C++11 C++ compilers, since we no longer support such compilers.

Also delete the complicated method of defaulting LIBCPLUSPLUS to YES.

Prodded by:	kevans
Sponsored by:	The FreeBSD Foundation
2020-03-18 21:28:55 +00:00
Konstantin Belousov
c105f5c1fa Widen the stored io_apic_id to 8 bits.
It seems that the newer Intel chipset did that, and Linux reads 8
bits. The only detail is that all seen datasheets, even under NDA,
claim that io apic id is 4 bits.

Submitted by:	jeff
Reviewed by:	jhb
Tested by:	flo, pho
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D23965
2020-03-18 21:24:34 +00:00
Ed Maste
dadc342d07 Revert r359083, fixed properly by r359088
r359083 introduced a workaround for stale libomp dependencies during a
regular (no -DNO_CLEAN) buildworld.  r359088 addressed the reason the
clean step missed libomp, so revert the workaround.

Sponsored by:	The FreeBSD Foundation
2020-03-18 21:20:10 +00:00
Ed Maste
d64b2df932 src.opts.mk: drop C++11 compiler conditional from OPENMP
We no longer support older C++ compilers, so do not need to explicitly
test for C++11 support.

After r339946 we stopped running `cc --version` during cleandir/obj
stages, so stopped setting COMPILER_FEATURES.  This in turn meant
lib/libomp was excluded from the clean stage in a normal buildworld
(i.e., one without -DNO_CLEAN), and this is what caused recent build
failures with errors about missing ittnotify_static.c.

This commit should obviate the need for the workaround committed in
r359083.  Thanks to bdrewery for the insight and for pushing for a
correct fix.  There are more cleanups to be done, but this change is
a simplification and an improvement over r359083.

Sponsored by:	The FreeBSD Foundation
2020-03-18 21:15:45 +00:00
Dimitry Andric
9ec406dc40 Merge commit 585a3cc31 from llvm git (by me):
Fix -Wdeprecated-copy-dtor and -Wdeprecated-dynamic-exception-spec
  warnings.

  Summary:
  The former are like:

  libcxx/include/typeinfo:322:11: warning: definition of implicit copy
  constructor for 'bad_cast' is deprecated because it has a
  user-declared destructor [-Wdeprecated-copy-dtor]
    virtual ~bad_cast() _NOEXCEPT;
	    ^
  libcxx/include/typeinfo:344:11: note: in implicit copy constructor
  for 'std::bad_cast' first required here
      throw bad_cast();
	    ^

  Fix these by adding an explicitly defaulted copy constructor.

  The latter are like:

  libcxx/include/codecvt:105:37: warning: dynamic exception
  specifications are deprecated [-Wdeprecated-dynamic-exception-spec]
      virtual int do_encoding() const throw();
				      ^~~~~~~

  Fix these by using the _NOEXCEPT macro instead.

  Reviewers: EricWF, mclow.lists, ldionne, #libc

  Reviewed By: EricWF, #libc

  Subscribers: dexonsmith, libcxx-commits

  Tags: #libc

  Differential Revision: https://reviews.llvm.org/D76150

This is because we use -Wsystem-headers during buildworld, and the two
warnings above are now triggered by default with clang 10, preventing
most C++ code from compiling without NO_WERROR.

Requested by:	brooks
MFC after:	6 weeks
X-MFC-With:	358851
Differential Revision: https://reviews.freebsd.org/D24049
2020-03-18 20:50:30 +00:00
Dimitry Andric
e39dad62a8 Merge commit b8ebc11f0 from llvm git (by Sanjay Patel):
[EarlyCSE] avoid crashing when detecting min/max/abs patterns (PR41083)

  As discussed in PR41083:
  https://bugs.llvm.org/show_bug.cgi?id=41083
  ...we can assert/crash in EarlyCSE using the current hashing scheme
  and instructions with flags.

  ValueTracking's matchSelectPattern() may rely on overflow (nsw, etc)
  or other flags when detecting patterns such as min/max/abs composed
  of compare+select. But the value numbering / hashing mechanism used
  by EarlyCSE intersects those flags to allow more CSE.

  Several alternatives to solve this are discussed in the bug report.
  This patch avoids the issue by doing simple matching of min/max/abs
  patterns that never requires instruction flags. We give up some CSE
  power because of that, but that is not expected to result in much
  actual performance difference because InstCombine will canonicalize
  these patterns when possible. It even has this comment for abs/nabs:

    /// Canonicalize all these variants to 1 pattern.
    /// This makes CSE more likely.

  (And this patch adds PhaseOrdering tests to verify that the expected
  transforms are still happening in the standard optimization
  pipelines.

  I left this code to use ValueTracking's "flavor" enum values, so we
  don't have to change the callers' code. If we decide to go back to
  using the ValueTracking call (by changing the hashing algorithm
  instead), it should be obvious how to replace this chunk.

  Differential Revision: https://reviews.llvm.org/D74285

This fixes an assertion when building the math/gsl port on PowerPC64.

Requested by:	pkubja
MFC after:	6 weeks
X-MFC-With:	358851
2020-03-18 20:44:40 +00:00
Dimitry Andric
5a0c326f63 Merge commit 315f8a55f from llvm git (by Fangrui Song):
[ELF][PPC32] Don't report "relocation refers to a discarded section"
  for .got2

  Similar to D63182 [ELF][PPC64] Don't report "relocation refers to a
  discarded section" for .toc

  Reviewed By: Bdragon28

  Differential Revision: https://reviews.llvm.org/D75419

This is needed to fix compile errors when building for ppc32/lld10.

Requested by:	bdragon
MFC after:	6 weeks
X-MFC-With:	358851
Differential Revision: https://reviews.freebsd.org/D24110
2020-03-18 20:38:15 +00:00
Dimitry Andric
92c0d181e5 Merge commit 00925aadb from llvm git (by Fangrui Song):
[ELF][PPC32] Fix canonical PLTs when the order does not match the PLT order

  Reviewed By: Bdragon28

  Differential Revision: https://reviews.llvm.org/D75394

This is needed to fix miscompiled canonical PLTs on ppc32/lld10.

Requested by:	bdragon
MFC after:	6 weeks
X-MFC-With:	358851
Differential Revision: https://reviews.freebsd.org/D24109
2020-03-18 20:28:26 +00:00
Ed Maste
0d02682c96 invoke _cleanobj_fast_depend_hack unconditionally
Apparently make ${CLEANDIR} is leaving stale entries in .depend files;
for now invoke the hacky cleanup in both the -DNO_CLEAN and normal
(no -DNO_CLEAN) cases.

In collaboration with:	dim
Sponsored by:	The FreeBSD Foundation
2020-03-18 20:12:46 +00:00
Dimitry Andric
cd675bb60e Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
llvmorg-10.0.0-rc4-5-g52c365aa9ca.  The actual release should follow Real
Soon Now.

PR:             244251
MFC after:      6 weeks
2020-03-18 18:26:53 +00:00
Dimitry Andric
2fc9bb9ce2 Vendor import of llvm-project branch release/10.x
llvmorg-10.0.0-rc4-5-g52c365aa9ca.
2020-03-18 18:20:05 +00:00
Ryan Moeller
4bee618957 Fixup line lost from previous commit (r359072)
Reviewed by:	kevans
Approved by:	mav (mentor)
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D24115
2020-03-18 17:01:03 +00:00
Ryan Moeller
79c20f2260 loader: Add a "kernel.loaded" hook
This hook can be useful, for example to run a local function to choose
different modules to load when a user has picked a different kernel
from the menu.

Reviewed by:	kevans
Approved by:	mav (mentor)
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D24115
2020-03-18 16:21:11 +00:00
Mateusz Piotrowski
6ac25cd4ac Document that posixshmcontrol first appeared in 12.1
Also while here, I am addressing some linting issues.

PR:	243132
Submitted by:	Noah Altunian <nbaltunian gmail com>
Approved by:	bcr (mentor)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D24112
2020-03-18 15:02:09 +00:00
Ed Maste
15f16425e4 if_muge: use C99 bool for boolean vars 2020-03-18 14:16:14 +00:00
Leandro Lupori
e9f87d29a8 Add fsck_flags config option
On UFS with SU+J, sometimes fsck's default recovery from journal marks the
filesystem as clean but some errors remain.

With SU only, default fsck in preen mode sometimes thinks all errors have
been fixed but some still remain.

To address the issues above, this change adds a new config option:
fsck_flags.  By default it's set to -p, but the user may change it to -y
or -f -y, for instance, to force a full fsck after a system crash.

Submitted by:	jhibbits@ (original version)
Reviewed by:	mckusick
Differential Revision:	https://reviews.freebsd.org/D24087
2020-03-18 13:09:47 +00:00
Hiroki Sato
d80eccfc98 Remove /etc/host.conf, which was automatically generated from
nsswitch.conf for backward compatibility.  This file was used
over 19 years ago, before introducing nsdispatch() in the
name-service lookup APIs.

MFC after:	3 days
2020-03-18 08:17:24 +00:00
Hiroki Sato
c165f4ab69 -F is GNU diff specific, not implemented in BSD diff.
Reported by:	kouya@ryuhoku.jp
MFC after:	3 days
2020-03-18 08:00:46 +00:00
Jung-uk Kim
f22e76dc20 Remove wrong entries added in the previous commit.
Pointyhat to:	jkim
2020-03-18 05:28:36 +00:00
Rebecca Cran
a717adb5a0 Bhyve: log message when rfb client connects
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D24098
2020-03-18 03:17:15 +00:00
Rebecca Cran
cbd7ddcf65 Bhyve: DPRINTF already includes newline, so don't add another
Reviewed by:	jhb, vmaffione, emaste
Differential Revision:	https://reviews.freebsd.org/D24099
2020-03-18 03:15:57 +00:00
Rebecca Cran
7e03a82b63 ath_hal: fix typo in ath_hal_printf 2020-03-18 03:14:17 +00:00
Brandon Bergren
3069380898 [PowerPC][Book-E] Fix missing load base in elf_cpu_parse_dynamic().
When I implemented MD DYNAMIC parsing, I was originally passing a
linker_file_t so that the MD code could relocate pointers.

However, it turns out this isn't even filled in until later, so it was
always 0.

Just pass the load base (ef->address) directly, as that's really the only
thing we were interested in in the first place.

This fixes a crash on RB800 where it was trying to write to an unmapped
address when updating the GOT.

Reviewed by:	jhibbits
Sponsored by:	Tag1 Consulting, Inc.
Differential Revision:	https://reviews.freebsd.org/D24105
2020-03-18 02:58:18 +00:00
Jung-uk Kim
0a70e97c94 Reduce diff with the vendor version. No functional change. 2020-03-18 02:20:03 +00:00
Jung-uk Kim
17f01e9963 Merge OpenSSL 1.1.1e. 2020-03-18 02:13:12 +00:00
Justin Hibbits
889d304bb4 powerpc: Axe PPC4xx support.
Summary:
The support was added almost a decade ago, and never completed.  Just axe
it.  It was also inadvertently broken 5 years ago, and nobody noticed.

Reviewed by:	bdragon
Differential Revision:	https://reviews.freebsd.org/D23753
2020-03-18 01:09:43 +00:00