Commit Graph

238233 Commits

Author SHA1 Message Date
Warner Losh
0d095c23a0 Const poison the command interface
Make the pointers we pass into the commands const, also make the
linker set mirrors const.

Suggested by: cem@
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18459
2018-12-06 22:58:42 +00:00
Warner Losh
228c425533 Dynamically load .so modules to expand functionality
o Dynamically load all the .so files found in /libexec/nvmecontrol and
  /usr/local/libexec/nvmecontrol.
o Link nvmecontrol -rdynamic so that its symbols are visible to the
  libraries we load.
o Create concatinated linker sets that we dynamically expand.
o Add the linked-in top and logpage linker sets to the mirrors for them
  and add those sets to the mirrors when we load a new .so.
o Add some macros to help hide the names of the linker sets.
o Update the man page.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18455

fold
2018-12-06 22:58:26 +00:00
John Baldwin
dab45de671 Rename riscv64-freebsd.c to riscv-freebsd.c.
This fixes truss when built as part of a riscv64sf world.  Additionally,
if FreeBSD ever supports RV32 RISC-V most of this file can be used as-is
just as a single file is used for all of the MIPS ABIs.

Sponsored by:	DARPA
2018-12-06 22:35:07 +00:00
Konstantin Belousov
a748d99a17 Fix build with option RSS, removing unused variables.
Reported by:	np
Sponsored by:	Mellanox Technologies
MFC after:	1 week
2018-12-06 21:52:40 +00:00
Navdeep Parhar
9b11a65d1c cxgbe(4): Get Linux cxgb4vf working in bhyve VMs with VFs passed
through.

cxgb4vf doesn't own the buffer size list but still expects the first two
entries to be 4K and some power of 2 respectively.  The BSD cxgbe
doesn't care where its preferred buffer sizes are as long as they're in
the list somewhere, so just move its entries towards the end as a
workaround.

MFC after:	1 month
Sponsored by:	Chelsio Communicatons
2018-12-06 21:33:08 +00:00
Ed Maste
407345752d hier.7: add /lib/casper directory
Reported by:	imp
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2018-12-06 21:27:36 +00:00
Simon J. Gerraty
2eae894ca7 Update bmake to version 20180919
Cleanup of stats cache
and new :q modifier.
2018-12-06 20:56:19 +00:00
Ian Lepore
9631ae8267 Don't reference zfs-specific variables if LOADER_ZFS_SUPPORT is undefined
because the variables will be undefined too.

Reported by:	sjg@
Pointy hat:	ian@
2018-12-06 20:28:09 +00:00
Cy Schubert
efc4145a6e Remove an ugly Ultrix hack. Ultrix has been AWOL since the last ice
age, more to come.

MFC after:	1 week
2018-12-06 20:15:54 +00:00
Joel Dahl
788cf7253a Minor mandoc fixes. 2018-12-06 20:04:01 +00:00
Mark Johnston
8e2a46c8bd Add zdopen(3) to complement zopen(3).
zdopen() can be used in capability mode.  Update zopen.3 accordingly
and fix some grammar nits while I'm here.

Reviewed by:	delphij
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18456
2018-12-06 20:03:06 +00:00
Joel Dahl
eb687a6e70 Sort .Xr 2018-12-06 19:49:08 +00:00
Kristof Provost
4fc65bcbe3 pfsync: Performance improvement
pfsync code is called for every new state, state update and state
deletion in pf. While pf itself can operate on multiple states at the
same time (on different cores, assuming the states hash to a different
hashrow), pfsync only had a single lock.
This greatly reduced throughput on multicore systems.

Address this by splitting the pfsync queues into buckets, based on the
state id. This ensures that updates for a given connection always end up
in the same bucket, which allows pfsync to still collapse multiple
updates into one, while allowing multiple cores to proceed at the same
time.

The number of buckets is tunable, but defaults to 2 x number of cpus.
Benchmarking has shown improvement, depending on hardware and setup, from ~30%
to ~100%.

MFC after:	1 week
Sponsored by:	Orange Business Services
Differential Revision:	https://reviews.freebsd.org/D18373
2018-12-06 19:27:15 +00:00
Konstantin Belousov
e206dc6479 Appease gcc build, remove duplicated declaration.
Reported by:	np
Sponsored by:	Mellanox Technologies
MFC after:	1 week
2018-12-06 19:20:00 +00:00
Sean Bruno
5fc3b4acab Change u32 to uint32_t to allow the native-xtools target to build
libsysdecode.

Submitted by:	kib
2018-12-06 18:59:33 +00:00
Kristof Provost
2b0a4ffadb pf: add a comment describing why do we call pf_map_addr again if port
selection process fails

