Commit Graph

289080 Commits

Author SHA1 Message Date
Michael Tuexen
f30c7d5654 TCP LRO: convert TCP header fields to host byte order earlier
This is a preparation for adding dtrace hooks in a follow-up commit,
which are missing in the code path, where packets are directly queued
to the tcpcb. The dtrace hooks expect the fields to be in host byte
order. This only applies when TCP HPTS is used.
No functional change intended.

Reviewed by:		rscheff
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D43594
2024-01-29 18:52:17 +01:00
Lexi Winter
a84e01f02b service(8): direct user to rc(8) for a list of valid commands
New users may refer to service(8) to discover how to manage services,
but this manpage does not explain which commands are permitted besides
start/stop (for example, 'enable').  Add a paragraph that directs the
reader to rc(8) to discover this.

While here, add a few examples of common use-cases.

Reported by:	Mina Galić <freebsd@igalic.co>
Pull request:	https://github.com/freebsd/freebsd-src/pull/1057
2024-01-29 18:47:09 +01:00
Dimitry Andric
ee14a9725d Merge commit 4a39d0890894 from llvm-project (by Mark Johnston):
[libc++] Fix filesystem::remove_all() on FreeBSD (#79540)

  remove_all_impl() opens the target path with O_NOFOLLOW, which fails if
  the target is a symbolic link. On FreeBSD, rather than returning ELOOP,
  openat() returns EMLINK. This is unlikely to change for compatibility
  reasons, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214633 .

  Thus, check for EMLINK as well.

Reported by:	markj
PR:		276632
MFC after:	3 days
2024-01-29 18:26:48 +01:00
Mark Johnston
8d5353de74 libc: Annotate a couple of local functions as such
No functional change intended.

MFC after:	1 week
2024-01-29 11:44:36 -05:00
Ed Maste
7e77089dcc linuxkpi: remove invalid KASSERT from hash_add_rcu
hash_add_rcu asserted that the node's prev pointer was NULL in an
attempt to detect addition of a node already on a list, but the caller
is not required to provide a zeroed node.

Reported in https://github.com/freebsd/drm-kmod/issues/282

Reviewed by:	bz, manu
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43645
2024-01-29 11:40:17 -05:00
R. Christian McDonald
5086b6ec32
libbe: handle destroying/renaming temporary/bootonce boot environments
When a temporary/bootonce boot environment is renamed, we need to also
update the bootenv nvlist on-disk to reflect the new name. Additionally,
when a temporary/bootonce boot environment is destroyed, we also need to
clear out the on-disk state.

Reviewed by:	kevans
Approved by:	kp
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D43591
2024-01-29 10:07:49 -05:00
Kristof Provost
31828075e4 pf: bind route-to states to their route-to interface
When we route-to the state should be bound to the route-to interface,
not the default route interface. However, we should only do so for
outbound traffic, because inbound traffic should bind on the arriving
interface, not the one we eventually transmit on.

Explicitly check for this in BOUND_IFACE().

We must also extend pf_find_state(), because subsequent packets within
the established state will attempt to match the original interface, not
the route-to interface.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D43589
2024-01-29 14:10:26 +01:00
Kristof Provost
ffeab76b68 pfil: PFIL_PASS never frees the mbuf
pfil hooks (i.e. firewalls) may pass, modify or free the mbuf passed
to them. (E.g. when rejecting a packet, or when gathering up packets
for reassembly).

If the hook returns PFIL_PASS the mbuf must still be present. Assert
this in pfil_mem_common() and ensure that ipfilter follows this
convention. pf and ipfw already did.
Similarly, if the hook returns PFIL_DROPPED or PFIL_CONSUMED the mbuf
must have been freed (or now be owned by the firewall for further
processing, like packet scheduling or reassembly).

This allows us to remove a few extraneous NULL checks.

Suggested by:	tuexen
Reviewed by:	tuexen, zlei
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D43617
2024-01-29 14:10:19 +01:00
Richard Scheffenegger
0b3f9e435f tcp: move cc_post_recovery past snd_una update
The RFC6675 pipe calculation (sack.revised, enabled
by default since D28702), uses outdated information,
while the previous default calculated it correctly
with up-to-date information from the incoming ACK.

This difference can become as large as the receive
window (not the congestion window previously),
potentially triggering a massive burst of new packets.

MFC after:             1 week
Reviewed By:           tuexen, #transport
Sponsored by:          NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D43520
2024-01-28 00:18:51 +01:00
Colin Percival
7b707e797b Revert "release.sh: Add -jN to make release"
The release-building code is not fully parallel-safe yet.

This reverts commit 9c1bad2da5.

Reported by:	jrtc27
2024-01-28 21:43:56 -08:00
Warner Losh
3be59adbb5 vtnet: Adjust for ethernet alignment.
If the header that we add to the packet's size is 0 % 4 and we're
strictly aligning, then we need to adjust where we store the header so
the packet that follows will have it's struct ip header properly
aligned.  We do this on allocation (and when we check the length of the
mbufs in the lro_nomrg case). We can't just adjust the clustersz in the
softc, because it's also used to allocate the mbufs and it needs to be
the proper size for that. Since we otherwise use the size of the mbuf
(or sometimes the smaller size of the received packet) to compute how
much we can buffer, this ensures no overflows. The 2 byte adjustment
also does not affect how many packets we can receive in the lro_nomrg
case.

PR:			271288
Sponsored by:		Netflix
Reviewed by:		bryanv
Differential Revision:	https://reviews.freebsd.org/D43224
2024-01-28 22:08:55 -07:00
Warner Losh
2b92b754f1 kldxref: Be more conservative about what we reject.
kldxref anything whose name doesn't end in .ko or that has no dots (eg
the kernel).

