Commit Graph

258442 Commits

Author SHA1 Message Date
Edward Tomasz Napierala
95a74ab4fb nvmecontrol: fix typo (s/Managment/Management/)
Reported By:	pstef
2021-05-07 13:12:30 +01:00
Fedor Uporov
c40a160fd0 Make inode extra time fields updating logic more closer to linux.
Found using pjdfstest:
pjdfstest/tests/utimensat/09.t

Reviewed by:    pfg
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D29933
2021-05-07 10:46:55 +03:00
Fedor Uporov
b3f4665639 Invalidate inode extents cache on truncation.
It is needed to invalidate cache in case of inode space removal
to avoid situation, when extents cache returns not exist extent.

Reviewed by:    pfg
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D29931
2021-05-07 10:27:37 +03:00
Fedor Uporov
5679656e09 Improve extents verification logic.
It is possible to walk thru inode extents if EXT2FS_PRINT_EXTENTS
macro is defined. The extents headers magics and physical blocks
ranges are checked during extents walk.

Reviewed by:    pfg
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D29932
2021-05-07 10:27:28 +03:00
Andriy Gapon
8afecefd57 storvsc: fix auto-sense reporting
I saw a situation where the driver set CAM_AUTOSNS_VALID on a failed ccb
even though SRB_STATUS_AUTOSENSE_VALID was not set in the status.
The actual sense data remained all zeros.
The problem seems to be that create_storvsc_request() always sets
hv_storvsc_request::sense_info_len, so checking for sense_info_len != 0
is not enough to determine if any auto-sense data is actually available.

Reviewed by:	whu, imp
MFC after:	2 weeks
Sponsored by:	CyberSecure
Differential Revision:	https://reviews.freebsd.org/D30124
2021-05-07 10:17:57 +03:00
Fedor Uporov
1ed5f62d61 Add chr/blk devices support.
The dev field is placed into the inode structure.
The major/minor numbers conversion to/from linux compatile
format happen during on-disk inodes writing/reading.

Reviewed by:    pfg
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D29930
2021-05-07 10:08:31 +03:00
Fedor Uporov
1484574843 Fix inode birthtime updating logic.
The birthtime field of struct vattr does not checked
for VNOVAL in case of ext2_setattr() and produce incorrect
inode birthtime values.

Found using pjdfstest:
    pjdfstest/tests/utimensat/03.t

Reviewed by:    pfg
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D29929
2021-05-07 10:08:20 +03:00
Alfredo Dal'Ava Junior
fb53b42e36 virtio-modern: fix PCI common read/write functions on big endian targets
Virtio modern has the common data organized in little endian, but
on powerpc64 BE it was reading and writing in the wrong endian.

Submitted by:	Leonardo Bianconi <leonardo.bianconi@eldorado.org.br>
Reviewed by:	bryanv, alfredo
Sponsored by:	Eldorado Research Institute (eldorado.org.br)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D28947
2021-05-07 02:40:35 -03:00
Marcin Wojtas
d5b20eaafc sdhci_fsl_fdt: specify base clk divisor per SoC
Only LS1046A and LS1028A require the base clk to be divided by 2.
Implement that by moving the divider to a SoC specific data.
This commit fixes base clk setup for the entire SoC family,
including the already suported LS2160A.

Submitted by: Lukasz Hajec <lha@semihalf.com>
Reviewed by: manu
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D30120
2021-05-07 03:48:54 +02:00
Marcin Wojtas
4dfb620ea4 Add LS1028A clockgen driver
The new driver provides probe and attach functions for the NXP LS1028A
clockgen and passes configuration information to QorIQ clockgen class.

Submitted by: Lukasz Hajec <lha@semihalf.com>
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D30125
2021-05-07 03:48:53 +02:00
Cy Schubert
ce9de47260 sqlite3: import sqlite3 3.35.5
Merge commit '0511e356f5e2106928ee352ee974d1470c860a9a' into new_merge

Changes at https://www.sqlite.org/releaselog/3_35_5.html.

MFC after:      1 month
2021-05-06 18:01:44 -07:00
Warner Losh
42f3faa762 cdefs.h: Remove __GNUCLIKE___OFFSETOF, it's unused
__GNUCLIKE___OFFSETOF is unreferenced in the tree, remove it as long
obsolete.

