1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-11 14:10:34 +00:00
Commit Graph

295622 Commits

Author SHA1 Message Date
Ed Maste
75af1320f4 build: note that MAKEOBJDIRPREFIX must be absolute
PR:		282711
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47538
2024-11-13 12:45:09 -05:00
John Baldwin
c55e4971d9 RELNOTES: Document that grep no longer follows symlinks by default
Requested by:	markj
2024-11-13 12:10:39 -05:00
John Baldwin
727de621c5 pci_user.c: Cosmetic fixes
Correct leading whitespace for a few lines.

Consistently use more canonical #ifdef to test for COMPAT_FREEBSD32.

Obtained from:	CheriBSD
Sponsored by:	AFRL, DARPA
2024-11-13 11:10:27 -05:00
Mark Johnston
a43b745aaf linux sendfile: Fix handling of non-blocking sockets
FreeBSD sendfile() may perform a partial transfer and return EAGAIN if
the socket is non-blocking.  Linux sendfile() expects no error in this
case, so squash EAGAIN.

PR:		282495
Tested by:	pieter@krikkit.xyz
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D47447
2024-11-13 14:15:47 +00:00
Mark Johnston
0a897e6754 riscv: Add support for building vmm as a kernel module
- Update sys/modules/vmm/Makefile.
- Add some required symbol definitions.
- Hook up vmm in sys/modules/Makefile.

Reviewed by:	br
Differential Revision:	https://reviews.freebsd.org/D47477
2024-11-13 14:15:07 +00:00
Mark Johnston
d11d407aee swap_pager: Ensure that swapoff puts swapped-in pages in page queues
Readahead/behind pages are handled by the swap pager, but the get_pages
caller is responsible for putting fetched pages into queues (or wiring
them beforehand).

Note that the VM object lock prevents the newly queued page from being
immediately reclaimed in the window before it is marked dirty by
swap_pager_swapoff_object().

Reported by:	pho
Tested by:	pho
Reviewed by:	dougm, alc, kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D47526
2024-11-13 14:14:32 +00:00
Dag-Erling Smørgrav
b210c33a91 mv: Type and style nits.
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D47537
2024-11-13 14:47:29 +01:00
Martin Matuska
5c65a0a916 zfs: merge openzfs/zfs@1c9a4c8cb
Notable upstream pull request merges:
 #16244 acb6e71ed Added output to `zpool online` and `offline`
 #16684 94a03dd1e Pack dmu_buf_impl_t by 16 bytes
 #16690 6187b1943 On the first vdev open ignore impossible ashift hints
 #16692 673efbbf5 zdb: add extra -T flag to show histograms of BRT refcounts
 #16693 2bf152021 Fix gcc uninitialized warning in FreeBSD zio_crypt.c
 #16694 b16e09619 Reduce dirty records memory usage
 #16701 5945676bc ZFS send should use spill block prefetched from
                  send_reader_thread
 #16734 1c9a4c8cb Fix user properties output for zpool list

Obtained from:	OpenZFS
OpenZFS commit:	1c9a4c8cb4
2024-11-13 13:49:10 +01:00
Franco Fichtner
3b337076ba pf: remove stale no_df tests from fragemtation_*.sh
compat: test case add was previously removed but not the test itself
pass: test was added twice

Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D47535
2024-11-13 10:34:08 +01:00
Kristof Provost
371bd29d4b pf: fix potential state key leak
If we fail to attach the new state keys in pf_state_key_attach() we are
expected to free both keys. Do so.
Note that in some scenarios both key are the same, so check for that
before freeing.

MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D47495
2024-11-13 10:34:08 +01:00
Edward Tomasz Napierala
fc595a6b76 Fix "vrefact: wrong use count 0" with DRM
Bump the vnode use count, not its hold count. This fixes a panic triggered
by fstatat(..., AT_EMPTY_PATH) on DRM device nodes, which happens to be
what glxinfo(1) from Ubuntu Jammy is doing.

PR:		kern/274538
Reviewed By:	kib (earlier version), olce
Differential Revision:	https://reviews.freebsd.org/D47391
2024-11-13 10:25:57 +00:00
Kristof Provost
aa5d3dec9d route.8: remove now incorrect bug report about blackhole routes
We removed IP fast forwarding a while ago, so this is no longer relevant.
The netlink interface always sets the nexthop interface as V_loif, so users
don't need to worry about it either.

