cd579b6f kp Jan. 28, 2021, 3:46 p.m.
0c458752 kp Jan. 28, 2021, 3:46 p.m.
When using DUP-TO rule, frames are duplicated 3 times on both output
interfaces and duplication interface. Add a flag to not duplicate a
duplicated frame.

Inspired by a patch from MiƂosz Kaniewski milosz.kaniewski at

Reviewed by:		kp@
Differential Revision:
d386f3a3 bz Jan. 28, 2021, 4:37 p.m.
with DRM.  Be sure to update your drm-kmod port to after the update.
fa765ca7 bz Jan. 28, 2021, 4:32 p.m.
This code implements a version of the devres framework found
working for various iwlwifi use cases and also providing functions
for ttm_page_alloc_dma.c from DRM.

Part of the framework replicates the consumed KPI, while others
are internal helper functions.

In addition the simple devm_k*malloc() consumers were implemented
and kvasprintf() was enhanced to also work for the devm_kasprintf()
Addmittingly lkpi_devm_kmalloc_release() could be avoided but for
the overall understanding of the code and possible memory tracing
it may still be helpful.

Further devsres consumer are implemented for iwlwifi but will follow
later as the main reason for this change is to sort out overlap with

Sponsored-by:	The FreeBSD Foundation
Obtained-from:	bz_iwlwifi
MFC After:	3 days
Reviewed-by:	hselasky, manu
Differential Revision:
1fac2cb4 bz Jan. 28, 2021, 4:23 p.m.
In pci_domain_nr() directly return the domain which got set in
lkpifill_pci_dev() in all cases.  This was missed between D27550
and 105a37cac76b971f7a94409fbdc4f508a7e97fa0 .

In order to implement pci_dev_put() harmonize further code
(which was started in the aforementioned commit) and add kobj
related bits (through the now common lkpifill_pci_dev() code)
to the DRM specific calls without adding the DRM allocated
pci devices to the pci_devices list.
Add a release for the lkpinew_pci_dev() (DRM) case so freeing
will work.
This allows the DRM created devices to use the normal kobj/refcount
logic and work with, e.g., pci_dev_put().
(For a slightly more detailed code walk see the review).

Sponsored-by:	The FreeBSD Foundation
Obtained-from:	bz_iwlwifi (partially)
MFC after:	3 days
Differential Revision:
4abbf816 bz Jan. 28, 2021, 4:15 p.m.
The upcoming in-kernel implementations for LinuxKPI based on work on
iwlwifi (and other wireless drivers) conflicts in a few places with
the drm-kmod graphics work outside the base system.

In order to transition smoothly extract the conflicting bits.
This included "unaligned" accessor functions, sg_pcopy_from_buffer(),
IS_*() macros (to be further restricted in the future), power management
bits (possibly no longer conflicting with DRM), and other minor changes.

Obtained-from:  bz_iwlwifi
Sponsored-by:   The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	kib, hselasky, manu, bdragon (looked at earlier versions)
Differential Revision:
a6c2507d bz Jan. 28, 2021, 4:05 p.m.
Implement linux firmware KPI compat code.
This includes: request_firmware() request_firmware_nowait(),
request_firmware_direct(), firmware_request_nowarn(),
and release_firmware().

Given we will try to map requested names from natively ported
or full-linuxkpi-using drivers to a firmware(9) auto-loading
name format (.ko file name and image name matching),
we quieten firmware(9) and print success or failure (unless
the _nowarn() version was called) in the linuxkpi implementation.
At the moment we try up-to 4 different naming combinations,
with path stripped, original name, and requested name with '/'
or '.' replaced.

We do not currently defer loading in the "nowait" case.

Sponsored-by:	The FreeBSD Foundation
Sponsored-by:	Rubicon Communications, LLC ("Netgate")
		(firmware(9) nowarn update from D27413)
MFC after:	3 days
Reviewed by:	kib, manu (looked at older versions)
Differential Revision:
b8051298 hselasky Jan. 28, 2021, 1:51 p.m.
This is a regression issue after the new UAR API was introduced
by f8f5b459d21e .

MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
4e76e4c3 andrew Jan. 28, 2021, 10:41 a.m.
This is all code only run on ARMv4 and ARMv5. Support for these have
been dropped from FreeBSD.

Differential Revision:
4d2ff233 andrew Jan. 28, 2021, 10:39 a.m.
This was only used when building for ARMv4 or some ARMv5 or when
_STANDALONE is defined. As ARMv4 and ARMv5 support has been removed,
and we only define _STANDALONE in the bootloader where we don't use
this version of memcpy we can remove it.

Differential Revision:
e09c8c9a andrew Jan. 28, 2021, 10:33 a.m.
Reviewed by:	imp
Differential Revision:
f59810e3 bapt Jan. 28, 2021, 8:20 a.m.
9b388ac3 tsoome Jan. 28, 2021, 7:52 a.m.
While loading kernel, we check if vt/vbe backend support is included in
kernel and set the tg_kernel_supported flag in gfx_state. unload
command needs to reset this flag to allow next load to perform
this check with new kernel.

Reported by: jhb
0e01ea87 cy Jan. 28, 2021, 5:52 a.m.
MFC after:	3 days
393e6924 noreply Jan. 28, 2021, 5:36 a.m.
While you can use zdb -R poolname vdev:offset:[<lsize>/]<psize>[:flags] 
to extract individual DVAs from a vdev, it would be handy for be able 
copy an entire file out of the pool.

Given a file or object number, add support to copy the contents to a 
file. Useful for debugging and recovery.

Reviewed-by: Jorgen Lundman <>
Reviewed-by: Brian Behlendorf <>
Signed-off-by: Allan Jude <>
Closes #11027