Commit Graph

266731 Commits

Author SHA1 Message Date
Mateusz Guzik
48d5b86364 pf: make DIOCGETSTATESNV iterations killable
Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-07-02 08:30:22 +00:00
Mateusz Guzik
904a08f342 ktls: switch bare zone_mbuf use to m_free_raw
Reviewed by:	gallatin
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30955
2021-07-02 08:30:22 +00:00
Mateusz Guzik
bad5f0b6c2 iflib: switch bare zone_mbuf use to m_free_raw
Reviewed by:	kbowling
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30961
2021-07-02 08:30:22 +00:00
Mateusz Guzik
05462babd4 mbuf: add m_free_raw to be used instead of directly calling uma_zfree
The intent is to remove all direct zone_mbuf consumers so that ctor/dtor
from that zone can be reimplemented as wrappers around uma, avoiding an
indirect function call.

Reviewed by:	kbowling
Discussed with:	gallatin
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30959
2021-07-02 08:30:22 +00:00
Mateusz Guzik
fb32c8dbeb iflib: retire MB_DTOR_SKIP
The flag was added in 2016 but remains unused.

Reviewed by:	kbowling
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30958
2021-07-02 08:30:22 +00:00
Alex Richardson
2eb9ad4274 Simplify and speed up the kyua build
Instead of having multiple kyua libraries, just include the files as part
of usr.bin/kyua. Previously, we would build each kyua source up to four
times: once as a .o file and once as a .pieo. Additionally, the kyua
libraries might be built again for compat32. As all the kyua libraries
amount to 102 C++ sources the build time is significant (especially when
using an assertions enabled compiler). This change ensures that we build
306 fewer .cpp source files as part of buildworld.

Reviewed By:	brooks
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30967
2021-07-02 09:21:05 +01:00
Edward Tomasz Napierala
acb1f1269c proccontrol(1): implement 'nonewprivs'
This adds the 'nonewprivs' mode, corresponding to newly added
procctl(2) commands PROC_NO_NEW_PRIVS_CTL and PROC_NO_NEW_PRIVS_STATUS.

Reviewed By:	kib
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D30940
2021-07-02 08:50:36 +01:00
Ganbold Tsagaankhuu
3416513a41 dtb: rockchip: Add NanoPI-R4S and RockPI E to the build 2021-07-02 15:20:25 +08:00
Stefan Eßer
c5b8d7b7c1 netstat: Fix typo
Correct spelling of "received packers" to "received packets".

PR:		256926
Reported by:	ghuckriede@blackberry.com
MFC after:	3 days
2021-07-02 08:42:34 +02:00
Peter Holm
fe5d22f8f4 stress2: Added a test scenario from Bug 227041 2021-07-02 07:24:38 +02:00
Peter Holm
e02046f747 stress2: Update the list of test not to run 2021-07-02 07:23:05 +02:00
Peter Holm
5bd70f0500 stress2: Improve cleanup code 2021-07-02 07:22:18 +02:00
Ceri Davies
2ce5851295 rc.conf.5: -Tlint fixes. 2021-07-01 22:54:26 +01:00
Ceri Davies
40944510db rc.conf.5: add .Xr to firewall(7), growfs(7), and tuning(7) 2021-07-01 22:54:26 +01:00
Ceri Davies
cd4346a0e4 cd(9): correct minor typo in manpage. 2021-07-01 22:54:25 +01:00
Mateusz Guzik
858937bea4 pfctl: cache getprotobynumber results
As for example pfctl -ss keeps calling it, it saves a lot of overhead
from elided parsing of /etc/nsswitch.conf and /etc/protocols.

Sample result when running a pre-nvlist binary with nfs root and dumping
7 mln states:
before: 24.817u 62.993s 1:28.52 99.1%
after:	8.064u 1.117s 0:18.87 48.5%

Idea by Jim Thompson

Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-07-01 21:31:45 +00:00
Alexander Motin
fa3d57c256 mrsas(4): Report more correct maximum I/O size.
Subtract one SGE for the case of misaligned address.  Also take into
account maximum number of sectors reported by firmware, that gives
nicer 256KB limit instead of 276KB calculated from the SGE limit.

