Commit graph

291448 commits

Author SHA1 Message Date
Kristof Provost 5311e73337 netinet tests: basic VRRP tests
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D44775
2024-05-08 13:19:04 +02:00
Gleb Smirnoff a254d6870e carp: isolate VRRP from CARP
There is only one functional change here - we don't allow SIOCSVH (or
netlink request) to change sc->sc_version.  I'm convinced that allowing
such a change doesn't brings any practical value, but creates enless
minefields in front of both developers and end users (sysadmins).  If
you want to switch from VRRP to CARP or vice versa, you'd need to recreate
the VHID.

Oh, one tiny funtional change: carp_ioctl_set() won't modify any fields
if it returns EINVAL.  Previously you could provide valid advbase with
invalid advskew - that used to modify advbase and return EINVAL.

All other changes is a sweep around not ever using CARP fields when
we are in VRRP mode and vice versa.  Also adding assertions on sc_version
where necessary.

Do not send VRRP vars in CARP mode via NetLink and vice versa.  However
in compat ioctl SIOCGVH for VRRP mode the CARP fields would be zeroes.

This allows to declare softc as union and thus prevent any future logic
deterioration wrt to mixing VRRP and CARP.

Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D45039
2024-05-08 13:19:04 +02:00
Gleb Smirnoff 601438fbfa carp: refactor packet tagging for ether_output()
- Separate HMAC preparation (CARP specific) from tagging.
- In unicast mode (CARP specific) don't put tag at all.
- Don't put pointer to software context into the tag.  Putting just vhid,
  an integer value, is a safer design.

Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D45038
2024-05-08 13:19:04 +02:00
Gleb Smirnoff cda57d955b carp: assert that we are calling correct input function. We are.
Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D45037
2024-05-08 13:19:04 +02:00
Gleb Smirnoff 5ee92cbd82 carp: don't chain call vrrp_send_ad via carp_send_ad
Provide inline send_ad_locked() that switches between protocol
specific sending function.

Rename carp_send_ad() to carp_callout() to avoid getting lost in
all these multiple foo_send_ad.

No functional change intended.

Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D45036
2024-05-08 13:19:04 +02:00
Kristof Provost 3711515467 carp: support VRRPv3
Allow carp(4) to use the VRRPv3 protocol (RFC 5798). We can distinguish carp and
VRRP based on the protocol version number (carp is 2, VRRPv3 is 3), and support
both from the carp(4) code.

Reviewed by:	glebius
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D44774
2024-05-08 13:19:03 +02:00
Peter Jeremy 3fe25a9bfc
mii: Add support for Realtek RTL8211F-VD PHY
The RTL8211F-VD is a replacement/upgrade for the RTL8211F. Based on
bb726b753f,
the only difference is the lack of the PCR2 register, which FreeBSD
doesn't use.

This fixes autonegotiation problems using the RTL8211F with ukphy(4).
Reviewed by:	manu, bz
MFC after:	1 month
Differential Revision:  <https://reviews.freebsd.org/D45109
2024-05-08 18:17:00 +10:00
Peter Jeremy b54d4a1627
dtb: rockchip: Add Radxa ROCK 4C Plus to the build.
The ROCK 4C Plus is a cost-reduced variant of the ROCK Pi 4 based on
the RockChip RK3399-T.

Reviewed by:	manu
MFC after:	1 week
Differential Revision:	<https://reviews.freebsd.org/D45110
2024-05-08 18:06:42 +10:00
Olivier Certner 54bbcc09a7
ObsoleteFiles.inc: Remove /var/db/portsnap
This is a followup to commit "Remove remnants of portsnap(8)"
(9b30b96c1f).  I wasn't aware of OLD_DIRS.

