1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-18 02:19:39 +00:00
Commit Graph

294960 Commits

Author SHA1 Message Date
Alexander Ziaee
fa573868f1 wpi.4: move hardware to HARDWARE + minor cleanup
Add devices supported by this driver to a HARDWARE section
for generation in the Hardware Compatibility Notes.

While here:
- describe more consistently with product doc and rest of manual
- consolidate basics in first paragraph of description
- mention boot time configuration
- cross-ref networking(7) quick start guide
- zap deprecated Tn, macro in list width, and "Dq Li" => "Ql"
- markup some unmarked elements
- add SPDX tag

MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D47170
2024-10-17 19:48:16 +00:00
Alexander Ziaee
545dbf9d5f iwn.4: move hardware to HARDWARE + minor cleanup
Add devices supported by this driver to a HARDWARE section
for inclusion in the release Hardware Compatibility Notes.
While here:
- add SPDX tag
- add networking(7) cross-ref quick start guide
- tweak examples for consistency

MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D47168
2024-10-17 19:48:16 +00:00
Warner Losh
f11c79fc00 Revert "modules: Add missing opt_*.h files for stand-alone compile"
This reverts commit 1a37caeb07.

I'd overlooked 06c07e1203 when I updated a
branch I'd previously committed but not updated. My search for this in
my tree before the commit was to a stale file...

Sponsored by:		Netflix
2024-10-17 12:52:32 -06:00
Navdeep Parhar
f48fb131c2 cxgbe/t4_tom: Change stid allocation strategy to be more IPv6 friendly.
A hardware IPv6 server needs 2 consecutive stids (server tids) starting
from a 2-aligned stid whereas an IPv4 server needs only 1 stid without
any constraint.  The allocator used to grab the first free stid(s) for
both but this can fragment the stid space leaving nothing suitable for
IPv6 even when lots of stids are available.  Change the allocator to
prefer stids for IPv4 from the ones that cannot be used for IPv6.

Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D47042
2024-10-17 10:40:38 -07:00
Bjoern A. Zeeb
96190b4fef LinuxKPI based WiFi drivers: scripts to extract fwget(8) and port details
Add a "zzz_fw_ports_fwget.sh" script to each LinuxKPI based wireless
driver which in essential are all the same and in detail all different.
The scripts have been referenced in fwget(8) sources since d33f5a0afa
but were never committed.

The scripts do the full job compared to `single-line-scripts` I tried to
use before to ease maintainance life.  Some use hacks like calling cpp
and extracting bits from the output to piece them together over multiple
files.  It will be left as an exercise for the future to see if what was
done (a longer while ago) for iwlwifi(4) would be a good idea for some
other drivers too, to have a FreeBSD-specific sysctl to export some of
the accumulated data in an easily processable way.
The scripts are written in the "perl spirit" -- "to get the job done" --
and not to be nice or neat or efficient.  For that we do not need them
often enough or in any critical path.  People are welcome to improve
them if they feel like.
I've used them for two version updates now and even if ports enforce
some other (manual) editing to keep support for multiple branches for
now they worked extremly well.

For the most the scripts extract 2 parts: PCI IDs and firmware name;
then they add "flavor"s to both and put the information together.

That output is then separated into:
- fwget(8) lines of PCI ID to port/package
  wifi-firmware-${name}-kmod-${flavor} mappings and
- distfiles per flavor for the ports.
- For iwlwififw(4) we also generate the tables for the man page
  (and the wiki) and hopefully the .Sh HARDWARE section for iwlwifi.4
  soon too.

Depending on driver various other checks are done, e.g.,
- does the PCI ID have one or more firmware files/flavors associated,
- does the referenced firmware exist in the linux-firmware.git repo,
- are there duplicates,
- find the latest version of the firmware API.

Sponsored by:	The FreeBSD Foundation
Suggested by:	imp (to have automation in D44918)
MFC after:	3 days
2024-10-17 17:26:28 +00:00
Bjoern A. Zeeb
b4c8f251d6 iwlwifi: FreeBSD specific sysctl export update
Update the sysctl export (also adding a mapping function) to also
print (1) for all lines the "flavor" (device_family) name and (2)
also print lines where we only have the trans cfg and not iwl cfg
as with the flavor we can match PCI IDs to firmware package and so
we can have an increased number of matches.
A side effect is that we can also have fwget(8) PCI ID matches for
firmware (flavors) not yet (publicly) existing.  That will allow
us to add them at a later point while a previous release already
supports the chipsets and knows how to get the firmware for them.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2024-10-17 17:26:24 +00:00
John Baldwin
d1516ec33e nvmf: Fail pass through commands while a controller is not associated
Previously this just dereferenced NULL qp pointers and panicked.
Instead, use a shared lock on the connection lock to protect access to
the qp pointers and allocate a request.  If the controller is not
associated, fail the request with ECONNABORTED.

