Commit graph

4389 commits

Author SHA1 Message Date
Konstantin Belousov
83271c68c4 Fix some modules to export more used symbols
(cherry picked from commit 5bb3134a8c)
2021-11-25 03:09:21 +02:00
Mark Johnston
f695727330 Export symbols from opensolaris.ko and dtrace.ko
Both modules provide many symbols used by various DTrace provider
modules, so just export everything.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 8a693ccf86)
2021-11-24 10:55:37 -05:00
Andriy Gapon
f1d2f22b34 pca954x: driver for PCA954x / TCA954x I2C switches
At the moment only PCA9548A is supported and has been tested.

(cherry picked from commit c0525ab1d1)
2021-11-24 16:19:09 +02:00
Andriy Gapon
9d7c92dbb9 add rk3328 overlay for enabling analog sound
(cherry picked from commit 00c06804a8)
2021-11-21 12:04:42 +02:00
Andriy Gapon
ee82e15cd9 pcf8574: driver for 8-pin quasi-bidirectional GPIO over I2C
(cherry picked from commit 6354154ef5)
2021-11-21 11:59:34 +02:00
Andriy Gapon
8f57430de1 driver for MAX44009 I2C illuminance sensor
(cherry picked from commit ff6fe29835)
2021-11-13 11:12:05 +02:00
Andriy Gapon
d6f71e09a7 pcf8591: driver for adc/dac with i2c interface
(cherry picked from commit a60b304697)
2021-11-13 11:10:44 +02:00
John Baldwin
6ca6d4edc2 ossl: Add ChaCha20 cipher support.
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D28756

(cherry picked from commit 92aecd1e6f)
2021-10-21 08:51:24 -07:00
John Baldwin
bc6265e8cf ossl: Add Poly1305 digest support.
Reviewed by:	cem
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D28754

(cherry picked from commit a079e38b08)
2021-10-21 08:51:23 -07:00
John Baldwin
d5cbcae312 Add an implementation of CHACHA20_POLY1305 to cryptosoft.
This uses the chacha20 IETF and poly1305 implementations from
libsodium.  A seperate auth_hash is created for the auth side whose
Setkey method derives the poly1305 key from the AEAD key and nonce as
described in RFC 8439.

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

(cherry picked from commit dd2e1352b6)
2021-10-21 08:51:22 -07:00
John Baldwin
ec3872a696 Add an OCF algorithm for ChaCha20-Poly1305 AEAD.
Note that this algorithm implements the mode defined in RFC 8439.

Reviewed by:	cem
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D27836

(cherry picked from commit fc8fc743d8)
2021-10-21 08:51:22 -07:00
Navdeep Parhar
bcb2da3a62 cxgbe(4): Update firmwares to 1.26.2.0.
The firmwares and the following changelog are from the "Chelsio Unified
Wire v3.15.0.0 for Linux."

Version : 1.26.2.0
Date    : 09/24/2021
====================

FIXES
-----

BASE:
- Added support for SFP+ RJ45 (0x1C).
- Fixing backward compatibility issue with older drivers when multiple
  speeds are passed to firmware.

OFLD:
- Do not touch tp_plen_max if driver is supplying tp_plen_max. This
  fixes a connection reset issue in iscsi.

ENHANCEMENTS
------------

BASE:
- Firmware header modified to add firmware binary signature.

Sponsored by:	Chelsio Communications

(cherry picked from commit 45d6fbaec2)
2021-10-20 10:36:34 -07:00
Navdeep Parhar
c1f66d325a cxgbe(4): Update firmwares to 1.26.0.0.
Changes since 1.25.6.0 are listed here.  This list comes from the
Release Notes for "Chelsio Unified Wire 3.14.0.4 for Linux" dated
2021-07-08.

Fixes
-----

BASE:
- Wait 5ms before and after the i2c command that clears the mod_select.
  This fixes incorrect port module type read from i2c.

Obtained from:	Chelsio Communications
Sponsored by:	Chelsio Communications

