1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00
Commit Graph

295800 Commits

Author SHA1 Message Date
Kevin Bowling
48ddd1b9f8 ixgbe: Add support for 1Gbit DAC links
This is a relatively well known trick for the X520 (82599), can be
useful for testing and lab settings.  It's not an official standard or
particularly common but ubiquitous Broadcom switch ASICs deal with it.

We'll call it 1000Base-KX because it's SerDes on the passive cable and
I don't think it's worth adding another media type for this.

Reviewed by:	emaste
MFC after:	1 week
Sponsored by:	BBOX.io
Differential Revision:	https://reviews.freebsd.org/D47352
2024-11-14 00:11:08 -07:00
Konstantin Belousov
209fd89a28 _dl_iterate_phdr_locked(): fix libc and libdl
Add prototype.  Export from libdl.

Fixes:	1426fd6cff
Reviewed by:	kevans
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D47563
2024-11-14 06:14:05 +02:00
Kyle Evans
3cc3d71efe libc: fix the stubs for pthread_{suspend,resume}_all_np
Noticed just a little too late, stub_null returns a `void *` but these
prototypes have no return value.  As far as I know, all of our archs
will throw the return value in a caller-saved register and it'll simply
be ignored, but it's probably worth being more accurate.

Fixes:	83aafcdc88 ("libc, libthr: coordinate stubs for [...]")
2024-11-13 21:08:02 -06:00
Kyle Evans
83aafcdc88 libc, libthr: coordinate stubs for pthread_{suspend,resume}_all_np
If libthr isn't linked into the process, then we don't have any pthreads
to worry about and our stubs can just return success -- there are none
to suspend/resume.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D47350
2024-11-13 20:48:05 -06:00
Konstantin Belousov
092e2ff33b ps.1: restore always true if predicate
Fixes:	62e6ca0f07
Reported and reviewed by:	jlduran
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D47561
2024-11-14 04:41:42 +02:00
Kyle Evans
1426fd6cff rtld: implement _dl_iterate_phdr_locked
Some sanitizers need to be able to use dl_iterate_phdr() after stopping
the rest of the process, but it's very hard to do so reliably as a
non-participant in the main logic of the program.

Introduce _dl_iterate_phdr_locked to bypass the locking that's normally
required for dl_iterate_phdr() and slap some scary warning on it.  It
will remain undocumented and probably shouldn't be used for anything
else.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D47558
2024-11-13 19:33:59 -06:00
Kyle Evans
4b202f4faf libthr: allow very early atfork registration
LSan wants to be able to register atfork handlers at __lsan_init time,
which can happen either at the first intercepted function call or in a
.preinit_array function.  Both of these end up being very early in rtld
and executed with the bind lock held, which ends up causing problems
when we go to _libpthread_init().

Instead of requiring libpthread to be initialized, just insert the new
atfork handler straight into the list if it's not ready yet.  The
critical section and locking should not be necessary if we're really
executing this early, as there won't be any threads to contend with.

Reviewed by:	kib (earlier version), markj
Differential Revision:	https://reviews.freebsd.org/D47349
2024-11-13 19:33:44 -06:00
Kyle Evans
7e6ac503ff libthr: add some tests for pthread_atfork() handling
Test that it generally functions, and also that registering multiple
times calls each handler in the order that it's documented to call them
in.

Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D47348
2024-11-13 19:33:37 -06:00
Ed Maste
36887e0494 sched_getcpu: Add man page
Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47556
2024-11-13 19:32:04 -05:00
Konstantin Belousov
de7a92756f mlx5en: improve reporting of kernel TLS, IPSEC offload, and ratelimit caps
Only ever set the capabilities bits if kernel options are enabled.
Check for hardware capabilities before setting software bits.

Sponsored by:	NVidia networking
MFC after:	1 week
2024-11-14 00:56:11 +02:00
Kyle Evans
f660777865 _utmx_op: don't recurse on chain busy
In handling a PP mutex, we'll busy it as soon as we enter the loop and
unbusy it either prior to sleeping or at exit time.  In this particular
case, if we fail to transition the mutex from OWNERDEAD -> owned because
of casueword(9) failure and the suspend check fails, we'll start over
and attempt to busy an already-busied chain and irrecoverably lock up
both this thread and anything else that tries to busy the chain.

Unbusy the chain prior to restarting because I couldn't decide if that
was a better or worse idea than just keeping track of whether we dirtied
it in do_lock_pp() and avoiding re-dirty.  This is marginally easier to
reason about as it returns us to expected state on entry to the loop.

While we're here, simplify the code a bit as `error` will be clobbered
right after the branch anyways.

Reviewed by:	kib, olce (both earlier version)
Differential Revision:	https://reviews.freebsd.org/D47493
2024-11-13 16:18:40 -06:00
Kyle Evans
0f30aed105 localedata: update widths.txt after recent Hangul exceptions
Sponsored by:	Klara, Inc.
2024-11-13 16:12:42 -06:00
Kyle Evans
160c36eae4 localedata: add some exceptions to utf8proc widths
Hangul Jamo medial vowels and final consonants are reportedly combining
characters that won't take up any columns on their own and should be
reported as zero-width, so add an exception for these as well to reflect
how they work in practice.  This conforms to how other implementations
(e.g., glibc) treat these characters.

Reviewed by:	bapt (earlier version), jkim
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D47472
2024-11-13 16:12:42 -06:00
Kyle Evans
a4b7367eb0 timedef: remove redundancy in Catalan date_fmt definitions
This is already factored into the month names, resulting in an awkward
construction:

$ env LC_ALL=ca_ES.UTF-8 date
dimecres,  6 de de novembre de 2024, 21:21:18 CST

This would now render as:

$ env LC_ALL=ca_ES.UTF-8 date
dimecres,  6 de novembre de 2024, 21:22:41 CST

Reviewed by:	bapt, royger
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D47471
2024-11-13 16:12:42 -06:00
Alexander V. Chernikov
1da4954c92 Fix failure to add an interface prefix route when route with the same
prefix is already presented in the routing table.

PR:		277125
Reported by:	Oleksandr Ignatyev <alex@i.org.ua>
Reviewed by:	ae, jlduran
Tested by:	jlduran
Differential Revision: https://reviews.freebsd.org/D47534
MFC after:	2 weeks
2024-11-12 23:36:50 +00:00
Kristof Provost
ac5e30a807 pf: add probe points to pf_route(6)()
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-11-13 21:26:28 +01:00
Ed Maste
01e186731a g_eli: update comment for bool return type
Fixes: 68eadcec0f ("Give a couple of predication functions a bool return type.")
Sponsored by: The FreeBSD Foundation
2024-11-13 15:13:35 -05:00
Kirk McKusick
ab05a1cf32 Revert commit 8733bc277a
Author: Mateusz Guzik <mjg@FreeBSD.org>
Date:   Thu Sep 14 16:13:01 2023 +0000

    vfs: don't provoke recycling non-free vnodes without a good reason

    If the total number of free vnodes is at or above target, there is no
    point creating more of them.

This commit was done as a performance optimization but ends up
causing slowdowns when doing operations on many files.

Requested by:   re (cperciva)
MFC after:      1 minute
2024-11-13 11:46:47 -08:00
Konstantin Belousov
46f02c4282 SU+J: all writes to SU journal must be exempt from runningbufspace throttling
regardless whether they come from the system thread or initiated from a
normal thread helping the system.  If we block waiting for other writes,
that writes might not finish because our journal updates block that.

Set TDP_NORUNNINGBUF around softdep_process_journal().

Note: Another solution might be to use bwrite() instead of bawrite() if the
current thread is subject to the runningbufspace limit.  The exempt
approach is used to be same as the bufdaemon.

PR:	282449
Noted and reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-11-13 21:35:03 +02:00
Konstantin Belousov
d0b41249bf bufwrite(): adjust the comment
The statement about 'do not deadlock there' is false, since this write
might need other writes to finish, which cannot be started due to
runningbufspace.

PR:	282449
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2024-11-13 21:35:02 +02:00
Konstantin Belousov
c1d93f81e4 bufwrite(): style
Use bool for vp_md.  Compactify the calculation.
Explicitly check for non-zero when testing flags.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2024-11-13 21:35:02 +02:00
Justin Hibbits
f6efccaa35 IfAPI: Remove temporary inclusion of if_private.h
Summary:
The kernel is now fully migrated to the IfAPI, so remove the temporary
inclusion of the private structure definition.

Reviewed By:	#network, melifaro
Differential Revision:	https://reviews.freebsd.org/D39621
2024-11-13 14:31:20 -05:00
Justin Hibbits
57609cb2de LinuxKPI: Use IfAPI to get LLADDR
Reviewed by:	bz, emaste
Differential Revision: https://reviews.freebsd.org/D47525
2024-11-13 14:31:20 -05:00
Justin Hibbits
4d0c95384f net: Include private header in more needed places
sys/netinet and sys/netipsec are both part of the 'blessed' netstack, so
can access struct ifnet directly.  With this structure becoming private
very soon, the necessary files need to get direct access.

Sponsored by:	Juniper Networks, Inc.
2024-11-13 14:30:59 -05:00
Justin Hibbits
1eaecc214e qlnx: Convert recent changes to IfAPI
Sponsored by:	Juniper Networks, Inc.
Reviewed by:	zlei
Differential Revision: https://reviews.freebsd.org/D47533
2024-11-13 14:30:59 -05:00
Justin Hibbits
b224af946a netlink: Don't directly access ifnet members
Summary:
Remove the final direct access of struct ifnet members from netlink.
Since only the first address is used, create the iterator and then free,
without fully iterating.

Reviewed By:	kp
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D42972
2024-11-13 14:30:58 -05:00
Justin Hibbits
3f2eb1ac23 dummymbuf: Explicitly include if_private.h
struct ifnet is expected to be private for everything outside of the
network stack (sys/net*, except netlink.  Since dummymbuf is part of the
network stack, explicitly include the header to get access to the
private members.

Sponsored by:	Juniper Networks, Inc.
2024-11-13 14:30:58 -05:00
Justin Hibbits
84d7ec4c65 bnxt: Use IfAPI accessors where able
Summary:
Don't directly access ifnet members, it's a private structure.

Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D47353
2024-11-13 14:30:58 -05:00
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:
  acb6e71ed Added output to `zpool online` and `offline`
  94a03dd1e Pack dmu_buf_impl_t by 16 bytes
  6187b1943 On the first vdev open ignore impossible ashift hints
  673efbbf5 zdb: add extra -T flag to show histograms of BRT refcounts
  2bf152021 Fix gcc uninitialized warning in FreeBSD zio_crypt.c
  b16e09619 Reduce dirty records memory usage
  5945676bc ZFS send should use spill block prefetched from
                  send_reader_thread
  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