Possibly this should be honoring kern.nvmf.fail_on_disconnection and
block waiting for a reconnect request while disconnected if that
tunable is false.

Reported by:	Suhas Lokesha <suhas@chelsio.com>
Sponsored by:	Chelsio Communications
2024-10-17 12:09:27 -04:00
Konstantin Belousov
b08d332da0 devices: report iommu data for the device in the dev. sysctl tree
Show the iommu unit' device name/unit which translates the device'
requests, if any, as parsed out from the BIOS tables.
Also show the rid value for the device.

Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D47098
2024-10-17 17:31:50 +03:00
Konstantin Belousov
cb83af64f1 device: add generic named per-device property
The KPI allows to store arbitrary data within struct device, retrieve it
back by name, and update the value.  The data is automatically destroyed
on the device deletion.  Also, the user can request to clear the named
property from all devices.

My need for this interface is due to IOMMU needing to save some
indicator on device, which must survive the re-creation of the domain
context.

Reviewed by:	imp
Discussed with:	emaste
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46605
2024-10-17 17:31:50 +03:00
Konstantin Belousov
ea4e4449b8 apic: add ioapic_get_dev() method
which returns apic device_t by apic_id, if there exists the pci representer

Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-10-17 17:31:50 +03:00
Igor Ostapenko
cc7ec8fe3b ipfw tests: Add basic coverage of divert(4) use cases
Reviewed by:	kp
Approved by:	kp (mentor)
Differential Revision:	https://reviews.freebsd.org/D47163
2024-10-17 14:02:27 +00:00
Bjoern A. Zeeb
157e93e0e8 LinuxKPI: pci: rename PCI_IRQ_LEGACY to PCI_IRQ_INTX
PCI_IRQ_LEGACY was added in 366d68f283 (likely) for rtw88 only.
The define now got renamed and I cannot find any other use but
rtw88 and rtw89.
We keep the old name as comapt while driver updates are in
progress enabling it defining LINUXKPI_VERSION for the two drivers.

Sponsored by;	The FreeBSD Foundation
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D46822
2024-10-17 13:27:05 +00:00
Bjoern A. Zeeb
105331f658 LinuxKPI: netdevice: add alloc_netdev_dummy()
Add alloc_netdev_dummy() which is needed by an updated rtw88 driver.
Given we already call linuxkpi_init_dummy_netdev() ourselves allow the
setup function to be NULL to not initialize and start a tasq td twice.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D46802
2024-10-17 13:27:05 +00:00
Zhenlei Huang
17120e4bc3 ndp: Remove a stray semicolon
MFC after:	1 week
2024-10-17 21:05:29 +08:00
Kristof Provost
9cd6ab45a4 pf tests: disable epsv for the ftp proxy test
The update to py-twisted 24.7.0 broke EPSV mode in twisted's ftp server.
Work around this by disabling EPSV (and thus using PASV).

PR:		282154
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-10-17 10:17:10 +02:00
Pedro F. Giffuni
b88df1e893 Reapply "sbin/ping: allow normal users to specify larger packets"
The ping tests were originally broken by an unrelated isue that
is now fixed ( 2926c25942 ).

THanks to kp@ for fixing the test and Jose Luis Duran for pinting it out.

This reverts commit 7bc0cb91a2.
2024-10-16 13:39:48 -05:00
John Baldwin
60516a51ab devinfo: Output device description in verbose mode
The description is listed in angle brackets after the device name
similar to device probe messages.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47157
2024-10-16 14:09:05 -04:00
John Baldwin
3342afcbaf bus_generic_detach: Remove redundant check
device_detach() checks the device state and only calls a driver's
DEVICE_DETACH method if the device is attached but not busy.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47156
2024-10-16 14:08:49 -04:00
John Baldwin
42078dfb0f device_attach: Invoke BUS_CHILD_DETACHED if an attach routine fails
This gives the parent bus driver the opportunity to cleanup any
allocated resources, etc. left behind by a failed attach attempt.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47155
2024-10-16 14:08:35 -04:00
John Baldwin
1ad3351966 device_delete_child: Update comments
This better matches the variable names and the function comment as
well as clarifying the reason for the order of operations.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47154
2024-10-16 14:08:24 -04:00
John Baldwin
47f49dd4bb sdt: Tear down probes in kernel modules during kldunload
Previously only providers in kernel modules were removed leaving
dangling pointers to tracepoints, etc. in unloaded kernel modules.