(cherry picked from commit 3c900106ea)
2021-10-20 10:35:56 -07:00
Navdeep Parhar
20cbc6676b cxgbe(4): Update firmwares to 1.25.6.0.
Changes since 1.25.0.0 are listed here.  This list comes from the
Release Notes for the "Chelsio Unified Wire v3.14.0.3 for Linux"
release dated 2021-05-21.

Fixes
-----

BASE:
- Fixed Back to back T6 100G-CR4 link coming up with NO FEC sometimes.
- [T5] Try to bring up link in 1G speed if link doesn't come up on 10G.
- Fixed a bug to not allow BaseR fec in 100G speed.
- Fixed linkup issues on BT adapter in 1G and 100M speed.
- Fixed an issue to allow driver to send VI_ENABLE multiple times (once
  with rx disable and then later rx enable).
- Fixed rate limiting not working on class number 16 to 30.
- Fixed backward compatibility issue in port type interpretation with vpd
  version 0x80.

ETH:
- Fixed a case when firmware failed to deliver NIC WR completion to host.
- No rate limit support for WR ETH_TX_PKTS2 due to performance reasons.

OFLD
- Fixed a connection hang in SO adapters when tp_plen_max (set by driver)
  is more than the window size.
- Added fw_filter_vnic_mode to firmware API file (t4fw_interface.h)
- Use correct rx channel in coprocessor crypto completion (CPL_FW6_PLD). This
  was causing out of order completion to host.

FOiSCSI
- Fixed a crash due to unaligned access of ipv6 address.
- Fixed a crash during lun reset.

Enhancements
------------

ETH:
- Rate limiting support added for encapsulated (vxlan, nvgre, geneve) NIC TCP
  packets.

OFLD:
- More than 128 SGLs supported in FW_RI_FR_NSMR_WR. Now, more than 16GB
  (upto 64GB) of PBLs can be written with single FW_RI_FR_NSMR_WR.

Obtained from:	Chelsio Communications
Sponsored by:	Chelsio Communications

(cherry picked from commit e0fa04e257)
2021-10-20 10:30:56 -07:00
Vladimir Kondratyev
fd6adf784e LinuxKPI: Remove FreeBSD struct resource from all LKPI headers
except linux/pci.h to avoid conflicts with Linux version.
This allows to #define resource in drm-kmod globally and strip some #ifdef-s

Reviewed by:	hselasky, manu
Differential revision:	https://reviews.freebsd.org/D31673

(cherry picked from commit 66ea390652)
2021-10-13 11:58:39 +03:00
Marcin Wojtas
112c1187c2 Upgrade ENA to v2.4.1
ena: Remove redundant declaration of ena_log_level.

GCC6 raises a -Wredundant-decl error due to duplicate declarations
in ena_fbsd_log.h and ena_plat.h.

Sponsored by:	Chelsio Communications

(cherry picked from commit 8843787aa1)

ena: Avoid unnecessary mbuf collapses for LLQ condition

In case of Low-latency Queue, one small enough descriptor can be pushed
directly to the ENA hw, thus saving one fragment. Check for this
condition before performing collapse.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit c81f8c2611)

ena: Trigger reset on ena_com_prepare_tx failure

All ena_com_prepare_tx errors other than ENA_COM_NO_MEM are fatal and
require device reset.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 36130d2979)

ena: Prevent reset after device destruction

Check for ENA_FLAG_TRIGGER_RESET inside a locked context in order to
avoid potential race conditions with ena_destroy_device. This aligns the
reset task logic with the Linux driver.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 433ab9b698)

ena: Add extra log messages

Stay aligned with the Linux driver by adding the following logs:
* inform the user about retrying queue creation
* warn on non-empty ena_tx_buffer.mbuf prior to ena_tx_map_mbuf

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 77160654a1)

ena: Add locking assertions

ENA silently assumed that ena_up, ena_down and ena_start_xmit routines
should be called within locked context. Driver's logic heavily assumes
on concurrent access to those routines, so for safety and better
documentation about this assumption, the locking assertions were added
to the above functions.

The assertion was added only for the main steps (skipping the helper
functions) which can be called from multiple places including the kernel
and the driver itself.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit cb98c439d6)

ena: Move RSS logic into its own source files

Delegate RSS related functionality into separate .c/.h files in
preparation for the full RSS support.

