Commit Graph

41967 Commits

Author SHA1 Message Date
John Baldwin
7aec088cbc nehemiah RNG: Switch to using FPU_KERN_NOCTX
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D41583
2023-08-25 12:34:16 -07:00
John Baldwin
8173fa60dd efirt: Move comment about fpu_kern_enter to where it is called
Reviewed by:	imp, kib, andrew, markj
Differential Revision:	https://reviews.freebsd.org/D41576
2023-08-25 12:33:00 -07:00
Justin Hibbits
2a3716432d IfAPI: Retire if_etherbpfmtap() and if_bpfmtap()
Summary:
These came in the original DrvAPI commits in 2014, and are obsoleted by
bpf_mtap_if() and ether_bpf_mtap_if().  The `_if` suffix, rather than
prefix, conveys that it's operating on the bpf of the interface, instead
than the interface itself.

Reviewed by:	glebius
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D41146
2023-08-25 12:50:14 -04:00
Warner Losh
8052b01e7e nvme: Add exclusion for ISR
Add a basically uncontended spinlock that we take out while the ISR is
running. This has two effects: First, when we get a timeout, we can
safely call the nvme_qpair_process_completions w/o racing any ISRs.
Second, we can use it to ensure that we don't reset the card while
the ISRs are active (right now we just sleep and hope for the best,
which usually is fine, but not always).

Sponsored by:		Netflix
MFC After:		2 weeks
Reviewed by:		chuck, gallatin
Differential Revision:	https://reviews.freebsd.org/D41452
2023-08-25 10:11:27 -06:00
Warner Losh
d4959bfcd1 nvme: Greatly improve error recovery
Next phase of error recovery: Eliminate the REOVERY_START phase, since
we don't need to wait to start recovery. Eliminate the RECOVERY_RESET
phase since it is transient, we now transition from RECOVERY_NORMAL into
RECOVERY_WAITING.

In normal mode, read the status of the controller. If it is in failed
state, or appears to be hot-plugged, jump directly to reset which will
sort out the proper things to do. This will cause all pending I/O to
complete with an abort status before the reset.

When in the NORMAL state, call the interrupt handler. This will complete
all pending transactions when interrupts are broken or temporarily
misbehaving. We then check all the pending completions for timeouts. If
we have abort enabled, then we'll send an abort. Otherwise we'll assume
the controller is wedged and needs a reset. By calling the interrupt
handler here, we'll avoid an issue with the current code where we
transitioned to RECOVERY_START which prevented any completions from
happening. Now completions happen. In addition and follow-on I/O that is
scheduled in the completion routines will be submitted, rather than
queued, because the recovery state is correct. This also fixes a problem
where I/O would timeout, but never complete, leading to hung I/O.

Resetting remains the same as before, just when we chose to reset has
changed.

A nice side effect of these changes is that we now do I/O when
interrupts to the card are totally broken. Followon commits will improve
the error reporting and logging when this happens. Performance will be
aweful, but will at least be minimally functional.

There is a small race when we're checking the completions if interrupts
are working, but this is handled in a future commit.

Sponsored by:		Netflix
MFC After:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D36922
2023-08-25 10:11:15 -06:00
Warner Losh
2a6b7055a9 nvme: Timeout expired transactions
When we went to having a shared timeout routine, failing the timed-out
transaction code was inadvertantly dropped. Reinstate it.

Fixes:			502dc84a8b
Sponsored by:		Netflix
MFC After:		2 weeks
Reviewed by:		chuck, jhb
Differential Revision:	https://reviews.freebsd.org/D36921
2023-08-25 10:10:44 -06:00
Warner Losh
2f06449d64 smartpqi: Fix build issues highlighted by gcc12
Make inline functions defined in a header file as static inline.
Mark inline functions used only in the compilation unit they are
defined in as merely static (the compiler can figure out it these
days).