Obtained from:	OpenBSD
2018-12-06 18:58:54 +00:00
Sean Eric Fagan
54ff4a6a05 Reduce number of DNS queries in mountd.
As reported by a FreeNAS user (see https://redmine.ixsystems.com/issues/55728),
mountd does more calls to getnameinfo() than it needs to; this changes it to
only call it for the RPC calls it needs the name information for.

Reported by:	Dave Flowers
Reviewed by:	imp, mav
Approved by:	mav (mentor)
MFC after:	2 weeks
Sponsored by:	iXsystems Inc
Differential Revision:	https://reviews.freebsd.org/D18430
2018-12-06 18:21:48 +00:00
Maxim Sobolev
617095d9de Apparently @portmgr does not feel like my current level of contribution
warrants me a repo access to the ports tree anymore. Move myself into alumni
at least for a time being.
2018-12-06 18:12:50 +00:00
Yuri Pankov
16e2120af9 syslog(3): stdarg.h is needed only for vsyslog()
Reported by:	Brian Wood <woodbrian77@gmail.com>
Reviewed by:	asomers, ngie
Differential revision:	https://reviews.freebsd.org/D18334
2018-12-06 18:03:18 +00:00
Mark Johnston
afde86eba3 Let kern.trap_enotcap be set as a tunable.
This is handy for testing programs that are run by rc.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2018-12-06 17:29:37 +00:00
Edward Tomasz Napierala
a3c733b261 Add examples for "make buildenv".
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2018-12-06 13:52:02 +00:00
Yuri Pankov
4e04e8bd78 termcap: add italics and tmux entries
- add "ecma+italics" cap
- use it in "xterm-basic"
- add "tmux"/"tmux-256color" caps, fixing "so" and "se" caps,
  and sourcing "ecma+italics" and "screen"/"screen-256color"

Reviewed by:	bapt
Differential revision:	https://reviews.freebsd.org/D18363
2018-12-06 13:46:18 +00:00
Andriy Gapon
817b71bbb9 acpi_{Device,Battery}IsPresent: restore pre-r330957 behaviour
Specifically, assume that the device is present if evaluation of _STA
method fails.

Before r330957 we ignored any _STA evaluation failure (which was
performed by AcpiGetObjectInfo in ACPICA contrib code) for the purpose
of acpi_DeviceIsPresent and acpi_BatteryIsPresent.  ACPICA 20180313
removed evaluation of _STA from AcpiGetObjectInfo.  So, we added
evaluation of _STA to acpi_DeviceIsPresent and acpi_BatteryIsPresent.
One important difference is that the new code ignored a failure only if
_STA did not exist (AE_NOT_FOUND).  Any other kind of failure was
treated as a fatal failure.  Apparently, on some systems we can get
AE_NOT_EXIST when evaluating _STA.  And that error is not an evil twin
of AE_NOT_FOUND, despite a very similar name, but a distinct error
related to a missing handler for an ACPI operation region.

It's possible that for some people the problem was already fixed by
changes in ACPICA and/or in acpi_ec driver (or even in BIOS) that fixed
the AE_NOT_EXIST failure related to EC operation region.

This work is based on a great analysis by cem and an earlier patch by
Ali Abdallah <aliovx@gmail.com>.

PR:		227191
Reported by:	0mp
MFC after:	2 weeks
2018-12-06 12:34:34 +00:00
Vincenzo Maffione
89a9a5b5c9 netmap: netmap_transmit should honor bpf packet tap hook
This allows tcpdump to capture outbound kernel packets while
in netmap mode

Submitted by:	Marc de la Gueronniere <mdelagueronniere@verisign.com>
Reviewed by:	vmaffione
MFC after:	1 week
Sponsored by:	Verisign, Inc.
Differential Revision:	https://reviews.freebsd.org/D17896
2018-12-06 09:45:25 +00:00
Li-Wen Hsu
037479ff5e Temporarily skip flakey test cases
PR:		233586, 233587, 233588
Approved by:	markj (mentor)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18362
2018-12-06 09:22:35 +00:00
Navdeep Parhar
f02cc9b2a8 cxgbe(4): Fall back to a basic configuration in case of any error during
card initialization.  This is an expanded version of r333682.

Break up prep_firmware into simpler routines while here.  Load the
firmware/config KLD only if needed.

MFC after:	1 month
Sponsored by:	Chelsio Communications
2018-12-06 06:18:21 +00:00
Justin Hibbits
76748087bf powerpc: Set very low priority mode while waiting for AP unleash event
The POWER9 does not recognize 'or 27,27,27' as a thread priority NOP.  On
earlier POWER architectures, this NOP would note to the processor to give up
resources if able, to improve performance of other threads.

All processors that support the thread priority NOPs recognize the
'or 31,31,31' NOP as very low priority, so use this to perform a similar
function, and not burn cycles on POWER9.
2018-12-06 04:36:02 +00:00
Justin Hibbits
ac37786a0a powerpc: Fix ELFv2 JMP_SLOT relocation fixup
The jump slot is a function pointer, not a descriptor pointer, in ELFv2.  Just
write the pointer itself over, not the contents of the pointer, which would be
the first instruction of the function.
2018-12-06 04:30:24 +00:00
Justin Hibbits
7c4f1a1c5a powerpc/powermac: Fix macgpio(4) child interrupt resource handling
The 'interrupts' property is actually 2 words, not one, on macgpio child
nodes.  Open Firmware's getprop function might be returning the value
copied, not the total size of the property, but FDT's returns the total
size.  Prior to this patch, this would cause the SYS_RES_IRQ resource list
to not be populated when running with the 'usefdt' loader variable set, to
convert the OFW device tree to a FDT.  Since the property is always 2 words,
read both words, and ignore the second.

Tested by:	Dennis Clarke (previous attempt)
MFC after:	2 weeks
2018-12-06 04:25:12 +00:00
Kirk McKusick
bdd6b77e1f If the vfs.ffs.dotrimcons sysctl option is enabled while a file
deletion is active, specifically after a call to ffs_blkrelease_start()
but before the call to ffs_blkrelease_finish(), ffs_blkrelease_start()
will have handed out SINGLETON_KEY rather than starting a collection
sequence. Thus if we get a SINGLETON_KEY passed to ffs_blkrelease_finish(),
we just return rather than trying to finish the nonexistent sequence.

Reported by:  Warner Losh (imp@)
Sponsored by: Netflix
2018-12-06 01:04:56 +00:00
Simon J. Gerraty
14ed4acf37 Import bmake-20180919 2018-12-06 00:13:35 +00:00
Kirk McKusick
fb14e73cb4 Normally when an attempt is made to mount a UFS/FFS filesystem whose
superblock has a check-hash error, an error message noting the
superblock check-hash failure is printed and the mount fails. The
administrator then runs fsck to repair the filesystem and when
successful, the filesystem can once again be mounted.

This approach fails if the filesystem in question is a root filesystem
from which you are trying to boot. Here, the loader fails when trying
to access the filesystem to get the kernel to boot. So it is necessary
to allow the loader to ignore the superblock check-hash error and make
a best effort to read the kernel. The filesystem may be suffiently
corrupted that the read attempt fails, but there is no harm in trying
since the loader makes no attempt to write to the filesystem.

Once the kernel is loaded and starts to run, it attempts to mount its
root filesystem. Once again, failure means that it breaks to its prompt
to ask where to get its root filesystem. Unless you have an alternate
root filesystem, you are stuck.

Since the root filesystem is initially mounted read-only, it is
safe to make an attempt to mount the root filesystem with the failed
superblock check-hash. Thus, when asked to mount a root filesystem
with a failed superblock check-hash, the kernel prints a warning
message that the root filesystem superblock check-hash needs repair,
but notes that it is ignoring the error and proceeding. It does
mark the filesystem as needing an fsck which prevents it from being
enabled for writing until fsck has been run on it. The net effect
is that the reboot fails to single user, but at least at that point
the administrator has the tools at hand to fix the problem.

Reported by:    Rick Macklem (rmacklem@)
Discussed with: Warner Losh (imp@)
Sponsored by:   Netflix
2018-12-06 00:09:39 +00:00
Kristof Provost
369d9a2c15 pf tests: Add a defer mode test for pfsync
Repeat the pfsync test, this time with the 'defer' option enabled. This
exercises slightly different code paths.
2018-12-05 19:53:09 +00:00
Brooks Davis
827c3852fe Further simplify arguments to init.
With the removal of BOOTCDROM and fastboot support, this code always
passed "-s" or "--". The latter simply terminates getopt(3) processing
in init so we only need to pass "-s" in the single user case, or nothing
in other cases.

The passing of "--" seems to have been done to ensure that the number of
arguments passed to init was always the same and thus that argc was the
same.

Also GC the write-only variable pathlen (not in reviewed version).

Reviewed by:	kib, jhb
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D18441
2018-12-05 19:18:16 +00:00
Alan Cox
749cdf6f3b Terminate a blist_alloc search when a blst_meta_alloc call fails with
cursor == 0.

Every call to blst_meta_alloc but the one at the root is made only when the
meta-node is known to include a free block, so that either the allocation
will succeed, the node hint will be updated, or the last block of the meta-
node range is, and remains, free.  But the call at the root is made without
checking that there is a free block, so in the case that every block is
allocated, there is no hint update to prevent the current code from looping
forever.

Submitted by:	Doug Moore <dougm@rice.edu>
Reported by:	pho
Reviewed by:	pho
Tested by:	pho
X-MFC with:	r340402
Differential Revision:	https://reviews.freebsd.org/D17999
2018-12-05 18:26:40 +00:00
Mark Johnston
5e97950ded ixl(4) has netdump support via iflib.
Reported by:	kbowling
MFC after:	3 days
2018-12-05 18:19:29 +00:00
Brooks Davis
68ea829fe7 Remove never enabled support for "fastboot".
This has been ifdef notyet since the import of BSD 4.4 Lite Kernel
Sources in r1541.

Sponsored by:	DARPA, AFRL
2018-12-05 17:35:15 +00:00
Brooks Davis
7a5db3a770 Remove ifdef BOOTCDROM option to start init.
When BOOTCDROM is defined (via CFLAGS as there is no config option)
it causes -C to be passed to init, but our init and the version of
sysinstall I glanced at in 6.x don't support -C. The last plausibly
related support was removed from the tree in 1995.

Reviewed by:	kib
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D18431
2018-12-05 17:29:14 +00:00
Alan Somers
006678fd05 stat(2): clarify which syscalls modify file timestamps
The list of syscalls that modify st_atim, st_mtim, and st_ctim was quite out
of date and probably not accurate to begin with.  Update it, and make it
clear that the list is open-ended.

Reviewed by:	kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D18410
2018-12-05 17:28:40 +00:00
Mark Johnston
9d2877fc3d Clamp the INPCB port hash tables to IPPORT_MAX + 1 chains.
Memory beyond that limit was previously unused, wasting roughly 1MB per
8GB of RAM.  Also retire INP_PCBLBGROUP_PORTHASH, which was identical to
INP_PCBPORTHASH.

Reviewed by:	glebius
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D17803
2018-12-05 17:06:00 +00:00
Mark Johnston
fd6c1171d2 Netdump support was added to mlx4en(4) in r341548.
MFC with:	r341548
2018-12-05 16:55:45 +00:00
Mateusz Guzik
f26db6948d sx: retire SX_NOADAPTIVE
The flag is not used by anything for years and supporting it requires an
explicit read from the lock when entering slow path.

Flag value is left unused on purpose.

Sponsored by:	The FreeBSD Foundation
2018-12-05 16:43:03 +00:00
Hans Petter Selasky
52da588961 Remove redundant declaration after r341517.
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2018-12-05 15:56:44 +00:00
Hans Petter Selasky
6da0d28e6a Fix some build of LinuxKPI on some platforms after r341518.
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2018-12-05 15:53:34 +00:00
Hans Petter Selasky
8a886978d4 Fix LINT build after r341572.
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2018-12-05 15:42:31 +00:00
Vincenzo Maffione
1d9ec3ee50 netmap.h: include stdatomic.h
The stdatomic.h header exports atomic_thread_fence(), that
can be used to implement the nm_stst_barrier() macro needed
by netmap.

MFC after:	3 days
2018-12-05 15:38:52 +00:00
Slava Shwartsman
0f3b263d83 mlx4/mlx5: Updated driver version to 3.5.0
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies
2018-12-05 14:25:34 +00:00
Slava Shwartsman
cc971b2261 mlx5en: Implement backpressure indication.
The backpressure indication is implemented using an unlimited rate type of
mbuf send tag. When the upper layers typically the socket layer has obtained such
a tag, it can then query the destination driver queue for the current
amount of space available in the send queue.

A single mbuf send tag may be referenced multiple times and a refcount has been added
to the mlx5e_priv structure to track its usage. Because the send tag resides
in the mlx5e_channel structure, there is no need to wait for refcounts to reach
zero until the mlx4en(4) driver is detached. The channels structure is persistant
during the lifetime of the mlx5en(4) driver it belongs to and can so be accessed
without any need of synchronization.

The mlx5e_snd_tag structure was extended to contain a type field, because there are now
two different tag types which end up in the driver which need to be distinguished.

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies
2018-12-05 14:25:03 +00:00
Slava Shwartsman
71defeda26 mlx5en: Improve configuration of HW LRO.
In order to enable HW LRO, both the "hw_lro" sysctl in the mlx5en(4) config
space must be set, and the ifconfig(8) LRO capability must be set. Any other
settings will disable HW LRO.

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies
2018-12-05 14:24:33 +00:00
Slava Shwartsman
01f02abfec mlx5en: Count all transmitted and received bytes.
Add counter for all transmitted and received bytes. Currently only all
transmitted and received packets were counted. Fix description of RX LRO
counters while at it.

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies
2018-12-05 14:24:02 +00:00