While at it, reorder functions and remove prototypes for ones with
internal linkage.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 986e7b9227)

ena: Disable meta descriptor caching for netmap

If LLQ is being used, `ena_tx_ctx.meta_valid` must stay enabled. This
fixes netmap support on latest generation ENA HW and aligns it with the
core driver behavior.

As netmap doesn't support any csum offloads, the
`adapter->disable_meta_caching` value can be simply passed to the HW.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit a831466830)

ena: Share ena_global_lock between driver instances

In order to use `ena_global_lock` in sysctl context, it must be kept
outside the driver instance's software context, as sysctls can be called
before attach and after detach, leading to lock use before sx_init and
after sx_destroy otherwise.
Solve this issue by turning `ena_global_lock` into a file scope
variable, shared between all instances of the driver and associated
sysctl context, and in turn initialized/destroyed in dedicated
SYSINIT/SYSUNINIT functions.
As a side effect, this change also fixes existing race in the reset
routine, when simultaneously accessing sysctl exposed properties.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 07aff471c0)

ena: Add missing statistics

Provide the following sysctl statistics in order to stay aligned with
the Linux driver:
* rx_ring.csum_good
* tx_ring.unmask_interrupt_num

Also rename the 'bad_csum' statistic name to 'csum_bad' for alignment.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 223c8cb12e)

ena: Implement full RSS reconfiguration

Bind RX/TX queues and MSI-X vectors to matching CPUs based on the RSS
bucket entries.

Introduce sysctls for the following RSS functionality:
- rss.indir_table:      indirection table mapping
- rss.indir_table_size: indirection table size
- rss.key:              RSS hash key (if Toeplitz used)

Said sysctls are only available when compiled without `option RSS`, as
kernel-side RSS support currently doesn't offer RSS reconfiguration.

Migrate the hash algorithm from CRC32 to Toeplitz and change the initial
hash value to 0x0 in order to match the standard Toeplitz implementation.
Provide helpers for hash key inversion required for HW operations.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 6d1ef2abd3)

ena: fix building in-kernel driver

When building ENA as compiled into the kernel, the driver would fail to
build. Resolve the problem by introducing the following changes:
1. Add missing `ena_rss.c` entry in `sys/conf/files`.
2. Prevent SYSCTL_ADD_INT from throwing an assert due to an extra
CTLTYPE_INT flag.

Fixes: 986e7b9227 ("ena: Move RSS logic into its own source files")
Fixes: 6d1ef2abd3 ("ena: Implement full RSS reconfiguration")

Obtained from: Semihalf
Sponsored by: Amazon, Inc.
MFC after: 1 week

(cherry picked from commit a3f0d18237)

ena: Update driver version to v2.4.1

Some of the changes in this release:
* Hardware RSS hash key reconfiguration and indirection table
reconfiguration support.
* Full kernel RSS support.
* Extra statistic counters.
* Netmap support for ENAv3.
* Locking assertions.
* Extra log messages.
* Reset handling fixes.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 42c7760be3)
2021-10-07 18:10:32 +02:00
Kyle Evans
bd4ee4ead1 modules: iichid: needs opt_acpi.h
This fixes the standalone build.

(cherry picked from commit 335c4f8edb)
2021-10-06 02:10:54 -05:00
Kyle Evans
38e0682c8c modules: netflow: need opt_inet.h
This fixes the standalone build.

(cherry picked from commit 6caae81d93)
2021-10-06 02:10:20 -05:00
Kyle Evans
7610a6b150 modules: acpi_video: need opt_evdev.h
This fixes the standalone build.

(cherry picked from commit 58ca99d116)
2021-10-06 02:09:58 -05:00
Guinan Sun
e4a16771e8 e1000: remove duplicated phy codes
Add two files base.c and base.h to reduce the redundancy
in the silicon family code.
Remove the code duplication from e1000_82575 files.
Clean family specific functions from base.
Fix up a stray and duplicate function declaration.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>

Approved by:	imp
Obtained from:	DPDK (44dddd14059f151f39f7e075b887decfc9a10f11)
MFC after:	1 week