PR:		281825
Reported by:	Sony Arpita Das <sonyarpitad@chelsio.com>
Reviewed by:	markj
Fixes:		ddf0ed09bd sdt: Implement SDT probes using hot-patching
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D46890
2024-10-16 13:50:37 -04:00
Simon J. Gerraty
0aa4a9fc85 bootstrap-packages.sh escape ++
We need to escape + when egreping parent makefile too.

Reviewed by:	stevek
2024-10-16 09:26:29 -07:00
Simon J. Gerraty
c5c0e79bb0 Add local.meta.stage.mk
We need to undo NO_OBJ if we are staging
as it causes us to drop the stage* target cookies in src tree
which is bad, and may break doing the same targets for multiple
architectures.

Reviewed by:	stevek
2024-10-16 09:26:29 -07:00
Simon J. Gerraty
45fe5580cd Updated and new Makefile.depend files
Reviewd by:	stevek
2024-10-16 09:26:29 -07:00
Igor Ostapenko
b3e7d4b67c tests: Fix style of netpfil/common/divapp.c
No functional change intended.

Reviewed by:	markj
Approved by:	markj (mentor)
Differential Revision:	https://reviews.freebsd.org/D47132
2024-10-16 16:24:54 +00:00
Kristof Provost
2926c25942 ping tests: fix for scapy-2.6.0
Scapy 2.6.0 now appears to parse the IPOption during construction, and it then
gets confused at a single-byte option. IP Options typically contain at least a 1
byte type and 1 byte length. Avoid this by just returning the raw bytes, rather
than an IPOption object.

MFC after:	1 week
Reviewed by:	Jose Luis Duran <jlduran@gmail.com>
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D47151
2024-10-16 17:25:57 +02:00
Peter Jeremy
bf8d4cfe34
eqos: Fix group address filtering.
The hash filter table order in the GMAC matches the order of the top
bit of the hashed destination address. See the description of
GMAC_MAC_Hash_table_Reg0 in RK3568 TRM part 2, section 20.4.2.

PR:		282074
Reviewed by:	manu
MFC after:	7 days
Differential Revision:	https://reviews.freebsd.org/D47115
2024-10-16 18:20:30 +11:00
Pedro F. Giffuni
7bc0cb91a2 Revert "sbin/ping: allow normal users to specify larger packets"
It is causing test failures.

This reverts commit 80a5b26871.
2024-10-16 00:23:58 -05:00
Warner Losh
42b7e9c4a9 newbus: Remove redundant check for 0
We already checked to see if the return code is 0 above. This code is
redundant. However, it's here so we can break out two layers, which a
simple goto fixes. A subsequent change makes the pri < 0 condition no
longer hold. This allows us to simplify a few things.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D44269
2024-10-15 21:19:27 -06:00
Pedro F. Giffuni
80a5b26871 sbin/ping: allow normal users to specify larger packets
Only super-user could specify a packet size larger than the default 56 bytes.
This restriction was added by Matt Dillon in 1998 during the BEST days [0].
This restriction doesn't exist in ping IPV6 or on NetBSD, OpenBSD and Linux.

UMS [1] uses this feature to estimate the client's bandwidth to optimize the
streaming experience.

[0] DFGit 526f06b278
[1] UMS: https://github.com/UniversalMediaServer/UniversalMediaServer

Obtained from:	DragonFlyBSD
Differential Revision:  https://reviews.freebsd.org/D45774
2024-10-15 20:05:50 -05:00
Sergey A. Osokin
bdbf50660c bsd-family-tree: add macOS 15
While I'm here fix whitespaces for recent OpenBSD releases.
2024-10-15 20:52:01 -04:00
Warner Losh
2cbda736ce gpart: Add warning when the start sector is too low.
Add a warning if the starting sector is too low. The standard requires
that at least 16k is reserved for the GPT Partition Array, but some
tools produce GPT images with fewer than the required number of reserved
sectors.

