Commit Graph

2148 Commits

Author SHA1 Message Date
Xin LI
cd3a777bca MFV: xz-embedded 3f438e15109229bb14ab45f285f4bff5412a9542
MFC after:	2 weeks
2022-11-17 22:04:57 -08:00
Martin Matuska
5d42ef55de zfs: workaround panic on rootfs mount
The import of OpenZFS PR 13758 causes a panic in zfsctl_is_node()
if ZFS is mounting as root filesystem. This implements a workaround
until the issue is resolved by authors.
2022-11-17 02:01:47 +01:00
Martin Matuska
9198651515 zfs: unbreak 32-bit world build broken in dbd5678dc 2022-11-17 00:33:26 +01:00
Martin Matuska
dbd5678dca zfs: merge openzfs/zfs@2163cde45
Notable upstream pull request merges:
  #13680 Add options to zfs redundant_metadata property
  #13758 Allow mounting snapshots in .zfs/snapshot as a regular user
  #13838 quota: disable quota check for ZVOL
  #13839 quota: extend quota for dataset
  #13973 Fix memory leaks in dmu_send()/dmu_send_obj()
  #13977 Avoid unnecessary metaslab_check_free calling
  #13978 PAM: Fix unchecked return value from zfs_key_config_load()
  #13979 Handle possible null pointers from malloc/strdup/strndup()
  #13997 zstream: allow decompress to fix metadata for uncompressed
         records
  #13998 zvol_wait logic may terminate prematurely
  #14001 FreeBSD: Fix a pair of bugs in zfs_fhtovp()
  #14003 Stop ganging due to past vdev write errors
  #14039 Optimize microzaps
  #14050 Fix draid2+2s metadata error on simultaneous 2 drive failures
  #14062 zed: Avoid core dump if wholedisk property does not exist
  #14077 Propagate extent_bytes change to autotrim thread
  #14079 FreeBSD: vn_flush_cached_data: observe vnode locking contract
  #14093 Fix ARC target collapse when zfs_arc_meta_limit_percent=100
  #14106 Add ability to recompress send streams with new compression
         algorithm
  #14119 Deny receiving into encrypted datasets if the keys are not
         loaded
  #14120 Fix arc_p aggressive increase
  #14129 zed: Prevent special vdev to be replaced by hot spare
  #14133 Expose zfs_vdev_open_timeout_ms as a tunable
  #14135 FreeBSD: Fix out of bounds read in zfs_ioctl_ozfs_to_legacy()
  #14152 Adds the `-p` option to `zfs holds`
  #14161 Handle and detect #13709's unlock regression

Obtained from:	OpenZFS
OpenZFS commit:	2163cde450
2022-11-16 21:27:42 +01:00
Emmanuel Vadot
b97ee269ea Import device-tree files from Linux 6.0
Sponsored by:   Beckhoff Automation GmbH & Co. KG
2022-11-15 20:02:06 +01:00
Emmanuel Vadot
d5b0e70f7e Import device-tree files from Linux 5.19
Sponsored by:   Beckhoff Automation GmbH & Co. KG
2022-11-15 20:01:13 +01:00
Jung-uk Kim
5723d13811 acpica: Fix the botched merge
Fixes:		9a4bc5208f acpica: Import ACPICA 20221020
2022-10-27 22:36:35 -04:00
Jung-uk Kim
9a4bc5208f acpica: Import ACPICA 20221020
(cherry picked from commit a799bdd9d50e84cd6a36e8f1d2ac4301b2a6b374)
2022-10-27 22:03:50 -04:00
Mark Johnston
6fe0a6c80a zfs: Fix a pair of bugs in zfs_fhtovp()
This cherry-picks upstream ed566bf1cd

    - Add a zfs_exit() call in an error path, otherwise a lock is
      leaked.
    - Remove the fid_gen > 1 check.  That appears to be Linux-specific:
      zfsctl_snapdir_fid() sets fid_gen to 0 or 1 depending on whether
      the snapshot directory is mounted.  On FreeBSD it fails, making
      snapshot dirs inaccessible via NFS.