(cherry picked from commit 6b9d35fac1)
2021-09-23 18:21:34 -07:00
Martin Matuska
f941f0a062 zfs: merge openzfs/zfs@71c609852 (zfs-2.1-release) into stable/13
OpenZFS release 2.1.1

Notable upstream pull request merges:
  #11997 FreeBSD: Don't force xattr mount option
  #11997 FreeBSD: Implement xattr=sa
  #11997 FreeBSD: Use SET_ERROR to trace xattr name errors
  #12022 Fix endianness issues with zstd
  #12161 Restore FreeBSD sysctl processing for arc.min and arc.max
  #12183 Optimize small random numbers generation
  #12246 arc: Drop an incorrect assert
  #12271 Tinker with slop space accounting with dedup
  #12279 Fix ARC ghost states eviction accounting
  #12281 Move gethrtime() calls out of vdev queue lock
  #12289 Compact dbuf/buf hashes and lock arrays
  #12294 Upstream: dmu_zfetch_stream_fini leaks refcount
  #12295 Fix abd leak, kmem_free correct size of abd_t
  #12297 Avoid vq_lock drop in vdev_queue_aggregate()
  #12299 file reference counts can get corrupted
  #12300 Introduce dsl_dir_diduse_transfer_space()
  #12314 Optimize allocation throttling
  #12320 FreeBSD: Use unmapped I/O for scattered/gang ABD buffers
  #12328 FreeBSD: Hardcode abd_chunk_size to PAGE_SIZE
  #12339 Read past end of argv array in zpool_do_import()
  #12348 Minor ARC optimizations
  #12365 Fixes in persistent L2ARC
  #12375 FreeBSD: Ignore make_dev_s() errors
  #12378 FreeBSD: Switch from MAXPHYS to maxphys on FreeBSD 13+
  #12383 Fixes for KMSAN reports
  #12397 Run arc_evict thread at higher priority
  #12398 Remove b_pabd/b_rabd allocation from arc_hdr_alloc()
  #12422 Fix/improve dbuf hits accounting
  #12428 Fix unfortunate NULL in spa_update_dspace
  #12443 Fixed data integrity issue when underlying disk returns error
  #12446 Allow disabling of unmapped I/O on FreeBSD
  #12473 Initialize parity blocks before RAID-Z reconstruction benchmarking
  #12511 Make 'zpool labelclear -f' work on offlined disks
  #12514 FreeBSD: Don't remove SA xattr if not SA znode
  #12522 Compressed receive with different ashift can result in incorrect
         PSIZE on disk
  #12535 Verify embedded blkptr's in arc_read()
  #12541 Allow sending corrupt snapshots even if metadata is corrupted

Manually included upstream 2.1 backport pull request #12573:
  #12282 FreeBSD: fix compilation of FreeBSD world after 29274c9

Obtained from:	OpenZFS
OpenZFS commit:	71c6098526
OpenZFS tag:	zfs-2.1.1
Relnotes:	yes
2021-09-18 20:44:14 +02:00
Alexander Motin
1d8cda26ca vmd(4): Major driver refactoring
- Re-implement pcib interface to use standard pci bus driver on top of
vmd(4) instead of custom one.
 - Re-implement memory/bus resource allocation to properly handle even
complicated configurations.
 - Re-implement interrupt handling to evenly distribute children's MSI/
MSI-X interrupts between available vmd(4) MSI-X vectors and setup them
to be handled by standard OS mechanisms with minimal overhead, except
sharing when unavoidable.

Successfully tested on Dell XPS 13 laptop with Core i7-1185G7 CPU (VMD
device ID 0x9a0b) and single NVMe SSD, dual-booting with Windows 10.

Successfully tested on Supermicro X11DPI-NT motherboard with Xeon(R)
Gold 6242R CPUs (VMD device ID 0x201d), simultaneously handling NVMe
SSD on one PCIe port and PLX bridge with 3 NVMe and 1 AHCI SSDs on
another.  Handles SSD hot-plug (except Optane 905p for some reason,
which are not detected until manual bus rescan) and enabled IOMMU
(directly connected SSDs work, but ones connected to the PLX fail
without errors from IOMMU).

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
Differential revision:	https://reviews.freebsd.org/D31762