While there, remove number of I/O size checks, duplicating what is
already checked by CAM and busdma(9).

MFC after:	1 month
Sponsored by:	iXsystems, Inc.
2021-07-01 15:37:01 -04:00
Kristof Provost
dd82fd3543 pf tests: ftp-proxy test
Basic test case for ftp-proxy

PR:		256917
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-07-01 21:34:40 +02:00
Kristof Provost
8923ea6c86 ftp-proxy: Revert incorrect migration to libpfctl
libpfctl supports creating rules, but not (yet) adding addresses to a
pool. Adding addresses certainly does not work through adding a rule.

PR:		256917
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-07-01 21:34:40 +02:00
Kristof Provost
8f76eebce4 dummynet: fix sysctls
The sysctl nodes which use V_dn_cfg must be marked as CTLFLAG_VNET so
that we use the correct per-vnet offset

PR:		256819
Reviewed by:	donner
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30974
2021-07-01 21:34:08 +02:00
Kornel Duleba
9428765626 ofw_pci: fix probing for non-DT cases
phandle_t is a uint32_t type, <= 0 comparison doesn't work with it as intended.
This caused the ofw_pci code to attach to PCI bus on ACPI based systems.
Since 3eae4e106a ("Fix error value returned by ofw_bus_gen_get_node().")
ofw subsystem can only return -1 for invalid nodes. Use that.

MFC after: 4 weeks
Reviewed by: mw
Differential revision: https://reviews.freebsd.org/D30953
2021-07-01 20:35:23 +02:00
Kornel Duleba
ddb928096b dts: fsl-ls1028a: Correct ECAM PCIE window ranges
Currently all PCIE windows point to bus address 0x0, which does not match
the values obtained from hardware during EA.
Replace those values with CPU addresses, since in reality we
have a 1:1 mapping between the two.

This patch is queued for Linux v5.14 in linux-next tree:
6bee93d93111 "arm64: dts: fsl-ls1028a: Correct ECAM PCIE window ranges"
2021-07-01 20:23:40 +02:00
Ferhat Gecdogan
8df71ea1aa tegra_pcie: use switch instead of if in tegra_pcib_pex_ctrl
Simplify obtaining per-port data in tegra_pcib_pex_ctrl() routine.

Reviewed by:    imp, mw
Pull Request:   https://github.com/freebsd/freebsd-src/pull/481
2021-07-01 20:09:46 +02:00
Emmanuel Vadot
2ca21223c5 dts: Bump the freebsd branding version to 5.13
Sponsored by:	Diablotin Systems
2021-07-01 18:48:56 +02:00
Emmanuel Vadot
993e8236c3 arm64: allwinner: Add r_intc driver
The r intc interrupt controller seems to do a lot of things :
- It can handle the NMI interrupt
- It have local interrupts for some device that also can be muxed with GIC
- It can serve as an forwarder for the GIC

It's mostly used for deepsleep/wakeup if I understood correctly and we do not
support this on arm64.

For now just forward everything to the GIC so interrupts works again for device
which now have this interrupts controller set since dts v5.12

Sponsored by:	Diablotin Systems
2021-07-01 18:46:38 +02:00
Ceri Davies
1f7d11e636 build.7: remove documentation of "make update"
update target was removed in e290182bcf
2021-07-01 16:52:32 +01:00
Emmanuel Vadot
2eb4d8dc72 Import device-tree files from Linux 5.13
Sponsored by:	Diablotin Systems
2021-07-01 17:51:01 +02:00
Emmanuel Vadot
71ca10f8bb Import device-tree files from Linux 5.13 2021-07-01 17:50:17 +02:00
Emmanuel Vadot
82ea1a07b4 Import device-tree files from Linux 5.12
Sponsored by:	Diablotin Systems
2021-07-01 17:41:57 +02:00
Emmanuel Vadot
c7a3c7298f Import device-tree files from Linux 5.12 2021-07-01 17:39:42 +02:00
Warner Losh
1426907f4d hz.9: update stathz for current usage
Update the stathz description to reflect reality. profhz is the only
thing we should deprecate. Add some implementation notes that describe
the optimizations made to date.