PR: 274312
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D42247
2024-10-15 18:15:16 -06:00
Kevin Bowling
a24dacde63 committers-src: Add myself
Approved by:	srcmgr
2024-10-15 16:38:18 -07:00
Warner Losh
09c999b155 gpart: More nuance for GPT support
A careful reading of the GPT standard shows that one may have fewer than
128 entries in your GPT table. While the standard requires that we
reserve enough space (32 512-byte-LBAs or 4 4096-byte-LBAs), it also
explicitly allows one to specify fewer actual partitions (since that
controls what is in the CRC). It requires that the first LBA to be 32
(512 sectors) or 6 (4k sectors) or larger. That requirement is not
enforced (it's not listed as one of validation criteria for the GPT).
We should likely do so in the future.

To that end, allow a default number of entries to use (defent) on
creation to be different (larger) than the minimum number of legal
entries. For gpt, these numbers work out to 128 and 1 respectively.  For
all the others, make minent == defent so this is a nop for those
partitioning schemes.

Sponsored by:		Netflix
Reviewed by:		zlei, emaste
Differential Revision:	https://reviews.freebsd.org/D42246
2024-10-15 17:15:17 -06:00
Warner Losh
ac77b26215 tests: Test endian.h, byteswap.h, sys/endian.h and both endian.h and byteswap.h together
What's required and not required to be defined is complicated. Write
tests to enshrine it:
	endian.h and sys/endian.h:
		[bl]e{16,32,64}toh
		hto[bl]e{16,32,64}
	byteswap.h:
		{__,}bswap_{16,32,64}
	sys/endian.h:
		{__,}bswap{16,32,64}
		_BYTE_ORDER
		_BIG_ENDIAN
		_LITTLE_ENDIAN
		_PDP_ENDIAN
	endian.h:
		__BYTE_ORDER
		__BIG_ENDIAN
		__LITTLE_ENDIAN
		__PDP_ENDIAN
		__FLOAT_WORD_ORDER

We also ensure that the sys/endian.h conditions hold true when
we include both endian.h and sys/endian.h in either order.

NOT TESTED:	deprecated symbols, internal to glibc symbols

Sponsored by:		Netflix
Discussed with:		markj (made the changes he requested)
Differential Revision:	https://reviews.freebsd.org/D32052
2024-10-15 17:14:42 -06:00
Warner Losh
9dbff03c34 nvme: Inject artificial failure on reset
Add a sysctl to artificially fail the reset to test the failure to reset
hardware code path. While there are many ways that reset can fail, this
provides an adequate way that similates enough of the failures well
enough to shake out this failure path.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D28584
2024-10-15 16:20:58 -06:00
Warner Losh
82c96fef52 nvme: Export recovery state
Export recovery state as a sysctl. This helps, sometimes, diagnose
what's going on.

Sponsored by:		Netflix
2024-10-15 16:19:30 -06:00
Warner Losh
16672453f1 cdefs: Add __deprecated
Add __deprecated decorator. This is for a deprecated interface. copystr
is tagged with this today in copy(9), but don't actually provide it or
use it. copystr is a #define so adding it will have to wait.

LinuxKPI was defining this away completely in compiler.h. Since this is
shared between Linux KPI consumers and OpenZFS, if it's already defined,
use the FreeBSD sys/cdefs.h version, otherwise define it away. For
OpenZFS this will retain it, while for Linux KPI it will tend to drop it
(I think always, but I didn't look at everything).

Sponsored by:		Netflix
Reviewed by:		jhb, emaste
Differential Revision:	https://reviews.freebsd.org/D46137
2024-10-15 15:05:49 -06:00
Warner Losh
b487b1f502 openzfs/freebsd: Use compiler.h from FreeBSD's base's linuxkpi
The FreeBSD linux/compiler.h in OpenZFS was copied from a very old
version of FreeBSD's linuxkpi's linux/compiler.h. There's no need for
this duplication. Use FreeBSD's linuxkpi version instead, and provide
zfs_fallthrough to augment it (it's all that's needed). Use #pragma once
to avoid naming issues for guard variables. Since this is a complete
rewrite, use my copyright here (the original code in FreeBSD still
credits everybody).

Remove extra copies of macros that were defined elsewhere, but are now
properly defined in LinuxKPI so are redundant.

This is currently pull request #16650 upstream. Committing now to get
wider testing (make universe works, but historically doesn't catch all
errors).

Sponsored by:		Netflix
Reviewed by:		brooks
Differential Revision:	https://reviews.freebsd.org/D47131
2024-10-15 15:05:49 -06:00
Pierre Pronchery
b34a4edefb bhyve: avoid buffer overflow in pci_vtcon_control_send
This is a follow-up to the fix for HYP-19, addressing another condition
where an overflow might still occur. (Spotted by jhb@, thanks!)

Reported by:    Synacktiv
Reviewed by:	markj
Security:       HYP-19
Sponsored by:   Alpha-Omega Project
Sponsored by:   The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D46882
2024-10-15 16:54:19 -04:00
Mitchell Horne
23cb03d145 thr_kill(2): fix title
Mandoc emits a STYLE warning due to the lowercase letters.
2024-10-15 17:44:52 -03:00
Graham Percival
a51584a2d2 manuals: Fix some "missing section argument"
These were reported by `mandoc -T lint ...` as warnings.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1467
2024-10-15 17:20:55 -03:00
Graham Percival
229381deb2 manuals: Misc syntax fixes
These were reported by `mandoc -T lint ...` as errors.

The rendered output (in ascii and html) is not affected by this commit.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1459
2024-10-15 17:20:47 -03:00
Graham Percival
6e1fc01180 manuals: Fix "unusual .Xr" warnings with a script
These were reported by `mandoc -T lint ...` as warnings:
- unusual Xr order
- unusual Xr punctuation

Fixes made by script in https://github.com/Tarsnap/freebsd-doc-scripts

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1464
2024-10-15 17:18:14 -03:00
Alexander Ziaee
c3294033e0 mitigations.7: minor cleanup (linter errors)
Reviewed by:	emaste
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1428
2024-10-15 17:18:14 -03:00
Alexander Ziaee
22fb46af90 mitigations.7: markup functions with Fn macro
+ include this page in `apropos Fn=memcpy`

Reviewed by:	emaste
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1428
2024-10-15 17:18:13 -03:00
Alexander Ziaee
5c59e40bc4 wpa_supplicant: xref relevant wpa_passphrase(8)
Reviewed by:	mhorne
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1461
2024-10-15 17:18:02 -03:00
osamaabb
ce4cc746bb ena: Update driver version to v2.8.0
Features:
* Add support for device request reset message over AENQ
* Support LLQ entry size recommendation from device
* Support max large LLQ depth from the device
* Expand PHC infrastructures
* Configuration notification support

Bug Fixes:
* Fix leaking ifmedia resources on detach
* Fix netmap socket chain unmapping issue
* Properly reinit netmap structs upon sysctl changes
* Correctly count missing TX completions

Minor Changes:
* Add reset reason for corrupted TX/RX completion descriptors
* Add reset reason for missing admin interrupts
* Improve reset reason statistics
* Update licenses

Approved by: cperciva (mentor)
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2024-10-15 17:38:33 +00:00
Osama Abboud
449496eb28 ena: Fix leaking ifmedia resources on detach
ifmedia_add() allocates an ifmedia_entry during ena_attach.
Current code doesn't release this memory during ena_detach()

This commit calls ifmedia_removeall() to properly free the
allocated memory during ena_detach().

Also, in case ena_attach fails, we need to detach ifmedia
which was allocated within ena_setup_ifnet().

This bug was first described in:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278100

Reviewed by: zlei
Approved by: cperciva (mentor)
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2024-10-15 17:38:32 +00:00
Osama Abboud
d0419551d9 ena: Support max large LLQ depth from the device
Large LLQ depth size is currently calculated by dividing the maximum
possible size of LLQ by 2.
In newer paltforms, starting from r8g the size of BAR2,
which contains LLQ, will be increased, and the maximum depth of
wide LLQ will be set according to a value set by the device, instead of
hardcoded division by 2.

The new value will be stored by the device in max_wide_llq_depth field
for drivers that expose ENA_ADMIN_LLQ_FEATURE_VERSION_1 or higher to
the device.

There is an assumption that max_llq_depth >= max_wide_llq_depth, since
they both use the same bar, and if it is possible to have a wide LLQ
of size max_wide_llq_depth, it is possible to have a normal LLQ of the
same size, since it will occupy half of the space.

Also moved the large LLQ case calculation of max_tx_queue_size
before its rounddown.

Approved by: cperciva (mentor)
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2024-10-15 17:38:32 +00:00