Sponsored by:		Netflix
Reviewed by:		jrtc27, jhb
Differential Revision:	https://reviews.freebsd.org/D43507
2024-01-28 21:45:23 -07:00
Warner Losh
34f0a01b6b mpi3mr: Fix confusion over | and &
Use sc->mpi3mr_debug & MPI3MR_IOT over the | version to test if a bit is
set.

CID: 1529718
Sponsored by:		Netflix
2024-01-28 21:43:56 -07:00
Colin Percival
9c1bad2da5 release.sh: Add -jN to make release
The `make release` command now creates VM and cloudware images (if
enabled) in addition to disk images; this results in a very large
number of 'make installworld' commands running sequentially.  Adding
-jN should speed this up significantly.

MFC after:	1 month
X-MFC-to:	stable/14
2024-01-28 18:08:23 -08:00
Florian Walpen
fb87726303 snd_hdspe(4): Per device sysctl for period.
Let the user choose a period (interrupt cadence in samples), in the
official RME drivers this setting is available as "Buffer Size".
Override the period propagated through blocksize by pcm channel latency
settings (see sound(4)), since these are unreliable and differ between
playback and recording channels.

Differential Revision: https://reviews.freebsd.org/D43527
2024-01-28 20:20:26 +00:00
Warner Losh
8f7327dcee kboot: update copyright on these files.
host_syscalls.c: I've written, so put Netflix copyright on. It's
possible in the confusion that Nathan wrote the host_gettimeofday
implementation.

syscall_nr: These files likely can't enjoy copyright protection since
they are just facts (the per-arch Linux system calls), so add a note
they are in the public domain.

Sponsored by:		Netflix
2024-01-28 13:04:32 -07:00
Warner Losh
2b7918f13c kboot: Assert copyright here
According to git blame I've 95%+ rewritten this file. Update copyright to
reflect that, but give nod to Nathan for the original I started with.

Sponsored by:		Netflix
2024-01-28 13:04:32 -07:00
Warner Losh
36ef238cb6 kboot: Move termios to libkboot
Sponsored by:		Netflix
2024-01-28 13:04:31 -07:00
Warner Losh
2e3f49888e kboot: Move system calls to libkboot
Sponsored by:		Netflix
2024-01-28 13:04:31 -07:00
Warner Losh
099335814d kboot: Move syscall stubs to libkboot
Sponsored by:		Netflix
2024-01-28 13:04:31 -07:00
Warner Losh
4aabaa1890 kboot: Cleanup libkern reference
For aarch64 and amd64, we don't pull in anything from libkern, so we
don't need it in our path.  However, powerpc needs ucmpdi2 from libkern,
so bring it into libkboot's build and omit it from loader.kboot.

Sponsored by:		Netflix
2024-01-28 13:04:31 -07:00
Warner Losh
a03411e847 kboot: Move _start out of kboot and into libkboot
Move the startup code from kboot/kboot to kboot/libkboot and add the
necessary infrastructure for it to build. move start_arch.h, a private
header for libkboot, over as well.