Sponsored by:		Netflix
2021-05-06 16:34:55 -06:00
Warner Losh
a709a4f0d4 headers: Implement _ISOC11_SOURCES macro when __POSIX_C_SOURCE defined
When _ISOC11_SOURCES is defined for glibc at the same time
__POSIX_C_SOURCE is defined, it extends the __POSIX_C_SOURCE definition
by exaclty what C11 adds to the spec for each system header.  We follow
both OpenBSD's and glibc's convention by also C11 or higher compliation
mode is selected.

The Open Group is working on issuing a new version of the POSIX standard
that will realign the standard from C99 to a newer version of C. This
commit is a stop-gap measure for greater compatibility until that
environment has been standardized.

Reviewed by:		brooks@, arichards@, Olivier Certne
			(comments tweaked before commit)
PR:			255290
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D29902
2021-05-06 16:20:36 -06:00
Warner Losh
6d6cca3633 nvmecontrol: update copyright on passthru command
I wrote this code, not Intel, so put my copyright on this. I mistakenly
copied it for the initial commit.

Sponsored by:		Netflix
2021-05-06 16:09:31 -06:00
Warner Losh
510a3da147 nvmecontrol: Report status from passthru commands
Report status from dword0 for passthru commands. Many commands report
some status or information here, so reporting it can help know what's
going on.

Sponsored by:		Netflix
2021-05-06 16:09:31 -06:00
Cy Schubert
0511e356f5 sqlite3: Vendor import of sqlite3 3.35.5
Changes at https://www.sqlite.org/releaselog/3_35_5.html.
2021-05-06 13:14:13 -07:00
Cy Schubert
8b10604cd1 Revert "sqlite3: Vendor import of sqlite3 3.35.5"
The source to be used should be sqlite-autoconf-3350500.tar.gz
instead of the souce sqlite-amalgamation-3350500.zip used by
the port.

This reverts commit eccd5a4d39.
2021-05-06 13:08:52 -07:00
Warner Losh
e713d3a013 boot: fix OBJS to not include BTX's crt0.o
According to comments in the Makefile, to make pxeboot work we need to
have crt0.o first. This is needed because the simplified loader in
pxeboot assumes that the startup code is at offset 0 in this binary. In
normal booting, the start address can be obtained from headers of the
binary, but since pxeboot encodes this as a pure binary, it has no way
of knowing where that is and assumes 0. Added comments to that effect
in the Makefile.

We've done this by adding it to OBJS before all the other .o's are
added. However, there's a problem. This also adds it to the CLEANFILES
variable, which causes it to be removed from multiple places. The
dependencies may also cause it to be re-built at a time that's after
boot2 is built. This causes installs to fail because at install time
boot2 is considered to be out of date and the programs to rebuild it are
no longer in the path.

Cope with this problem by just adding it to LDFLAGS instead.

Glanced at by:		kevans ("I thought that went in ages ago")
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D28876
2021-05-06 13:08:30 -06:00
Andriy Gapon
12588ce02d PCI hot-plug: use dedicated taskqueue for device attach / detach
Attaching and detaching devices can be heavy-weight and detaching can
sleep waiting for events.  For that reason using the system-wide
single-threaded taskqueue_thread is not really appropriate.
There is even a possibility for a deadlock if taskqueue_thread is used
for detaching.

In fact, there is an easy to reproduce deadlock involving nvme, pass
and a sudden removal of an NVMe device.
A pass peripheral would not release a reference on an nvme sim until
pass_shutdown_kqueue() is executed via taskqueue_thread.  But the
taskqueue's thread is blocked in nvme_detach() -> ... -> cam_sim_free()
because of the outstanding reference.

MFC after:	10 days
Sponsored by:	CyberSecure
Reviewed by:	mav, imp
Differential Revision:	https://reviews.freebsd.org/D30144
2021-05-06 21:49:37 +03:00
Alan Somers
420dbe763f gmultipath: make physpath distinct from the underlying providers'
zfsd uses a device's physical path attribute to automatically replace a
missing ZFS disk when a blank disk is inserted into the same physical
slot.  Currently gmultipath passes through its underlying providers'
physical path attribute.  That may cause zfsd to replace a missing
gmultipath provider with a newly arrived, single-path disk.  That would
be bad.

This commit fixes that problem by simply appending "/mp" to the
underlying providers' physical path, in a manner similar to what geli
already does.

Sponsored by:	Axcient
MFC after:	3 weeks
Differential Revision: https://reviews.freebsd.org/D29941
2021-05-06 12:32:27 -06:00
Gleb Smirnoff
be578b67b5 tcp_twcheck(): use correct unlock macro.
This crippled in due to conflict between two last commits 1db08fbe3f
and 9e644c2300.

