Commit graph

44084 commits

Author SHA1 Message Date
Aymeric Wibo
84bbfc32a3
acpi_powerres: D3cold support
Cherry-pick commit 0b76c0a from ACPICA (actypes: Distinguish between
D3hot/cold, and default `ACPI_STATE_D3` to D3cold).

The same distinction is made between `PCI_POWERSTATE_D3_HOT` and
`PCI_POWERSTATE_D3_COLD`, as they're defined by ACPI (and are asserted
to be the same).

D3cold is essentially the same as D3hot except the power resources are
turned off.  Add support for D3cold to `acpi_pwr_switch_consumer`.

`acpi_d_state_to_str` replaces the `printf("D%d", d_state)` pattern,
allowing for "D3hot" and "D3cold" strings to be printed instead of just
"D3".

Reviewed by:	markj, ziaee, mckusick (mentor)
Approved by:	markj, mckusick (mentor)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D48384
2025-08-08 11:42:44 +02:00
Andriy Gapon
6eb503116e sdio: don't use CAM_PRIORITY_NONE for queued CCB-s
This is similar to changes done in other CAM drivers and fixes a panic
because of a sanity check added in b4b166b8c4.

While here, remove unneeded ccb setup in sdiobdiscover.
It's possible that ccb allocation in that function is not needed as
well, but I wasn't sure about that.

MFC after:	1 week
2025-08-05 19:27:12 +03:00
Mark Johnston
4a8e62a120 qat: Revert changes to BAR indices
It is not clear how commit ded037e65e could reasonably change BAR
indices, and doing so broke at least the C3000 driver.  Revert that part
of the change.

Reported by:	kp
Reviewed by:	kp, Haresh Sankar Raj <hareshx.sankar.raj@intel.com>
MFC after:	3 days
Fixes:		ded037e65e ("qat: driver updates to improve code and fix bugs")
Differential Revision:	https://reviews.freebsd.org/D51664
2025-08-04 12:44:05 +00:00
Peter Jeremy
dbc22fdad8
eqos: Whitespace cleanup
Reformat if_eqos.c to make it easier to follow and closer to style(9).
No functional changes.

Reviewed by:	fuz@
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D51693
2025-08-03 10:11:05 +10:00
Bojan Novković
7a9a15eaf9 if_dwc: Add support for cvitek ethernet controller
This patch adds support for the cvitek flavor of the DWC ethernet
controller. This controller is present on the Milk-V riscv SoCs.

Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D48530
2025-08-01 14:35:54 +02:00
Bojan Novković
19643b415b if_dwc: Ignore clk_set_assigned errors if "assigned_clocks" is not specified
dwc_attach will currently fail if clk_set_assigned fails, even if the
"assigned_clock" property was not specified. Since there are platforms
whose DTS files do not have this property (e.g. if_dwc_aw,
if_dwc_socfpga), do not return an error if clk_set_assigned
returns ENOENT.

Reviewed by:	manu
Differential review:	https://reviews.freebsd.org/D48529
2025-08-01 14:35:54 +02:00
Bojan Novković
89e650eacc sdhci: Add driver for the cvitek sdhci controller
This patch add support for cvitek SDHCI controller (only SD card mode).
This controller is present on Milk-V's riscv SoCs.

Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D48528
2025-08-01 14:35:54 +02:00
Bjoern A. Zeeb
0f8a8416a4 dwmmc: cleanup cmd and locking, consistency between mmc and mmccam
In general sprinkle locking assertions and harmonized KASSERTs
throughout the upper part of the driver to document expectations.

In dwmmc_cmd_done() "cmd" should be set correctly and be used for
both MMCCAM and classic mmc rather than special-casing mmccam.
In dwmmc_next_operation() place variable declarations on the top
for both cases before the first debug and lock assertion calls;
then factor out common parts at the end and put both cases in the
same order.
By calling dwmmc_next_operation() directly from both dwmmc_request()
in the mmc case, and dwmmc_cam_request() in the mmccase (rather than)
chaining calls in the latter, we avoid unlocking the sc in the mmccam
case and have a consistent call path from both; also removing the
mmccam #ifdef from dwmmc_request() brings more clarity.
In dwmmc_next_operation() enhance the panic/error messages with
some extra information and assert that we come in with a cam pinfo
on CAM_ACTIVE_INDEX.