(cherry picked from commit 7af4475a6e)
2021-09-12 18:44:13 -04:00
Vladimir Kondratyev
139144a7ae wsp(4): Add evdev support.
Reviewed by:	hselasky
Tested by:	Greg V, Constantin Furst<constantin_AT_fuersten_DOT_info>
PR:		252236
Differential revision:	https://reviews.freebsd.org/D31653

(cherry picked from commit 8d73071c47)
2021-09-08 03:01:07 +03:00
Peter Grehan
d7388d33b4 MFC 517904de5c: igc(4): Introduce new driver for the Intel I225 Ethernet controller.
This controller supports 2.5G/1G/100MB/10MB speeds, and allows
tx/rx checksum offload, TSO, LRO, and multi-queue operation.

The driver was derived from code contributed by Intel, and modified
by Netgate to fit into the iflib framework.

Thanks to Mike Karels for testing and feedback on the driver.

Reviewed by:	bcr (manpages), kbowling, scottl, erj
Relnotes:	yes
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30668

(cherry picked from commit 517904de5c)
2021-08-15 20:33:54 +10:00
Kristof Provost
c3d03672e1 pf: syncookie support
Import OpenBSD's syncookie support for pf. This feature help pf resist
TCP SYN floods by only creating states once the remote host completes
the TCP handshake rather than when the initial SYN packet is received.

This is accomplished by using the initial sequence numbers to encode a
cookie (hence the name) in the SYN+ACK response and verifying this on
receipt of the client ACK.

Reviewed by:	kbowling
Obtained from:	OpenBSD
MFC after:	1 week
Sponsored by:	Modirum MDPay
Differential Revision:	https://reviews.freebsd.org/D31138

(cherry picked from commit 8e1864ed07)
2021-07-27 09:42:25 +02:00
Martin Matuska
06887e0686 zfs: update zfs_gitrev.h
From now on, every merge from vendor/openzfs/zfs-2.1-release should come
with an updated zfs_config.h and zfs_gitrev.h

(direct commit)
2021-07-23 03:29:33 +02:00
Emmanuel Vadot
4e6f174686 arm: allwinner: dtb: Add overlays to disable SD/MMC node
Useful for dev

Sponsored by:	Diablotin Systems

(cherry picked from commit bc805293d8)
2021-07-22 19:29:21 +02:00
Emmanuel Vadot
4187041f70 arm64: rockchip: Add some DTSO to disable sd/mmc
This helps during developement to reduce the number of mmc controller.

(cherry picked from commit eb09408085)
2021-07-22 19:29:20 +02:00
Emmanuel Vadot
c62869cdb7 sdhci_fdt: Add gpio_if.h to the source
Otherwise if we compile a kernel without gpio support this file isn't compiled.
Also it's needed so it's good to list all deps.

PR:	256756
(cherry picked from commit bf7b542e02)
2021-07-22 19:27:17 +02:00
Emmanuel Vadot
4292390bd6 modules: Only build sdhci_fdt for arm and arm64
Other FDT platform (like powerpc64* or riscv64) don't have gpio built
by default so just compile the module for those two arches.

Fixes:	9e08f82058 ("modules: Add sdhci_fdt module")
(cherry picked from commit 0b426a1c2c)
2021-07-22 18:51:33 +02:00
Emmanuel Vadot
f13f43e2ba modules: Add sdhci_fdt module
This is a module for sdhci on fdt system

(cherry picked from commit 9e08f82058)
2021-07-22 18:51:32 +02:00
Martin Matuska
e1946a699d zfs: merge openzfs/zfs@4f92fe0f5 (zfs-2.1-release) into stable/13
OpenZFS release 2.1.0

Version bump only, no changes in code.

Obtained from:	OpenZFS
OpenZFS commit:	4f92fe0f5c
OpenZFS tag:	zfs-2.1.0
Relnotes:	yes
2021-07-10 17:59:52 +02:00
Martin Matuska
a4c1676749 zfs: update zfs_config.h to match current OpenZFS version (4f92fe0f5)
TBD: fetch(3) support for keylocation=http(s)://