PR:		266236
MFC after:	3 days
2022-10-24 12:05:17 -04:00
Bjoern A. Zeeb
92daf3a606 iwlwifi: prepare to support debugfs
Import two files left out initially from the driver needed for debugfs
support [1].  Adjust the driver further to make it compile on FreeBSD.
This is currently turned off and needs more LinuxKPI/lindebugfs work.
Being in the tree will allow us to collaboratively work on it and
then we can enable it for good.

Obtained from:	Linux wireless-testing (tag: wt-2022-10-19) [1]
		2c9078b9abcb884e27360340aaa7dfd4c0de29b3
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-10-22 17:40:17 +00:00
Bjoern A. Zeeb
71ebd2d00b iwlwifi: constify another argument of iwl_print_hex_dump()
This is needed when enabling debugfs as it passes a const in which
would otherwise be dropped.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-10-22 17:33:18 +00:00
Mateusz Guzik
f860ce8151 zfs: mix mismerge in zfs_znode_free
happens to be a noop
2022-10-08 20:43:33 +00:00
Alfredo Dal'Ava Junior
344986ff4c zfs: powerpc: disable kernel floating point support
Powerpc* doesn't support support floating point in the kernel yet,
so disable it on zfs for now.

This fixes "panic: altivec unavailable trap" when loading zfs.ko

Approved by:	jhibbits
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D36894
2022-10-06 20:35:48 -03:00
Martin Matuska
be181ee2a2 zfs: merge openzfs/zfs@d62bafee9
Notable upstream pull request merges:
  #13857 Enforce "-F" flag on resuming recv of full/newfs on existing dataset
  #13928 Revert "Reduce dbuf_find() lock contention"
  #13928 Dynamically size dbuf hash mutex array
  #13930 zpool: Don't print "repairing" on force faulted drives
  #13938 Bring per_txg_dirty_frees_percent back to 30
  #13939 Fix panic in dsl_process_sub_livelist for EINTR
  #13954 Fix bad free in skein code
  #13967 Fix potential NULL pointer dereference in dsl_dataset_promote_check()

Obtained from:	OpenZFS
OpenZFS commit:	d62bafee9f
2022-10-04 20:16:52 +02:00
John Baldwin
7550e242ab zlib crc32: Add prototypes for recently-added static functions.
This appeases -Wstrict-prototypes with GCC.  Using a separate
prototype using the OF macro seems to be consistent with the rest of
this file which still supports pre-ANSI C.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D36755
2022-09-28 14:00:27 -07:00
John Baldwin
c5eed4146f Fix various places which cast a pointer to a uint64_t or vice versa.
GCC warns about the mismatched sizes on 32-bit platforms.

Reviewed by:	imp, markj
Differential Revision:	https://reviews.freebsd.org/D36752
2022-09-28 13:58:02 -07:00
Mateusz Guzik
de56ac8809 zfs: bring per_txg_dirty_frees_percent back to 30
This cherry-picks upstream eb9bec0a5d

    The current value causes significant artificial slowdown during mass
    parallel file removal, which can be observed both on FreeBSD and Linux
    when running real workloads.

    Sample results from Linux doing make -j 96 clean after an allyesconfig
    modules build:

    before: 4.14s user 6.79s system 48% cpu 22.631 total
    after:  4.17s user 6.44s system 153% cpu 6.927 total

    FreeBSD results in the ticket.

See https://github.com/openzfs/zfs/issues/13932
2022-09-28 01:26:52 +00:00
Bjoern A. Zeeb
1a2b55732f lindebugfs,rtw88,rtw89: correct module dependencies
In f697b9432d the name of the PSEUDOFS
was changed from debugsfs to lindebugfs but the in-tree consumers
were not updated now leaving the drivers not loading if compiled
with debugfs support due to missing dependencies.