Sponsored by:		Netflix
2023-08-25 09:46:44 -06:00
John Hall
7ea28254ec smartpqi: update to version 4410.0.2005
This updates the smartpqi driver to Microsemi's latest code. This will
be the driver for FreeBSD 14 (with updates), but no MFC is planned.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D41550
2023-08-24 15:25:09 -06:00
Kevin Bowling
725e4008ef iflib: invert default restart on VLAN changes
In rS360398, a new iflib device method was added to opt out of VLAN
events needing an interface reset.

I am switching the default to not requiring a restart for:
* VLAN events
* unknown events

After fixing various bugs, I do not think this would be a common need
of hardware and it is undesirable from the user's perspective causing
link flaps and much slower VLAN configuration. Currently, there are no
other restart events besides VLAN events, and setting the
ifdi_needs_restart default to false will alleviate the need to churn
every driver if an odd event is added in the future for specific
hardware.

markj points out this could cause churn in the other direction; I will
solve that problem with an event registration system as he mentions in
the review should we need it in the future.

These drivers will opt into restart and need further inspection or work:
* ixv (needs code audit, 61a8231 fixed principal issue; re-init probably
not necessary)
* axgbe (needs code audit; re-init probably not necessary)
* iavf - (needs code audit; interaction with Malicious Driver Detection
mentioned in rS360398)
* mgb - no VLAN functions are currently implemented. Left a comment.

MFC after:	2 weeks
Sponsored by:	BBOX.io
Differential Revision:	https://reviews.freebsd.org/D41558
2023-08-24 13:48:19 -07:00
Kevin Bowling
14a14e36ae ice: Don't restart on VLAN changes
In rS360398, a new iflib device method was added with default of opt out
for VLAN events needing an interface reset.

This re-init is unnecessary for ice(4).

MFC after:	2 weeks
Sponsored by:	BBOX.io
Differential Revision:	https://reviews.freebsd.org/D41558
2023-08-24 13:46:57 -07:00
Kevin Bowling
1d6c12c511 iavf: Add explicit ifdi_needs_reset for VLAN changes
In rS360398, a new iflib device method was added with default of opt out
for VLAN events needing an interface reset.

iavf(4) was the original need for this, because VLAN filter changes
currently have negative interactions with Malicious Driver Detection.

Add iavf_if_needs_restart and explicitly enable VLAN re-init.

MFC after:	2 weeks
Sponsored by:	BBOX.io
Differential Revision:	https://reviews.freebsd.org/D41558
2023-08-24 13:46:56 -07:00
Kevin Bowling
fe6c4e214d enic: Don't restart on VLAN changes
In rS360398, a new iflib device method was added with default of opt out
for VLAN events needing an interface reset.

This re-init is unintentional for vmxnet3(4).

MFC after:	2 weeks
Sponsored by:	BBOX.io
Differential Revision:	https://reviews.freebsd.org/D41558
2023-08-24 13:46:56 -07:00
Kevin Bowling
b6b75424c5 vmxnet3: Don't restart on VLAN changes
In rS360398, a new iflib device method was added with default of opt out
for VLAN events needing an interface reset.

This re-init is unintentional for vmxnet3(4).

MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D41558
2023-08-24 13:46:56 -07:00
Kevin Bowling
f9e0a790ae enetc: Don't restart on VLAN changes
In rS360398, a new iflib device method was added with default of opt out
for VLAN events needing an interface reset.

This re-init is unintentional for enetc(4).

MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D41558
2023-08-24 13:46:56 -07:00
Kevin Bowling
bce864d1c2 bnxt: Don't restart on VLAN changes
In rS360398, a new iflib device method was added with default of opt out
for VLAN events needing an interface reset.

This is unintentional for bnxt(4) and is causing another bug in its VLAN
initialization code to affect the common case of adding and removing
VLANs on an existing interface.