MFC after:      3 days
Reviewed by:	manu
Differential Revision: https://reviews.freebsd.org/D51628
2025-07-31 17:37:54 +00:00
Ed Maste
74072e9f16 usbhid: Enable by default
Co-authored-by: Emmanuel Vadot <manu@FreeBSD.org>
Reviewed by:	bapt, wulf
Relnotes:	Yes
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45659
2025-07-30 14:31:54 -04:00
Chandrakanth Patil
f795179987 pci_iov: Support dynamic subordinate bus growth during VF creation
Certain SR-IOV devices enumerate Virtual Functions (VFs) on a different
PCIe bus than their parent Physical Function (PF).  In such cases, the
default subordinate bus range assigned by BIOS may be insufficient to cover
all VFs.

This patch dynamically expands the subordinate bus range by:
- Allocating additional bus numbers using bus_alloc_resource() when VFs are
  initialized
- Releasing the reserved bus range during VF deletion via
  bus_release_resource()

Reviewed by:	jhb
2025-07-29 15:09:53 -04:00
Poul-Henning Kamp
36027361f9 iichid: Stop using split I²C bus transactions
Read IIC-HID reports as a single I²C transaction, instead of reading
first the two byte length field, holding the bus, and then the rest
of the report in a separate transaction.

While technically legal, I²C bus split transactions are not universally
supported, and in particular the "Snapdragon Elite" ARM CPU does
not seem to support them.

It is also not obvious that they are beneficial in this case, given
the overhead of controller setup, interrupts and tear-down.

Reviewed by: wulf
Differential Revision: https://reviews.freebsd.org/D51302
2025-07-29 06:17:43 +00:00
John Baldwin
9f0f30bc1f libnvmf: Add nvmf_nqn_valid_strict() function
This moves the checks previously under #ifdef STRICT in
nvmf_nqn_valid() into a separate helper for userland.  This
requires that the NQN starts with "nqn.YYYY-MM." followed by at
least one additional character.

Reviewed by:	asomers
Differential Revision:	https://reviews.freebsd.org/D48767
2025-07-28 14:33:03 -04:00
Bojan Novković
a4197ea477 vmm: Add support for guest NUMA emulation
This change adds the necessary kernelspace bits required for
supporting NUMA domains in bhyve VMs.

The layout of system memory segments and how they're created has
been reworked. Each guest NUMA domain will now have its own memory
segment. Furthermore, this change allows users to tweak the domain's
backing vm_object domainset(9) policy.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D44565
2025-07-27 18:31:48 +02:00
Aymeric Wibo
f2de5a6dd7
amdsmu: Read and dump idlemask
Read and dump the SMU's idlemask value in `dev.amdsmu.0.idlemask`
sysctl.

The idlemask is used internally by AMD and its value is not documented
anywhere. This patch exposes it mainly to help AMD diagnose issues with
S0i3 entry on FreeBSD.

Reviewed by:	cem, emaste, kib, mckusick (mentor)
Approved by:	emaste, kib, mckusick (mentor)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D51487
2025-07-27 15:17:51 +02:00
Ed Maste
7507d6ca0e vmm: Clean up legacy create/destroy interface
Add sysctl descriptions, and remove surprising default text.

PR:		288437
Reviewed by:	jhb, markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51533
2025-07-26 18:51:37 -04:00
Aymeric Wibo
e4e44f69f9
amdsmu: Expose sysctls for metrics about last sleep
Get "log" address with the `SMU_MSG_LOG_GETDRAM_ADDR_HI/LO` SMU
commands. From this, we dump & read metrics about residency in various
sleep states (none, S0i2, and S0i3), as well as active durations for
the IP blocks on the CPU during the last sleep. All these metrics are
exposed under the `dev.amdsmu.0.metrics` node.

This is useful for debugging sleep as the residency registers in the
`_LPI` object are not populated on some systems (e.g. AMD Phoenix).

A `dev.amdsmu.0.ip_blocks.XXX` node is also created for each IP block,
with children for the current active state and time spent active during
the last sleep.

Differential Revision: https://reviews.freebsd.org/D48714

Reviewed by:	cem, kib, mckusick
Approved by:	kib, mckusick
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D48714
2025-07-27 00:26:46 +02:00
Aymeric Wibo
f261b63307
amdsmu: Initial work on a driver for the AMD SMU
Start work on a driver for the AMD SMU (system management unit), which
will eventually be used for getting S0ix statistics (e.g. how long the
CPU has spent in the deepest - S0i3 - sleep state during the last
sleep) as well as letting PMFW (power management firmware, running on
the SMU) know when we intend to enter and exit sleep. It is what's
responsible for actually turning off the VDD line to the CPU.

