Commit Graph

266371 Commits

Author SHA1 Message Date
Colin Percival
e193d3ba33 libsa: Add support for timestamp logging (tslog)
At present this only supports x86, due to the use of the rdtsc
instruction; and is inert unless a buffer is allocated and passed to
the tslog code (which will be done by a future commit).

Reviewed by:	kevans
2021-06-20 20:09:42 -07:00
Colin Percival
60a978bec9 stand/common: Add file_addbuf()
This provides an interface for a memory buffer to be passed from the loader
to the kernel as a "preloaded module".

Reviewed by:	kevans
2021-06-20 20:09:41 -07:00
Warner Losh
4afa62be71 cam: Set the CAM_QOS_VALID when valid
When the elapsed time of the operation is complete and stored in the QOS
field, set the CAM_QOS_VALID bit.  In iosched, test to make sure it's
set before using it.

Sponsored by:		Netflix
2021-06-20 19:14:13 -06:00
Mike Karels
13604fb0fd genet: Fix potential crash during attach
As pointed out in the bug, the genet driver (RPi4 Ethernet) was
attaching the interrupts before the data structures were fully
initialized, causing a crash if an interrupt came in during the
attach.  Fix by reordering code blocks.

PR:		256334
Reported by:	< ghuckriede at blackberry.com >
Reviewed by:	< ghuckriede at blackberry.com > (informally)
MFC after:	3 days
2021-06-20 11:17:13 -05:00
Martin Matuska
9d1cafb304 zfs: add version update missing in 0d8fe2373 2021-06-20 10:04:52 +02:00
Martin Matuska
0d8fe23735 zfs: merge openzfs/zfs@c4c162c1e (master) into main
Notable upstream pull request merges:
  #12054 Avoid deadlock when removing L2ARC devices under I/O
  #12172 Use wmsum for arc, abd, dbuf and zfetch statistics
  #12221 vdev_draid_min_asize() ignores reserved space

Obtained from:	OpenZFS
OpenZFS commit:	c4c162c1e8
2021-06-20 09:18:44 +02:00
Alan Somers
5403f2c163 fusefs: ensure that FUSE ops' headers' unique values are actually unique
Every FUSE operation has a unique value in its header.  As the name
implies, these values are supposed to be unique among all outstanding
operations.  And since FUSE_INTERRUPT is asynchronous and racy, it is
desirable that the unique values be unique among all operations that are
"close in time".

Ensure that they are actually unique by incrementing them whenever we
reuse a fuse_dispatcher object, for example during fsync, write, and
listextattr.

PR:		244686
MFC after:	2 weeks
Reviewed by:	pfg
Differential Revision: https://reviews.freebsd.org/D30810
2021-06-19 14:45:29 -06:00
Alan Somers
77b040c993 fusefs: also debug INIT operations in the test suite
MFC after:	2 weeks
Reviewed by:	pfg
2021-06-19 14:45:21 -06:00
Alan Somers
b97c7abc1a fusefs: delete dead code
It was always dead, accidentally included in SVN r345876.

MFC after:	2 weeks
Reviewed by:	pfg
2021-06-19 14:45:04 -06:00
Lutz Donnerhacke
d261e57dea libalias: Switch to efficient data structure for incoming traffic
Current data structure is using a hash of unordered lists.  Those
unordered lists are quite efficient, because the least recently
inserted entries are most likely to be used again.  In order to avoid
long search times in other cases, the lists are hashed into many
buckets.  Unfortunatly a search for a miss needs an exhaustive
inspection and a careful definition of the hash.

Splay trees offer a similar feature: Almost O(1) for access of the
least recently used entries, and amortized O(ln(n)) for almost all
other cases.  Get rid of the hash.

Now the data structure should able to quickly react to external
packets without eating CPU cycles for breakfast, preventing a DoS.

PR:		192888
Discussed with:	Dimitry Luhtionov
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30536
2021-06-19 22:12:28 +02:00
Lutz Donnerhacke
935fc93af1 libalias: Switch to efficient data structure for outgoing traffic
Current data structure is using a hash of unordered lists.  Those
unordered lists are quite efficient, because the least recently
inserted entries are most likely to be used again.  In order to avoid
long search times in other cases, the lists are hashed into many
buckets.  Unfortunatly a search for a miss needs an exhaustive
inspection and a careful definition of the hash.