MFC after:		3 days
X-MFC-with-after:	f697b9432d
2022-09-25 21:41:22 +00:00
Bjoern A. Zeeb
f808c43ad9 iwlwifi: enforce FreeBSD specific (expected) behaviour
iwlwifi can return early from probe (in FreeBSD attach) while a separate
thread is still grinding loading the firmware and setting things up.
For us this means that kldload succeeded but we may not have a physical
wireless interface (com) yet but the rc framework might already try to
configure a vap on one.

Wait until we get a firmware completion event from the other thread
(on success or error) and block returning.  That way we can ensure that
the "hw" (or com in net80211 terms) is there when we return from attach
matching the expected FreeBSD driver behaviour.

Reported by:	J.R. Oldroyd (jr opal.com)
Reported by:	probably inderectly showing as other problem
Tested by:	J.R. Oldroyd (jr opal.com)
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-09-25 21:41:06 +00:00
Martin Matuska
1761afc50a zfs: fix powerpc build broken in c7046f76c2
The breakage was introduced in OpenZFS commit 48cf170d5.
When a (different) fix solving this issue gets upstreamed
it will replace the current fix in the next merge from OpenZFS.
2022-09-22 12:04:28 +02:00
Martin Matuska
c7046f76c2 zfs: merge openzfs/zfs@c629f0bf6
Notable upstream pull request merges:
  #13725 Fix BLAKE3 tuneable and module loading on Linux and FreeBSD
  #13756 FreeBSD: Organize sysctls
  #13773 FreeBSD: add kqfilter support for zvol cdev
  #13781 Importing from cachefile can trip assertion
  #13794 Apply arc_shrink_shift to ARC above arc_c_min
  #13798 Improve too large physical ashift handling
  #13799 Revert "Avoid panic with recordsize > 128k, raw sending and
         no large_blocks"
  #13802 Add zfs.sync.snapshot_rename
  #13831 zfs_enter rework
  #13855 zfs recv hangs if max recordsize is less than received
         recordsize

Obtained from:	OpenZFS
OpenZFS commit:	c629f0bf62
2022-09-21 14:17:13 +02:00
Mateusz Guzik
4e1262ac99 zfs: stop passing LK_INTERLOCK to VOP_LOCK
There is an ongoing effort to eliminate this feature.
2022-09-19 20:03:01 +00:00
Mateusz Guzik
a75d1ddd74 vfs: introduce V_PCATCH to stop abusing PCATCH 2022-09-17 15:41:37 +00:00
Mateusz Guzik
298c7c5165 zfs: don't access nameidata unless namei succeeded 2022-09-17 12:25:59 +00:00
Mateusz Guzik
5b5b7e2ca2 vfs: always retain path buffer after lookup
This removes some of the complexity needed to maintain HASBUF and
allows for removing injecting SAVENAME by filesystems.

Reviewed by:	kib (previous version)
Differential Revision:	https://reviews.freebsd.org/D36542
2022-09-17 09:10:38 +00:00
Bjoern A. Zeeb
866e021654 rtw89: import firmware for Realtek's rtw89 supported chipsets.
Import the most recent versions of the firmware images for the
rtw89 driver.

This is based on linux-firmware at 2f2f0181581d3e35bfdb9fc65f609ee9d3fbaeb7.

The license of the firmware matches the previously added rtw88(4) firmware
and you can find a copy in sys/contrib/dev/rtw89fw/LICENCE.rtlwifi_firmware.txt.

Add build infrastructure to create the .ko files but do not yet hook
it up to the build until all parts are in the tree.

Approved by:	core.11 (imp) [2022-03-27]
MFC after:	6 weeks
2022-09-09 16:32:17 +00:00
Bjoern A. Zeeb
8e93258f26 rtw89: import Realtek's rtw89 driver
Import rtw89 based on wireless-testing at (tag: wt-2022-09-02)
78667a29c116c6b186a37e28cd8dd7fa9923aee8 with adjustments for FreeBSD.