Submitted by:	Peter Lei
2021-05-06 10:19:21 -07:00
Randall Stewart
5d8fd932e4 This brings into sync FreeBSD with the netflix versions of rack and bbr.
This fixes several breakages (panics) since the tcp_lro code was
committed that have been reported. Quite a few new features are
now in rack (prefecting of DGP -- Dynamic Goodput Pacing among the
largest). There is also support for ack-war prevention. Documents
comming soon on rack..

Sponsored by:           Netflix
Reviewed by:		rscheff, mtuexen
Differential Revision:	https://reviews.freebsd.org/D30036
2021-05-06 11:22:26 -04:00
Andrew Turner
0ec3e99111 Use '.arch_extension crc' in the arm64 crc32 code
We don't care about the base architecture here, just that the crc
extension is enabled.

Sponsored by:	Innovate UK
2021-05-06 07:42:35 +00:00
Edward Tomasz Napierala
916f3dba45 linux(4): make arch_prctl(2) support GET_CET_STATUS, report unknown codes
This is largely a no-op, to make future debugging slightly easier.

Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D30035
2021-05-06 09:33:42 +01:00
Cy Schubert
eccd5a4d39 sqlite3: Vendor import of sqlite3 3.35.5
Changes at https://www.sqlite.org/releaselog/3_35_5.html.
2021-05-05 22:35:02 -07:00
Justin Hibbits
49c894ddce powerpc64: Split out DMAP and non-DMAP implementations of some methods
Summary:
Some methods are split between DMAP and non-DMAP, conditional on
hw_direct_map variable.  Rather than checking this variable every time,
use it to install different functions via IFUNCs.

Reviewed By: luporl
Differential Revision: https://reviews.freebsd.org/D30071
2021-05-05 20:57:33 -05:00
Justin Hibbits
6640579610 msun fixes for SPE
Summary:
Fix FPU exception management for powerpcspe.  Bits are in a different place from
the standard FPSCR, so we need to handle the shifting differences.  Also,
there's no concept of a "software exception" raise, so we need to do exceptional
math to trigger the exception from software.

Reviewed By: alfredo
Differential Revision: https://reviews.freebsd.org/D22824
2021-05-05 20:57:33 -05:00
Michael Tuexen
d1cb8d11b0 sctp: improve consistency when handling chunks of wrong size
MFC after:	3 days
2021-05-06 01:02:41 +02:00
Warner Losh
097e8701c9 fix style nit: space after if 2021-05-05 15:26:09 -06:00
Warner Losh
d00aff6278 provide easy way to disable kld_list loading
set kld_disbale=y or any value in the boot loader and that will
disable loading of the kld_list.

Differential Revision: https://reviews.freebsd.org/D26939
2021-05-05 15:19:41 -06:00
Warner Losh
f009aedae4 bsnmpd: Return the correct uptime.
Do not assume that the kernel boot time is invariant. It is not. FreeBSD
uses the formula:
	wall_time = boot_time + uptime
where uptime is monotinically increasing and boot_time is adjusted to
get the proper time of day.  FreeBSD offers a way to retrieve the uptime
directly, so use that instead of trying to compute it by subtracting
boot_time from wall_time.

Sponsored by:		Netflix
Reviewed by:		cy@
Differential Revision:	https://reviews.freebsd.org/D30114
2021-05-05 15:12:38 -06:00
Mark Johnston
6c34dde83e igmp: Avoid an out-of-bounds access when zeroing counters
When verifying, byte-by-byte, that the user-supplied counters are
zero-filled, sysctl_igmp_stat() would check for zero before checking the
loop bound.  Perform the checks in the correct order.

Reported by:	KASAN
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-05-05 17:12:51 -04:00
Mark Johnston
9a7c2de364 realloc: Fix KASAN(9) shadow map updates
When copying from the old buffer to the new buffer, we don't know the
requested size of the old allocation, but only the size of the
allocation provided by UMA.  This value is "alloc".  Because the copy
may access bytes in the old allocation's red zone, we must mark the full
allocation valid in the shadow map.  Do so using the correct size.

Reported by:	kp
Tested by:	kp
Sponsored by:	The FreeBSD Foundation
2021-05-05 17:12:51 -04:00
John Baldwin
1b2806931a src.conf.5: Regen.
Reviewed by:	emaste
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D30107
2021-05-05 14:11:33 -07:00
John Baldwin
0ac711e07e Add a description for WITH_SVNLITE.
Reviewed by:	emaste
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D30106
2021-05-05 14:11:32 -07:00
John Baldwin
a2bc17474b Disable building svnlite(1) by default.
Now that all repositories have switched to git, initiate the de-orbit
burn for svnlite(1).