With this commit, amdsmu is just able to get the SMU's firmware version
on AMD Rembrandt, Phoenix, and Strix Point CPUs.

This is the equivalent to amd-pmc on Linux.

Reviewed by:	cem, kib, mckusick
Approved by:	kib, mckusick
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D48683
2025-07-26 21:17:06 +02:00
Gleb Smirnoff
b93e930ca2 sendfile: retire M_BLOCKED
Follow unix(4) commit 51ac5ee0d5 and retire M_BLOCKED for TCP sockets as
well.  The M_BLOCKED flag was introduced back 2016 together with non-
blocking sendfile(2).  It marked mbufs in a sending socket buffer that
could be ready to sent, but are sitting behind an M_NOTREADY mbuf(s), that
blocks them.

You may consider this flag as an INVARIANT flag that helped to ensure
socket buffer consistency.  Or maybe the socket code was so convoluted
back then, that it was unclear if sbfree() may be called on an mbuf that
is in the middle of the buffer, and I decided to introduce the flag to
protect against that.  With today state of socket buffer code it became
clear that the latter cannot happen.  And this commit adds an assertion
proving that.

Reviewed by:		markj
Differential Revision:	https://reviews.freebsd.org/D50728
2025-07-25 13:06:28 -07:00
Richard Russo
15925062e1 biosboot: Detect memory disks from PXE
Walk through the disk driver entries chained off of INT13.

MEMDISK is part of the Syslinux project; it loads disk images into
memory, sets an int 13h hook and then does a BIOS boot from the image;
this can be used as part of a PXE boot environment to load installer
disks, however the disks are not accessible from inside the FreeBSD
kernel because it doesn't access disks through BIOS APIs.

This patch detects the disk images in the loader, and passes their
address and length as a driver hint. When the md driver sees the hint,
it maps the image, and presents it to the system.