(direct commit)
2021-07-10 17:56:31 +02:00
Martin Matuska
7f101ca7d1 zfs: merge openzfs/zfs@508fff0e4 (zfs-2.1-release) into stable/13
Notable upstream pull request merges:
  #12253 module/zfs: simplify ddt_stat_add() loop
  #12280 Help compiller optimize out abd_verify()
  #12288 Avoid 64bit division in multilist index functions

Obtained from:	OpenZFS
OpenZFS commit:	508fff0e4b
OpenZFS tag:	zfs-2.1.0-rc8
2021-06-30 10:56:20 +02:00
Martin Matuska
363a2f5661 zfs: merge openzfs/zfs@aee26af27 (zfs-2.1-release) into stable/13
Notable upstream pull request merges:
  #12172 Use wmsum for arc, abd, dbuf and zfetch statistics
  #12227 Revert Consolidate arc_buf allocation checks
  #12273 zfs_metaslab_mem_limit should be 25 instead of 75
  #12266 Fix flag copying in resume case
  #12276 Update cache file when setting compatibility property

Obtained from:	OpenZFS
OpenZFS commit:	aee26af277
2021-06-26 13:38:37 +02:00
Martin Matuska
25302a721f zfs: merge openzfs/zfs@9a865b7fb (zfs-2.1-release) into stable/13
Notable upstream pull request merges:
  #11904 libspl: implement atomics in terms of atomics

Obtained from:	OpenZFS
OpenZFS commit:	9a865b7fb7
2021-06-22 09:18:11 +02:00
Mark Johnston
df57775d7a hyperv: Fix vmbus after the i386 4/4 split
The vmbus ISR needs to live in a trampoline.  Dynamically allocating a
trampoline at driver initialization time poses some difficulties due to
the fact that the KENTER macro assumes that the offset relative to
tramp_idleptd is fixed at static link time.  Another problem is that
native_lapic_ipi_alloc() uses setidt(), which assumes a fixed trampoline
offset.

Rather than fight this, move the Hyper-V ISR to i386/exception.s.  Add a
new HYPERV kernel option to make this optional, and configure it by
default on i386.  This is sufficient to make use of vmbus(4) after the
4/4 split.  Note that vmbus cannot be loaded dynamically and both the
HYPERV option and device must be configured together.  I think this is
not too onerous a requirement, since vmbus(4) was previously
non-functional.

Reported by:	Harry Schmalzbauer <freebsd@omnilan.de>
Tested by:	Harry Schmalzbauer <freebsd@omnilan.de>
Reviewed by:	whu, kib
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 97993d1ebf)
2021-06-21 21:09:17 -04:00
Martin Matuska
d4b4969967 zfs: merge openzfs/zfs@3de7aeb68 (zfs-2.1-release) into stable/13
Notable upstream pull request merges:
  #12054 Avoid deadlock when removing L2ARC devices under I/O
  #12221 vdev_draid_min_asize() ignores reserved space

Obtained from:	OpenZFS
OpenZFS commit:	3de7aeb68a
2021-06-20 15:16:16 +02:00
Marko Zec
4715d948c5 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.

Reviewed by:	melifaro
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D29821

(cherry picked from commit 2aca58e16f)
2021-06-17 12:07:05 +02:00
Martin Matuska
b0c251b0de zfs: merge openzfs/zfs@c3b60eded (zfs-2.1-release) into stable/13
Notable upstream pull request merges:
  #12015 Replace zstreamdump with zstream link
  #12046 Improve scrub maxinflight_bytes math.
  #12052 FreeBSD: incorporate changes to the VFS_QUOTACTL(9) KPI
  #12072 Let zfs diff be more permissive
  #12091 libzfs: On FreeBSD, use MNT_NOWAIT with getfsstat
  #12104 Reminder to update boot code after zpool upgrade
  #12114 Introduce write-mostly sums
  #12125 Modernise all (most) remaining .TH manpages
  #12145 More aggsum optimizations
  #12149 Multiple man-pages: Move to appropriate section
  #12158 Re-embed multilist_t storage
  #12177 Livelist logic should handle dedup blkptrs
  #12196 Unify manpage makefiles, move pages to better sexions, revisit some
  #12212 Remove pool io kstats

