Commit graph

292065 commits

Author SHA1 Message Date
Emmanuel Vadot 304ac69eca puc: Make kernel module working
We need uart_bus_puc.c in the module for it to work.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
2024-05-29 19:07:51 +02:00
Emmanuel Vadot 70c2998c0e Revert "files: make uart_bus_puc.c not depend on puc"
This reverts commit 114ab149e2.

This doesn't work, no idea how I tested this at the time but clearly the wrong way.
2024-05-29 19:06:41 +02:00
Warner Losh b8a7548399 LINT: Don't build bnxt on 32-bit platforms
Sponsored by: Netflix
Fixes: acd884dec9 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
2024-05-29 10:50:27 -06:00
Warner Losh 6bad7d2486 checkstyle9.pl: Add check for missing space between ) {
Sponsored by:		Netflix
2024-05-29 09:59:27 -06:00
Alexander Motin 800d59d577
Some improvements to metaslabs eviction
- Add old eviction for special and dedup metaslab classes. Those
vdevs may be potentially big and fragmented with large metaslabs,
while their asynchronous write pattern is not really different
from normal class. It seems an omission to not evict old metaslabs
from them.
 - If we have metaslab preload enabled, which means we are not too
low on memory, do not evict active metaslabs even if they are not
used for some time.  Eviction of active metaslabs means we won't
be able to write anything until we load them, that may take some
time, that is straight opposite to metaslab preload goals.  For
small systems the memory saving should be less important after
recent reduction in number of allocators and so open metaslabs.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #16214
2024-05-29 08:53:31 -07:00
Warner Losh c48820a448 minor style tweak.
checkstyle9 doesn't check for this construct...

Fixes: 6d849754b9
2024-05-29 09:53:20 -06:00
Warner Losh 175b2c00a6 Fix bnxt build in LINT
LINT includes bnxt_re driver. Adjust the path in files, add missing
files and add a new BNXT_C to build (which thinly wraps OFED version
with bnxt specicif stuff).

Sponsored by:		Netflix
Fixes: acd884dec9 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
2024-05-29 09:49:53 -06:00
Ahmad Khalifa 5360d017be loader: Fix G overflowing for G(4) on 32-bit builds
Prevent G(4) and over from overflowing for 32-bit builds.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1098
2024-05-29 08:37:17 -06:00
Ahmad Khalifa dcc7b3698d loader: Allow overriding NEWVERSWHAT
This can be useful when making alternate versions of the loader.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1098
2024-05-29 08:29:30 -06:00
Son Phan Trung 6d849754b9 linux: implement PR_CHILD_SET_SUBREAPER
Reviewed by: imp, dchagin
Pull Request: https://github.com/freebsd/freebsd-src/pull/1260
2024-05-29 07:56:23 -06:00
Mariusz Zaborski bb421be6c1 libutil: move ftime to libutil
It seems that there are still some applications that use ftime(3)
(for example, science/siconos and sysutils/lcdproc). The issue
is that we don't build libcompat as a shared library anymore.
The easiest solution is to move it to libutil, until we
deprecate it for good.

This solution was proposed by kib@ in
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257789.

PR:		257789
MFC after:	1 month
Reviewed by:	kib (ages ago)
Differential Revision:	https://reviews.freebsd.org/D39994
2024-05-29 14:36:09 +02:00
Emmanuel Vadot dcb65c5a94 csh: Remove hardlink /.cshrc
Remove this historical artifact.
csh will try to use /.csrch if the user has no home directory defined which
is rather unlikely (To be exact if the concatenation of $HOME and "/.cshrc"
fail which is the same thing).

Also, with this change pkg will happily handle 3way merge for /root/.cshrc

Differential Revision:	https://reviews.freebsd.org/D45382
Reviewed by:		emaste, imp
Sponsored by:		Beckhoff Automation GmbH & Co. KG
2024-05-29 09:56:58 +02:00
Kristof Provost 8b28ec3861 pf tests: test longer anchor names
PR:		279225
MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-05-28 22:29:38 +02:00
Kristof Provost 8ddd0359bc pfctl: fix recursive printing of nat anchors
Similar to the preceding fix for rules, ensure that we
recursively list wildcard anchors for nat rules.

MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-05-28 22:29:28 +02:00
Kristof Provost 6ee3e37682 pf: fix incorrect anchor_call to userspace
777a4702c changed how we copy out the anchor_call string, and
incorrectly limited it to 8 (4 on 32-bit systems) bytes. Fix that so we
get the full anchor path, rather than just the first few characters.

PR:		279225
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-05-28 22:27:22 +02:00
Kristof Provost cd2054d48b libpfctl: add pfctl_get_rule_h()
Add a handle variant of pfctl_get_rule(). This converts us from using
the nvlist variant to the netlink variant, and also moves us closer to a
world where all libpfctl functions take the handle.

While here have pfctl use the new function.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-05-28 22:27:22 +02:00
Gleb Smirnoff 2780e5f43d linux: allow RTM_GETADDR without full ifaddrmsg argument
Even modern glibc uses truncated argument for RTM_GETADDR when it wants to
list all addresses in a system.  See
sysdeps/unix/sysv/linux/ifaddrs.c:__netlink_sendreq().  It sends a one
char payload.  Linux kernel allows that as long as given socket is not
marked as a 'strict'.  We have a similar flag in the general netlink code
and it is checked in
sys/netlink/netlink_message_parser.h:nl_parse_header().  If the flag is
not present, parser will allocate a temporary zeroed buffer to make the
message correct.  The checks added in b977dd1ea5 blocked such message
before the parser.  My reading of glibc says that there are two types of
messages that are sent with __netlink_sendreq() - RTM_GETLINK and
RTM_GETADDR.  The RTM_GETLINK is binary compatible between Linux and
FreeBSD and thus doesn't need any ABI handler.

PR:		279012
Fixes:		b977dd1ea5
2024-05-28 13:13:08 -07:00
Simon J. Gerraty 2b7c1402f9 src.sys.obj.mk: Export OBJTOP
If we had to set OBJTOP we want to .export it (if .MAKE.LEVEL > 0)
for the benefit of things like x!= ${.MAKE} -r ... and similar.

Without OBJTOP, the default MAKEOBJDIR setting will result in
attempting to use an objdir like /lib or /bin etc in some cases.

This patch is based on D30990
with the addition of the check for level > 0.

Reviewed by: jrtc27
Differential Revision:        <https://reviews.freebsd.org/D30990>
2024-05-28 11:51:31 -07:00
Mark Johnston c867ba7288 bnxt: Do not compile on 32-bit platforms
The new bnxt_re driver doesn't compile on any of them (it uses writeq()
from the LinuxKPI, which isn't implemented there), and had already been
disconnected from the build on i386.

Reported by:	Jenkins
Fixes:	acd884dec9 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
2024-05-28 09:12:52 -04:00
Mark Johnston bbe42332e5 bnxt_re: Explicitly cast pointer-to-integer conversions
Reported by:	Jenkins
Fixes:	acd884dec9 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
2024-05-28 09:12:42 -04:00
Mark Johnston 8164d511d6 libc/tests: Fix installation without MK_TOOLCHAIN
There is some exotic conditional logic here to avoid building a
particular test if a certain UBSAN library isn't present in the
toolchain sysroot.  This causes build failures for me when doing an
"installworld WITHOUT_TOOLCHAIN=", which I do frequently during tests.

I believe the problem is that SYSROOT is unset during installworld, so
the build sees the host's copy of libclang_rt.ubsan_standalone.a and
then tries to install a binary that wasn't built during buildworld.  Try
to make the check a bit less fragile.

Reviewed by:	dim
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D45035
2024-05-28 08:24:43 -04:00
Mark Johnston bf56e8b9c8 bnxt: Add a module makefile to fix the build
Fixes:	35b53f8c98 ("bnxt_en: Add PFC, ETS & App TLVs protocols support")
2024-05-28 08:02:19 -04:00
Chandrakanth patil faeff3b851 bnxt_{en/re}: Update bnxt_en and bnxt_re Makefile
Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D45202
2024-05-28 10:36:11 +00:00
Sumit Saxena acd884dec9 RDMA/bnxt_re: Add bnxt_re RoCE driver
This patch introduces the RoCE driver for the
Broadcom NetXtreme-E 10/25/50/100/200G RoCE HCAs.

The RoCE driver is a two part driver that relies
on the bnxt_en NIC driver to operate. The changes
needed in the bnxt_en driver is included through
another patch "L2-RoCE driver communication interface"
in this set.

Presently, There is no user space support, Hence
recommendation to use the krping kernel module for
testing. User space support will be incorporated in
subsequent patch submissions.

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D45011
2024-05-28 10:36:11 +00:00
Chandrakanth patil 862af86f4b bnxt_en: Driver version update to 230.0.133.0
Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D45010
2024-05-28 10:36:11 +00:00
Chandrakanth patil 3d8bbe0011 bnxt_en: Firmware header version update to 1.10.3.42
This file is automatically generated from the firmware code to
export the driver interfaces.

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D45009
2024-05-28 10:36:11 +00:00
Chandrakanth patil c9965974a5 bnxt_en: Firmware error recovery support
Implement firmware error recovery support for Thor adapters.
This entails enabling the capability for the firmware to initiate
error recovery. Specifically, the firmware will send the reset notify
asynchronous event to notify the driver of an error and impending reset.
Subsequently, the driver will queue a task to execute the following steps.

1. Deactivate the allocated resources.
2. Await completion of the firmware's recovery process.
3. Configure the resources and reactivate the network interface.

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D45008
2024-05-28 10:36:11 +00:00
Chandrakanth patil 032899b59c bnxt_en: Added support for priority queues extended stats
Below priority queues extended stats are exposed to sysctl:

tx_bytes_pri{0-7}
rx_bytes_pri{0-7}
tx_packets_pri{0-7}
rx_packets_pri{0-7}

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D45007
2024-05-28 10:36:11 +00:00
Chandrakanth patil 050d28e13c bnxt_en: L2-RoCE driver communication interface
- Added Aux bus support for RoCE.
- Implemented the ulp ops that are required by RoCE driver.
- Restructure context memory data structures
- DBR pacing support

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D45006
2024-05-28 10:36:10 +00:00
Matthew Seaman 4354163e5f Don't package /var/db/locate.database
... or install an empty file.

The locate database is a mutable working file, and unsuitable to be
managed by pkg(8).  locate(1) copes gracefully with the absence of
this file.  Running /etc/periodic/weekly/310.locate will create the
locate database with the correct ownership and permissions.

Having the locate.database file as part of the FreeBSD-runtime package
means it gets zeroed if ever that package gets updated, which is
excessive, given that updating packages will typically only change a
relatively small number of the _filenames_ on the system -- unlike the
file contents.  Plus it always causes it to flag as modified when
verifying checksums, but /var/db/locate.database is expected to be
modified by the user.

MFC after:	1 week
Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D45384
2024-05-28 11:20:07 +01:00
Chandrakanth patil 35b53f8c98 bnxt_en: Add PFC, ETS & App TLVs protocols support
Created new directory "bnxt_en" in /dev/bnxt and /modules/bnxt
and moved source files and Makefile into respective directory.

ETS support:

   - Added new files bnxt_dcb.c & bnxt_dcb.h
   - Added sysctl node 'dcb' and created handlers 'ets' and
     'dcbx_cap'
   - Add logic to validate user input and configure ETS in
     the firmware
   - Updated makefile to include bnxt_dcb.c & bnxt_dcb.h

PFC support:

   - Created sysctl handlers 'pfc' under node 'dcb'
   - Added logic to validate user input and configure PFC in
     the firmware.

App TLV support:

   - Created 3 new sysctl handlers under node 'dcb'
       - set_apptlv (write only): Sets a specified TLV
       - del_apptlv (write only): Deletes a specified TLV
       - list_apptlv (read only): Lists all APP TLVs configured
   - Added logic to validate user input and configure APP TLVs
     in the firmware.

Added Below DCB ops for management interface:

   - Set PFC, Get PFC, Set ETS, Get ETS, Add App_TLV, Del App_TLV
     Lst App_TLV

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D45005
2024-05-28 10:15:29 +00:00
Keith Reynolds 1c45a62a2f qlnxe: Fix multiple locking issues
Multiple issues are reported with WITNESS and code inspection of the
locking and lock initialization.

PR:		278084
MFC after:	1 week
2024-05-27 23:41:05 -07:00
Kevin Bowling fb78e20b4e Revert "qlnxe: Fix multiple locking issues"
This commit is missing a file, revert so I can do it correctly,
atomically.

This reverts commit 29684d08fa.
2024-05-27 23:39:23 -07:00
Keith Reynolds 29684d08fa qlnxe: Fix multiple locking issues
Multiple issues are reported with WITNESS and code inspection of the
locking and lock initialization.

PR:		278084
MFC after:	1 week
2024-05-27 23:13:10 -07:00
Keith Reynolds e3ec564ecb qlnxe: Fix promiscuous and allmulti settings
PR:		278087
MFC after:	1 week
2024-05-27 22:57:44 -07:00
Fuqian Huang 9370f49ad1 qlnx: qlnxe: Fix kernel address leakage
In function qlnx_rdma_deregister_if,
the address of object rdma_if will be printed out.
rdma_if is the address of a global variable qlnxr_drv,
which is passed from dev/qlnx/qlnxr/qlnxr_os.c
A kernel address leakage happens.
Fix this by removing the printf statement.

PR:		238646
MFC after:	1 week
2024-05-27 22:45:52 -07:00
Fuqian Huang ae38977758 qlxge: replace device_printf with QL_DPRINT2
QL_DPRINT2 checks the debug level first before printing.
Replace device_printf with QL_DPRINT2 to check debug level
first before printing out the kernel pointers.

PR:		238656
MFC after:	1 week
2024-05-27 22:40:12 -07:00
Fuqian Huang 3d6c7ee87e qlxgbe: fix debug prints in ql_os.c
QL_DPRINT2 checks the debug level first and then prints.
Replace device_printf with QL_DPRINT2 to check debug level
first before printing out the kernel pointers.

PR:		238655
MFC after:	1 week
2024-05-27 22:32:16 -07:00
Fuqian a58b4ee025 qlxgbe: Remove pointer printing in ql_ioctl.c
PR:		238653
MFC after:	1 week
2024-05-27 22:18:52 -07:00
Zhenlei Huang 2439ae9483 mlx4, mlx5: Eliminate redundent NULL check for packet filter
mlx4 and mlx5 are Ethernet devices and ether_ifattach() does an
unconditional bpfattach(). From commit 16d878cc99 [1] and on, we
should not check ifp->if_bpf to tell us whether or not we have any bpf
peers that might be interested in receiving packets. And since commit
2b9600b449 [2], ifp->if_bpf can not be NULL even after the network
interface has been detached.

No functional change intended.

1. 16d878cc99 Fix the following bpf(4) race condition which can result in a panic
2. 2b9600b449 Add dead_bpf_if structure, that should be used as fake bpf_if during ifnet detach

Reviewed by:	kp, kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45196
2024-05-28 12:46:04 +08:00
Rick Macklem 6c9170e0af svc.c: Check for a non-NULL xp_socket
Commit a16ff32f04 added support to the kernel RPC to set
TCP_USE_DDP.
However, for the unusual case of a NFSv4.1/4.2 non-NULL callback,
the xp_socket field of SVCXPRT is NULL, since it uses the same
socket as the client->server connection.

This patch adds the check for this to avoid crashes.

This only affects NFSv4.1/4.2 mounts where either pNFS or
delegations are in use.

MFC after:	3 days
2024-05-27 19:22:04 -07:00
Mitchell Horne deab57178f Adjust comments referencing vm_mem_init()
I cannot find a time where the function was not named this.

Reviewed by:	kib, markj
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D45383
2024-05-27 18:37:40 -03:00
Alfonso S. Siciliano 079f60541f
contrib/bsddialog: Import version 1.0.3
Change --mixedform output to adapt to bsdinstall restoring dialog(1)
behavior.

Avoid to print the field value to output if <fieldlen> is read-only
(less than or equal to zero). This fixes passwords in wlanconfig,
avoiding to print also SSID.

To note --mixedform continues to print field value if <flag> is
read-only. This avoids breaking netconfig and netconfig_ipv6.

See /usr/src/contrib/bsddialog/CHANGELOG '2024-05-27 Version 1.0.3'
for more detailed information.

Reported by:	garga

(redo branch main moved forward)
Merge commit '813f3dc7b302324a361326c2583f37b002100968' into redo-bsddialog-1.0.3
2024-05-27 21:32:01 +02:00
Alfonso S. Siciliano 813f3dc7b3
contrib/bsddialog: Import version 1.0.3
Change --mixedform output to adapt to bsdinstall restoring dialog(1)
behavior.

Avoid to print the field value to output if <fieldlen> is read-only
(less than or equal to zero). This fixes passwords in wlanconfig,
avoiding to print also SSID.

To note --mixedform continues to print field value if <flag> is
read-only. This avoids breaking netconfig and netconfig_ipv6.

See /usr/src/contrib/bsddialog/CHANGELOG '2024-05-27 Version 1.0.3'
for more detailed information.

Reported by:	garga
2024-05-27 19:51:37 +02:00
Mark Johnston c52ca7dd09 stress2: Don't run aesni.sh on non-x86 platforms
aesni.ko only exists on amd64 and i386, so on other platforms we are
just running geli.sh twice.

In fact, this test has little value anymore because aesni is included in
GENERIC, so it's always going to be used in preference to cryptosoft.

Reviewed by:	pho
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45366
2024-05-27 11:26:47 -04:00
Mark Johnston 568be71de3 stress2: Use the proper type for the getopt(3) return value
On arm platforms "char" is typically unsigned, in which case the test
"(c = getopt(...)) != -1" does not behave as desired.

Reviewed by:	pho
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45365
2024-05-27 11:26:47 -04:00
Bojan Novković 4c053c17f2 zfs: Update use of UMA-related symbols in arc_available_memory
da76d34 repurposed the use of UMA_MD_SMALL_ALLOC in a way that breaks
arc_available_memory on -CURRENT. This change ensures that
arc_available_memory uses the new symbol while maintaining compatibility
with older FreeBSD releases. This change was submitted to upstream
as well.

Approved by:	markj (mentor)
Fixes:	da76d34
2024-05-27 15:47:17 +02:00
Mariusz Zaborski e24ff5c99b libcapsicum: cache more time zone information
The functions like gmtime(3) expect to cache a GMT time zone. Some
sandboxed programs (like last(1)) use the gmtime(3) function.
In case of last(1), this function fails to load a proper time zone
because it is called after entering the capability mode.

_open () at _open.S:4
0x00000008011bc5a8 in tzloadbody (name=0x8018b9580 "/usr/share/zoneinfo/Etc/UTC", sp=0x801870140,
tzload (name=<optimized out>, sp=0x801870140, doextend=true)
0x00000008011bb8ba in gmtload (sp=0x801870140) at /usr/src/contrib/tzcode/localtime.c:1456
gmtcheck () at /usr/src/contrib/tzcode/localtime.c:1581
0x000000080111f85a in _libc_once (once_control=0x80127c550, init_routine=0x0)
_once (once_control=0x80127c550, init_routine=0x0) at /usr/src/lib/libc/gen/_once_stub.c:63
0x00000008011bb9d0 in gmtime_r (timep=0x7fffffffe3a8, tmp=0x80127c568)
gmtime (timep=timep@entry=0x7fffffffe3a8) at /usr/src/contrib/tzcode/localtime.c:1865
0x0000000001024cd4 in printentry (bp=bp@entry=0x8018b4800, tt=tt@entry=0x80186a0a0)
0x00000000010245ae in doentry (bp=0x8018b4800)
0x00000000010243a7 in main (argc=1, argv=<optimized out>)

This time zone is not loaded by the tzset(3) function. Because of
that, extend the caph_cache_tzdata(3) function to also include the
GMT time zone. There is no other way to cache this data than
calling gmtime(3) once.

MFC after:	5 days
Reviewed by:	emaste, markj
Differential Revision:	https://reviews.freebsd.org/D45297
2024-05-27 13:17:34 +02:00
Cy Schubert 018a4ab7b0 ntp: Update version strings
Reported by:	"Herbert J. Skuhra" <herbert@gojira.at>
MFC after:	3 days
Fixes:		f5f40dd63b
2024-05-27 02:19:51 -07:00
Andre Albsmeier cca0ce62f3 pam_xdg: pam_get_item can return NULL
Fix pam_xdg as pam_get_item can return NULL, this happens when pressing
control + C in xdm for example.

MFC after:	1 week
PR:		279268
2024-05-27 08:33:14 +02:00