(rebased and reworked from https://reviews.freebsd.org/D27349)

Feedback from: kib, bapt, olce
Differential Revision:	https://reviews.freebsd.org/D45404
2025-07-22 18:10:25 -06:00
Matteo Riondato
7cd7b849b0 vt: refer to correct man section.
Signed-off-by: Matteo Riondato <matteo@FreeBSD.org>
Reviewed by: imp,emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/1781
2025-07-22 09:26:21 -06:00
ShengYi Hung
f840492b5b efidev: add support for memory attribute
The EFI_PROPERTIES_TABLE has been deprecated in the UEFI specification.
It is now replaced by the EFI_MEMORY_ATTRIBUTES_TABLE, which provides
a new header and data format for describing memory region attributes.

Reviewed by:    imp
Approved by:    markj (mentor)
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D49998
2025-07-22 00:45:29 -04:00
Zhenlei Huang
386960a880 qlnxe: Advertise the IFCAP_HWSTATS capability
The hardware can count statistics and the driver has already retrieved
them via qlnx_get_counter().

Advertise the IFCAP_HWSTATS capability to avoid the net stack from
double counting IFCOUNTER_IBYTES.

Reviewed by:	kbowling
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D51451
2025-07-22 12:11:02 +08:00
Zhenlei Huang
c18860339d qlnxe: Fix advertising the IFCAP_LINKSTATE capability
The following up advertising of IFCAP_HWCSUM capability unconditionally
overwrite IFCAP_LINKSTATE.

Reviewed by:	kbowling
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D51450
2025-07-22 12:11:02 +08:00
Warner Losh
b21e67875b nvme: Move AER processing into a task thread
Move the AER processing into the taskqueue thread. We do memory
allocations and such burried deep in things we call, so this just makes
all that simpler and doesn't stall the completion thread. It fixes a few
panics if you get a reliability failure from the drive at the wrong
time.

Sponsored by:		Netflix
MFC After:		2 weeks
2025-07-21 22:00:33 -06:00
Warner Losh
35b2e888ef nvme: Finish removing failed request queue
Remove the failed request queue, it's been unused since bc85cd303c
when we removed the last function that referenced it. Also adjust
the comment for the reset taskqueue. We still start 2 threads.

Sponsored by:		Netflix
2025-07-21 22:00:33 -06:00
Andrew Turner
7fcdbfc9ba dev/ofw: Add interrupt-map support
Follow interrupt-map properties until either an interrupt controller or
invalid node is found. In the former case return the translated details
for the interrupt controller driver to decode. In the latter case return
0 as an error.

Tested on the Arm DTS files that use interrupt-maps and with a
userspace test.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D51257
2025-07-21 13:07:14 +01:00
Mark Johnston
fa8db724ae random: Treat writes to /dev/random as separate from /entropy
RANDOM_CACHED is overloaded to refer both to entropy obtained from files
loaded by the boot loader, and entropy obtained via writes to
/dev/random.  Introduce a new source, RANDOM_RANDOMDEV, to refer to the
latter.  This is to enable treating RANDOM_CACHED as a special case in
the NIST health test implementation.

Update the default harvest_mask in rc.conf to include RANDOM_RANDOMDEV,
preserving the old behaviour of accepting writes to /dev/random.

Bump __FreeBSD_version for modules which register a pure source, since
all of their values have now shifted.

Reviewed by:	cem
MFC after:	3 months
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D51155
2025-07-18 20:33:06 +00:00
Mark Johnston
f92ff79720 random: Add NIST SP 800-90B entropy source health test implementations
This patch implements the noise source health tests described in chapter
four of NIST SP 800-90B[1].  The repetition count test and adaptive
proportion test both help identify cases where a noise source is stuck
and generating the same output too frequently.  The tests are disabled
by default, but making an implementation available may help implementors
conform to FIPS validation requirements.  This implementation aims to
comply with the requirements listed in section 4.3 of the document.

To enable health testing, set the kern.random.nist_healthtest_enabled
tunable to 1.  Startup testing is implemented as specified in the
document: the first 1024 samples from a source are evaluated according
to the two tests, and they are discarded.  The RANDOM_CACHED and
RANDOM_PURE_VMGENID sources are excluded from testing, as they are
effectively a one-time source of entropy, and statistical testing
doesn't seem to provide much use.

Since the first 1024 samples from entropy sources are discarded by the
implementation, it is possible that we might end up with insufficient
entropy during early boot if no boot-time entropy source (i.e.,
/entropy) is provided.  If this is a problem, it could be remediated by
modifying the implementation to poll applicable sources (e.g., RDRAND)
to complete startup testing quickly, rather than relying on the random
kthread.

The entry point for the tests is random_harvest_healthtest(), intended
to be called from individual CSPRNG implementations in order to leverage
their locking context, e.g., the entropy pool lock in Fortuna.  The
Fortuna implementation is modified to call this entry point, mainly to
demonstrate how the health tests can be integrated.

The tests operate on the entropy buffer plus the embedded timestamp,
treating them as a single value.  We could alternately apply the tests
to the buffer and timestamp separately.

The main parameters for the tests themselves are H, the expected
min-entropy of samples, and alpha, the desired false positive error
rate.  This implementation selects H=1 and alpha=2^{-34}; since each
sample includes a CPU cycle counter value, it seems reasonable to expect
at least one bit of entropy from among the low bits of the
high-frequency counter present on systems where FreeBSD is commonly
deployed, and the false positive rate was somewhat arbitrarily selected;
for more details see the comment in random_healthtest_init().

When a health test fails, a message is printed to the console and the
source is disabled.  On-demand testing is also supported via the
kern.random.nist_healthtest_ondemand sysctl.  This can be used be an
administrator to re-enable a disabled source, following the same startup
testing mentioned above.

[1] https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-90B.pdf

Reviewed by:	cem
MFC after:	3 months
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D51154
2025-07-18 20:33:06 +00:00
Krzysztof Galazka
0464725903 ice(4): Fix setting VF MAC address
MAC address assigned to a Virtual Function using iovctl configuration
was not passed to the VF, but its presence caused ICE to reject random
address generated by the VF. This lead to VF not being able to send
or recieve traffic. Send the administratively assigned MAC address to
a VF in a response to the 'Get VF Resources' virtual channel command.

While at that replace bcopy with memcpy for consistency, and shorten
an over 80 characters line.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1573
2025-07-18 13:16:17 -06:00
Eric Joyner
430f1acc45 ice(4): Add MAC filter and VLAN resource limits to VFs
Adds two new parameters to iovctl config for VLAN filter limits and MAC
filter limits and gives them defaults of 64 and 16, respectively.

These are intended to limit the number of resources that a VF can
consume so that any one VF cannot starve an other VFs or the PF of
filters.

Signed-off-by: Eric Joyner <eric.joyner@intel.com>
Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1573
2025-07-18 13:16:17 -06:00
Krzysztof Galazka
51ed28c12f ice(4): Enable WB_ON_ITR capability for VFs (#76)
Let VF driver know that HW supports WB_ON_ITR
feature. It allows polling mode driver such
as DPDK to configure an immediate write-back
of completed descriptors.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1573
2025-07-18 13:16:17 -06:00
Krzysztof Galazka
69bb592fa3 ice(4): Fix set RSS hena virtchnl op handler
Remove existing RSS HENA configuration to make sure that
only config requested by VF is applied and allow VFs to
disable RSS completely.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1573
2025-07-18 13:16:17 -06:00
Krzysztof Galazka
d6958f3fae ice(4): Fix re-enabling VF queues
On receiving a virtual channel request from VF driver tried
to configure and enable Tx and Rx queues without making
sure that they were disabled. It caused issue with reloading
a VF driver without a reset e.g. in case it crashed.
Fix that by always disabling all Rx and Tx queues.

While at that make sure that only queues requested by VF
driver are enabled. VF driver may use less queues than
assigned to the function when it was created.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1573
2025-07-18 13:16:16 -06:00
Krzysztof Galazka
925a15b969 ice(4): Add basic VFLR handler
PF driver needs to tear down and setup VF configuration after
a reset event, e.g. due to reloading a VF driver. Re-use
ice_reset_vf function for that by adding new parameter,
which decides if new reset has to be triggered.
This most likely does not cover all necessary steps
and will be extended in future commits.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1573
2025-07-18 13:16:16 -06:00
Krzysztof Galazka
21f3395713 ice(4): Fix panic when VF uses less queues then available
VF driver may request to configure MSI-X vectors for less
queues than assigned by PF. Don't try to configure
unassigned vectors to avoid panic.

While at that make the loop process whole array of vectors
received in a VIRTCHNL_OP_CFG_IRQ_MAP message from a VF.
It's not guarantied that vector '0', which is used for other
interrupt causes and is not mapped to a queue, will be always
on the last position. Condition inside the loop already
handles that vector correctly.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1573
2025-07-18 13:16:16 -06:00
Krzysztof Galazka
160becc7dc ice: Add broadcast filter while creating VF
Filter for unicast MAC address is configured
with a virtual channel message, but filter for
a broadcast traffic was missing. It caused
issues with e.g. ARP.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1573
2025-07-18 13:16:16 -06:00
Krzysztof Galazka
bc761988b7 ice: Add host SR-IOV support
Enable basic SR-IOV support for E800 adapters.

Authored-by: Eric Joyner <erj@FreeBSD.org>
Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1573
2025-07-18 13:16:16 -06:00
Konstantin Belousov
72c9ad9331 mlx5en ipsec offload: copy xform_history to the ipsec_accel_in_tag
Reviewed by:	Ariel Ehrenberg <aehrenberg@nvidia.com>, slavash
Sponsored by:	Nvidia networking
2025-07-17 12:36:26 +03:00
Zhenlei Huang
12fea46407 qlnxe: Fix error handling of SIOCGI2C ioctl
The error -1 is actually ERESTART in the context of syscall. It is for
kernel mode only and will not be passed to user mode. When the kernel
sees this error it will restart the syscall.

When the the SFP module data is not available, e.g. the SFP module is
not present, the ioctl handler returns ERESTART and kernel will retry
infinitely, hence the userland `ifconfig -v ql0` will hang forever until
get interrupted. That is apparently wrong.

Fix that by returning error ENODEV to indicate the SFP module data is
not available.

As for the case that ecore_ptt_acquire() fails, it appears to be quite
safe to restart, so keep returning ERESTART.

Reported by:	Steve Wheeler
See also:	https://redmine.pfsense.org/issues/16248
Reviewed by:	kbowling
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D51351
2025-07-17 12:01:16 +08:00
Zhenlei Huang
10d9ec31bf qlnxe: Fix build with INET
opt_inet.h is missing from 5684c8783b, thus actually `#ifdef INET`
does not work.

PR:		287445
See also:	https://redmine.pfsense.org/issues/16248
Reviewed by:	kbowling
Tested by:	leper <leper4@protonmail.com>
Fixes:		5684c8783b qlnxe: Add missing #ifdef INET to fix amd64 LINT-NOINET/NOIP builds
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D51295
2025-07-17 12:01:16 +08:00
Ahmad Khalifa
cc86794b03 gpiobus: plug IRQ leaks
Unmap the IRQ instead of just freeing the map data in the case of an
error. Also don't overwrite the resource's virtual address since the
copy of the map data made by intr_activate_irq is stored there.

Implement gpiobus_release_resource so it can unmap IRQs mapped by
gpio_alloc_intr_resource.

Reviewed by:	imp
Approved by:	imp (mentor)
Differential Revision:	https://reviews.freebsd.org/D51325
2025-07-17 03:33:52 +03:00
Ariel Ehrenberg
d6d66936c4 mlx5en: fix TLS Rx hardware offload initialization
The TLS RX context had the tcp sequence number of next TLS record set
in resync_tcp_sn parameter instead of in next_record_tcp_sn parameter
during hardware initialization.  This prevent the hardware from
synchronizing with the TLS stream, and caused TLS offload to remain
inactive.  Set next_record_tcp_sn to the next TCP sequence number and
resync_tcp_sn to zero to enable proper TLS record boundary detection
and activate hardware offload.

Reviewed by:	kib, slavash
Sponsored by:	NVidia networking
MFC after:	1 week
2025-07-17 02:32:27 +03:00
Jaeyoon Choi
0d5fdcb63c ufshci: enable the ufshci module to load at boot time
The ufshci driver tried to allocate a single 256KB segment for the UTP
command descriptor during boot, but failed due to memory fragmentation.
I fixed it to allocate the buffer in 8KB segments instead.

Sponsored by:		Samsung Electronics
Reviewed by:		imp
Differential Revision:	https://reviews.freebsd.org/D50933
2025-07-16 17:20:59 -06:00
jefby
5f9a73c22f mgb: Fix mac tx disable bug in teardown
Signed-off-by: jefby <jef199006@gmail.com>
Reviewed-by: emaste
Pull-request: https://github.com/freebsd/freebsd-src/pull/1755
2025-07-16 17:30:06 -04:00
Mateusz Piotrowski
56eb7566c4 md(4): Stop symlinking vn.4 to md.4
We've done the same in the past to the vnconfig.8->mdconfig.8 link in:
    eb5f456981 Remove ancient vnconfig symlink

Reviewed by:	bcr, markj, ziaee
Approved by:	markj (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D27122
2025-07-16 16:23:41 +02:00
Tom Jones
4d718f57c5 xhci pci: Add some amd xhci controller device ids
Reviewed by: aokblast
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51259
2025-07-14 09:03:45 +01:00
Ahmad Khalifa
3d5ef29825 acpi_gpiobus: don't print error message if _AEI object doesn't exist
GPIO controllers aren't required to have an _AEI object.

Reviewed by:	wulf
Approved by:	imp (mentor)
Differential Revision:	https://reviews.freebsd.org/D51236
2025-07-11 15:10:00 +03:00
Jessica Clarke
cb75bb5126 vmbus: Avoid gratuitous ifdef and use more generic implementation instead
Checking for __LP64__ is non-portable as it assumes that ILP32 and LP64
are the only two ABIs that exist, but CheriBSD supports an additional
ABI where long is still 64-bit but pointers are 128-bit capabilities,
and thus __LP64__ is not defined. We could change this to check the
value of __SIZEOF_LONG__, since the code here only cares about that
aspect of the ABI, however in this instance, the only real reason an
ifdef is used at all is to be able to get log2(sizeof(u_long)), but if
we instead multiply and divide rather than shift, and let the compiler
optimise that to a shift, we can just use sizeof(u_long) instead. Note
also that VMBUS_EVTFLAGS_MAX could always just have been defined as
VMBUS_EVTFLAGS_SIZE / sizeof(u_long).

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D50630
2025-07-10 20:33:33 +01:00
Ariel Ehrenberg
b6b3743fa2 mlx5en: add driver tls status string method for rx sessions
Upon collecting tls information, kernel calls driver to get driver/hw
tls state. Driver calls hw to get its tracking and authentication
states, and dump them into the driver state buffer. This requires a
sleep to wait for the hw response.

Reviewed by:	kib
Sponsored by:	NVidia networking
2025-07-10 17:42:27 +03:00
Konstantin Belousov
cdd8129216 mlx5_en: wait_for_completion_timeout() takes jiffies
Sponsored by:	Nvidia networking
2025-07-10 17:42:27 +03:00