Discusssed with:	emaste
Reviewed by:		kib (prior), jhb (prior), gbe
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D30815
2021-07-01 09:33:03 -06:00
Alexander Motin
b192a2c0a1
Remove avl_size field from struct avl_tree
This field is used only by illumos mdb.  On other platforms it only
increases the struct size from 32 to 40 bytes.  For struct vdev_queue
including 13 instances of avl_tree_t size means active cache lines.

Keep the padding in user-space for now to not break the ABI.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12290
2021-07-01 09:32:31 -06:00
Alexander Motin
490c845efe
Compact dbuf/buf hashes and lock arrays
With default dbuf cache size of 1/32 of ARC, it makes no sense to have
hash table of the same size (or even bigger on Linux).  Reduce it to
1/8 of ARC's one, still leaving some slack, assuming higher I/O rate
via dbuf cache than via ARC.

Remove padding from ARC hash locks array.  The idea behind padding
is to avoid false sharing between locks.  It would have sense if
there would be a limited number of very busy locks.  But since we
have no limit on the number, using the same memory for more locks we
can achieve even lower lock contention with the same false sharing,
or we can use less memory for the same contention level.

Reduce number of hash locks from 8192 to 2048.  The number is still
big enough to not cause contention, but reduced memory size improves
cache hit rate for mutex_tryenter() in ARC eviction thread, saving
about 1% of the thread time.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12289
2021-07-01 09:30:31 -06:00
Jorgen Lundman
c6d1112bf4
Fix abd leak, kmem_free correct size of abd_t
Fix a leak of abd_t that manifested mostly when using
raidzN with at least as many columns as N (e.g. a
four-disk raidz2 but not a three-disk raidz2).
Sufficiently heavy raidz use would eventually run a system
out of memory.

Additionally:

* Switch abd_cache arena to FIRSTFIT, which empirically
improves perofrmance.

* Make abd_chunk_cache more performant and debuggable.

* Allocate the abd_zero_buf from abd_chunk_cache rather
than the heap.

* Don't try to reap non-existent qcaches in abd_cache arena.