Approved by:            markj (mentor)
MFC after:              1 day
MFC with:               9b30b96c1f
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D45023
2024-05-08 15:38:56 +09:00
Alan Cox a803837cec arm64 pmap: Add ATTR_CONTIGUOUS support [Part 3]
Introduce L3C promotion of base page mappings.  When the base page size
is 4KB, use ATTR_CONTIGUOUS to promote 16 aligned, contiguous base page
mappings to a 64KB mapping.  Alternatively, when the base page size is
16KB, use ATTR_CONTIGUOUS to promote 128 aligned, contiguous base page
mappings to a 2MB mapping.

Given the frequency of L3C counter updates, switch to per-CPU counters
to avoid cache line ping ponging.

Revise the L3C counter descriptions to reflect the fact that the size
of an L3C mapping varies depending on the base page size.

Co-authored-by:	Eliot Solomon <ehs3@rice.edu>
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D44983
2024-05-07 21:31:14 -05:00
Gleb Smirnoff f6963113f4 in6_rmx: remove unnecessary socketvar.h 2024-05-07 14:15:56 -07:00
Gleb Smirnoff b6b4ac2faa tcp_hostcache: remove unnecessary socketvar.h 2024-05-07 14:15:49 -07:00
Gleb Smirnoff b925d71967 sockets: garbage collect PRCOREQUESTS and stale comment
The code deleted predates FreeBSD history.  The comment deleted is 99%
outdated.  Why KAME decided to use these constants instead of normal ones
also lost in centuries.
2024-05-07 14:15:49 -07:00
John Baldwin 29d7e39f56 nvme: Bump the alignment of struct nvme_health_information_page to 8
This ensures that embedded uint64_t values used for statistics
counters are aligned when allocating a structure on the stack or as
part of a containing structure.  In particular this quiets
-Waddress-of-packed-member warnings from GCC when compiling the code
in nvmfd to update the stats.

Reported by:	GCC
2024-05-07 13:54:00 -07:00
John Baldwin c8703409ed nvmecontrol: Fix a sign compare mismatch
Even though mqes (uint16_t) and queue_size (u_int) are both unsigned,
the expression 'mqes + 1' gets promoted to int which is signed.  Keep
the value unsigned by explicitly promoting mqes to u_int before
incrementing the value.

Reported by:	GCC
2024-05-07 13:54:00 -07:00
John Baldwin 766c4ad385 libzpool: Disable -Wpointer-to-int-cast warnings for GCC
This warning is already disabled for zfs.ko.
2024-05-07 13:54:00 -07:00
Richard Scheffenegger 59884aea8b tcp: clean up macro useage in tcp_fixed_maxseg()
Replace local PAD macro with PADTCPOLEN macro
No functional change.

Reviewed By:		tuexen, #transport
Sponsored by:		NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D45076
2024-05-04 13:04:25 +02:00
John Baldwin 6ca0468a2f libcbor: Ignore errors for unknown #pragmas
libcbor embeds clang-specific #pragmas that GCC then warns about.

Reviewed by:	emaste
2024-05-07 11:44:52 -07:00
Jari Sihvola 0612538e3a jh7110: Add StarFive JH7110 clock/reset generator drivers
Implement a core clknode driver for the JH7110 (StarFive VisionFive v2)
platform.

Add clock/reset generator drivers for the PLL, SYS, and AON clock
groupings.