PR:		269133
Tested by:	kp
MFC after:	2 weeks
Sponsored by:	BBOX.io
Differential Revision:	https://reviews.freebsd.org/D41558
2023-08-24 13:46:56 -07:00
John Baldwin
0677f5ccbb cxgbe ddp: Trim stale function prototype
Sponsored by:	Chelsio Communications
2023-08-23 14:30:16 -07:00
Piotr Kubaj
0834f13da9 iavf: remove compatibility code and address some warnings
Code for pre-11 FreeBSD versions is removed.
Also removed are macros that are not used anymore and "i" variable
does not shadow anymore other "i" variable.

Differential Revision: https://reviews.freebsd.org/D41547
Approved by:	erj
2023-08-23 14:48:11 +02:00
Emmanuel Vadot
5fb94d0e16 arm64: xilinx: dwc3: Fix reset names
Use the correct resets and not the same one three times in a row.

Reported by:	rpokala
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2023-08-23 09:42:40 +02:00
Emmanuel Vadot
29bfcb3a28 arm64: xilinx: Add glue driver for usb3 controller
Like other dwc3 controller, on Xilinx ZynqMP the base node is just here
to provide resets, the main dwc3 controller node is a child node.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
2023-08-23 09:00:05 +02:00
Marius Strobl
dc485b968d tcp_info: Add and export more FreeBSD-specific fields
This change adds struct tcp_info fields corresponding to the following
struct tcpcb ones:
- snd_una
- snd_max
- rcv_numsacks
- rcv_adv
- dupacks

Note that while both tcp_fill_info() and fill_tcp_info_from_tcb() are
extended accordingly, no counterpart of rcv_numsacks is available in
the cxgbe(4) TOE PCB, though.

Sponsored by:	NetApp, Inc. (originally)
2023-08-22 20:34:01 +02:00
Marius Strobl
8c6104c48e tcp_fill_info(): Change lock assertion on INPCB to locked only
This function actually only ever reads from the TCP PCB. Consequently,
also make the pointer to its TCP PCB parameter const.

Sponsored by:	NetApp, Inc. (originally)
2023-08-22 20:33:49 +02:00
Luiz Otavio O Souza
2c135a2aec e6000sw: support building without FDT
This enables the use of this driver on platorms without device tree,
such as Netgate's XG-7100.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-08-21 17:26:17 +02:00
Konstantin Belousov
3c872a70b8 hwpmc: on process exit, ensure that the owned log is closed
Tested by:	pho (previous version)
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D41521
2023-08-21 16:33:13 +03:00
Konstantin Belousov
42e70f4283 PMC_OP_CONFIGURELOG: cleanup logging process if aborting due to pm_flags
Reported by:	pho
Fixes:	8e63e787ab
Sponsored by:	The FreeBSD Foundation
2023-08-21 13:31:06 +03:00
Val Packett
64fbda90da Add atopcase, the Apple HID over SPI input driver
The driver provides support for Human Interface Devices (HID) on
Serial Peripheral Interface (SPI) buses on Apple Intel Macs
produced in 2015-2018.

The driver appears to work more stable after installation of Darwin OSI
in acpi(4) driver.
To install Darwin OSI insert following lines into /boot/loader.conf:

hw.acpi.install_interface="Darwin"
hw.acpi.remove_interface="Windows 2009, Windows 2012"

Reviewed by:	wulf
Differential revision:	https://reviews.freebsd.org/D39863
2023-08-20 12:53:32 +03:00
Val Packett
1c4edee342 bcm5974(4): add support for devices attached over SPI bus
Reviewed by:	wulf
2023-08-20 12:53:32 +03:00
Vladimir Kondratyev
62aa7ab939 Add plug and play information macro for SPI bus.
Matching table format is compatible with ACPI_ID_PROBE bus method.
2023-08-20 12:53:32 +03:00
Dmitry Salychev
58983e4b02
dpaa2: Clean up channels in separate tasks
Each channel gets its own DMA resources, cleanup and "bufferpool"
tasks, and a separate cleanup taskqueue to isolate channels operation
as much as possible to avoid various kernel panics under heavy network
load.