For the moment this will stay disconnected from the build until the
last bits are flushed out, but this will help people with a card to
do testing and possibly help improving.

Given the lack of full license texts on non-local files this is
imported under the draft policy for handling SPDX files (D29226). [1]

Approved by:	core.11 (imp) [1] [2022-03-27]
MFC after:	6 weeks
2022-09-09 16:32:17 +00:00
Bjoern A. Zeeb
549198b1ab LinuxKPI, dev: 80211 update mac80211 KPI
Update the mac80211 ops KPI for (*conf_tx), (*assign_vif_chanctx),
(*unassign_vif_chanctx), (*start_ap), and (*stop_ap), as well as
ieee80211_beacon_get_tim() and ieee80211_beacon_get_template().

Update in-tree drivers iwlwifi and rtw88 accordingly based on upstream
changes (as well as out-of-tree ones).  This was triggered by trying to
synchronize more drivers to a common state.

MFC after:	1 week
2022-09-07 23:38:54 +00:00
Bjoern A. Zeeb
e3a0b1202b LinuxKPI: 80211 / iwlwifi: improve queue management
For one initialise vif->hw_queues later set in lkpi_80211_txq_tx_one()
for drivers using them.  This may still need slightly more cleanup once
we get QUEUE_CONTROL-supporting drivers into the tree.

For the other rework and improve how we deal with tid/ac/txq in
lkpi_80211_txq_tx_one() and cleanup old comments and unused code.
This seems to reduce (remove) "Invalid TXQ id" reports from iwlwifi.
(The assumption is that the frame(s) triggering this WARN_ONCE or the
added FreeBSD specific logging were sent with lkpi_80211_mo_tx()).

Adjust the one logging from e674ddec0b
to IWL_DEBUG_TX so that now this is fixed it is also not always logged
anymore but leave it in case we need to further debug queues in the
future.

Tested by:	pstef, Kevin Oberman (rkoberman gmail.com)
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-09-05 21:03:03 +00:00
Bjoern A. Zeeb
26a3694833 iwlwifi: move an ieee80211_get_tid() call
Introduce a local change.  It seems ieee80211_get_tid() does not deal
with non-dataqos packets unlike net80211's ieee80211_gettid().
Gernally all calls in Linux drivers to ieee80211_get_tid() seem to
be proceeded by an ieee80211_is_data_qos() check.

Moving the ieee80211_get_tid() has no difference in the result, but
(a) saves us the call if we do not need it due to an earlier return,
and (b) allows us to put an assert into the LinuxKPI ieee80211_get_tid()
implementation to avoid accidentally returning random frame header data
in case of a missing earlier ieee80211_is_data_qos() check in (future/
other) drivers.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-08-31 23:01:36 +00:00
Martin Matuska
08aba0aec7 zfs: merge openzfs/zfs@a582d5299
Notable upstream pull request merges:
  #13717 Fix zpool status in case of unloaded keys
  #13753 Prevent zevent list from consuming all of kernel memory
  #13767 arcstat: fix -p option
  #13785 Updates for snapshots_changed property

Obtained from:	OpenZFS
OpenZFS commit:	a582d52993
2022-08-26 00:58:56 +02:00
Bjoern A. Zeeb
e674ddec0b iwlwifi: add FreeBSD specific debugging
"Invalid TXQ id" and "Queue <n> is stuck <x> <y>" are two errors seen
more commonly by FreeBSD users.  Try to gather some extra data the
"easy way" adding more error logging for these situations in the hope
to find a clue or at least do more targetd debugging in the future.
Note that for one of the errors the Linux Intel driver has a TODO to
print register data.  If that will show up in future versions of the
driver this may also help.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-08-17 16:11:47 +00:00
Martin Matuska
271171e0d9 zfs: merge openzfs/zfs@b3d0568cf
Notable upstream pull request merges:
  #9372 Implement a new type of zfs receive: corrective receive (-c)
  #13635 Add snapshots_changed as property
  #13636 Add support for per dataset zil stats and use wmsum counters
  #13643 Fix scrub resume from newly created hole
  #13670 Fix memory allocation for the checksum benchmark
  #13695 Skip checksum benchmarks on systems with slow cpu
  #13711 zpool: fix redundancy check after vdev removal