Reported by:	Jim Thompson
Reviewed by:	melifaro
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D47528
2024-11-13 09:12:32 +01:00
Colin Percival
e95e3e6eb7 release: Publish OCI images on "ftp" mirrors
If WITH_OCIIMAGES is set, "make ftp-stage" will now publish those bits
into a directory under /OCI-IMAGES/, similar to how we publish CI and
VM images.

MFC after:	1 minute
2024-11-12 22:36:14 -08:00
Tore Amundsen
78c63ed260 net: if_media for 1000Base-BX BiDi
1000Base-BX uses two wavelengths, commonly 1310nm, 1490nm, 1550nm, or
1590nm, in a Coarse Wavelength Division Multiplexing (CWDM) arrangement
so that a single fiber strand may carry both upstream and downstream.
It is sometimes referred to as BiDi for bi-directional usage of one
fiber.

Optics must be paired such that the RX and TX wavelengths cross over,
with one side often called U(pstream) and the other D(ownstream).

This technology is useful for increasing link density or working around
construction issues, and is also frequently used as a last mile delivery
technology for FTTx.

MFC after:	3 days
Sponsored by:	BBOX.io (review/commits)
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1518
2024-11-12 22:27:32 -07:00
Warner Losh
7e8f87ca2b loader: Don't need the arch list
MK_LOADER_KBOOT is already marked broken for these architectures, so I
don't need an if too.

Sponsored by:		Netflix
2024-11-12 22:01:24 -07:00
Alexander Ziaee
93b30f1b6c man4:: wifi manuals: revise .Sh HARDWARE + polish some
The Release Hardware Notes are generated from hardware sections in the
manual pages. Create or organize these sections in Wi-Fi driver manuals
for information flow, and perform minor maintenance on them while here.

After some testing, we have determined that a compact column list is
the best for a single column listing in the hardware release notes.
This makes very clean subsections and is for some reason denser than
using a tagged list.

This adds the long requested conversion from netmask to cidr examples.
These examples probably shouldn't even be here, but that is a discussion
for another day.