Obtained from:	OpenZFS
OpenZFS commit:	c3b60ededa
OpenZFS tag:	zfs-2.1.0-rc7
2021-06-13 05:43:03 +02:00
Martin Matuska
04c4bd7f7b zfs: merge openzfs/zfs@7d9f3ef0e (zfs-2.1-release) into stable/13
Notable upstream pull request merges:
  #11710 Allow zfs to send replication streams with missing snapshots
  #11786 Ratelimit deadman zevents as with delay zevents
  #11813 Allow pool names that look like Solaris disk names
  #11822 Atomically check and set dropped zevent count
  #11822 Don't scale zfs_zevent_len_max by CPU count
  #11837 zfs get -p only outputs 3 columns if "clones" property is empty
  #11849 Use dsl_scan_setup_check() to setup a scrub
  #11861 Improvements to the 'compatibility' property
  #11862 cmd/zfs receive: allow dry-run (-n) to check property args
  #11864 receive: don't fail inheriting (-x) properties on wrong dataset type
  #11877 Combine zio caches if possible
  #11881 FreeBSD: use vnlru_free_vfsops if available
  #11883 FreeBSD: add support for lockless symlink lookup
  #11884 FreeBSD: add missing seqc write begin/end around zfs_acl_chown_setattr
  #11896 Fix crash in zio_done error reporting
  #11905 zfs-send(8): Restore sorting of flags
  #11926 FreeBSD: damage control racing .. lookups in face of mkdir/rmdir
  #11938 Fix AVX512BW Fletcher code on AVX512-but-not-BW machines
  #11966 Scale worker threads and taskqs with number of CPUs
  #11997 FreeBSD: Don't force xattr mount option
  #11997 FreeBSD: Use SET_ERROR to trace xattr name errors
  #11998 Simplify/fix dnode_move() for dn_zfetch
  #12003 FreeBSD: Initialize/destroy zp->z_lock
  #12010 Fix dRAID self-healing short columns
  #12033 Revert "Fix raw sends on encrypted datasets when copying back snapshots"
  #12040 Reinstate the old zpool read label logic as a fallback
  #12049 FreeBSD: avoid memory allocation in arc_prune_async
  #12061 Fix dRAID sequential resilver silent damage handling
  #12077 FreeBSD: Retry OCF ENOMEM errors.
  #12088 Propagate vdev state due to invalid label corruption
  #12097 FreeBSD: Update dataset_kstats for zvols in dev mode

Obtained from:	OpenZFS
OpenZFS commit:	7d9f3ef0ef
OpenZFS tag:	2.1.0-rc6
2021-06-08 17:01:18 +02:00
Kristof Provost
f9b057eaf6 pf: Introduce nvlist variant of DIOCADDRULE
This will make future extensions of the API much easier.
The intent is to remove support for DIOCADDRULE in FreeBSD 14.

Reviewed by:	markj (previous version), glebius (previous version)
MFC after:	4 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D29557

(cherry picked from commit 5c62eded5a)
2021-05-07 10:15:41 +02:00
Vladimir Kondratyev
91e562169c hidmap: add missing opt_hid.h to module Makefile
Reported by:	pstef
2021-04-30 23:12:33 +03:00
Martin Matuska
049d49e40a zfs: merge openzfs/zfs@3522f57b6 (master)
Notable upstream pull request merges:
  #11742 When specifying raidz vdev name, parity count should match
  #11744 Use a helper function to clarify gang block size
  #11771 Support running FreeBSD buildworld on Arm-based macOS hosts

This is the last update that will be MFCed into stable/13.

From now on, the tracking of OpenZFS branches will be different:
- main continues tracking openzfs/zfs/master
- stable/13 is going to track openzfs/zfs/zfs-2.1-release

Obtained from:	OpenZFS

(cherry picked from commit 6db169e920)
2021-04-22 17:03:06 +02:00
Vladimir Kondratyev
99bc385243 hid: add opt_hid.h to modules that use HID_DEBUG
Submitted by:	Greg V <greg_AT_unrelenting_DOT_technology>
Reviewed by:	imp, wulf
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D28995