Co-authored-by: mhorne
Reviewed by:    mhorne
Sponsored by:   The FreeBSD Foundation (mhorne's contributions)
Differential Revision:  https://reviews.freebsd.org/D43037
2024-05-07 13:07:36 -03:00
Mitchell Horne 6ea05fce8e Revert "jh7110: Add StarFive JH7110 clock/reset generator drivers"
I did not set the author field properly; revert to fix this.

This reverts commit 5d6d627897.
2024-05-07 13:05:31 -03:00
Mitchell Horne c8b472aa4b jh7110: enable MMC driver
Add a variant of the existing dwmmc driver, and enable it in the GENERIC
kernel.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D44026
2024-05-07 13:02:57 -03:00
Mitchell Horne 5d6d627897 jh7110: Add StarFive JH7110 clock/reset generator drivers
Implement a core clknode driver for the JH7110 (StarFive VisionFive v2)
platform.

Add clock/reset generator drivers for the PLL, SYS, and AON clock
groupings.

Co-authored-by:	mhorne
Reviewed by:	mhorne
Sponsored by:	The FreeBSD Foundation (mhorne's contributions)
Differential Revision:	https://reviews.freebsd.org/D43037
2024-05-07 13:02:57 -03:00
Mitchell Horne cf08768207 starfive: add a syscon driver
It serves the purpose of attaching syscon devices as early as possible;
this is required for early attachment of the PLL clock driver.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D44270
2024-05-07 13:02:57 -03:00
Mitchell Horne a77e1f0f81 busdma: better handling of small segment bouncing
Typically, when a DMA transaction requires bouncing, we will break up
the request into segments that are, at maximum, page-sized.

However, in the atypical case of a driver whose maximum segment size is
smaller than PAGE_SIZE, we end up inefficiently assigning each segment
its own bounce page. For example, the dwmmc driver has a maximum segment
size of 2048 (PAGE_SIZE / 2); a 4-page transfer ends up requiring 8
bounce pages in the current scheme.

We should attempt to batch segments into bounce pages more efficiently.
This is achieved by pushing all considerations of the maximum segment
size into the new _bus_dmamap_addsegs() function, which wraps
_bus_dmamap_addseg(). Thus we allocate the minimal number of bounce
pages required to complete the entire transfer, while still performing
the transfer with smaller-sized transactions.

For most drivers with a segment size >= PAGE_SIZE, this will have no
impact. For drivers like dwmmc mentioned above, this improves the memory
and performance efficiency when bouncing a large transfer.

Co-authored-by:	jhb
Reviewed by:	jhb
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D45048
2024-05-07 13:02:57 -03:00
Mitchell Horne 5604069824 busdma: deduplicate _bus_dmamap_addseg() function
It is functionally identical in all implementations, so move the
function to subr_busdma_bounce.c. The KASSERT present in the x86 version
is now enabled for all architectures. It should be universally
applicable.

Reviewed by:	jhb
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D45047
2024-05-07 13:02:57 -03:00
Marko Zec b24e353f9e fib_dxr: set fib_data field in struct dxr_aux early enough
Previously it was possible for dxr_build() to return with da->fd
unset in case of range_tbl or x_tbl malloc() failures.  This
may have led to NULL ptr dereferencing in dxr_change_rib_batch().

MFC after:	1 week

PR:		278422
2024-05-07 17:44:09 +02:00
Marko Zec 4aa275f12d fib_dxr: s/KASSERT/MPASS/
MFC after:	1 week
2024-05-07 17:33:23 +02:00
Marko Zec 7a5de1d4cc fib_dxr: KASSERTs for chasing NULL ptr and runaway refcount suspects
MFC after:	1 week
2024-05-07 17:22:00 +02:00
Marko Zec ed541e201a fib_dxr: move the bulko of malloc() failure logging into dxr_build() 2024-05-07 17:11:30 +02:00
Warner Losh 75e5f5916e boot1.efi: Don't redundantly include devpath.c
devpath.c is on both the comand line and in libefi. This is redundant
and was a mistake in 4cf36aa101. It never should have been here. In
practice, this just means that the devpath.o from libefi.a goes unused.
This will cause problems with some upcoming changes (D44872) to enable
LTO to reduce the size of the binaries, so go ahead and make the change
now to reduce the changeset for that. No functional change indended.

Fixes:		4cf36aa101
Co-authored-by:	sobomax
Sponsored by:	Netflix
2024-05-07 08:53:50 -06:00
Ed Maste d84fd89ecd dlopen(3): mention fdlopen for capsicum(4)
Capsicum-sandboxed applications generally cannot use dlopen, as absolute
and cwd-relative paths cannot be accessed.  Mention that fdlopen is
useful for sandboxed applications.

PR:		277169
Reviewed by:	markj, oshogbo
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45108
2024-05-07 09:09:59 -04:00
Poul-Henning Kamp d3831ca8e3 Remove lingering geom_bde references. 2024-05-07 09:25:23 +00:00
Poul-Henning Kamp 69956de36f Remove final cross-reference to GBDE 2024-05-07 07:40:20 +00:00
Poul-Henning Kamp 66bee50af7 Remove cross-references to GBDE 2024-05-07 07:35:33 +00:00
Poul-Henning Kamp 6580f5c38d Remove gbde from the "userland" pseudo-target 2024-05-07 07:35:14 +00:00
Poul-Henning Kamp 77bd06e430 Add gbde rc.d script to ObsoleteFiles.inc 2024-05-07 07:31:19 +00:00
Poul-Henning Kamp 8d2d1d6516 Remove GBDE source files 2024-05-07 07:31:09 +00:00
Poul-Henning Kamp 984764d796 Remove GBDE stress test 2024-05-07 07:26:39 +00:00
Poul-Henning Kamp bbc36ba969 Remove documentation of GBDE rc support 2024-05-07 07:25:51 +00:00
Poul-Henning Kamp d50f41366b Remove gbde from rescue 2024-05-07 07:23:38 +00:00
Poul-Henning Kamp 0c7237d7e2 Remove GBDE rc support 2024-05-07 07:23:03 +00:00
Poul-Henning Kamp 14b475c479 Remove gbde support from swapon(8) 2024-05-07 07:21:46 +00:00
Poul-Henning Kamp eef9887871 Remove gbde.4 man page 2024-05-07 07:21:28 +00:00
Poul-Henning Kamp 6ac1f02be3 Add GBDE to ObsoleteFiles.inc 2024-05-07 06:50:52 +00:00
Poul-Henning Kamp 74be648512 Disconnect GBDE from the build. (Per earlier announcements of retirement.) 2024-05-07 05:19:03 +00:00
Warner Losh 08b4520338 sg: Add sg(4) man page
Add minimal sg(4) manual page. This implements a subset of the Linux
IOCTL interface for either native FreeBSD programs, or for Linux
binaries in the linuxulator.

Noticed by:	Lexi Winter
Sponsored by:	Netflix
2024-05-06 16:29:58 -06:00
Gleb Smirnoff 0089d83b3a lagg: enable tests that stress the configuration changes
I wasn't able to reproduce a crash in several runs.  Might be that
48698ead6f or earlier changes have closed the races.  In case crashes
with just enabled tests are registered, I will either work on them or
disable tests again.
2024-05-06 15:27:32 -07:00
Gleb Smirnoff fadbb6f85a lagg: remove use of net epoch in the ioctl paths
Rely on LAGG_SLOCK() instead.  The use of network epoch(9) here was added
in 6573d7580b (later tidied by 87bf9b9cbe) as a large sweep that
blindly substituted blocking kernel primitives with epoch(9).  In these
particular code paths use of epoch(9) is incorrect and doesn't provide any
protection against a stale pointer.  Recent fix 48698ead6f, which should
actually have removed the epoch use, created a potential sleeping in epoch
problem.
2024-05-06 15:27:32 -07:00
Gleb Smirnoff 570685971c lagg: propagate up/down to the children
Based on the old submission from asomers@.  With modern state of locking
in lagg(4), the patch got much simplier.  Enable the test that was
waiting for this change.

PR:			226144
Reviewed by:		asomers
Differential Revision:	https://reviews.freebsd.org/D44605
2024-05-06 15:27:32 -07:00
John Baldwin 1d425ef341 nvmf: Add explicit alignment for struct nvmf_fabric_cmd
This avoids -Wcast-align warnings from clang when upcasting from
struct nvmf_fabric_cmd to struct nvmf_fabric_prop_set_cmd.

Reported by:	bapt
Sponsored by:	Chelsio Communications
2024-05-06 15:19:39 -07:00