Obtained from:	OpenZFS
OpenZFS commit:	b3d0568cfd
2022-08-14 01:14:21 +02:00
Warner Losh
4f0c9b76cf stand: Only compile decompression routines
We don't need the compress rotuines, nor zstd_opt.c. Remove them.
Expand the number of places we omit code for IN_LIBSA (which are FreeBSD
specific). Due to the agressive optimization, though, this doesn't
reduce the size of the loader. It does reduce the number of 'false
positives' for places to omit to reduce the size as well as reducing the
build time slightly.

Sponsored by:		Netflix
Reviewed by:		tsoome, delphij
Differential Revision:	https://reviews.freebsd.org/D36145
2022-08-12 21:48:18 -06:00
Emmanuel Vadot
c9ccf3a32d Import device-tree files from Linux 5.18
Sponsored by:   Beckhoff Automation GmbH & Co. KG
2022-08-10 14:32:46 +02:00
Emmanuel Vadot
e67e85659c Import device-tree files from Linux 5.17
Sponsored by:   Beckhoff Automation GmbH & Co. KG
2022-08-10 14:29:43 +02:00
Emmanuel Vadot
8cc087a1ee Import device-tree files from Linux 5.16
Sponsored by:   Beckhoff Automation GmbH & Co. KG
2022-08-10 14:27:16 +02:00
Emmanuel Vadot
354d7675fe Import device-tree files from Linux 5.15
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-08-10 14:21:52 +02:00
Emmanuel Vadot
5956d97f4b Import device-tree files from Linux 5.14 2022-08-10 14:12:15 +02:00
Mark Adler
2969066f73 zlib: Fix extra field processing bug that dereferences NULL state->head.
The recent commit to fix a gzip header extra field processing bug
introduced the new bug fixed here.

(cherry picked from zlib commit 1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d)
2022-08-08 14:19:27 -04:00
Mark Adler
dc3509f1aa zlib: Fix a bug when getting a gzip header extra field with inflate().
If the extra field was larger than the space the user provided with
inflateGetHeader(), and if multiple calls of inflate() delivered
the extra header data, then there could be a buffer overflow of the
provided space. This commit assures that provided space is not
exceeded.

(cherry picked from zlib commit eff308af425b67093bab25f80f1ae950166bece1)
2022-08-04 22:30:20 -04:00
Mark Johnston
100ddf8922 qat: Move qat_c2xxx firmware files and build glue into separate dirs
Reviewed by:	Zdziarski, KrzysztofX <krzysztofx.zdziarski@intel.com>
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36032
2022-08-04 09:37:55 -04:00
Bjoern A. Zeeb
13a7663c52 iwlwifi firmware: update to -73 / newer builds for 9xxx
Update iwlwifi 22000 firmware to -73 and rebuilds for 9000/9260.
Update the driver to accept the newer version.

Firmware was obtained from linux-firmware at
150864a4d73e8c448eb1e2c68e65f07635fe1a66.

Sponsored by:	The FreeBSD Foundation
MFC after:	23 days
2022-07-31 00:41:33 +00:00
Bjoern A. Zeeb
467d3e2e8a LinuxKPI 802.11/iwlwifi/rtw88: update KPI
Upgrade the argument of (*bss_info_changed) mac80211 ops function call
from 32 to 64 bit.
Add an extra argument to ieee80211_beacon_get_template().

Both changes are needed in order to keep other out-of-tree drivers in
synch and to move forward.

The driver changes were extracted from Linux wireless-testing
7b7090b4c6a906cc7c3e2a460335f705b93f4506 and
6e8912a503759bb8f1f01c5b761d0d45815fa6de.