(cherry picked from commit 6241b57131)
2021-04-12 00:48:51 +03:00
Ka Ho Ng
d7ffa208d9 AMD-vi: Fix IOMMU device interrupts being overridden
Currently, AMD-vi PCI-e passthrough will lead to the following lines in
dmesg:
"kernel: CPU0: local APIC error 0x40
ivhd0: Error: completion failed tail:0x720, head:0x0."

After some tracing, the problem is due to the interaction with
amdvi_alloc_intr_resources() and pci_driver_added(). In ivrs_drv, the
identification of AMD-vi IVHD is done by walking over the ACPI IVRS
table and ivhdX device_ts are added under the acpi bus, while there are
no driver handling the corresponding IOMMU PCI function. In
amdvi_alloc_intr_resources(), the MSI intr are allocated with the ivhdX
device_t instead of the IOMMU PCI function device_t. bus_setup_intr() is
called on ivhdX. the IOMMU pci function device_t is only used for
pci_enable_msi(). Since bus_setup_intr() is not called on IOMMU pci
function, the IOMMU PCI function device_t's dinfo->cfg.msi is never
updated to reflect the supposed msi_data and msi_addr. So the msi_data
and msi_addr stay in the value 0. When pci_driver_added() tried to loop
over the children of a pci bus, and do pci_cfg_restore() on each of
them, msi_addr and msi_data with value 0 will be written to the MSI
capability of the IOMMU pci function, thus explaining the errors in
dmesg.

This change includes an amdiommu driver which currently does attaching,
detaching and providing DEVMETHODs for setting up and tearing down
interrupt. The purpose of the driver is to prevent pci_driver_added()
from calling pci_cfg_restore() on the IOMMU PCI function device_t.
The introduction of the amdiommu driver handles allocation of an IRQ
resource within the IOMMU PCI function, so that the dinfo->cfg.msi is
populated.

This has been tested on EPYC Rome 7282 with Radeon 5700XT GPU.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	jhb
Approved by:	philip (mentor)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D28984

(cherry picked from commit 74ada297e8)
2021-04-07 18:55:38 +08:00
Martin Matuska
93d1c189bc zfs: merge OpenZFS master-891568c99
Notable upstream pull request merges:
  #11652 Split dmu_zfetch() speculation and execution parts
  #11682 Fix zfs_get_data access to files with wrong generation
  #11735 Clean up RAIDZ/DRAID ereport code
  #11737 Initialize metaslab range trees in metaslab_init
  #11739 FreeBSD: make seqc asserts conditional on replay
  #11763 Allow setting bootfs property on pools with indirect vdevs
  #11767 FreeBSD: Fix memory leaks in kstats

Obtained from:	OpenZFS

(cherry picked from commit f9693bef8d)
2021-04-04 15:19:09 +02:00
Martin Matuska
cf2a726434 zfs: merge OpenZFS master-9305ff2ed
Notable upstream pull request merges:
  #11153 Scalable teardown lock for FreeBSD
  #11651 Don't bomb out when using keylocation=file://
  #11667 zvol: call zil_replaying() during replay
  #11683 abd_get_offset_struct() may allocate new abd
  #11693 Intentionally allow ZFS_READONLY in zfs_write
  #11716 zpool import cachefile improvements
  #11720 FreeBSD: Clean up zfsdev_close to match Linux
  #11730 FreeBSD: bring back possibility to rewind the
         checkpoint from bootloader

Obtained from:	OpenZFS

(cherry picked from commit 9db44a8e5d)
2021-04-04 15:18:45 +02:00
Dmitry Chagin
f5209bef0f Get rid of i386 ref here as linux64 is a 64-bit module.
Reviewed By:		emaste, imp
Differential Revision:	https://reviews.freebsd.org/D29412

(cherry picked from commit 88588c4b76)
2021-04-01 11:03:35 +03:00
Hans Petter Selasky
773811507d MFC ebe5cf355d:
Implement basic support for allocating memory from a specific numa node
in the LinuxKPI.

Differential Revision:	https://reviews.freebsd.org/D29077
Reviewed by:	markj@ and kib@
Sponsored by:	Mellanox Technologies // NVIDIA Networking

(cherry picked from commit ebe5cf355d)
2021-03-23 11:50:47 +01:00