Reviewed by:	emaste
MFC after:	1 month
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D30105
2021-05-05 14:11:13 -07:00
John Baldwin
9c87db4b3c Group all compat shim structures together to consolidate #ifdef's.
Reviewed by:	brooks, kib
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D29894
2021-05-05 13:59:09 -07:00
John Baldwin
01e9cbc4c5 Use thunks for compat ioctls using struct ifgroupreq.
Reviewed by:	brooks, kib
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D29893
2021-05-05 13:59:00 -07:00
John Baldwin
d61d98f4ed Add freebsd32 compat shims for SIOC[GS]DRVSPEC.
Reviewed by:	brooks, kib
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D29892
2021-05-05 13:58:50 -07:00
John Baldwin
d17e0940f7 Rework compat shims in ifioctl().
Centralize logic for handling compat ioctls into two blocks of code at
the start and end of the ioctl routine.  This avoids the conversion
logic being spread out both in multiple blocks in ifioctl as well as
various helper functions.

Reviewed by:	brooks, kib
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D29891
2021-05-05 13:58:23 -07:00
Warner Losh
a512d0ab00 kern: clarify boot time
In FreeBSD, the current time is computed from uptime + boottime. Uptime
is a continuous, smooth function that's monotonically increasing. To
effect changes to the current time, boottime is adjusted.  boottime is
mutable and shouldn't be cached against future need. Document the
current implementation, with the caveat that we may stop stepping
boottime on resume in the future and will step uptime instead (noted in
the commit message, but not in the code).

Sponsored by:		Netflix
Reviewed by:		phk, rpokala
Differential Revision:	https://reviews.freebsd.org/D30116
2021-05-05 12:32:13 -06:00
Warner Losh
cb58805943 cam: Add doxygen docs to cam_sim_alloc
Add description for what each of the parameters are to the cam_sim_alloc
call. Add some additional context for the mtx and queue parameters to
explain what special values passed in mean.

MFC After:		3 days
Reviewed by:		mav@
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D30115
2021-05-05 11:44:39 -06:00
Ka Ho Ng
4e1e1d667f virtio_blk: Fix issuing T_GET_ID before DRIVER_OK status
DRIVER_OK status is set after device_attach() succeeds. For now postpone
disk_create to attach_completed() method.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Reviewed by:	grehan
Approved by:	lwhsu (mentor)
Differential Revision:	https://reviews.freebsd.org/D30049
2021-05-05 23:22:16 +08:00
Ed Maste
cec2682cd2 Restore Cirrus-CI boot smoke test
This reverts commit a7d593dd1d.
We now use compute_engine_instance which allows us to specify a custom
disk size.  Also go back to using the default qemu version (rather than
qemu42 or qemu-devel) as any issues were fixed some time ago.

Reviewed by:	lwhsu, markj
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30082
2021-05-05 10:05:58 -04:00
Edward Tomasz Napierala
5e8caee259 linux: remove redundant SDT tracepoints
Remove all the 'entry' and 'return' probes; they clutter up the source
and are redundant to FBT.

Reviewed By:	dchagin
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D30040
2021-05-05 13:59:00 +01:00
Marko Zec
2aca58e16f Introduce DXR as an IPv4 longest prefix matching / FIB module
DXR maintains compressed lookup structures with a trivial search
procedure.  A two-stage trie is indexed by the more significant bits of
the search key (IPv4 address), while the remaining bits are used for
finding the next hop in a sorted array.  The tradeoff between memory
footprint and search speed depends on the split between the trie and
the remaining binary search.  The default of 20 bits of the key being
used for trie indexing yields good performance (see below) with
footprints of around 2.5 Bytes per prefix with current BGP snapshots.

Rebuilding lookup structures takes some time, which is compensated for by
batching several RIB change requests into a single FIB update, i.e. FIB
synchronization with the RIB may be delayed for a fraction of a second.
RIB to FIB synchronization, next-hop table housekeeping, and lockless
lookup capability is provided by the FIB_ALGO infrastructure.

DXR works well on modern CPUs with several MBytes of caches, especially
in VMs, where is outperforms other currently available IPv4 FIB
algorithms by a large margin.

Synthetic single-thread LPM throughput test method:

kldload test_lookup; kldload dpdk_lpm4; kldload fib_dxr
sysctl net.route.test.run_lps_rnd=N
sysctl net.route.test.run_lps_seq=N