Sponsored by:	The FreBSD Foundation
MFC after:	1 week
2022-07-28 23:39:03 +00:00
Julian Grajkowski
78ee8d1c4c qat: Import a new Intel (R) QAT driver
QAT in-tree driver ported from out-of-tree release available
from 01.org.

The driver exposes complete cryptography and data compression
API in the kernel and integrates with Open Crypto Framework.
Details of supported operations, devices and usage can be found
in man and on 01.org.

Patch co-authored by: Krzysztof Zdziarski <krzysztofx.zdziarski@intel.com>
Patch co-authored by: Michal Jaraczewski <michalx.jaraczewski@intel.com>
Patch co-authored by: Michal Gulbicki <michalx.gulbicki@intel.com>
Patch co-authored by: Julian Grajkowski <julianx.grajkowski@intel.com>
Patch co-authored by: Piotr Kasierski <piotrx.kasierski@intel.com>
Patch co-authored by: Adam Czupryna <adamx.czupryna@intel.com>
Patch co-authored by: Konrad Zelazny <konradx.zelazny@intel.com>
Patch co-authored by: Katarzyna Rucinska <katarzynax.kargol@intel.com>
Patch co-authored by: Lukasz Kolodzinski <lukaszx.kolodzinski@intel.com>
Patch co-authored by: Zbigniew Jedlinski <zbigniewx.jedlinski@intel.com>

Reviewed by:	markj, jhb (OCF integration)
Reviewed by:	debdrup, pauamma (docs)
Sponsored by:	Intel Corporation
Differential Revision: https://reviews.freebsd.org/D34632
2022-07-27 11:12:35 -04:00
Mark Johnston
f4f56ff43d qat: Rename to qat_c2xxx and remove support for modern chipsets
A replacement QAT driver will be imported, but this replacement does not
support Atom C2xxx hardware.  So, the existing driver will be kept
around to provide opencrypto offload support for those chipsets.

Reviewed by:	pauamma, emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35817
2022-07-27 11:10:52 -04:00
Alfredo Dal'Ava Junior
56e8444a17 zfs: fixup build on powerpc64le
This complements 0a7fa9d11b removing
a #warning added intentionally, replacing it by a "TODO" comment.

PR:	265003
2022-07-08 18:52:14 -03:00
Piotr Kubaj
0a7fa9d11b zfs: fix powerpc64le build
PR:	265003
Reviewed by: alfredo (on IRC)
2022-07-08 18:10:24 +02:00
Martin Matuska
a0b956f5ac zfs: merge openzfs/zfs@cb01da680
Notable upstream pull request merges:
  #12438 Avoid panic with recordsize > 128k, raw sending and no large_blocks
  #13015 Fix dnode byteswapping
  #13256 Add a "zstream decompress" subcommand
  #13555 Scrub mirror children without BPs
  #13576 Several sorted scrub optimizations
  #13579 Fix and disable blocks statistics during scrub
  #13582 Several B-tree optimizations
  #13591 Avoid two 64-bit divisions per scanned block
  #13606 Avoid memory copies during mirror scrub
  #13613 Avoid memory copy when verifying raidz/draid parity

Obtained from:	OpenZFS
OpenZFS commit:	cb01da6805
2022-07-08 00:02:36 +02:00
Bjoern A. Zeeb
17732dd8f0 Revert "rtw88: split driver up into a core and pci part"
After some discussion, for now, simply revert the change to split
the driver up into if_rtw88_core.ko and if_rtw88_pci.ko as we do
not have an if_rtw88.ko anymore.  We do have code trying to
auto-load modules, e.g. ifconfig, based on if_xxx.ko.

We could, based on Makefile magic or further code, generate a
if_rtw88.ko module with proper dependencies and keep this but for
simplicity stay with the one slightly larger module for now.
Should code appear to do this "properly" we can revisit this once
USB support has landed.

Slightly update the module Makefile to keep the separation of files
between core and pci bits visible and maintainable for the future.

This reverts commit 0f7b9777f8.
2022-07-01 13:06:31 +00:00