Sponsored by:		Netflix
2024-01-28 13:04:31 -07:00
Warner Losh
091c255b5b kboot: Move to kboot/kboot
In anticipation of separating the library elements from the kboot
prorgam elements, move kboot down a level into a subdirectory. There
will be libkboot and include directories in subsequent commits,
mirroring other subsystems like i386 and efi.

Sponsored by:		Netflix
2024-01-28 13:04:31 -07:00
Warner Losh
dcc20bced5 stand: Use modern function definitions
Use modern function definitions for functions with no args.

Sponsored by:		Netflix
2024-01-28 13:04:31 -07:00
Gordon Bergling
551921a757 if_eqos: Fix a typo in a kernel error message
- s/errer/error/

MFC after:	5 days
2024-01-28 16:42:12 +01:00
Steve Kargl
0dd5a5603e lib/msun: Cleanup after $FreeBSD$ removal
Remove no longer needed explicit inclusion of sys/cdefs.h.

PR:	276669
MFC after:	1 week
2024-01-28 17:00:23 +02:00
Andriy Gapon
4d1161f094 subr_bus: report DEVICE_SUSPEND failures
This greatly aids with diagnosing system suspend failures when
they are due to a device driver or hardware.
2024-01-28 15:21:09 +02:00
Andriy Gapon
bf87d4a4bf efibootmgr: fix potential endless loop with -v
I observed the problem on a system with fairly old and, apparently,
buggy EFI implementation.  A list of boot devices had an invalid
trailing entry.  efidp_size() for that entry returned zero, which means
that the code got stuck looping on that entry.
2024-01-28 15:20:29 +02:00
Andriy Gapon
c053a56c0f hdaa_pcmchannel_setup: do not advertise AC3 8+0
The rest of the sound system supports 7+1 maximum and is not aware of 8+0.

I believe that these messages are caused by 8+0:
kernel: feeder_init(0xfffff801f935d680) on feeder_matrix returned 22
kernel: pcm0: feeder_build_matrix(): can't add feeder_matrix
2024-01-28 15:18:55 +02:00
Andriy Gapon
e92491d95f dtrace: make 'ring' and 'fill' policies imply 'noswitch' flag
This should disable allocation of the second per-CPU principal buffer
which is never used.  This will also enable additional asserts
for buffers that are never switched.
2024-01-28 15:15:17 +02:00
Andriy Gapon
9cdf326b4f run acpi_shutdown_final later to give other handlers a chance
For example, shutdown_panic wants to produce some output and maybe take
some input before a system is actually reset.

The change should only make difference for the case of system reset
(reboot), poweroff and halt should not be affected.

The change makes difference only if hw.acpi.handle_reboot is set.  It
used to default to zero until r213755 / ac731af567.
2024-01-28 15:04:55 +02:00
Andriy Gapon
cbf7c81b60 ichsmb: fix block read operation
First of all and unlike I2C, it's not the master that dictates how many
bytes to read in block read operation.  It's the device that informs the
master how many bytes it's sending back.

Thus, for ichsmb_bread() the count parameter is purely an output
parameter.  The code has been changed to reflect that.
The sanity checking of the response length is now done once it (the
first byte of the response) is received.

While here, handling of ICH_HST_STA_FAILED status bit has been added.
Plus some code style improvements and some new code comments in the
vicinity of the changed code.
2024-01-28 14:54:19 +02:00
Andriy Gapon
8fdb261601 change ipmi watchdog to awlays stop when system is halted
That is, wd_shutdown_countdown value is ignored when halting.

A halted system should remain halted for as long as needed until
a power cycle, so the watchdog should not reset the system.
2024-01-28 14:45:16 +02:00
Andriy Gapon
90dc788982 fix signature of ipmi_shutdown_event
The function had a signature of watchdog_fn while in fact it is used as
shutdown_fn.
2024-01-28 14:44:13 +02:00
Andriy Gapon
43ca38eb59 mmc_fdt_parse: remove redundant bootverbose check 2024-01-28 13:39:03 +02:00
Andriy Gapon
ea7f45d3d8 dwmmc: fix a typo 2024-01-28 13:37:57 +02:00
Andriy Gapon
89cb925fdd rk_i2s: remove unused definition 2024-01-28 13:37:25 +02:00
Andriy Gapon
406e959d07 rk_i2s: change interrupt type from MISC to AV (audio/video)
This gives a higher priority to the interrupt handling thread.
We need it because its work (filling the hardware FIFO) is time sensitive.
2024-01-28 13:36:19 +02:00
Andriy Gapon
408a9efd75 rk3328_codec: remove diagostic printfs
Most likeyly there were intended as reminders for unimplemented functions,
but they do not seem to be useful.