As a side-effect of this work, dpaa2_buf structure is simplified and
all of the functions to re-seed those buffers are gathered now in
dpaa2_buf.h and .c files; functions to work with channels are
extracted into dpaa2_channel.h and .c files as well.

Reported by:		dch
Reviewed by:		bz
Approved by:		bz (mentor)
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D41296
2023-08-20 10:17:26 +02:00
Stephen J. Kiernan
332af8c25d xhci: Add support for 64-bit DMA in generic XHCI controller driver
The XHCI controller on 64-bit SoCs need to use 64-bit DMA.
Add a quirk to tell the generic XHCI driver that 32-bit DMA needs
to be used, if there are any that may need to use 32-bit DMA only.

Reviewed by:	andrew
Obtained from:	Juniper Networks, Inc.
2023-08-19 20:05:45 -04:00
John Baldwin
5aacf339f6 sys: Remove SND_DECLARE_FILE
Reviewed by:	kbowling, imp, emaste
Differential Revision:	https://reviews.freebsd.org/D41499
2023-08-18 13:05:12 -07:00
John Baldwin
cbe53bd975 pcm: Turn SND_DECLARE_FILE into a no-op.
SND_DECLARE_FILE originally added lines to the output of /dev/sndstat
listing the $FreeBSD$ strings for individual files, but only if the
value of hw.snd.verbose was raised to 3.  With the switch to Git these
strings became meaningless as they were now all identical and no longer
contained the path (which was implicitly included previously via the
keyword expansion).

This commit removes all of the infrastructure to support file version
strings from /dev/sndstat, but preserves the KPI/KBI by turning the
SND_DECLARE_FILE macro into a nop and changing the backing sysinit
functions into null functions and is suitable for merging to
stable/13.

A future commit will remove SND_DECLARE_FILE entirely.

Reviewed by:	kbowling, emaste
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D41498
2023-08-18 13:04:33 -07:00
Bartosz Sobczak
01fbb86991
irdma(4): upgrade to 1.2.17-k
Update Intel irdma driver to version 1.2.17-k

Notable changes:
- pf-reset handling improvements, including fixes in communication with if_ice(4)
- avoid racing when handling various events
- adding sw stats sysctls
- hand over pe_criterr handling from ice(4) to irdma(4)
- debug prints adjustments
- fix crash after changes in irdma_add_mqh_ifa_cb

Signed-off-by: Bartosz Sobczak <bartosz.sobczak@intel.com>
Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Reviewed by:	erj@
MFC after:	1 month
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D41425
2023-08-18 11:28:58 -07:00
Marius Strobl
ae6d496358 sym(4): Add __diagused to nseg of getbaddrcb()
The parameter is only used when compiling with INVARIANTS.
2023-08-18 16:33:27 +02:00
Dmitry Salychev
2a9021898c
sff: Add SFP driver (fdt-based draft)
This basic version of the driver obtains properties of the "sff,sfp"
compatible devices and implements a simple interface to provide an I2C
bus device for the rest of the drivers (e.g. to implement SIOCGI2C).

Both of the interface and driver are subjects for a further
generalization to be used in case of non-FDT and non-arm64 platforms.

Reviewed by:		bz, manu
Approved by:		bz (mentor)
MFC after:		3 weeks
Differential Revision:	https://reviews.freebsd.org/D41440
2023-08-18 12:40:11 +02:00
Marius Strobl
51e235148a iflib drivers: Constify PCI ID LUTs
Since d49e83eac3, iflib(9) is ready
for this change.
While at it, make isc_driver_version strings (static) const where
not apparently un-const on purpose, too.
This reduces the size of the amd64 GENERIC by about 10 KiB.
2023-08-17 20:34:23 +02:00
Ed Maste
4722ceb7d5 Use 115200 bps by default for serial communication
9600 was a standard baud rate decades ago, but 115200 is now more common
so choose defaults that are useful to the largest number of users.