* KM_PUSHPAGE->KM_SLEEP when allocating chunks from their
own arena

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
Co-authored-by: Sean Doran <smd@use.net>
Closes #12295
2021-07-01 09:28:15 -06:00
Jorgen Lundman
eca174527e
Upstream: dmu_zfetch_stream_fini leaks refcount
dmu_zfetch_stream_fini() is missing calls to destroy the refcounts,
leaking them and the mutex inside.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
Closes #12294
2021-07-01 09:22:16 -06:00
Emmanuel Vadot
5def4c47d4 Import device-tree files from Linux 5.11
Sponsored by:	Diablotin Systems
2021-07-01 17:21:47 +02:00
Kevin Jin
50e09eddd0
Optimize txg_kick() process (#12274)
Use dp_dirty_pertxg[] for txg_kick(), instead of dp_dirty_total in
original code. Extra parameter "txg" is added for txg_kick(), thus it
knows which txg to kick. Also txg_kick() call is moved from
dsl_pool_need_dirty_delay() to dsl_pool_dirty_space() so that we can
know the txg number assigned for txg_kick().

Some unnecessary code regarding dp_dirty_total in txg_sync_thread() is
also cleaned up.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: jxdking <lostking2008@hotmail.com>
Closes #12274
2021-07-01 09:20:27 -06:00
Alexander Motin
42afb12da7
Remove refcount from spa_config_*()
The only reason for spa_config_*() to use refcount instead of simple
non-atomic (thanks to scl_lock) variable for scl_count is tracking,
hard disabled for the last 8 years.  Switch to simple int scl_count
reduces the lock hold time by avoiding atomic, plus makes structure
fit into single cache line, reducing the locks contention.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Mark Maybee <mark.maybee@delphix.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12287
2021-07-01 09:16:54 -06:00
Andrew Turner
244002b482 Switch the order of the ID_AA64PFR1_EL1 fields
This makes them consistent with the fields in other registers.

Sponsored by:	The FreeBSD Foundation
2021-07-01 00:48:56 +00:00
Ceri Davies
d93a2f5d67 fortune: correct documentation of default FORTUNE_PATH.
While here, fix a typo in a comment relating to FORTUNE_PATH
2021-07-01 14:02:00 +01:00
Edward Tomasz Napierala
db8d680ebe procctl(2): add PROC_NO_NEW_PRIVS_CTL, PROC_NO_NEW_PRIVS_STATUS
This introduces a new, per-process flag, "NO_NEW_PRIVS", which
is inherited, preserved on exec, and cannot be cleared.  The flag,
when set, makes subsequent execs ignore any SUID and SGID bits,
instead executing those binaries as if they not set.

The main purpose of the flag is implementation of Linux
PROC_SET_NO_NEW_PRIVS prctl(2), and possibly also unpriviledged
chroot.

Reviewed By:	kib
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D30939
2021-07-01 09:42:07 +01:00
Edward Tomasz Napierala
93c3453f11 linux(4): revert arm64 part of 447636e43c
The arm64 part of the patch was incomplete and prevented
linux64.ko from loading due to missing symbol.

Sponsored By:	EPSRC
2021-07-01 08:29:23 +00:00
Rick Macklem
c5f4772c66 nfscl: Improve "Consider increasing kern.ipc.maxsockbuf" message
When the setting of kern.ipc.maxsockbuf is less than what is
desired for I/O based on vfs.maxbcachebuf and vfs.nfs.bufpackets,
a console message of "Consider increasing kern.ipc.maxsockbuf".
is printed.

This patch modifies the message to provide a suggested value
for kern.ipc.maxsockbuf.
Note that the setting is only needed when the NFS rsize/wsize
is set to vfs.maxbcachebuf.

While here, make nfs_bufpackets global, so that it can be used
by a future patch that adds a sysctl to set the NFS server's
maximum I/O size.  Also, remove "sizeof(u_int32_t)" from the maximum
packet length, since NFS_MAXXDR is already an "overestimate"
of the actual length.

MFC after:	2 weeks
2021-06-30 15:15:41 -07:00
Edward Tomasz Napierala
447636e43c linux(4): implement coredump support
Implement dumping core for Linux binaries on amd64, for both
32- and 64-bit executables.  Some bits are still missing.

This is based on a prototype by chuck@.

Reviewed By:	kib
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D30019
2021-06-30 22:45:06 +01:00
Greg V
8c2dd68caa libpmc: Import AMD Zen 3 PMU events
Reviewed by:	mav, mhorne
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D30965
2021-06-30 18:21:23 -03:00
Mitchell Horne
13f5a3076b hwpmc_arm64: add a PMCDBG to the interrupt handler
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2021-06-30 18:21:23 -03:00
Olivier Houchard
8c3bd133dd arm: Make sure we can handle a thumb entry point.
Similarly to what's been done on arm64 with commit
712c060c94, when executing a binary, if the
entry point is a thumb symbol, then make sure we set the PSL_T flag, otherwise
the CPU will interpret it in ARM mode, and that will likely leads to an
undefined instruction.

PR:	256899
MFC after: 	1 week
2021-06-30 22:56:50 +02:00
Antoine Brodin
d75d33870d ObsoleteFiles.inc: add a few missed files 2021-06-30 20:34:36 +00:00
Allan Jude
781c3b5119 Add Thomas Munro to the committers graph
Reported by:	gnn
2021-06-30 20:09:18 +00:00
Mitchell Horne
28dd6730a5 libpmc: enable pmu_utils on arm64
This allows supported libpmc to query/select from the pmu-events table,
which may have a more complete set of events than what we define
manually. A future update to these definitions should greatly improve
this support. The alias table is empty for now, until this future import
is complete.

Add the Foundation's copyright for recent work on this file.

Reviewed by:	ray (slightly earlier version)
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30603
2021-06-30 16:47:18 -03:00