Splay trees offer a similar feature - almost O(1) for access of the
least recently used entries), and amortized O(ln(n) - for almost all
other cases.  Get rid of the hash.

Discussed with:	Dimitry Luhtionov
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30516
2021-06-19 22:09:44 +02:00
Lutz Donnerhacke
d989935b5b libalias: Restructure - Finalize
Note, that the restructuring is done.

MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30582
2021-06-19 21:58:56 +02:00
Lutz Donnerhacke
fe83900f9f libalias: Restructure - Remove temporary state deleteAllLinks from global struct
The entry deleteAllLinks in the struct libalias is only used to signal
a state between internal calls.  It's not used between API calls.

MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30604
2021-06-19 21:55:11 +02:00
Lutz Donnerhacke
9efcad61d8 libalias: Restructure - Use AliasRange instead of PORT_BASE
Get rid of PORT_BASE, replace by AliasRange. Simplify code.
Factor out the search for a new port. Improves the perfomance a bit.

Discussed with:	Dimitry Luhtionov
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30581
2021-06-19 21:40:09 +02:00
Lutz Donnerhacke
1178dda53d libalias: Restructure - Table for PPTP
Let PPTP use its own data structure.
Regroup and rename other lists, which are not PPTP.

MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30580
2021-06-19 21:26:31 +02:00
Lutz Donnerhacke
7b44ff4c52 libalias: Restructure - Group expire handling entries
Reorder the internal structure semantically.

MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30575
2021-06-19 21:12:27 +02:00
Lutz Donnerhacke
492d3b7109 libalias: Restructure - Group incoming links
Reorder incoming links by grouping of common search terms.
Significant performance improvement for incoming (missing) flows.

Remove LSNAT from outgoing search.
Slight speedup due to less comparsions in the loop.

MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30574
2021-06-19 21:03:47 +02:00
Lutz Donnerhacke
d4ab07d2ae libalias: Restructure - Cleanup and Use for links
Factor out a common idiom to return found links.

MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30573
2021-06-19 20:28:53 +02:00
Lutz Donnerhacke
d541903438 libalias: Restructure - Outgoing search
Factor out the outgoing search function.
Preparation for a new data structure.

MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30572
2021-06-19 20:25:08 +02:00
Lutz Donnerhacke
19dcc4f225 libalias: Restructure - Cleanup _FindLinkIn
Simplify program flow in function _FindLinkIn.

MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30571
2021-06-19 20:19:16 +02:00
Dimitry Andric
23408297fb Merge llvm-project 12.0.1 rc2
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12.0.1-rc2-0-ge7dac564cd0e, a.k.a. 12.0.1 rc2.

PR:		255570
MFC after:	6 weeks
2021-06-19 20:09:28 +02:00
Lutz Donnerhacke
cac129e603 libalias: Restructure - Table for partially links
Separate the partially specified links into a separate data structure.

This would causes a major parformance impact, if there are many of
them.  Use a (smaller) hash table to speed up the partially link
access.

MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30570
2021-06-19 20:03:08 +02:00
Richard Scheffenegger
74d7fc8753 tcp: Add PRR cwnd reduction for non-SACK loss
This completes PRR cwnd reduction in all circumstances
for the base TCP stack (SACK loss recovery, ECN window reduction,
non-SACK loss recovery), preventing the arriving ACKs to
clock out new data at the old, too high rate. This
reduces the chance to induce additional losses while
recovering from loss (during congested network conditions).

For non-SACK loss recovery, each ACK is assumed to have
one MSS delivered. In order to prevent ACK-split attacks,
only one window worth of ACKs is considered to actually
have delivered new data.

MFC after: 6 weeks
Reviewed By: rrs, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29441
2021-06-19 19:25:22 +02:00
Lutz Donnerhacke
32f9c2ceb3 libalias: Restructure - Separate fully qualified search
Search fully specified links first.  Some performance loss due to need
to revisit the db twice, if not found.

MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30569
2021-06-19 19:21:05 +02:00
Emmanuel Vadot
3386347f65 mmc_sim: Make XPT_MMC_GET_TRAN_SETTINGS fully async
Sponsored by:	Diablotin Systems
2021-06-19 19:15:25 +02:00
Emmanuel Vadot
6506efea63 mmccam: Read the common members of CSD v1.0 and v2.0
And only get the differents ones based on the version.

No functional changes intented.

Sponsored by:	Diablotin Systems
2021-06-19 19:06:54 +02:00
Emmanuel Vadot
20d601682e mmccam: Style(9) more mmc_da.c
No functional changes.
Sponsored by:	Diablotin Systems
2021-06-19 19:06:54 +02:00
Lutz Donnerhacke
d41044ddfd libalias: Restructure - Common search terms
Factor out the common Out and In filter
Slightly better performance due to eager skip of search loop

MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30568
2021-06-19 18:58:52 +02:00
Lutz Donnerhacke
ef828d39be libalias: Promote per instance global variable timeStamp
Summary:
- Use LibAliasTime as a real global variable for central timekeeping.
- Reduce number of syscalls in user space considerably.
- Dynamically adjust the packet counters to match the second resolution.
- Only check the first few packets after a time increase for expiry.

Discussed with:	hselasky
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30566
2021-06-19 18:25:44 +02:00
Lutz Donnerhacke
3fd20a79e7 libalias: Stats are unsigned
Stats counters are used as unsigned valued (i.e. printf("%u")) but are
defined as signed int.  This causes trouble later, so fix it early.

MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30587
2021-06-19 18:21:17 +02:00
Emmanuel Vadot
ed0a582d88 pkgbase: Put the last sendmail files in the sendmail package
Differential Revision:	https://reviews.freebsd.org/D30757
Sponsored by:	Diablotin Systems
2021-06-19 17:50:11 +02:00
Emmanuel Vadot
af5e40770e pkgbase: Put the mibs and defs in the bnsmp package
Differential Revision:	https://reviews.freebsd.org/D30756
Sponsored by:	Diablotin Systems
2021-06-19 17:50:03 +02:00
Emmanuel Vadot
c42e9af5f1 pkgbase: Move ctld/ctladm to iscsi package
While here only compile both of them if WITH_ISCSI is set (this is the default).

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D30755
Sponsored by:	Diablotin Systems
2021-06-19 17:49:57 +02:00
Emmanuel Vadot
081fb64492 pkgbase: Create a FreeBSD-nfs package
And move all the nfs related commands there.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D30754
Sponsored by:	Diablotin Systems
2021-06-19 17:49:50 +02:00
Emmanuel Vadot
2c733106ae pkgbase: Put chio in utilities
No need to bloat runtime with this utility.

Differential Revision:	https://reviews.freebsd.org/D30753
Sponsored by:	Diablotin Systems
2021-06-19 17:49:44 +02:00
Emmanuel Vadot
79ac3c12a7 pkgbase: Put dtrace in its own package
While dtrace is usefull some people might not want it.

Differential Revision:	https://reviews.freebsd.org/D30752
Sponsored by:	Diablotin Systems
2021-06-19 17:49:31 +02:00
Emmanuel Vadot
395d907e61 regulator: Add manpage for this framework
Reviewed by:	imp, mmel
Differential Revision:	https://reviews.freebsd.org/D30762
Sponsored by:	Diablotin Systems
2021-06-19 17:42:43 +02:00
Warner Losh
0febdc5ed5 NOTES: Improve wording
jhb@ pointed out an extra plural in this phrase and a gramatical error,
so reword a little to be less awkward to fix both issues.

Sponsored by:		Netflix
2021-06-19 08:56:58 -06:00
Stefan Eßer
84f35b6f86 sbin/md5: add md5sum to synopsis in the man-page
When invoked with "sum" following the hash name, the -c option takes a
file argument, not a string argument.
2021-06-19 13:27:16 +02:00
Ka Ho Ng
210e6aec4f vmm: Fix ivrs_drv device_printf usage
The original %b description string is wrong.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	imp, jhb
Differential Revision:	https://reviews.freebsd.org/D30805
2021-06-19 14:07:26 +08:00
Peter Holm
3f770843d5 stress2: Add snap8.sh back on the exclude list 2021-06-19 07:03:25 +02:00
Bjoern A. Zeeb
5f88df77a6 LinuxKPI: fix build after d4a4960c65 pci: "pcim" (managed) support
Fix a last minute change from d4a4960c65
based on review feedback in where a function now gets called before
it is declared which did not fully get merged back to my commit branch.

Noticed by:	CI, jkim
MFC after:	10 days
X-MFC with:	d4a4960c65
Sponsored-by:	The FreeBSD Foundation
2021-06-18 22:49:12 +00:00
Bjoern A. Zeeb
41dfd8bd64 Bump __FreeBSD_version to 1400024 for LinuxKPI change. 2021-06-18 21:32:13 +00:00
Bjoern A. Zeeb
46ae23a402 LinuxKPI: avoid userret: Returning with with pinned thread
Some code manually calls local_bh_disable() and spin_lock() but
then calls spin_unlock_bh() (or vice versa).
Our code then calls local_bh_disable() again from spin_lock()
which means we have the thread pin count increased twice and that
means we get out of synch and are still pinned when returning to
user space.

Avoid this by adding the explicit local_bh_{enable,disable}() to
the spin_[un]lock_bh() versions.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D30711
2021-06-18 21:20:10 +00:00
Bjoern A. Zeeb
edfcdffefc LinuxKPI: fix sg_pcopy_from_buffer()
In sg_pcopy_from_buffer() is an error in that skip can underflow
and lead to bogus page arithmetics which may lead to memory corruption
or more likely panics.  Once we found a s/g page to copy into there
is nothing to skip anymore so simply set skip to 0.

Sponsored by:	The FreeBSD Foundation
MFC after:	5 days
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D30676
2021-06-18 21:20:10 +00:00
Bjoern A. Zeeb
d4a4960c65 LinuxKPI: pci: cleanup some code and add support for "pcim" (managed)
Restructure some code and add support for various "managed" versions
for PCI resource management.
This is beyond of what iwlwifi needs but some was found with other
wireless drivers and it mostly all goes together.
Add one FreeBSD sepcific feature returning the resource rather than
the handle to allow us to use bus_*() functions in drivers directly.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D30558
2021-06-18 21:20:09 +00:00
Bjoern A. Zeeb
c3518147ce LinuxKPI: fix pci device devres initialisation
Given we are manually setting up the "device" in PCI in some cases,
we need to initialise the list and lock for device devres here as well
as otherwise we will panic on the uninitialised lock.

Sponsored by:	The FreeBSD Foundation
MFC after:	5 days
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D30681
2021-06-18 21:20:09 +00:00
Bjoern A. Zeeb
d16b6cb178 LinuxKPI: enhance the irq KPI for managed and threaded operations.
Move request_irq() to an internal function which serves request_irq()
and the newly added request_threaded_irq() and devm_request_threaded_irq().
Likewise factor out parts of free_irq() to also be used with
devm_free_irq().  Add the storage and call to a thread_handler in case
of IRQ_WAKE_THREAD.
This is needed for the iwlwifi driver.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D30549
2021-06-18 21:20:09 +00:00
Bjoern A. Zeeb
8e106c5230 LinuxKPI: extend pci.h by various functions for wireless driver
Add dummy functions for dealing with "HotPlug" events which we currently
do not support.

Add pci_dev_get(), pci_find_ext_capability() and pci_pme_capable().

The added pcie_find_root_port() is a bit special as we need to create
another linux pci device;  for that make lkpinew_pci_dev() public
which is also helpful for other cases when we want to use the Linux
routines to check for device identifiers only and need a container
for the "bsddev" to use natively.  This has proven to avoid basic
checking code for the sake of rewriting it to native field names
elsewhere.  Given we cache the newly created "root" we also need to
make sure we clean it up.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D30521
2021-06-18 21:20:09 +00:00
Bjoern A. Zeeb
2afeed13b5 LinuxKPI: add dmam_pool_create() support
dmam_pool_create() is a "managed" version of dma_pool_create() which
will cleanup everything left when the device goes away using the
devres framework.  For that add an internal cleanup function to be
called from devres release.
This is used by at least one wireless driver.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D30520
2021-06-18 21:20:09 +00:00