Commit graph

42988 commits

Author SHA1 Message Date
Zhenlei Huang
4d47c7ca7b fwip(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:28 +08:00
Zhenlei Huang
d1a89bd9b6 flexspi: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:27 +08:00
Zhenlei Huang
48741f4cec etherswitch: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:27 +08:00
Zhenlei Huang
51971340bd ena(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:26 +08:00
Zhenlei Huang
6dbf3aca4f drm2: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:26 +08:00
Zhenlei Huang
955b380365 cxgbe(4): Stop checking for failures from malloc/mb_alloc_ext_pgs(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:26 +08:00
Zhenlei Huang
bb51f7c8a4 cxgb(4): Stop checking for failures from malloc/buf_ring_alloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:25 +08:00
Zhenlei Huang
dcd387aaa5 bnxt(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:25 +08:00
Zhenlei Huang
ab0b996bdd axgbe: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:25 +08:00
Zhenlei Huang
3fdf587ab0 ath(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:24 +08:00
Zhenlei Huang
e06e2c8407 altera: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:24 +08:00
Zhenlei Huang
00ae9c1be0 al_eth: Stop checking for failures from malloc/buf_ring_alloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:23 +08:00
Mark Johnston
cef5f43f81 vmm: Use make_dev_s() to create vmm devices
This avoids creating windows where a device file is accessible but the
device-specific field is not set.

Now that vmmdev_mtx is a sleepable lock, avoid dropping it while
creating devices files.  This makes it easier to handle races and
simplifies some code; for example, the VSC_LINKED flag is no longer
needed.

Suggested by:	jhb
Reviewed by:	imp, jhb
Differential Revision:	https://reviews.freebsd.org/D46488
2024-09-01 14:09:17 +00:00
Mark Johnston
887c0877a6 vmm: Use an sx lock for vmmdev_mtx
This will make it easier to atomically create the device file and set
its si_drv1 member.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D46487
2024-09-01 14:03:16 +00:00
Mark Johnston
4008758105 vmm: Validate credentials when opening a vmmdev
Rather than performing privilege checks after a specific VM's device
file is opened, do it once at the time the device file is opened.  This
means that one can continue to access a VM via its device fd after
attaching to a jail which does not have vmm enabled, but this seems like
a reasonable semantic to have anyway.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D46486
2024-09-01 14:03:16 +00:00
Bjoern A. Zeeb
a800b5bcd1 sdiodevs: add more vendors and devices
Add IDs for Realtek, Atheros (QCA), and Mediatek.
While I am not sure we'll ever support the ath10k and possibly mt76
SDIO devices, rtw88 ones can be found with SoCs (e.g. r2s-plus) and
are actively being worked on.

Update Broadcom/Cypress entries.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D46460
2024-08-31 21:38:57 +00:00
Jean-François Hren
d7c87526b1 tpm: Register TPM as entropy source
TPM is defined as an entropy and is called every 10 seconds. However it
was not registered and calls were discarded.

Signed-off-by: Jean-François Hren <jean-francois.hren@stormshield.eu>

MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1398
2024-08-31 10:53:02 -07:00
Navdeep Parhar
9fdb683d92 cxgbe/iw_cxgbe: Fail early in some callbacks when the RNIC is stopped.
Stop allocating new resources when the RNIC is stopped but continue to
allow previously allocated resources to be freed.  Note that t4_tom's
uld_stop tears down all TOE connections, including those being used for
iWARP, and that triggers the cleanup of iWARP resources.

Fail post_send/post_recv early too to avoid the SQ doorbell.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-08-30 08:31:45 -07:00
Franco Fichtner
4b6e76eff8 u3g: add SIERRA AC340U
Pull request:	https://github.com/freebsd/freebsd-src/pull/1397
MFC after:	3 days
2024-08-30 00:05:30 -07:00
Navdeep Parhar
3b4dcc0feb cxgbe/iw_cxgbe: c4iw_connect should return a negative errno.
Avoid a pointless assignment while here.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-08-29 17:58:36 -07:00
Mark Johnston
12500c1428 agp: Set the driver-specific field correctly
PR:		281035
Reviewed by:	mhorne
MFC after:	1 week
Fixes:		437ea82ce7 ("agp: Handle multiple devices more gracefully")
2024-08-29 13:12:19 +00:00
Navdeep Parhar
3f250bb6f0 cxgbe/iw_cxgbe: Tidy up a couple of CTRs in c4iw_create_listen.
backlog is an int and not a string.  While here, fix an adjacent CTR
that was spread over two lines even though it fits in one.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-08-28 19:40:04 -07:00
Navdeep Parhar
8254a276ad cxgbe/iw_cxgbe: Replace the fatal error flag with a stopped flag.
Now that suspend/resume is supported by the base driver, a fatal error
isn't the only reason that the RNIC can stop abruptly.  Also, this state
is no longer permanent as it's possible to resume operations after a
stop.  Rename the flag and associated routines to match the new state of
affairs.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-08-28 12:19:23 -07:00
Mark Johnston
a852dc580c vmm: Harmonize compat ioctl definitions
For compat ioctls and structures, we use a mix of suffixes: _old,
_fbsd<version>, _<version>.  Standardize on _<version> to make things
more consistent.  No functional change intended.

Reported by:	jhb
Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D46449
2024-08-28 19:12:32 +00:00
Mark Johnston
72ea8f41e1 vmm: Let devmem devices reference the VM credential
Otherwise they are globally visible (in jails with allow.vmm set),
instead of being restricted to the jail to which the VM belongs.

Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D46448
2024-08-28 19:12:16 +00:00
Mark Johnston
c23da668fa vmm: Be more consistent with the credential used for VM lookup
vmmdev_lookup() is used from sysctl context to find a VM by name.
There, a reference credential is already passed, so use that instead of
assuming that it's the same as curthread->td_ucred, even though that's
true today.  No functional change intended.

Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D46447
2024-08-28 18:57:33 +00:00
Mark Johnston
f4002135a2 vmm: Remove an unneeded lookup in devmem_create_cdev()
The sole caller of this function already holds a pointer to the VM's
softc, so rather than passing the VM name and looking it up again, just
pass the softc pointer directly.  This function is only called from an
ioctl context, so the softc structure will remain live.

Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D46446
2024-08-28 18:57:21 +00:00
Mark Johnston
063a8bd908 vmm: Factor most of sysctl_vmm_destroy() into a separate function
This will make it easy to share code with an ioctl handler which creates
VMs.  No functional change intended.

Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D46445
2024-08-28 18:57:12 +00:00
Mark Johnston
d581970976 vmm: Factor most of sysctl_vmm_create() out into a separate function
This will make it easy to share code with an ioctl handler which creates
VMs.  No functional change intended.

Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D46444
2024-08-28 18:57:03 +00:00
Navdeep Parhar
1e584ca30e cxgbe(4): Export the core suspend/resume functionality to other modules.
MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-08-28 11:20:26 -07:00
Krzysztof Galazka
4fecb70154
ixl(4): Add more debug information for queues' config
Include information about interrupt linked lists in
queue_interrupt_table sysctl and add new debug sysctl queue_int_ctln
allowing to check current interrupt state.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Reviewed by:	erj@
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D45403
2024-08-27 16:13:19 -07:00
Eric Joyner
fef4249f07
ixl(4): Use GL_RXERR1 register for correct oversize packet count
The driver sets the Maximum Transmission Unit (MTU) at the Virtual Station
Interface (VSI) level, which leads to a discrepancy in the GLPRT_ROC counter's
ability to accurately tally oversized packets, as this counter operates at the
physical port level. To rectify this issue, it is necessary to take an
additional register (GL_RXERR1) into account to obtain the correct count of
oversized packets.

Signed-off-by: Yogesh Bhosale <yogesh.bhosale@intel.com>
Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Reviewed by:	erj@
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D45870
2024-08-27 15:59:49 -07:00
Bjoern A. Zeeb
9c0cce3283 usb: correct the rtw8821cu quirk and add another wireless rtw88 device
The RTW8821CU_CD entry in quirks has an invalid lo_rev/hi_rev match
entry.  Use the different USB_QUIRK macro to match on all of these;
the value we currently see is 0x0200 on two different wifi sticks. [1]

Also add an entry for the DLINK DWA-181 rev A1, rtw88 USB.

Submitted by:	phk
Tested by:	phk
Fixes:		b3b6a959c8 [1]
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D46189
2024-08-27 17:48:43 +00:00
Mark Johnston
e12b6aaf0d vmm: Move compat ioctl definitions to vmm_dev.c
There is no reason to keep them in vmm_dev.h.  No functional change
intended.

Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D46432
2024-08-26 18:42:13 +00:00
Mark Johnston
b9ef152bec vmm: Merge vmm_dev.c
This file contains the vmm device file implementation.  Most of this
code is not machine-dependent and so shouldn't be duplicated this way.
Move most of it into a generic dev/vmm/vmm_dev.c.  This will make it
easier to introduce a cdev-based interface for VM creation, which in
turn makes it possible to implement support for running bhyve as an
unprivileged user.

Machine-dependent ioctls continue to be handled in machine-dependent
code.  To make the split a bit easier to handle, introduce a pair of
tables which define MI and MD ioctls.  Each table entry can set flags
which determine which locks need to be held in order to execute the
handler.  vmmdev_ioctl() now looks up the ioctl in one of the tables,
acquires locks and either handles the ioctl directly or calls
vmmdev_machdep_ioctl() to handle it.

No functional change intended.  There is a lot of churn in this change
but the underlying logic in the ioctl handlers is the same.  For now,
vmm_dev.h is still mostly separate, even though some parts could be
merged in principle.  This would involve changing include paths for
userspace, though.

Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D46431
2024-08-26 18:41:39 +00:00
Mark Johnston
93e81baa1c vmm: Move duplicated stats code into a generic file
There is a small difference between the arm64 and amd64 implementations:
the latter makes use of a "scope" to exclude AMD-specific stats on Intel
systems and vice-versa.  Replace this with a more generic predicate
callback which can be used for the same purpose.

No functional change intended.

Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D46430
2024-08-26 18:41:14 +00:00
Mark Johnston
3ccb02334b vmm: Move vmm_ktr.h to a common directory
No functional change intended.

Reviewed by:	corvink, jhb, emaste
Differential Revision:	https://reviews.freebsd.org/D46429
2024-08-26 18:41:05 +00:00
Joshua Rogers
49a5fe1a01 asmc: Add support for MacbookPro11,4
Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>

MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1366
2024-08-26 14:27:58 +00:00
Christos Margiolis
0864dfe629 sound: Improve sndstat nvlist feederchain format
- Use snd_afmt2str() to display format conversions in feeder_format,
  instead of the plain hex value.
- Simplify feeder_rate contents.
- Print "ch" (e.g 2.1ch) after matrix values in feeder_matrix.
- Use snd_afmt2str() instead of a plain hex for the the rest of the
  feeder classes.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46309
2024-08-24 15:07:54 +03:00
Oliver Fromme
ef3f8aa0a0 amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processors
Adds support for AMD Ryzen 7 "Phoenix" processors (family 0x19,
model 0x70-0x7f) to the amdsmn(4) and amdtemp(4) drivers. This
enables temperature readings of these CPUs via sysctl.

The sensors function identically to those for the "Raphael" processors
(model 0x60-0x6f); only the PCI device ID differs.

PR:		kern/280942
Relnotes:	yes
MFC after:	3 days
2024-08-22 21:51:19 -07:00
Doug Moore
d48524e21f dev_pager: define free_page for mgt devices
Callers of cdev_pager_free_page in the kernel always have object->type
== OBJT_MGTDEVICE. Define a function for them to call that skips the
runtime type check in cdev_pager_free.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D46389
2024-08-21 15:48:59 -05:00
Navdeep Parhar
d668a0b0ab cxgbe(4): reset routine for general use.
Add a reset_adapter wrapper that picks the most suitable reset routine
internally.  Use it in the fatal error handler as well as the sysctl
based reset.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-08-21 11:47:15 -07:00
Ariel Ehrenberg
205263ac25 mlx5en: support ipsec offload on vlan if
Add vlan tag match to RX FS SA and policy rules
and report SA lifetime counter on vlan interface
in case SA was installed on vlan interface

Existing code didn't have the net tag id as part of
the FS matching rules. This can cause applying
ipsec offload to the wrong interface.
This commit add tag id as part of FS matchers
and treat tag value 0 as no tag

Sponsored by:   NVidia networking
2024-08-20 15:42:13 +03:00
Konstantin Belousov
828da10bb3 mlx5en: fix destroying tx sa_entry when installing rx sa_entry failed
In particular, do not cancel freed linux delayed work.

Sponsored by:	NVidia networking
2024-08-20 15:42:12 +03:00
Konstantin Belousov
d00f3505ef mlx5en: do now waste ipsec_accel_in_tag on non-ipsec packets rx
Do not prepend ipsec tags into mbuf head when preparing rx wqe, store it
separately.  Only prepend (and clear the store) when received packed was
indeed offloaded by ipsec engine.  Then we do not need to refill tags
for slots that received non-ipsec packets.

This should solve some minimal degradation of the rx CPU usage due to
unneeded tag allocation for each packet.

Sponsored by:	NVidia networking
2024-08-20 15:42:12 +03:00
Konstantin Belousov
2787f8c39c mlx5en: stop including mlx5_accel/ipsec.h from en.h
This creates a circular dependency preventing inline functions from
ipsec.h from using en.h definitions.

Sponsored by:	NVidia networking
2024-08-20 15:42:12 +03:00
Navdeep Parhar
0a9d1da6e6 cxgbe(4): Stop work request queues in a reliable manner.
Clear the EQ_HW_ALLOCATED flag with the wrq lock held and discard all
work requests, pending or new, when it's not set.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-08-17 11:23:32 -07:00
Navdeep Parhar
b5332809c6 cxgbe/iw_cxgbe: Fix typo in assertion.
eanbled -> enabled

MFC after:	3 days
2024-08-17 10:38:36 -07:00
Warner Losh
3d89acf590 nvme: Separate total failures from I/O failures
When it's a I/O failure, we can still send admin commands. Separate out
the admin failures and flag them as such so that we can still send admin
commands on half-failed drives.

Fixes: 9229b3105d (nvme: Fail passthrough commands right away in failed state)
Sponsored by: Netflix
2024-08-15 21:31:20 -06:00
Warner Losh
ce7fac64ba Revert "nvme: Separate total failures from I/O failures"
All kinds of crazy stuff was mixed into this commit. Revert
it and do it again.

This reverts commit d5507f9e43.

Sponsored by:		Netflix
2024-08-15 21:29:53 -06:00