Note that boot0sio does not support rates above 9600 so it remains
unchanged.

Reviewed by:	bz, imp, manu
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36295
2023-08-17 13:31:38 -04:00
Dag-Erling Smørgrav
e738085b94 Remove my middle name. 2023-08-17 15:08:30 +02:00
Mateusz Pacuszka
89e7335942 ixl: fix multicast filters handling
Summary:
Hardware supports up to 128 entries of multicast filters. If there is more,
filters should be removed and multicast promiscuous enabled. In case
user deletes the multicast address and overall count is less than 128,
multicast promiscuous mode should be disabled and all the filters
reapplied into the HW.

Currently driver only enables multicast promiscuous mode and deletes
the entries without any information to the user and it's not capable of
reapplying the filters once count is less than 128.

Address that by:

1. Add logging
2. Add logic in case multicast promiscuous is enabled and user lowers
the number of multicast entries to <128.
3. Fix a bug where driver removes different MAC entries along with the one
that's being deleted by the user.

Reviewers: #intel_networking, erj

Reviewed By: #intel_networking, erj

Subscribers: imp, ae

Differential Revision: https://reviews.freebsd.org/D40860
2023-08-17 13:46:48 +02:00
Andrew Turner
02f2706606 Add a virtio-gpu 2D driver
Add a driver to connect vt to the VirtIO GPU device in 2D mode. This
provides a output on the display when a qemu virtio gpu device is
added, e.g. with -device virtio-gpu-pci.

Tested on qemu using UTM, and a Hetzner arm64 VM instance.

Reviewed by:	bryanv (earlier version)
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D40094
2023-08-17 12:26:57 +01:00
Warner Losh
78d146160d sys: Remove $FreeBSD$: one-line bare tag
Remove /^\s*\$FreeBSD\$$\n/
2023-08-16 11:55:17 -06:00
Warner Losh
031beb4e23 sys: Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:54:58 -06:00
Warner Losh
685dc743dc sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:36 -06:00
Warner Losh
dfc016587a sys: Remove $FreeBSD$: two-line .c pattern
Remove /^#include\s+<sys/cdefs.h>.*$\n\s+__FBSDID\("\$FreeBSD\$"\);\n/
2023-08-16 11:54:30 -06:00
Warner Losh
71625ec9ad sys: Remove $FreeBSD$: one-line .c comment pattern
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
2023-08-16 11:54:24 -06:00
Warner Losh
2ff63af9b8 sys: Remove $FreeBSD$: one-line .h pattern
Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
2023-08-16 11:54:18 -06:00
Warner Losh
95ee2897e9 sys: Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:11 -06:00
Warner Losh
82a265ad9b sys: Remove $FreeBSD$: sound driver version
Remove /SND_DECLARE_FILE\("\$FreeBSD\$"\);/
2023-08-16 11:53:59 -06:00
Navdeep Parhar
8a2e880ab0 cxgbe(4): Update firmwares to 1.27.4.0
This is the list of changes since last release, taken from the release
notes of Chelsio Unified Wire 3.18.0.1.

Version : 1.27.4.0
Date    : 07/05/2023
=======================================
Fixes
-----

BASE:
- Handle 40G to 100G cable change.
- Avoid unnecessary i2c read.
=======================================

Obtained from:	Chelsio Communications
Sponsored by:	Chelsio Communications
MFC after:	1 week
2023-08-16 08:43:43 -07:00
Warner Losh
19fae0f660 cursor.bdf: Remove $FreeBSD$ tag
Remove $FreeBSD$ tag COMMENT

Sponsored by:		Netflix
2023-08-16 01:36:00 -06:00
Kevin Bowling
eac761e967 e1000: Fix off by one ipcse
This has been off by one in the FreeBSD drivers as far back as I've
looked.  Emperically HW and SW emulations I have available don't seem to
mind.  Noticed while debugging other issues.

MFC after:	3 days
2023-08-15 14:39:35 -07:00