where N is the number of randomly generated keys (IPv4 addresses) which
should be chosen so that each test iteration runs for several seconds.

Each reported score represents the best of three runs, in million
lookups per second (MLPS), for two bechmarks (RND & SEQ) with two FIBs:

host: single interface address, local subnet route + default route
BGP: snapshot from linx.routeviews.org, 887957 prefixes, 496 next hops

Bhyve VM on an Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60 GHz:
inet.algo         host, RND    host, SEQ    BGP, RND    BGP, SEQ
bsearch4             40.6         20.2         N/A         N/A
radix4                7.8          3.8         1.2         0.6
radix4_lockless      18.0          9.0         1.6         0.8
dpdk_lpm4            14.4          5.0        14.6         5.0
dxr                  70.3         34.7        43.0        19.5

Intel(R) Core(TM) i5-5300U CPU @ 2.30 GHz:
inet.algo         host, RND    host, SEQ    BGP, RND    BGP, SEQ
bsearch4             47.0         23.1         N/A         N/A
radix4                8.5          4.2         1.9         1.0
radix4_lockless      19.2          9.5         2.5         1.2
dpdk_lpm4            31.2          9.4        31.6         9.3
dxr                  84.9         41.4        51.7        23.6

Intel(R) Core(TM) i7-4771 CPU @ 3.50 GHz:
inet.algo         host, RND    host, SEQ    BGP, RND    BGP, SEQ
bsearch4             59.5         29.4         N/A         N/A
radix4               10.8          5.5         2.5         1.3
radix4_lockless      24.7         12.0         3.1         1.6
dpdk_lpm4            29.1          9.0        30.2         9.1
dxr                 101.3         49.9        69.8        32.5

AMD Ryzen 7 3700X 8-Core Processor @ 3.60 GHz:
inet.algo         host, RND    host, SEQ    BGP, RND    BGP, SEQ
bsearch4             70.8         35.4         N/A         N/A
radix4               14.4          7.2         2.8         1.4
radix4_lockless      30.2         15.1         3.7         1.8
dpdk_lpm4            29.9          9.0        30.0         8.9
dxr                 163.3         81.5        99.5        44.4

AMD Ryzen 5 5600X 6-Core Processor @ 3.70 GHz:
inet.algo         host, RND    host, SEQ    BGP, RND    BGP, SEQ
bsearch4             93.6         46.7         N/A         N/A
radix4               18.9          9.3         4.3         2.1
radix4_lockless      37.2         18.6         5.3         2.7
dpdk_lpm4            51.8         15.1        51.6        14.9
dxr                 218.2        103.3       114.0        49.0

Reviewed by:	melifaro
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D29821
2021-05-05 13:45:52 +02:00
Marko Zec
a43104ebe7 Revise FIB lookups per second benchmarking routines.
Add a LPS benchmark variant which introduces artificial dependencies
between successive lookups. While here, instead of writing the results
from the lookups to a huge array, add them to an accumulator, in a more
lightweight attempt at preventing the CPU's OOO machinery from
discarding the lookup results if they would be completely unused.

net.route.test.run_lps_rnd measures LPS throughput with independent
uniformly random keys

net.route.test.run_lps_seq measures LPS throughput with uniformly
random keys with artificial interdependencies
Reviewed by:	melifaro
MFC after:	7 days
Differential Revision: https://reviews.freebsd.org/D30096
2021-05-05 12:28:17 +02:00
Warner Losh
122a8c7eb1 param.h: Fix typos
Submitted by:		rpokala@
Sponsored by:		Netflix
2021-05-05 00:50:35 -06:00
Warner Losh
9e0ba9536b param.h: Document __FreeBSD_version better
Document what __FreeBSD_version means a bit better by documenting the
sorts of events it should be bumped for. Also include a handy shorthand
for what it means. Add a some advice for how frequently to change this
as well.

Added a note about the approved way to parse this from the param.h file,
though that was not in the review. All in-tree users have been updated
to this method prior to this commit. Move and reword the comment that
was on the same line.

Suggestions by:		greg@unrelenting, arch@
Reviewed by:		rgrimes@ (earlier version).
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D29850
2021-05-05 00:33:56 -06:00
Navdeep Parhar
f4ba035bca cxgbe(4): Use ifaddr_event_ext instead of ifaddr_event for CLIP management.
The _ext event notification includes the address being added/removed and
that gives the driver an easy way to ignore non-IPv6 addresses.  Remove
'tom' from the handler's name while here, it was moved out of t4_tom a
long time ago.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2021-05-04 20:16:25 -07:00