Also, a small style nit.
2024-01-28 13:33:16 +02:00
Andriy Gapon
b587cb69f3 audio_soc: set "status" as being at simplebus
This is more true and less confusing than previous "at EXPERIMENT".
2024-01-28 13:32:38 +02:00
Andriy Gapon
320e4beb97 gpiopower: trigger low, high and both edges
Power off or reset may be activated either by low or high signal or by an
edge.  So, try everything.

Also, the driver now supports DTS properties for timings.

Finally, the driver does not change the pin configuration during attach.
It is assumed that the pin is already in a state that does not trigger
the power event (otherwise we wouldn't be running).
2024-01-28 13:29:41 +02:00
Andriy Gapon
197944948e add allwinner overlays for enabling additional USB ports
For instance, on NanoPi NEO two additional ports are available via a
GPIO header.
2024-01-28 13:12:39 +02:00
Andriy Gapon
5b54b6ac8c usbdevs: add Ralink RT7601 aka MT7601
This is a popular USB WiFi chip.
Unfortunately, it's not supported by FreeBSD yet.
2024-01-28 13:10:51 +02:00
Andriy Gapon
34694f3da7 ds1307: restore hints-based configuration on FDT systems
Fall-through to non-FDT probe code if no matching device node is found.
While here, fix indentation of the switch statement.
Also, make the device description for the hints-based attachment the
same as for FDT attachment.

Fixes:	2486b446db ds1307: add support for the EPSON RX-8035SA I2C RTC
2024-01-28 12:45:57 +02:00
Mark Johnston
4dedcb1bb5 libc/amd64: Disable ASAN for amd64_archlevel.c
The code in this file runs before the sanitizer can initialize its
shadow map.

Fixes:	ad2fac552c ("lib/libc/amd64: add archlevel-based simd dispatch framework")
2024-01-27 22:12:01 -05:00
Alexander Motin
3883c6fbf2 ntb_hw_plx: Workaround read-only scratchpad registers
On several systems we've noticed that when NTB link goes down, the
Physical Layer User Test Pattern registers we use as additional
scratchpad registers (that is explicitly allowed by the chip specs)
become read-only for about 100us.  I see no explanation for this in
the chip specs, neither why it was not seen before, may be a race.
Since we do need these registers, workaround it by repeating writes
until we succeed or 1ms timeout expire.

MFC after:	1 week
2024-01-27 17:29:01 -05:00
Dimitry Andric
5c38ea60a0 Add libllvm and liblldb source files to enable WITH_ASAN build
This is another part of fixing the WITH_ASAN build. Some additional
source files had to be added to libllvm and liblldb, since the ASan
instrumentation causes symbols in those files to be referenced.

Reported by:	markj
PR:		276597
MFC after:	3 days
2024-01-27 22:51:08 +01:00
Dimitry Andric
31aedef26f Merge commit 16a1ef86cbc5 from llvm-project (by David CARLIER):
[compiler-rt] remove hexdump interception. (#79378)

  a freebsd dev member reported a symbol conflict and intercepting this
  had little value anyway.

This is one part of fixing the WITH_ASAN build. Some executables in the
base system define their own hexdump() symbol, which would otherwise
conflict with the ASan-intercepted one.

Reported by:	markj
PR:		276597
MFC after:	3 days
2024-01-27 22:48:58 +01:00
Dimitry Andric
d04e03c19a msun: remove fabs from Symbol.map, and adjust comment
We have s_fabs.c, but fabs(3) is already provided by libc due to
historical reasons, so it is not compiled into libm. When the linker
does not use --undefined-version, this leads to a complaint about the
symbol being nonexistent, so remove it from Symbol.map.

While here, adjust the comment about some functions being supplied by
libc: while it is true that all these are indeed in libc, libm still
includes its own versions of frexp(3), isnan(3), isnanf(3), and
isnanl(3).

Reported by:	Steve Kargl <sgk@troutmask.apl.washington.edu>
MFC after:	3 days
2024-01-27 22:24:38 +01:00
Mark Johnston
001c48b413 netinet tests: Make test jail names unique
Otherwise we get spurious test failures when running tests in parallel.
The intent here was to name jails after the tests, but this was done
incorrectly in a couple of places.

MFC after:	1 week
2024-01-27 13:51:37 -05:00