MFC after:	3 days
X-MFC with:	8f1a2d507e
Reported by: bz (relnotes generation, cidr, test-net-1 ip4addr)
Reported by: grahamperrin (HARDWARE order mentioned in fdp-primer)
Reported by: Graham Percival <gperciva@tarsnap.com> (don't prompt)
Reviewed by: bz (anything wrong likely is my polishing fault; incl. iwm.4)
Differential Revision: https://reviews.freebsd.org/D47508
2024-11-12 23:02:45 +00:00
Cy Schubert
fabc5e81bd ipfilter: Remove dead code from "Virtualize ipfilter"
6d8a5eacae virtualized ipfilter for VNET. A few  remnants of old
defunct code remained. Remove them. At the time it was not known if
6d8a5eacae would cause any issues. As it's been a number of years
since the conversion was done, it's certainly safe to remove the
dead code.

MFC after:	1 week
2024-11-12 13:58:59 -08:00
Cy Schubert
6e608d2990 ipfilter: ipfilter: Remove more dead code
This also is an artifact of the timeout(9) to callout(9) conversion done
in ea3022cbbd.

Fixes:		ea3022cbbd
MFC after:	1 week
2024-11-12 13:52:38 -08:00
Jose Luis Duran
650900cc2f
ipfilter: Avoid holding a lock while stopping
Avoid calling _callout_stop_safe with a non-sleepable lock held when
detaching by initializing callout_init_rw() with CALLOUT_SHAREDLOCK, and
avoiding re-initialization inside the timer function.

PR:		282478
Reviewed by:	cy, emaste, jhb, markj
Tested by:	cy
Approved by:	emaste (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D47530
2024-11-12 21:31:24 +00:00
Ed Maste
2d9ff965b5 bsdinstall: skip tzsetup UTC question
During installation bsdinstall asks (via tzsetup):

> Is this machine's CMOS clock set to UTC?  If it is set to local time,
> or you don't know, please choose NO here!

Most operating systems, except for Windows, use UTC in the hardware
real-time clock by default.  This question from tzsetup is presumably
intended to aid in dual-boot-with-Windows configurations, but these
represent a fraction of all FreeBSD installs.

Rather than asking this question on every install just default to UTC.
Users who want to dual-boot Windows can create /etc/wall_cmos_clock.
We can look at making this smarter in the future.

Reviewed by:	bapt, brooks, brd, cy, 0mp, ngie
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45569
2024-11-12 14:49:04 -05:00
Ka Ho Ng
6e3875ebcf sys: move SAN and COVERAGE options handling to kern.mk
This allows the flags to be picked up more easily when building external
modules.

Sponsored by: Juniper Networks, Inc.
Reviewed by:	markj (earlier)
Differential Revision:	https://reviews.freebsd.org/D45563
2024-11-12 19:04:13 +00:00
Jose Luis Duran
a0618fbe19
Revert "ipfilter: Avoid stopping with a lock held"
The timeout function still tries to acquire the rwlock, and now it
deadlocks, since the callout framework will have already acquired it.

This reverts commit 1fa6daaafd.

PR:		282478
Reported by:	markj
Approved by:	emaste (mentor)
2024-11-12 18:53:39 +00:00
Ed Maste
93f7a3023c style.9: be explicit about booleans in comparisons
We prefer something like "if (count != 0)" over "if (count)" for
non-boolean variables.  This was implicit in examples, but was unclear
for some new contributors.  Attempt to clarify by providing a more
explicit statement and example.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30507
2024-11-12 12:25:28 -05:00
Kajetan Staszkiewicz
65b2077171 pf tests: Simplify handling of pfctl -s
Some pf tests check the output of pfctl -s[sSr] to find if relevant
states, source nodes or rules exist and if their counters have proper
values. The output is multiple lines per entry and contains varying
amount of whitespace. This makes parsing it rather hard.

Provide a function for standardization of output of pfctl -s[sSr] which
converts the output to a single line per entry and reduces whitespace
always to a single space. Adjust existing tests to make use of this
function.

Revieved by:		kp
Approved by:		kp (mentor)
Differental Revision:	https://reviews.freebsd.org/D47435
2024-11-12 18:17:12 +01:00
Kajetan Staszkiewicz
452e6f549c pf: Merge pf_clear_srcnodes() and pf_kill_srcnodes()
The functions pf_clear_srcnodes() and pf_kill_srcnodes() serve the same
purpose, however the former kills all source nodes while the later only
a selected subset of them.

They differ in how they reach that goal. pf_clear_srcnodes() first
iterates over all states and detaches the source nodes from them. Then
it iterates over all source nodes and marks them as expired leaving the
cleanup to pf_purge_expired_src_nodes().

If a new state and a new source node are created between iterating over
all states and all source nodes, this source node will have its state
counter set to 0 and expiry to 1, marking it as expired without properly
detaching the state from it. Later the source node will be freed with
the state sill pointing to it.

The function pf_kill_srcnodes() performs the same operation in a safer
manner by first marking the required source nodes as expiring and then
iterating over all states and checking which states point to expiring
nodes. Any source node created between iterating over states and source
nodes will simply be ignored.

Add functionality of killing all source nodes to pf_kill_srcnodes().
Replace all calls to pf_clear_srcnodes() with a calls to
pf_kill_srcnodes(), and remove the former.

Reviewed by:		kp
Approved by:		kp (mentor)
Differential Revision:	https://reviews.freebsd.org/D47440
2024-11-12 18:17:11 +01:00
Ed Maste
3750ccefb8 Retire MK_PROFILE infrastructure
It was disabled by default in fe52b7f60e.  We planned to (but did not)
remove the option before FreeBSD 14.  Remove it now, for FreeBSD 15.

Relnotes:	Yes
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31558
2024-11-12 12:11:51 -05:00
Cy Schubert
fc32b5ddf3 ipfilter: Remove dead code
ea3022cbbd converted timeout(9) to callout(9). This code remained as
an artifact of the conversion.

Fixes:		ea3022cbbd
MFC after:	1 week
2024-11-12 08:00:46 -08:00
Zhenlei Huang
f9f470f72c ifnet(9): Document the IFF_PALLMULTI flag
It was introduced by the recent commit [1].

1. 58f194223a ifnet: Add handling for toggling IFF_ALLMULTI in ifhwioctl()

Reviewed by:	markj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D47511
2024-11-12 22:47:45 +08:00
Konstantin Belousov
166c1fac59 struct proc: add locking annotation for p_pendingcnt
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2024-11-12 08:05:48 +02:00
Jose Luis Duran
1fa6daaafd
ipfilter: Avoid stopping with a lock held
Avoid calling _callout_stop_safe with a non-sleepable lock held when
detaching by initializing callout_init_rw() with CALLOUT_SHAREDLOCK.

It avoids the following WITNESS warning when stopping the service:

    # service ipfilter stop
    calling _callout_stop_safe with the following non-sleepable locks held:
    shared rw ipf filter load/unload mutex (ipf filter load/unload mutex) r = 0 (0xffff0000417c7530) locked @ /usr/src/sys/netpfil/ipfilter/netinet/fil.c:7926
    stack backtrace:
    #0 0xffff00000052d394 at witness_debugger+0x60
    #1 0xffff00000052e620 at witness_warn+0x404
    #2 0xffff0000004d4ffc at _callout_stop_safe+0x8c
    #3 0xffff0000f7236674 at ipfdetach+0x3c
    #4 0xffff0000f723fa4c at ipf_ipf_ioctl+0x788
    #5 0xffff0000f72367e0 at ipfioctl+0x144
    #6 0xffff00000034abd8 at devfs_ioctl+0x100
    #7 0xffff0000005c66a0 at vn_ioctl+0xbc
    #8 0xffff00000034b2cc at devfs_ioctl_f+0x24
    #9 0xffff0000005331ec at kern_ioctl+0x2e0
    #10 0xffff000000532eb4 at sys_ioctl+0x140
    #11 0xffff000000880480 at do_el0_sync+0x604
    #12 0xffff0000008579ac at handle_el0_sync+0x4c

PR:		282478
Suggested by:	markj
Reviewed by:	cy
Approved by:	emaste (mentor)
MFC after:	1 week
2024-11-12 03:46:15 +00:00
Cy Schubert
9da30a23a5 ipfilter: Include the IP address in error message
Include the IP address in the message when a hashnode add error occurs.
This helps to identify the ippool.conf statement that the error occurred.

MFC after:	1 week
2024-11-11 19:22:15 -08:00
Cy Schubert
3a2cb65b6e ipfilter: Support printing of IPv6 addresses in error message
Replace inet_ntoa(3) with inet_ntop(3). This supporting the printing of
IPv6 IP addresses in addition to IPv4 IP addresses in error message.

MFC after:	1 week
2024-11-11 19:21:22 -08:00
Cy Schubert
858a7a27f5 ipfilter: Close a bracket in the poolnode error message
When a node in a tree is discovered in error, i.e. duplicate, the
IP address of the node is printed but no closing bracket completes
the node in the message. Fix this.

MFC after:	1 week
2024-11-11 19:20:49 -08:00
Cy Schubert
8aae4220d7 ipfilter: Print the hash name when adding a hashnode fails
As with when printing errors for failed poolnodes, printing the hash
node (IP address) only leads to speculation which hash pool the failed
add occurred. This is especially useful when the same IP address is
listed in multiple hash pools.

MFC after:	1 week
2024-11-11 19:18:08 -08:00
Cy Schubert
470c680cfb ipfilter: Print the pool name when adding a poolnode fails
Printing the pool node (IP address) only leads to speculation which
pool the failed add occurred. This is especially useful when the same
IP address is listed in multiple pools.

MFC after:	1 week
2024-11-11 19:15:45 -08:00
Cy Schubert
4293571628 ipfilter: Avoid overrunning the message buffer
Avoid overrunning the message buffer when printing an ippool btree error.
We do this in two ways. First we increase the message buffer from 80 to
255 bytes and secondly we replace strcat(3) with strlcat(3).

MFC after:	1 week
2024-11-11 19:14:31 -08:00
Cy Schubert
c607b3258f ntp: Switch to upstream man pages
The downstream (FreeBSD) ntp man pages are out of date. Switch to those
provided by ntp.org (nwtime.org).

PR:			104493
Differential Revision:	https://reviews.freebsd.org/D47319
2024-11-11 19:10:04 -08:00
Mark Johnston
195402c5c5 busdma_bounce: Replace a SYSINIT with static initializations
No functional change intended.

MFC after:	1 week
2024-11-12 01:57:35 +00:00
Mark Johnston
1030ee9128 sleepqueue: Fix the comment for sleepq_switch()
The comment from mi_switch() applies here.

PR:		279708
Fixes:		686bcb5c14 ("schedlock 4/4")
MFC after:	1 week
2024-11-12 01:57:24 +00:00
Lexi Winter
5b62dc782d p9fs.5: rename to p9fs.4
This is a filesystem (driver), not a file format, so it should be in
section 4.

Pull Request:	https://github.com/freebsd/freebsd-src/pull/1520
2024-11-12 01:43:15 +00:00
Artem Hevorhian
65a4daeaf3 ktrace: log execve(2) arguments and environment
Two new events KTR_ARGS and KTR_ENV can be used to
trace arguments of execve(2).

Reviewed by:		glebius
Differential Revision:	https://reviews.freebsd.org/D47127
2024-11-11 13:19:35 -08:00
Umer Saleem
1c9a4c8cb4 Fix user properties output for zpool list
In zpool_get_user_prop, when called from zpool_expand_proplist and
collect_pool, we often have zpool_props present in zpool_handle_t equal
to NULL. This mostly happens when only one user property is requested
using zpool list -o <user_property>. Checking for this case and
correctly initializing the zpool_props field in zpool_handle_t fixes
this issue.

Interestingly, this issue does not occur if we query any other property
like name or guid along with a user property with -o flag because while
accessing properties like guid, zpool_prop_get_int is called which
checks for this case specifically and calls zpool_get_all_props.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Umer Saleem <usaleem@ixsystems.com>
Closes #16734
2024-11-11 09:46:45 -08:00
Umer Saleem
3a0a142f1c JSON: fix user properties output for zpool list
This commit fixes JSON output for zpool list when user properties are
requested with -o flag. This case needed to be handled specifically
since zpool_prop_to_name does not return property name for user
properties, instead it is stored in pl->pl_user_prop.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Umer Saleem <usaleem@ixsystems.com>
Closes #16734
2024-11-11 09:46:19 -08:00
John Baldwin
4d3b659f24 nvmf: Track SQ flow control
This isn't really needed since the host driver never submits more
commands to a queue than it can hold, but I noticed that the
recently-added SQ head and tail sysctl nodes were not updating.  This
fixes that and also uses these values to assert that there we never
submit a command while a queue pair is full.

Sponsored by:	Chelsio Communications
2024-11-11 11:39:05 -05:00
John Baldwin
3ff90d91b4 nvmf: Schedule requests across multiple I/O queues
Similar to nvme(4), use the current CPU to select which I/O queue to
use.  The assignment in nvmf_attach() had to be moved down since
sc->num_io_queues is initialized in nvmf_establish_connection().

Note that nvmecontrol(8) still defaults to using a single I/O queue
for an association.

Sponsored by:	Chelsio Communications
2024-11-11 11:37:32 -05:00
Ed Maste
9e46943799 inet.4: drop "experimetal use" from net0 and net240 descriptions
The sysctls enable any use of 0/8 and 240/4, not only experimental use.

Reviewed by:	zlei
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47506
2024-11-11 07:46:58 -05:00
Hajimu UMEMOTO
8eaeaf5c46 usb: Add support for Brainboxes USB-to-Serial adapters
PR:		277482
Reported by:	Cameron Williams
2024-11-11 21:14:05 +09:00
Michal Meloun
248109448f arm: switch the BUSDMA buffers to normal uncached memory
The BUSDMA buffer is treated as normal memory during compilation and compiler
is free to inline/optimize basic functions (i.e. memset, memcpy) accessing
buffers, including when an instruction is generated that performs a word
access to unaligned data. We support this, but only if the buffer in question
is mapped as normal memory (cached or not), but not to memory mapped as
strongly ordered or device type.

MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D47485
2024-11-11 09:22:37 +01:00
Ed Maste
114080d199 usb: fix loop in usb_config_parse
By inspection, index increment was missing.

PR:		281843
Reported by:	Matt Jacobson
Reviewed by:	bz, markj
Fixes: e4611d2626 ("usb(4): Call optional endpoint_uninit() when changing configuration or alternate setting.")
Sponsored by:	The FreeBSD Foundation
2024-11-10 21:53:18 -05:00
Adrian Chadd
37e54466cf net80211: clean up / add more macros to check the frame types
* Add new macros to check the version+type and version+type+subtype of a frame.
* Use these for existing frame checks.
* Convert the flag checks in net80211 to use the macros, rather than direct
  header poking.

Notably I'm callign out things like QOS any versus QOS data, the
kind of NULL frames, etc.  Eg, in the TKIP code it's checking whether
a frame is ANY kind of QOS frame, not just QOS data.

These macros should hopefully make the header checks clearer and less
error prone.  They're also useful in drivers that are doing their
own header parsing.

Locally:

* ath(4), AP, STA, AP+STA modes
* local ath10k/athp - AP, STA modes
* rtwn - STA mode

Differential Revision: https://reviews.freebsd.org/D36615
2024-11-10 17:11:58 -08:00